Posts

Showing posts from September, 2012

java - Printing fields from another applet -

applet 1 a("www.domain.com/applet.jar"); applet 1 1 gets applet.jar website applet 2 starts ur server; now applet 2 how print fields of class applet 1 i know this: for (field f : getclass().getfields()) { system.out.println(f.getname()); } you need applet context (get calling getappletcontext() in applet) (see this answer). there, can call getapplets() enumeration of applets.

keyboard shortcuts - Emacs: how to swap ctrl and alt using configure file? -

before posting question, i've read so thread , have brief view on emacs wiki . however, guides above use system-wide keymapping or key binding software. emacs can configured, there way swap ctrl , alt key using ~/.emacs configure file? by default alt key not mapped emacs modifier. each os differently. will need os depended solution: on windows try use key binding functions of emacsw32 . on mac osx use built-in ns-command-modifier , ns-control-modifier , ns-option-modifier .

javascript - Modal bootstrap - keyboard ipad adds blank space under modal backdrop -

Image
i can't figure out causing problem. when scroll down modal window last input field , click on bring ipad keyboard works expected. but if don't scroll down (so bottom partially hidden because modal window bigger height of window) , click input field, result: i have googled many websites , possible fixes nothing seems work. able backdrop bottom when occured (just simple negative bottom) modal window still not behave properly. i use default bootstrap v3 modal. try adding: .modal-open { min-height: 100% !important; } to stylesheet.

java - WebDriver: input type=file - how to attach a file when filing the form -

i testing web application selenium, webdriver, jbehave, thucydides. when try choose file when filling form: webelementfacade wef = find(by.cssselector("#inputtypefileid")); wef.type("/data/file.txt"); i such exception: net.thucydides.core.webdriver.webdriverassertionerror: org.openqa.selenium.webdriverexception: element must user-editable in order clear it. i cannot find solution attaching files in jbehave tests. how should point file upload when testing web applications? kind regards, lukasz

cordova - Phonegap barcode scanner plugin -

i have used barcodescanner v 1.1.0 plugin application having problem scanning in device , not scanning fast need. can show me better plugin scans fast , scans without red-line can scan horizontally or vertically you can try using github. it's simple integrate (add plugin), scans fast , efficient. https://github.com/jonathannaguin/barcodescanner - red line, not sure how remove doesn't stop scanning barcode vertically or horizontally.

c# - Entity repsoitory/service pattern, where to put functionality that needs 2 or more services -

