Posts

Showing posts from April, 2012

Android Alert Box Wont Stay Open -

as title says alert box in app wont stay open. box nested within loop checked when button clicked. when loop goes alert box flashes on screen before disappearing straight away. is there sort of timer can put on alert box keep open or have implemented box incorrectly? button w/ loop , nested alert box button button= (button) findviewbyid(r.id.cookbutton); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { finish(); //deducting 1 ingredient final cursor ingredients = adapter.getrecipesingredients(recipecode); final cursor missing = adapter.missingingredients(recipecode); if(missing.getcount() == 0) { toast.maketext(getapplicationcontext(), "haveeverything", toast.length_short).show(); ingredients.movetofirst(); string ingredient = ingredients.getstring(ingredients.getcolumnindex("i...

maven - Spring Boot Dev Tools: Crash on hot reload with CommandLineRunners and Spring Data Repositories -

i'm developing project spring boot 1.3.2, spring data mongodb , spring security, using dev tools, intellij idea 15.0.3, using maven. i did read spring boot developer tools documentation , , configured indicated, , hot reload worked fine. then, since needed perform tasks during application startup, connecting database , perform validations, , insertions if needed, decided use commandlinerunner beans this: @configuration public class databaseinitializer { @bean commandlinerunner verifyconfiguration(configurationrepository repository) { return args -> { // id provided 1 , can't modify it. if (repository.findone(...) == null) { // offending line //perform tasks here } }; } // more commandlinerunners following same approach } if restart application, works fine, no crashes, no errors, when trigger dev tools hot reload, fails, , throws stacktrace: java.lang.illegalstateexception: failed ...

function - How can I convert a string converted using toLocaleString() in javascript back to Date Object? -

i using javascript function tolocalestring() convert date object string (as it's output user friendly), storage purpose, , want fetch saved data (obviously in form of string) later, , want compare such dates. i have date stored in format : february 5, 2016 7:04:40 pm ist but that's not possible directly, tried convert string date object using both implicit (using date constructor) , explicit (using date object) methods. gives invalid date, output, when printed. google lot find out how can convert date format directly date object can perform desired date operations. couldn't found worth using. please me came out solution problem, can complete project. if need use pure javascript should create function parses string in order use arguments create date object. var months = { 'january': 0, 'february': 1, 'march': 2, 'april': 3, 'may': 4, 'june': 5, 'july': 6, 'august': 7, ...

php - Laravel eloquent query issue -

i trying users images relation 1 many. in images table column type equal 1. closest created. user::with('images')->has('images')->get(); but return images not type 1; also tried $a = user::defaultimage()->get(); and in user model def scope public function scopedefaultimage($query) { $query->wherehas('images', function ($query) { $query->where('default', 1); })->get(); return $query; } but doesn't return relation images, user you want modify way using with function. make images returned of type 1. user::with(['images' => function($q) { $q->where('type', 1); }])->wherehas('images', function($q) { $q->where('type', 1); })->get(); by adding wherehas , return users have image type of 1 attached. i make sure in database have users , attached images image type of 1 know sure sho...

android - How to pass data between fragments of a FragmentTabHost? -

i'm trying learn android , having issue project. have set fragment tab host 4 fragments. have first 3 fragments interactive user , when tab on 4th tab, display information put in on first three. figured can pass info overriding on onpause() trigger don't want use button press. right now, i'm trying edittext work make sure i'm doing right. i'm not sure if i'm using fragment transaction correctly, or way i'm trying collect edit text field. later on hope pass information via bundle. appreciated. main: package valdes.fragmenttabsmenu; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmenttabhost; import android.app.fragmenttransaction; public class mainactivity extends fragmentactivity implements welcomefragment.welcomelistener { private fragmenttabhost mtabhost; private string firstname; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate)...

jquery - How to make a navigation menu dynamic? -

how make following navigation dynamic, doesn't break if add navigation element. nav { position: relative; height: 57px; line-height: 57px; width: 100%; background-color: #fff; font-weight: 500; text-transform: uppercase; font-size: 14px; overflow: hidden; } nav ul { position: relative; display: -ms-flexbox; display: -webkit-flex; display: -moz-flex; display: -ms-flex; display: flex; margin: 0 auto; padding: 0; list-style: none; -ms-box-orient: horizontal; -ms-box-pack: center; -webkit-flex-flow: row wrap; -moz-flex-flow: row wrap; -ms-flex-flow: row wrap; flex-flow: row wrap; -webkit-justify-content: center; -moz-justify-content: center; -ms-justify-content: center; justify-content: center; text-align: center; width: 100%; height: 100%; } nav ul li { position: relative; margin: 0; text-align: center; -webkit-flex: 1; -moz-flex: 1; -ms-flex: 1; flex: 1; ...

ruby - rbenv: bundle: command not found -

i trying create bosh release using command bosh create release --force --final --with-tarball i got following error error: > + bundle package --all > rbenv: bundle: command not found > > `bundle' command exists in these ruby versions: > 2.2.4 'admin_ui' pre-packaging failed in linux machine following version of software installed. which ruby /root/.rbenv/shims/ruby ruby --version ruby 2.2.4p230 (2015-12-16 revision 53155) bundle /root/.rbenv/shims/bundle bundle --version bundler version 1.11.2 update: ~/.profile file export path="$home/.rbenv/bin:$path" eval "$(rbenv init -)" i source file before creating bosh release error: > using membrane 0.0.5 > installing mime-types-data 3.2015.1120 > > gem::installerror: mime-types-data requires ruby version >= 2.0. looks bosh runs in it’s own environment (read: not load .bashrc etc configs.) one might...

video - audio sample format s16p, ffmpeg or audio codec bug? -

i have video file , had dumped video info txt file ffmpeg 3 year ago. ... stream #0:1[0x1c0]: audio: mp2, 48000 hz, stereo, s16, 256 kb/s stream #0:2[0x1c1]: audio: mp2, 48000 hz, stereo, s16, 256 kb/s but found format changed when used update ffprobe (ffprobe version n-78046-g46f67f4 copyright (c) 2007-2016 ffmpeg developers). ... stream #0:1[0x1c0]: audio: mp2, 48000 hz, stereo, s16p, 256 kb/s stream #0:2[0x1c1]: audio: mp2, 48000 hz, stereo, s16p, 256 kb/s with same video, sample format changes s16p. i implemented simple video player uses ffmpeg. can play video 3 years ago, failed output correct pcm stream after changing update ffmpeg. spent lots time , found audio should have been s16 instead of s16p. decoded audio stream works after added line before calling avcodec_decode_audio4, audio_codec_ctx->sample_fmt = av_sample_fmt_s16 but hack. encounter issue? how make ffmpeg work correctly? hint appreciated. thanks! the output format changed . reason convo...

javascript - Offscreencanvas illegal constructor -

i'm testing new offscreen canvas in firefox , , haven't trouble asynchronous offscreen canvas in web workers (gfx.offscreencanvas enabled), when try first example, illegal constructor error in offscreencanvas constructor: var offscreen = new offscreencanvas(256, 256); here example. i'm using firefox 44 on ubuntu 15.10. offscreencanvas has basic support since version 44 of firefox offscreencanvas constructor has support since version 46 of firefox

javascript - EJS syntax highlighting in HTML files with Notepad++ -

Image
i using notepad++ view html files have javascript , ejs (embedded java script, node.js rendering engine) parts. unfortunately syntax highlighting looks this: with ejs can insert dynamic stuff php in html files. opening tag <% or <%= , close %> . is there possibility configure notepad++ in such way syntax highlighting between <% %> ignored? or whole block treated normal text or something? you can try use asp syntax highlighting need use double quote because in asp ' comment. hopefully it's helpful.

cron - PHP error_log from CLI -

i'm calling php script using cron. the script use lot error_log function : error_log('my error'); seems it's not working cli. i can make work using more arguments : error_log('my error', 3, '/fullpath/to/my/log'); but avoid modifying (my script include lot of other scripts). as far understand, php using different php.ini when called command line. is there way force use normal php.ini ? i need cron execute script in exact same environment web. are there problems should aware of ? others differences break code ? edit : i found way tell php php.ini file use (-c): /path/to/php5 -c /path/to/php.ini /path/to/script.php but it's not working. in script shell_exec('php --ini') still showing cli/php.ini... if need cron execute script in exact same environment web, call the web : setup virtual host (local only, e.g. on port 4242, locked iptables) run cron curl http://localhost:4242/script.php it run scr...

No package matching 'mesos' is available on Ansible -

Image
i configuring mesos-marathon cluster. have next role install java , mesos. --- - name: importar key mesosphere shell: gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys e56151bf - name: ppa java8 apt_repository: repo='ppa:webupd8team/java' state=present - name: seleccionar licencia oracle shell: echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections - name: actualizar apt: update_cache=yes - name: instalar java8 apt: name=oracle-java8-installer state=latest update-cache=yes force=yes - name: actualizar sources list shell: distro=$(lsb_release -is | tr '[:upper:]' '[:lower:]') && codename=$(lsb_release -cs) && echo "deb http://repos.mesosphere.io/${distro} ${codename} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list - name: actualizar paquetes apt: update_cache=yes cache_valid_time=3600 - name: instalar mesos apt: name=mesos state=present install_recommends=y...

java - Make servlet filter for all 404 responses -

i want make custom filter extends javax.filter, when 404 status of response return static html page. not work , wondering why. here filter: @webfilter("/*") public class pagenotfoundfilter implements filter { @override public void dofilter(final servletrequest request, final servletresponse response, final filterchain filterchain) throws ioexception, servletexception { httpservletresponse httpresponse = (httpservletresponse) response; if (httpresponse.getstatus() == 404) { httpresponse.sendredirect("pages/pagenotfound.html"); } filterchain.dofilter(request, response); } but nothing happens, why? note: not want use: <error-page> <error-code>404</error-code> <location>/pages/pagenotfound.html</location> </error-page> but filter you test status code before request processed (and before 404 error set). so need test status code after have...

php - Binding parameters to mysql query -

i want result mysql database php. i using query one: select * images images.name ? or images.title ? and how bind parameters query: $f_for = "%". $filter_for ."%"; $stmt->bind_param('ss', $f_for, $f_for); if replace questionmarks ? made search string, query looks this: select * images images.name '%searchforthis%' or images.title '%searchforthis%' and execute directly (not php, phpmyadmin or directly via terminal), correct/positive result (ie getting rows back, search string matches value in 1 of 2 columns). using parameterized query not errors, empty result (ie 0 rows). tried different string formats, seems none of these work either. $f_for = "'%". $filter_for ."%'"; $f_for = "%{$filter_for}%"; how correctly bind parameters? doing wrong or problem? this 1 way can it, , involves lot less fiddling $filter_for $sql = "select * images i...

solr - How do you configure Apache Nutch 2.3 to honour robots metatag? -

i have nutch 2.3 setup hbase backend , run crawl of includes index solr , solr deduplication. i have noticed solr index contains unwanted webpages. in order nutch ignore these webpages set following metatag: <meta name="robots" content="noindex,follow"> i have visited apache nutch official website , explains following: if not have permission edit /robots.txt file on server, can still tell robots not index pages or follow links. standard mechanism robots meta tag searching web answers, found recommendations set protocol.check_robots or set protocol.plugin.check.robots property in nutch-site.xml. none of these appear work. at current nutch 2.3 ignores noindex rule, therefore indexing content external datastore ie solr. the question how configure nutch 2.3 honour robots metatags? also if nutch 2.3 configured ignore robot metatag , during previous crawl cycle indexed webpage. providing rules robots metatag correct, result in page bein...

haskell - How to use record-syntax with Yesod-Persistent -

why doesn't following work? kinda know there's lot going under hood , user type doesn't have email , createdat , , updatedat field. what's best way not instantiate objects using positional parameters, can go out of hand? share [mkpersist sqlsettings, mkmigrate "migrateall"] [persistlowercase| user email string createdat utctime maybe default=current_time updatedat utctime maybe default=current_time deriving show ]] main :: io () main = runsqlite ":memory:" $ runmigration migrateall u <- insert $ user {email="saurabhnanda@gmail.com" createdat=nothing updatedat=nothing} compilation errors: trysql.hs:38:23: ‘email’ not (visible) field of constructor ‘user’ trysql.hs:38:55: ‘createdat’ not (visible) field of constructor ‘user’ trysql.hs:38:74: ‘updatedat’ not (visible) field of constructor ‘user’ the function names like: useremail , usercreatedat , userupdatedat . running cabal repl , browsin...

Spring MVC redirect to page with custom parameter when session expired -

i can not find solutions spring redirect page parameters when session timed out. need redirect login page error "session expired" . have tried filter , method session.isnew() . not work since when request reaches login page has session. httpsessionevent handler not work because not allow access request attributes , redirect page. the easiest way create interceptor adds refresh header every response time after session expiry. public class refreshinterceptor extends handlerinterceptoradapter { @override public void posthandle ( httpservletrequest request, httpservletresponse response, object handler, modelandview modelandview ) throws exception { //if session != null , user authenticated then... response.setintheader("refresh", figureoutwhensessionexpires() + a_small_delay ); super.posthandle(request, response, handler, modelandview); } }

html - Making a responsive bootstrap nav (problems with alignment) -

i've created nav using bootstrap it's not responding way i'd to. want align first image in photo menu (opens when click camera icon), want align @ screen sizes. i've tried playing around margins i'm not sure if best way, didn't scale down nicely. website: http://explorecanterbury.co.uk/# thanks you have .container wrapping .container-fluid . defeats purpose of fluid container. remove innermost fluid container , replace outermost container fluid container. can see difference in 2 snippets below. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0msbjdehialfmubbqp6a4qrprq5ovfw37prr3j5elqxss1yvqotnepnhvp9aj7xs" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6...

jquery - Typical CSS Lib used with Angular js? -

hi things done jquery can done angularjs , heard can done more angular. have following questions? for asp mvc provides unobstrusive validations of forms' controls, since angularjs not jquery , not commonly used jquery unobstrusive validations done through angular or have use other? is bootstrap still used angular primary look-and-feel library? please provide resource links angularjs-ui , data binding etc have resource links jquery i'm not sure angularjs commonly used jquery directives etc. can use angular without jquery angular comes it's own lighter version of it. unobtrusive should work alongside angular. yes, bootstrap commonly used styling. can check out angularui bootstrap has angularjs support builtin , nice set of tools. check out github pages each project, contains bunch of useful info. https://github.com/angular-ui/

Polymer 1.0 behaviors changes not propagated -

i'm trying make custom i18n behaviors (there no i18n component fit need currently, check i18n-msg, i18n-next custom implementations found on stackoverflow...). it works on first page generation when try change language, labels not updated. here code : behavior : var polymer = polymer || {}; /* defining behavior's */ polymer.i18n = polymer.i18n ||{ properties: { lang: { type: string, value: "en", observer: '_onchangedlocale' }, /** exposes translations */ translation: { type: object, } }, created: function() { /* initialisation */ this._onchangedlocale(polymer.i18n.lang); }, _onchangedlocale: function(locale) { switch(locale) { case 'de': polymer.i18n.translation = i18nde; break; ...

c# - Get invalid parameters from commandline parser -

i use commandline parser nuget. var options = new options(); bool isinputvalid = commandline.parser.default.parsearguments(args, options); how parameters invalid? in 1.9.71 dont' see option can fetch invalid tokens arguments after parsing. if upgrade -pre release version i.e. <package id="commandlineparser" version="2.0.275-beta" targetframework="net45" /> this version gives flexibility more parsed results. can find invalid token below: var result = commandline.parser.default.parsearguments<options>(args); result.mapresult( options => { // optios return 0; }, errors => { var invalidtokens = errors.where(x => x tokenerror).tolist(); if(invalidtokens != null) { invalidtokens.foreach(token => console.writeline(((tokenerror)token).token)); } return 1; }); ...

mysql select returns empty on sha1 hashed password -

i testing hash using sha1 , have inserted row : insert tbl_user (username, password, email) values ('maysam', sha1('21lf892'), 'gerdakan.sa@gmail.com'); and when want select row using : select * tbl_user password = sha1('21lf892'); and result : empty set (0.00 sec) but if try select using username : select * tbl_user username = 'maysam'; +----+----------+--------------------------------+-----------------------+ | id | username | password | email | +----+----------+--------------------------------+-----------------------+ | 2 | maysam | dd989b1d1d67c6e706852024ccb6a1 | gerdakan.sa@gmail.com | +----+----------+--------------------------------+-----------------------+ what problem? why can't select ?( have tested hashing , selecting using md5 , sha2.... a sha1 hash 160bits, i.e. 40 characters when formatted in way. your table appears have length of password column set sm...

php - Get list of current page's categories in MediaWiki -

i'm trying display page's categories in mediawiki skin without resorting following default code: <?php if ( $this->data['catlinks'] ) { $this->html( 'catlinks' ); } ?> which adds bunch of unnecessary html not want. <div id='catlinks' class='catlinks'> <div id="mw-normal-catlinks" class="mw-normal-catlinks"> <a href="/wiki/special:categories" title="special:categories">category</a>: <ul><li><a href="/w/index.php?title=category:player_character&amp;action=edit&amp;redlink=1" class="new" title="category:player character (page not exist)">player character</a></li></ul> </div> </div> ideally category names plain text or array, don't want extrapolate them html returned code above. how can echo mediawiki page's categories plain text? upda...

powershell - power shell remove-item recurse sub directory 3 level down -

i can't figure out way recursively remove folders except sub-sub directory in each folder called "broadcast" dir ->subdir1 -->main -->broadcast ->subdir2 -->main -->broadcast ->test i want keep subdir#\broadcast folders , test folder. problem code below removes subdir1 , subdir2 in few recursion below, removes sub-sub directory get-childitem -path $copy_file -recurse | select -expandproperty fullname | {$_ -notlike '*broadcast\*' -and $_ -notlike '*testing*'} | sort length -descending | remove-item -force i can't use -force /a because list when sort includes subdir1 , subdir2... it prompt me "this item has children..." [y] yes [a] yes all... [l] no i want automatically select l any suggestions? thank in advance... did through couldn't find exact solution looking for. this exclude 'broadcast' folder (you can replace your) , can pass object remove-item get-childitem -path d:\ -rec...

c++ - Using std::move for a "take" method implementation -

i implement "take" method. "take" method method, steals getted object owner: owner left object in empty state. of course, involves c++11 move semantics. of following best way implement it? class b { public: take_a_1() { return std::move(m_a); } // can compiled looks weird me std::move // not complain i'm passing constant object take_a_2() const { return std::move(m_a); } a&& take_a_3() { return std::move(m_a); } // can't compiled (which fine) // // a&& take_a_4() const // { // return std::move(m_a); // } private: m_a; }; none of them. i'd use this: struct b { && get() && { return std::move(m_a); } }; that way can "take" rvalues of b : b b; a = std::move(b).get();

jquery - Weird "for" instruction to PHP -

so have weird code never seen anywhere else. works. {{each sizes}} ${endmark($data, sizes, ',')} <p>${$value.tam}</p> {{/each} this little script write paragraph arrays items. never seen before , need convert array php. i've tried this: {{each sizes}} ${endmark($data, sizes, ',')} <?php $testee = "?> ${$value.tam} <?php "; $i++; ?> {{/each} but not work! does have idea? thank you. some template engine processing that https://github.com/mardix/handlebars

node.js - what's the best way to reference parent/containing nodejs module? -

mymodule |__index.js |__foo.js |__bar.js inside of foo.js want reference mymodule (parent). what's best way of doing that? i debating between 1 of following: var parent = module.parent.exports var parent = require('./'); you can use __dirname reference parent module.

jquery - AJAX with ASP.NET: How to call a method of a user control using AJAX? -

i have master page has placeholder generate content default.aspx default.aspx defines user control : <asp:content id="bodycontent" runat="server" contentplaceholderid="maincontent"> <uc:maincontent id="maincontent" runat="server" /> </asp:content> user control has following code inside: <div class="form-group"> <button type="button" class="btn btn-primary" text="get data" runat="server" data-toggle="model" data-target="#mymodal" title="provide year" id="btngenerate" /> </div then, want call method, defined in user control code behind: [system.web.services.webmethod] public static string generatepdfs() { string test = "test string"; return test; } to have following jquery code: $('#btngenerate').click(function () { if (!validateinput()) { ...

What are the disadvantages of a Docker container using the host network? -

i understand default docker container created in own network stack. i use --net host flag when running docker containers allow use of host ports. the disadvantages aware of: services running inside container potentially conflict other services in other containers run on same port. containers can access full network stack. my question is, security impact when allowing container use full network stack?

python - How to store words read from a file into a list -

apologies basic question new programming language. found similar questions cannot making them work specific case. my aim read words txt file (with more lines, each word separated space), store them list , print list check doing. the following code seems work in terms of printing single words, apparently not storing them (or not able access list). import os def main(): read_text(dir_path) def read_text(file_name): file_data = [] text_file = open(file_name,"r") word in text_file.read().split(): print(word) file_data.append(word) text_file.close() return file_data if __name__ == "__main__": main() what doing wrong? suggestions. if want store data list further use, need retrieve list read_text method returns: def main(): resultlist = read_text(dir_path) # store list # use it...

xcodebuild - How to pass bundle id of extension as environment variable -

i need build xcode project within today extension 'xcodebuild'. bundle of main target com.myapp, while bundle id of extension com.myapp.todayextension. i'd pass both bundle id's parameters of xcodebuild: tried replace bundle id's in xcode project custom environment variables (e.g. ${main_target_bundleid} , ${extension_bundleid}) xcodebuild fails. please me correct syntax of xcodebuild command ? thanks.

ember.js - Avoid repetition of method name in actions -

how avoid following repetition of foo method in ember component? ember.component.extend({ ... foo(val) { this.set('baz', val); }, actions: { bar() { this.foo(this.get('val')); // .. other code }, foo(val) { this.foo(val); } } }); your code looks okay. if want change make foo method action: ember.component.extend({ ... actions: { bar() { this.send('foo', this.get('val')); // .. other code }, foo(val) { this.set('baz', val); } } });

ssis - unicode flat file can't find CRLF row delimiter -

i have csv file contains unicode characters (specifically hindi characters) need import using ssis. when set connection unicode, ssis cannot find crlf delimiters. if uncheck unicode check box, finds crlf delimiters fine. how can correctly import data? rather ticking "unicode" checkbox beside "locale" drop-down, leave checkbox blank , pick "65001 (utf-8)" option "locale" drop-down instead. discovered today after wasting 30 minutes trying various combinations of encodings etc. may work in case well.

asp.net mvc - How to pass an IEnumerable or queryable list of properties from Controller to View -

i hope can me out, struggling issue days now.. programming web application grant users access coupon codes online shops. what use: vb.net, entity framework, mvc (mvvm), ms sql server. this first post on , native language not english, nor advanced hobby programmer, pls accept apologies in case there appropriate answer not able find due not knowing search :/ i have few tables linked many-to-many relations via relation table: tblmerchantsinfo, tblproductsinfo,tblcouponsinfo, tblrelations i have set view expect viewmodel contains neccessary information view useful possible, cannot figure out how pass list(?) of tbl.productsinfo.prodcategoryname view via viewbag or viewdata. from viewmodel can list of categories exist in database, however, list contains duplicates avoid can set actionlink each distinct category. view: <%@ page inherits="system.web.mvc.viewpage(of rabattverwaltung.couponinfoviewmodellist)" language="vb" %> <!doctype html> ...

php - how to veiw all location quantities -

hi guys entire file. <tbody id="cart_contents"> <?php if(count($cart)==0) {?> <tr> <td colspan='8'> <div class='warning_message' style='padding: 7px;'><?php echo $this->lang->line('sales_no_items_in_cart'); ?></div> </td> </tr> <?php } else { $tabindex = 2; foreach(array_reverse($cart, true) $line=>$item) { if($tabindex == 3) { $tabindex = 5; } echo form_open("sales/edit_item/$line");?> <tr> <td><?php echo anchor("sales/delete_item/$line",'['.$this->lang->line('common_delete').']');?></td> <td><?php echo $item['item_number']; ?></td> <td style=...

javascript - Jquery - copy excel data into input fields -

i trying copy excel columns 1 input field break each excel cell own input field. have working not excel data. for example, if copy , paste '1 2 3 4 5' 1 input field, take each value , paste separate input field. example: ! http://imgur.com/1uzt1k1 if copy , paste data example below, not work: ! http://imgur.com/fwvaoua check out jsfiddle example https://jsfiddle.net/jdarville/rfsn1sz4/ $("#templateinfo").bind("paste", function(e){ // access clipboard using api var pasteddata = e.originalevent.clipboarddata.getdata('text'); arr = pasteddata.split(' '); for(i=0; < arr.length; i++){ $("#temp"+i).val(arr[i]); } } ); its splitting data ' ' , if copy , paste excel data has space between information not working.

scala - Convert a logistic regression LBFGS model to POJO -

looking @ h20, wondering if there way can convert spark logisticregressionwithlbfgs() model pojo object. currently, ve been loading logisticregressionmodel.load() function takes 40 seconds. right h2o not support export of spark models pojo. however, can use sparkling water: prepare data in spark call val trainhf = h2ocontext.ash2oframe(sparkdataframe) , build glm model on data. h2o's glm model can exported pojo. or effort can extract information spark's glm model , fill them h2o's glm model.

oracle - PL/SQL - Use "List" Variable in Where In Clause -

in pl/sql, how declare variable mylistofvalues contains multiple values (myvalue1, myvalue2, etc.) select * databasetable databasetable.field in mylistofvalues i using oracle sql developer use collection: create type varchar2tabletype table of varchar2(200); or use built-in type sys.odcivarchar2list or sys.odcinumberlist : variable cursor refcursor; declare your_collection sys.odcivarchar2list := sys.odcivarchar2list(); begin your_collection.extend( 100 ); your_collection( 1) := 'some value'; your_collection( 2) := 'some other value'; -- ... your_collection(100) := dbms_random.string( 'x', 20 ); open :cursor select t.* your_table t inner join table( your_collection ) c on t.id = c.column_value; end; / print cursor;

c - Using if statement instead of default of switch case -

is correct use if statement before opening switch case , avoid using default keyword? example want program takes input number of month , tells name. code uses switch case statement: #include <stdio.h> #include <stdlib.h> main() { int month; printf("insert number of month , program return name"); scanf("%i", &month); switch (month) { case (1): printf("the month january"); break; case (2): printf("the month february"); break; case (3): printf("the month march"); break; case (4): printf("the month april"); break; case (5): printf("the month may"); break; case (6): printf("the month june"); break; case (7): printf("the month july"); break; case (8): printf("the month august"); ...

escaping - Bash missing ']' error for output -

i wrote function in ~/.bashrc file clean configuration files of comments. function follows: clean_config() { [ -z "$2"] && cleanchar="#" || cleanchar="$2" egrep -v "^[[:space:]]*${cleanchar}|^$" "$1" | uniq } basically states if user doesn't pass 2nd argument, use # comment character , clean. first argument file itself. function "works" when run ; character clean, following: [root@server]: /etc/php5/fpm/pool.d # clean_config www.conf \; bash: [: missing `]' [www] user = www-data group = www-data listen = /var/run/php5-fpm.sock listen.owner = www-data listen.group = www-data it escapes character fine, bash: [: missing ']' line @ top. i've tried changing [[ -z "$2"]] causes bash.bashrc not load @ all. any ideas? version info below: [root@server]: ~ # bash --version | head -n1 gnu bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) the space before clos...

data retrieval - CouchBase map multiple documents with key prefix -

i have following keys in couch db : content_hashkey content_info_hashkey in above example hashkey unique in both documents prefix , document content vary both , web client not want them making multiple couch db calls retrieve both pieces of information (related ot same hashkey), efficient way retrieve both documents in single call couch base db ? edit : need hashkey property insideexach of documents able join them ?: content_hashkey hashkeyval : hashkey content_info_hashkey hashkeyval : hashkey

php - .htaccess rewrites but doesn't capture -

my .htaccess file simple: rewriteengine on rewriterule ^([0-9]+)/?.*$ view.php?id=$1 [l] rewriterule ^delete/([0-9]+)/?$ delete.php?id=$1 [l] the first rule works perfectly. when go http://userless.net/123 request sent view.php , can access id $_get['id'] . second rule rewrites fine too, sends http://userless.net/delete/123 delete.php, id not captured!!! $_get['id'] not set. how can similar , yet 1 work , other fail? missing? this due multiviews option turned on default. can turn off using this: options -multiviews rewriteengine on rewriterule ^([0-9]+) view.php?id=$1 [l,qsa] rewriterule ^delete/([0-9]+)/?$ delete.php?id=$1 [l,qsa,nc]

How to stop the rest of code in current method from executing in Java? -

i have 4 textboxes, 2 of them being password boxes (for user confirm password). here's code: public void actionperformed(actionevent arg0) { string username = usernamefield.gettext(); string emailaddress = emailfield.gettext(); string password1 = passwordfield1.gettext(); string password2 = passwordfield2.gettext(); if (password1 != password2) { [code here] } } how can make if passwords aren't equal stops rest of code in method executing? there significant problem before can this: have compare strings correctly. then, can decide if they're false. ultimately, using return in void method acceptable if want return. if (!password1.equals(password2)) { // [code here] } however, better approach simple blanket check, , avoid early return - if passwords are valid, operations in scope of block. fall-through case exit method early. public void actionperformed(actionevent arg0) { string username = usernamefield....

meteor - Handling form submittion -

i have form within modal , don't seem able catch submit event. let's have html page defined (for sake of simplicity leaving out templates defined me) <body> <button class="ui button">open modal</button> <div class="ui small modal"> <div class="header"> enter email </div> <div class="content"> <form class="ui form"> <div class="field"> <div class="ui left icon input"> <i class="at icon"></i> <input type="email" name="email" placeholder="email"> </div> </div> <div class="ui error message"> </div> </form> </div> ...

mongoDB: Aggregation - Is there a equivalent of the $lookup joins for the native node.js driver? -

mongodb: 2.1.3 after reading of aggregation enhancements coming mongodb 3.2 excited "$look" pipeline stage left-outer equi-joins. unfortunately appears node driver doesn't have operator.(i don't see in native driver docs node , when tried use got error: update: here code tried var cursor = db.collection('messagethreads').aggregate([ {"$match": { _id: new objectid(threadid)} }, {"$lookup": { from: "messages", localfield: "_id", foreignfield: "threadid", as: "messageslist"} } ]); cursor.toarray(function(err,messages){ if(err) { res.status(500).json(error); } else if(convo === null){ res.status(400).end(); } else{ res.status(200).json(messages); } }); }); example - threadmessage document { ...