i have created generic repository entity types handles retrieving , adding , deleting data. each entity type has corresponding service class interacts generic repository handle data access. however many times need retrieve data based on more 1 service , never sure place code. example below code returns list of email addresses ("getemailtrackingaddressgroup" function) using 3 different service. have placed in "groupservice" go in "userservice" aswell. public class groupservice { irepository<group> grouprepository; public groupservice(irepository<group> grouprepository) { this.grouprepository = grouprepository; } public group getbyid(int id) { return grouprepository.getsingle(g => g.id == id); } public static list<string> getemailtrackingaddressesgroup(int instanceid, int groupid) { myentities entitycontext = new myentities(); usergroupservice usergroupse...

web services - Calling Soap webservice including WSS from javascript -

i wondering if there technical solution calling soap webservice using client authentication via certificates (xwss ; digital signatures on body, timestamp, binarysecuritytoken) javascript. means keystore should available , accessible, outgoing connection should allowed,... any library exists this? if needed browser extension used? thanks thoughts. cheers. there no such thing far know. chrome extensions limited in can do. the possible solution make extension requests web-services , call native messaging host xml digital signature verification in c++/c#/whatever. for extension need soap client in javascript. had write own implementation of soap client in javascript fulfill task there free libraries out there. see, example, this one .

Grails/Groovy isn't persisting change in object's collection -

i have following problem: my object route contains list of routepoints. when alter list, changed list saved. when next method accesses list, seems change reverted. ruled kind of transaction rollback out, b/c on end of altering method, acces list loading database , still has right (altered) size. here's code: first altering method: def removestationfromroute(station){ def driver = driver.get(integer.valueof(requestaccessservice.getparams().userid)) def route = driver.routes.find{ it.routedate == new date().cleartime() } def rp = routepoint.findbystation(station) route.routepoints.remove(rp) def newroute = driver.routes.find{ it.routedate == new date().cleartime()} println 'new route size: ' + newroute.routepoints.size() def newroute2 = route.get(route.id) println 'new route db size: ' + newroute2.routepoints.size() } both prints return size of 5, correct. right after method carried out, method executed: de...

scala - play2 selectively override settings in application.conf for the run task -

in production play projects can selectively override settings adding application.conf classpath. not seem work development run task. useful different developers test/work different settings without affecting versioned file. in non-play scala project uses typesefe-config can adding additional application.conf in sbt config: unmanagedclasspath in runtime ++= sys.env.get("custom_config").map(ec=>attributed.blank(file(ec))).toseq this way each developer can have own override. play run task doesn't seem honor thought according sbt inspect depends on runtime:unamanagedclasspath setting. you can of course provide complete replacement application.conf not override few entries. anyone knows how this? create new config file: /my/local.conf within file: include "application.conf" my.custom.setting="hello" the first line references application.conf within classpath. succeeding line adds/overrides settings. you start with: s...

Measuring Network Throughput Java/Android -

i'm doing app android, , want measure network throughput using http. far have done code makes http www.google.pt page. measure time between before , after request. the problem: i'm measuring time of entire data exchange between server , app, overhead of tcp protocol. need time takes app receive webpage (useful data). i have used wireshark see happens during request. useful data pdu's see. that's want. http://imgur.com/aodpzrq http://tinypic.com/r/15u6og/8 public static string get(string url){ inputstream inputstream = null; string result = ""; try { // create httpclient httpclient httpclient = new defaulthttpclient(); // time functions before calendar calendarbefore = calendar.getinstance();// instance class calendar int millisecondsbefore = calendarbefore.get(calendar.millisecond); // make request given url httpresponse httpresponse = h...

zend framework2 - zendframework 2 does not recognize strptime() -

i tried calling strptime() function within zendframework 2 application got error message: fatal error: call undefined function strptime() this how called it: $dateobject = strptime(2014-04-01 , '%d-%m-%y'); i trying convert date timestamp. alternatively, there way convert date timestamp in zend framework 2 correction!!!!! hi eveyone.its fault; attempting use striptime() on windows platform. documentation says not run on windows.

How to execute local queries with breeze EntityManager in Edmunds sample? -

i'm newby breeze , wonder if possible run local queries against entities have been fetched using rest service in edmunds sample. is possible execute local queries using breeze entitymanager after reading entities remote rest service? i tried extend edmunds sample app local query called after makes have been loaded: var query = breeze.entityquery .from("make:#edmunds") .where("nicename", "startswith", "a") return manager.executequerylocally(query).then(returnresults); when execute query following exception: "cannot find entitytype resourcename: 'make:#edmunds'. consider adding 'entityquery.totype' call query or calling metadatastore.setentitytypeforresourcename method register entitytype resourcename." what wrong or missing here? how make local query run? breeze interpretting query .from() parameter resource instead of type. (which appear trying set) to let...

google apps script - How to enable or disable textbox and button from listbox selection -

i trying use validation feature enable or disable textbox , button when listbox value selected. please see example code below. appreciated. function examplelistbox(){ var app = uiapp.createapplication().settitle('example').setheight(100).setwidth(250); var ss = spreadsheetapp.getactivespreadsheet(); var panel = app.createformpanel(); var grid = app.creategrid(5, 3); var listbox = app.createlistbox().setid('lb1').additem('none').additem('item1').additem('item2').additem('item3').additem('item4'); var textbox = app.createtextbox().setid('tb1').settext('none').setenabled(false); var pressme = app.createbutton('press me').setid('btn1').setenabled(false); var chandler1 = app.createclienthandler() .validatematches(listbox, 'item1, item3') .fortargets(textbox).setenabled(true) .validatenotmatches(listbox, 'none, item1, item4') .fortargets(textbox).setenabled(false); grid.setwidget(0...

java - Why i can't start activity in my android app? -

if test on samsung galaxy 2 code works: for(int = 0; < all_ids.size(); i++) { if(i == position) { system.out.println("rabotaet if"); string topic = null; string message_id = null; intent activity = new intent(getapplicationcontext(), messageactivity.class); activity.putextra(session_id, sess_id); activity.putextra(date,date); activity.putextra(type,folder_type); activity.putextra(topic,all_subjects.get(i)); activity.putextra(message_id, all_ids.get(i)); activity.putextra(from, all_emails_address.get(i)); startactivity(activity); } } but if test on samsung tab 3, it's not working. , in debug see message: 04-14 12:27:10.760: w/system.err(24669): java.lang.indexoutofboundsexception: invalid index 4, size 0 any ideas? after update i've code: for(int = 0; < all_ids.size(); i++) { if(i == position) ...

audio - Playing m3u playlist with html5 -

i've created simple , basic html5 audio player, not more than: <audio src="[url-to-m3u]" controls> but facing 2 problems, simple audio tag working on chrome, not in safari 7 second is not working on iphone ios7, nor htc android 2.3 the playlist elements mp3 content type: audio/mpeg i guess support m3u file format going scattered in html5 media compatible browser. it should play on ios : try add mime-type audio/mpegurl or application/x-mpegurl server (if not done) , our source tag. <audio controls> <source src="[url-to-m3u]" type="audio/mpegurl" /> </audio> you need check browser support both mp3 , m3u canplaytype method - example: var supportsmp3 = false; var myaudio = document.createelement('audio'); if (myaudio.canplaytype('audio/mpeg') !== ""){supportsmp3 = true;} you need check audio/mpegurl , application/x-mpegurl , audio/mpeg before going ahead , deliver m3u fi...

c# - List loop operations with linq -

Image
i've list this: var query = enumerable.range(0, drea2.count / 4 * 1440).select((n, index) => { if ((index >= 480 && index < 750) || (index >= 810 && index < 1080)) return 0; else if (index >= 750 && index < 810) return 1; else return 2; }); but, range must changeable. example; i've list contains these indexes. these indexes may different each other. 1440 means 1440 min. of day. want add 1440 these indexes. example: query[0], ... query[479] = 2 --- query [1440], ... query[1919] = 2 --- query[2880] = 2 query[480], .. query[749] = 0, --- query[810], .. query[1079] = 0, --- query[1920], .. query[2189] = 0.. so, whatever count of drea2 list, query has size (drea2.count / 4 * 1440) how can this? edit: if drea2.count() returns 6, if condition must have 6 different phrase per 1440 index. first if: (and query range must has 7200 size, now) if ((index >= 480 && index < 7...

arrays - How to create a "for" loop to add not only a value but also an indentifier. Android, Eclipse IDE -

let's have example array of integers, don't know length of array (it gets added shared preferences , grow in size each time app run): int[] testarray = new int[unknown length]; and want create int names values array. ie. int test1 = testarray[1]; int test2 = testarray[2]; int test3 = testarray[3]; .... int test999 = testarray[999]; let's assume length , final value, although in real app don't know. so, started, have: for (int = 0; < items.length; i++) { int test1 = testarray[i] } however, add values i=0 , upwards testarray[i]. ie. test1 = testarray[1]; test1 = testarray[2]; test1 = testarray[3]; can make "test1" change test2, test3 etc. using loop , i? ie. int testi = testarray[i]. of course line of code not work obvious reasons, there way such thing array , loop?? or need resort array list, or perhaps else? data structure store set of values of unknown length) // create vector , populate elements...

c# - Entity Framework compilation error in return methods -

i imported database visual studio project. here code main.cs file: using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace entityframework { class program { static void main(string[] args) { northwindentities db = new northwindentities(); foreach (var customer in db.customers) { console.writeline(customer.contactname); } db.dispose(); } } } the problem error: error cs1502: best overloaded method match 'system.data.entity.core.objects.objectcontext.executefunction(string, params system.data.entity.core.objects.objectparameter[])' has invalid arguments when double click on automatically go method: public virtual objectresult<custorderhist_result> custorderhist(string customerid) { var customeridparameter = customerid != null ? ...

c++ - How to return a vector reference from a function? -

i trying return vector function. if return whole vector, copying process take time, trying return reference vector only. how do in c++ ? here's current function, vector<ii>& primefactors(int n) { int i; vector<ii> factors; for(i=0; i<=n && n!=1 ; ++i) { int cnt = 0; while((n%primes[i]) == 0) { ++cnt; n/=primes[i]; } if(cnt!=0) factors.push_back({primes[i],cnt}); } if(i == lim) factors.push_back({n,1}); return factors; } and heres calling in main() vector<ii> factors = primes.primefactors(20); but if return whole vector, copying process take time, trying return reference vector only. don't worry that. compiler optimize call via rvo (return value optimization) , elide copies. return vector value: std::vector<ii> primefactors(int n...

html - Table like content display using div structure? -

Image
is possible display content shown in attached screenshot using div structure instead table , html/css alone except using jquery toggle control. few points regarding output: any child-row , content won't visible until user clicks arrow-icon of parent-row, clicking same arrow again hide respective child row. clicking on arrow-icon make child row visible using jquery toggle animation. it has responsive. i guess this: ember table http://addepar.github.io/#/ember-table/overview and can place divs table layout css display:table . html <div class="mytable"> <div> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> <div> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <...

Building code from Jenkins using TFS -

i trying use jenkins build code resides in https:// * .visualstudio.com/defaultcollection. i have tried manually check code out using script in jenkins e.g. tf workspace /delete jenkins /noprompt /collection:https://*******.visualstudio.com/defaultcollection /login:mylogin@myaccount.com,mypassword tf workspace /new jenkins /noprompt /collection:https://*******.visualstudio.com/defaultcollection /permission:private /login:mylogin@myaccount.com,mypassword tf workfold /workspace:jenkins /s:https://*******.visualstudio.com/defaultcollection /map "$/myproject" "%workspace%" tf /force /recursive this runs fine command line fails in jenkins tf30063: not authorized access jenkins running local system account. have tried plugin jenkins no joy either. failed on authentication. even if have no intention of using it, i'd install , configure tfs build controller software. create authentication link between cloud instance , system profile. jenkins,...

lisp - How to avoid NIL from getting added to the list? -

i'm newbie in lisp. i've written flatten function in lisp. (defun flatten (list) (cond ((null list) nil) ((atom (first list)) (cons (first list) (flatten (rest list)))) (t (append (flatten (first list)) (flatten (rest list)))))) input- (flatten '(a () b (c d))) expected output- (a b c d) my output- (a nil b c d) what should avoid 'nil' getting added list? i'm supposed make single recursive function. the problem nil , while doubling the empty list , still atom . cl-user> (atom nil) t cl-user> (atom '()) t cl-user> if need ignore it, you'll need change second clause check nil specifically. ... ((and (atom (first list)) (not (null (first list)))) ...) ... another option changing base case gracefully handles nil s in first return value.

java - Problems with jface and RAP -

i'm developing view application i'm working on, , i'm using jface rap. thought wouldn't difficult i'm not making progresses. have sketch of need do, can't start application. google doesn't :/ any tip me started? i tried developing minimal working example, doesn't work. anytime start application, got error: java.lang.illegalstateexception: no context available outside of request processing. i'm pretty sure noob error, can't fix this! idea on might doing wrong? the following should comment! have not enough reps. there little information reproduce issue assume mixing setup options provided rap. read building applications part in developer's guide completely. outstanding worked out tutorial can found here might understand differences. try create project 3 setup options (1 rap osgi , 2 rap workbench , 3 rwt standalone ). just guessing: in faq quite similar error description might help. no context available outsid...

ruby on rails - simple_form no input found for json -

environment mac os x rails 4.0.4 ruby 2.1.1 gems: simple_form create model json typed field, here migration file: create_table :my_model |t| t.string :name t.json :my_field t.timestamps end and when try create new object (new form), getting error runtimeerror - no input found json: simple_form (3.0.2) lib/simple_form/form_builder.rb:551:in `find_mapping' simple_form (3.0.2) lib/simple_form/form_builder.rb:482:in `find_input' simple_form (3.0.2) lib/simple_form/form_builder.rb:111:in `input' i guessing simple_form not handling json type well, , don't know how work around 1 (newbie simple_form). hope can help simple_form, doesn't support json type natively. turns out, json text based data format, can simple use textarea output json. <%= f.my_field, as: :text %> this should work fine

PHP Post Unset Fully -

this question has answer here: reload/refresh page in browser without re-submitting form? 3 answers okay found out browsers try smart , remember form data if refresh. if click url bar , hit enter unset post data is there way unset $_post data if u refresh it? (google chrome) has no way of remembering. <?php if (isset($_post['loginsubmit'])) { echo 'triggered'; unset($_post['loginsubmit']); } ?> by refreshing, re-sending post request. if "hit address bar" not re-send it, call teh url request. handled browser, not php. you can use sessions prevent post data being comitted twice. one way have token in forms, set in session (simply store in session uppon creating form). if data submitted via post , processed (i.e. inserted database) check if token exists in session. after processing data de...

actionscript 3 - gotoAndStop MovieClip outside of extended MovieClip -

i have inventory system worked on timeline. now, trying connect class i'm having difficulties. on stage, have movieclip instance name inventorymc inside inventorymc , have 15 more movieclips instance name itemslot1 , itemslot2 etc... gotoandstop functions not working properly... have no document class, classes extend movieclips ... this beginnerchest class, when clicked calls function inventory class: package { import flash.display.movieclip; import flash.events.mouseevent; public class beginnerchest extends movieclip { private var _inventory:inventory; public function beginnerchest() { _inventory = new inventory(); addeventlistener(mouseevent.click, begclick); claimbtn.addeventlistener(mouseevent.click, _inventory.claimclick); } public function begclick(e: mouseevent) { play(); } //ends startbtnclick; public function inserttext(str) { return str + "\r" } } } this inventory c...

php - Language anomaly. Curious jump -

i have section of code following structure. if ( isset( $x) ){ error_log("a"); $a = f(); error_log("b"); } error_log("c"); the error log has entries a c i no other entries in error log. i have narrowed odd behavior down api call, phpcas::isauthenticated() , phpcas v1.3.2, inside f(). how possible code skip call error_log("b") ? language construct allows this? are sure log 'c' 1 ? can log file , line if error handler hasn't information. if 3 logs ones, sure code ? don't have things before or after call of f() ? you may have code deactivate logs or change handler, reactivate or reset old handler. can search strings "set_error_handler", "ini_set", "error_log"... if "f()" uses classes instances, @ contructor , destructor of class , not in methods specificaly called.

javascript - choose function by select in angularjs -

i have 2 selects , 1 button function. want check if location selected location part of code, if assigned selected assigned part of code. works if both null in api ;), can change 1 of them. $scope.edit_location = function() { for(var = 0; < $scope.inventories.length; i++) { if($scope.currentinventory.location){ console.log('i in location'); var copyselectedinv = restangular.copy($scope.currentinventory); copyselectedinv.customput({location: $scope.currentinventory.location, assigned: null, tags: $scope.inventories[i].tags}); }else if ($scope.currentinventory.assigned){ console.log('i in assigned'); var copyselectedinv2 = restangular.copy($scope.currentinventory); copyselectedinv2.customput({location: null, assigned: $scope.currentinventory.assigned, tags: $scope.inventories[i].tags}); } } }; my template selects <select class="input-mediu...

java - Can program execution go different by choosing between Enhanced for loop and old fashioned index based loop for a collection? -

i asked in interview. said no. interviewer did not seem impressed. any corner case missed? note: not talking cases 1 can iterate 2 times faster/modify loop variable. in other words difference between for (int = 0;i<set.size();i++) { // } and for (int x : set) { // something. } anything performance(i know both compile same code)/etc. the answer is: yes, program may behave differently. kayaman mentioned thread-safety in answer. special case may show different behavior. question whether or not collection itself modified during iteration 1 aspect may influence program flow. but regardless of that, enhanced for-loop, iterator created @ beginning of loop. , iterator keep reference "his" collection iterating over. in contrast that, iteration classical for-loop take account when collection replaced new one. this can seen in following example. import java.util.arraylist; import java.util.list; public class differentforloops { public static v...

sql - Out of a set of data returned grouped by months, only the initial month is returning incorrect data -

i trying return data last 24 months of end of last month. initial month returns incorrect data, while other months correct. believe issue in strbegindate = section of code. ideas causing partially returned data initial month? thank much. sub getstaticapprovalrates_slide6() dim strbegindate dim strenddate strenddate = sheets("instructions").range("enddate").value strbegindate = dateadd("m", -23, strenddate) + 1 sheets("slide6data").select it's hard what's wrong based on posted. see calculating start date based on end date, subtracting months. there no allowance days. might missing of first month not allowing days of first month. that , if end date occurs mid-month, think algorithm cause start date mid-month also. perhaps missing days 1-x of first month.

jquery - Image over image hover -

i have div, , div, both have images set them ex: <div id="image"></div> <div id="btnprev"></div> the image underneath button prev. - i'm trying trigger hover on image, , fade in btnprev, when mouse goes on btnprev fades out due leaving div id 'image'. is there way 'append these together', cannot place btnprev inside 'image'. i cannot place btnprev inside 'image'. however, can create class. ex : <div id="image" class="hoverdiv"></div> <div id="btnprev" class="hoverdiv"></div> and in jquery can : $('.hoverdiv').on("hover", function() { //do stuff }); however, think if put them 1 containing div work better because btnprev won't showing if have : <div id="imagecontainer"> <div id="image" class="hoverdiv"></div> <div id="btnp...

spring - Configuring a Conversion Service with a custom DateFormatter -

i'm trying add custom dateformatter spring/thymeleaf application, of following documentation : http://www.thymeleaf.org/doc/html/thymeleaf-spring3.html#conversions-utility-object the problem don't use xml configuration beans definitions, webconfig.java class following implementation : @configuration @enablewebmvc @componentscan(basepackages = {"com.myapp.web.controller","net.atos.wfs.wts.adminportal.web.domain"}) public class webconfig extends webmvcconfigureradapter { private static final logger log = loggerfactory.getlogger(webconfig.class); @override public void addresourcehandlers(resourcehandlerregistry registry) { registry.addresourcehandler("/resources/**").addresourcelocations("/resources/"); } @override public void addinterceptors(interceptorregistry registry) { localechangeinterceptor localechangeinterceptor = new localechangeinterceptor(); localechangeinterceptor.setparamname("lang"); regis...

Do unix timestamps change across timezones? -

as subject asks; unix timestamps change in each timezone? for example, if sent request email other side of world saying, "send out email when time 1397484936" , other server's timestamp 12 hours behind own? the definition of unix timestamp timezone independent. timestamp number of seconds (or milliseconds) elapsed since absolute point in time, midnight of jan 1 1970 in utc time. (utc greenwich mean time without daylight savings time adjustments.) regardless of timezone, timestamp represents moment same everywhere. of course can convert , forth to local timezone representation (time 1397484936 such-and-such local time in new york, or other local time in djakarta) if want. the article @ http://en.wikipedia.org/wiki/unix_time pretty impressive if you'd longer read.

JPA native query second level cache -

i need use second level cache native sql using jpa. not finding way it. if jpa supports native query cache, can suggest way the jpa l2 cache designed entities. if haven't got firstly, pointless using jpa, , secondly, if have entities native query not return them, nothing cacheable. obviously may find implementation allow amount of caching of information in l2 cache native (sql) queries, not using jpa specification standard, , instead using vendor specifics (which stop working if ever changed jpa provider)

sql - Execute stored procedure in OUTER APPLY block -

why can not use stored procedure in outer apply block? need int value stored procedure dbo.getteacherid , use in where clause. here code: use [studentsdb] declare @teacheridout int; select studentlastname, studentfirstname, studentmiddlename, lessonname, score, tlastname, tfirstname, tmiddlename scores join students on scores.studentid=students.studentid join lessons on scores.lessonid=lessons.lessonid outer apply ( execute dbo.getteacherid 0, 0, @teacherid=@teacheridout -- here error select teachers.teacherlastname, teachers.teacherfirstname, teachers.teachermiddlename teachers teachers.teacherid=@teacheridout )t(tlastname, tfirstname, tmiddlename) score <=3 and there other way value stored procedure? here stored procedure dbo.getteacherid : use [studentsdb] go set ansi_nulls on go set quoted_identifier on go alter procedure [dbo].[getteacherid] @lessonid int, @groupid int, @teacherid int output begin set nocount on; select @teacherid=gr...

elisp - Control the order in which customization options appear? -

in major mode, have options defined defcustom , defface . each assigned same :group defined via defgroup . when m-x customize-mode , options appear , work correctly. however don't order in appear. example i'd put @ top customizations users more need or want change. unfortunately can't figure out how emacs determines order. example doesn't seem correspond order in defined in .el file, or alphabetical sort of doc strings or :tag s. maybe i'm overlooking obvious, seems be... "random"? in reading elisp docs , searching online haven't found answer. is possible control order in options appear, , if so, how? the order of options determined c-h custom.*(sort\|order) ret : custom-browse-order-groups user option: if non-nil, order group members within each customization group. properties: standard-value custom-type custom-requests variable-documentation custom-browse-sort-alphabetically user option: i...

jquery - Javascript Inserting a clone ordering issue -

i trying clone , insert items in order in js, can clone , add elements order seems incorrect, trying assign value radio buttons can tie radio buttons text fields seen below: <div id='1'> <div class="template"> <div> <label class="right inline">response:</label> </div> <div> <input type="text" name="responsetext[]" value="" maxlength="400" /> </div> <div> <input type="checkbox" name="responscheck[]" value="0" /> </div> </div> <div> <input type="button" name="addnewrow" value="add row" /> </div> </div> js: var $counter = 0; var $te...

jquery - Chrome is not working for dynamically created audio tag using javascript -

in our mvc application,we creating html5 audio control dynamically using javascript ,but not showing player play button in chrome browser.my javascript code //create audio tag var audiotag = document.createelement("audio"); audiotag.setattribute("controls", "controls"); audiotag.classlist.add("newaudio"); audiotag.classlist.add("col-xs-11"); but works in firefox , ie .any ?

ios - Displaying image in UIButton -

to preface question, extremely new objective-c , xcode. have been learning week or have been stuck on problem few days. trying display image in uibutton. have 3 choose from, blue.png, purple.png , orange.png. no matter or image tell xcode use, display blue image. have deleted image project entirely. have "reset content , settings" in ios simulator. going on here? the.h code iboutlet uibutton *h1; the.m code uiimage *buttonimage = [uiimage imagenamed:@"purple.png"]; [h1 setimage:buttonimage forstate:uicontrolstatenormal]; [self.view addsubview:h1]; no matter image specify within quotes, uses blue.png, when image no longer exists in project. everybody! you must have set blue.png background image in storyboard or xib file. write nslog(@"%@",buttonimage) make sure image not nil. make sure entering correct name , extension purple.png and also, use [h1 setbackgroundimage:buttonimage forstate:uicontrolstatenormal]; instead of setimag...

String into integer in C++ -

i have string value : 2014-04-14 i want convert integer 20140414 i know string in integer can done std::string mystring = "45"; int value = atoi(mystring.c_str()); //value = 45 but don't know how remove - sign. using streams: std::istringstream iss("2014-04-14"); then if have c++11, can use new get_time io manipulator : std::tm tm; if (iss >> get_time(&tm, "%y-%m-%d")) ... the std::tm structure has extracted values, namely: years since 1900 stored in tm.tm_year months since january (so 0..11) stored in tm.tm_mon day of month (1..31) stored in tm.tm_mday so, desired value is: int value = (tm.tm_year + 1900) * 10000 + (tm.tm_mon + 1) * 100 + tm.tm_mday; alternatively, or c++03, can parse values out of istringstream yourself: int year, month, day; char c; if (iss >> year >> c && c == '-' && iss >> month >> c && c == '-' ...

jboss7.x - How do I delete old JBoss logs? -

i'm using jboss 7.1.3 on mac 10.9.1. development machine. how delete old server logs appear under the $jboss_home/standalone/log directory? ideally, i'd logs older 4 days deleted system, freeing disk space. i not sure whether can auto delete files based on time lines of 4 days, <periodic-rotating-file-handler> does not have provision so. since requirement free disk space can achieve using config file (standalone or domain.xml). by default config file logging setting comes periodic-rotating-file setting looks like: <periodic-rotating-file-handler name="file" autoflush="true"> <formatter> <pattern-formatter pattern="%d{hh:mm:ss,sss} %-5p [%c] (%t) %s%e%n"/> </formatter> <file relative-to="jboss.server.log.dir" path="server.log"/> <suffix value=".yyyy-mm-dd"/> <appe...

cordova - access file system iOS device using phonegap -

i developing ios app using phonegap. application should able download files internet, storing them directory created in device. have done same thing android target, , code works properly. creates directory in phone, download , save files. in ios code doesn't work. i've tried search solutions in web, without results. here code: document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { alert("device ready"); window.requestfilesystem(localfilesystem.persistent, 0, onfilesystemsuccess, fail); } function onfilesystemsuccess(filesystem) { console.log(filesystem.name); console.log(filesystem.root.name); var directoryentry = filesystem.root; directoryentry.getdirectory("mydir", {create: true, exclusive: false}, ondirectorysuccess, ondirectoryfail); } function ondirectorysuccess(parent) { console.log(parent); window.localstorage.setitem("directory_path",pare...

objective c - UITableView troubles in 3.5inch and 4inch screens -

i have uitableview 150 pixels wide. on 4inch iphone screen shows of rows fine. on 3.5inch iphone screen shows half of last row. how can make sure shows full width of last row. many i added constraints uitableview , works on iphone 3.5 , 4inch screens.

java - Running JUnit tests from Terminal -

i have junit tests running in intellij fine. however, need run these same tests terminal. problem is, no matter do, error says: junit version 4.10 not find class: com.mycompany.mytests i not know why not working. in attempt run unit tests command-line, i'm running following: java -cp /applications/intellij\ idea\ 13.app/lib/junit-4.10.jar org.junit.runner.junitcore com.mycompany.mytests however, thing see error listed above. keep running command , down source directory. yet, no matter can't tests run command-line. yet, run fine within intellij. how tests run command-line in same way run within intellij? there way can view actual command(s) intellij runs when running junit? thank you somewhere there directory or jar holds 'com' directory root of application's package structure (com/mycompany). directory or jar needs added classpath through -cp flag using. so example class in: /workspaces/myproject/bin/com/mycompany/mytests.class then need...

Python subprocess.Popen blocks with shell and pipe -

running following command: yes | head -1 , shell, outputs y . using python's subprocess module call shell hangs indefinitely: import subprocess arg = "yes | head -1" process = subprocess.popen(arg, shell=true, stdout=subprocess.pipe, stderr=subprocess.pipe, ) print "command started: %d" % process.pid r = process.communicate() print "command ended: %s %s" % r killing process exogenously using kill not help, nor making child process it's session leader using preexec_fn=os.setsid . what causing behavior, , there anyway can prevent it? i'm running python 2.7.3 , /bin/sh gnu bash, version 3.2.48(1)-release (x86_64-apple-darwin12) so turns out caused due known issue python not resetting signal handlers before exec in subprocess module. this same problem causes 'yes' reporting error subprocess communicate() , except gnu yes , epipe returned write causes program abort, whereas bsd yes (which used on os x...

hibernate - Generate java.awt.Image using byte[] from oid column in PostgreSQL -

have nice day. i'm working application using seam 2, rich faces , primefaces, hibernate jpa , postgresql. have done catalogs tables image field. use annotations declare image field in table: @lob @basic(fetch=fetchtype.lazy) @column(name = "fotografia") public byte[] getfotografia() { return fotografia; } public void setfotografia(byte[] fotografia) { this.fotografia = fotografia; } and stores in oid column in table in postgresql database. after can show image without problem in views using primefaces tag showing images: <p:graphicimage id="_ftfur" value="#{genericimagestreamer.image}" rendered="#{genericimagestreamer.image!=null}" alt="sin fotografia" style="width:320px; height:420px;" styleclass="ui-image-container" /> so works without problems...