Posts

Showing posts from April, 2011

git - LibGit2Sharp Find release for commit -

in github can view commit , view releases part of. i trying similar libgit2sharp . can find commit , can find release, can't see how tell if commit in release or not. is possible, if how? a release github concept. it's built on git concept of tag , enriched styled release notes , downloadable assets. from libgit2sharp perspective, you're after finding tags point specific commit. the question what's fastest way find tags pointing commits? deals this.

c# - Improving SQLite index -

i have sqlite database c# application i'm running in memory (:memory:). table has 650k rows, isn't much. want fast response-times on following query (syntax fetched linq sql dynamic linq query) select sum([t0].[value1]) [sum], [t0].[dim1] [primary], [t0].[dim2] [secondary] [budgetline] [t0] [t0].[budgetid] = 4 group [t0].[dim1], [t0].[dim2] which optimal index query? index other primary key looks following... create index ix_0 on budgetline (budgetid, dim1, dim2) create index ix_1 on budgetline (budgetid) create index ix_2 on budgetline (dim1, dim2) create index ix_3 on budgetline (budgetid, dim1, dim2,value1) currently execution times varies, around 1s current average. want query take less 0.5s @ least. the table has 50 columns. please assist update: see 4 indexes above, these i'm getting 0.8s response... remove indexes create index ix_3 on budgetline (budgetid, dim1, dim2,value1) create index ix_0 on budgetline (budgetid, dim1, dim2) ...

Access phpMyAdmin main page in Amazon EC2 instance -

i have amazon ec2 amazon-linux instance running. i installed phpmyadmin (correctly think, followed these steps https://superuser.com/questions/291230/how-to-install-phpmyadmin-on-linux-ec2-instance ), when access http:// myelasticip /phpmyadmin see file list, in phpmyadmin folder. what have view phpmyadmin main page??? know must stupid question, dont know else do... thanks in advance! silly question, had install php in ec2 instance. not installed default. hope helped someone

Delphi XE6 - Access Violation at address 5006677D in module 'trl200.bpl' -

i upgraded delphi xe6. went fine. i installed custom .bpl file , when try load delphi xe6 error. access violation @ address 5006677d in module 'trl200.bpl' i suspect because forgot recompile component package before installing on xe6. does know can tell xe6 not try load this? just delete bpl tried install (or rename suggested below). after restart of delphi asked if want load bpl next time delphi started, press "no". try install bpl again, compiled xe6. not delete rtl200.bpl! have done many times , never had change registry.

performance issue in jointjs when more component -

i have use jointjs building workflow diagram. how performance affect in ie browser when there more 200 component(includes arrows, nodes,bozes ) on same page ? as may know there demo application named rappid here you can test performance requirements there. i have tested performance ~150 components , 1 link between 2components , there no performance issue @ all.

html - Using aria-invalid on divs representing input -

i working on site asks users upload items validation. make output of upload accessible, unclear whether or not acceptable set aria-invalid on div when div represents user input (as opposed being valid on input elements). yes, correct use aria-invalid element contains user input if value of element has been or checked correctness. value of attribute, defined in aria spec , should set according result of check, aria-invalid=true if test fails. the use of attribute not limited form fields. in fact, in them, unnecessary @ least in principle if html5 checks performed, since assistive software can have access results (though not happen), whereas checks performed client-side javascript invisible assistive software unless signal results aria attributes. a typical scenario div element has contenteditable=true attribute , acts advanced user input area, checks on content. if div element merely echoes user input (e.g., user input has been taken via normal form , server-s...

java - How to get week of year figure in GWT -

is there simple way how week of year information date object or millis time in gwt on client side? something this: date date = new date(); date yearstart = new date(date.getyear(), 0, 0); int week = (int) (date.gettime() - yearstart.gettime())/(7 * 24 * 60 * 60 * 1000); note give week in date object, has no time zone information. when use it, may have adjust using time zone information.

javascript - Why jQuery trigger method doesn't use native events? -

jquery trigger works listeners attached jquery , won't work if listener attached otherwise (with prototype.js example). but, @ same time - if trigger native event - works both jquery , other libraries. the question - why jquery doesn't generate native event out of box , instead uses own stuff? i'm curious , want know why works way. p.s. sample code native event var trigger = function(el, eventname) { if (document.createevent) { var evt = document.createevent('htmlevents'); evt.initevent(eventname, true, true); return el.dispatchevent(evt); } if (el.fireevent) return el.fireevent('on' + eventname); } in versions of ie (before attachevent/addeventlistener), assign 1 handler/listener each event. jquery assign handler event, calls list of callbacks (the handlers assigned). allows consistent behaviour of multiple handlers across different browsers.

c++ - Eclipse not updating "built-in" include paths for Android NDK Project after switching to GCC 4.8 -

i have android/eclipse project uses ndk , i've enabled c++11 support adding following application.mk file: ndk_toolchain_version := 4.8 #same result here clang app_cppflags += -std=c++11 this works fine, c++11 features available , compile expected. goes ndk-build , eclipse builds (which invoke nkd-build), eclipse code parser becomes confused now. when open file uses types added stl in c++11 (like example std::unique_ptr ), red squiggles , error entry in problems tab saying symbol 'unique_ptr' not resolved . wouldn't bad, if errors present in list eclipse refuses launch (or debug) application. right-clicking on #include <memory> line , selecting open declaration opens wrong (4.6) file. when checking project properties under c/c++ general --> paths , symbols --> includes still lists old (4.6) includes when show built-in values ticked: screenshot are cached somewhere , can re-generate entries? i've tried clean , rebuild project, no effect...

ios - CABasicAnimation does not animate correctly when I update model layer -

Image
i'm implementing cabasicanimation animates calayer transform property. now, although i'm new core animation, have been able gather through various blogs , articles such objc.io bad idea use (incorrectly) recommended method getting animations stick using fillmode , removedoncompletion properties of animation. method considered bad practice many because creates discrepancy between model layer , presentation layer, , future queries 1 of layers may not match user seeing. instead, recommended way of doing animations update model layer @ same time add animation layer being animated. however, i'm having trouble understanding how working. animation simple, , goes this: catransform3d updatedtransform = [self newtransformwithcurrenttransform]; // location 1 cabasicanimation *transformanimation = [cabasicanimation animationwithkeypath:@"transform"]; transformanimation.duration = 1; transformanimation.fromvalue = [nsvalue valuewithcatransform3d:self.layerbeingani...

sql - MySql ranking system with multiple categories -

this question has answer here: how perform grouped ranking in mysql 5 answers on game ranking system, users can rate games using 3 categories (eg: cat1, cat2, cat3). table game_ranking | id | user_id | game_id | cat1 | cat2 | cat3 | | 1 | 1 | 1 | 5 | 7 | 8 | | 2 | 1 | 2 | 10 | 8 | 5 | | 3 | 2 | 2 | 1 | 4 | 5 | | 4 | 3 | 1 | 5 | 7 | 8 | | 5 | 4 | 1 | 2 | 3 | 6 | | 6 | 7 | 3 | 6 | 6 | 3 | | 7 | 9 | 3 | 3 | 10 | 7 | the ranking must based on total of sum of each category column. eg: game_id 2 score = cat1(10 + 1) + cat2(8 + 4) + cat3(5 + 5). game_id 2 score 33. if 2 or more games have same score, game has highest number of votes should on top of other. i need mysql query create ranking based on these criterias...

RatingBar deforms my layout in Android 2.3 -

Image
this how item of listview in app looks in android 4.4 (real device): and how same activity in same app looks in android 2.3 (real device, too): as can see, using custom layout rating bar, deforms activity in android 2.3 horrible vertical bars. can tell me why happening? set correct android:minheight , android:maxheight values stars style. happens because of different parent styles on different platforms.

performance - Excel multi word/value search -

Image
i have master server list, excel file. one of columns lists server name, column lists application on server, 1 lists supports application, etc.. secondly, have list of 30 servers, need find (or highlight) within master list, can determine apps associated these specific servers. i know can filter, there hundreds of servers on list, , i'm trying find quicker way pull of rows 1 of 30 servers listed. *a db isn't option wish were. take example: the list in columnf can 30 items, if desired. result of clicking ok is: in first image, $f$8 should $f$3 in case.

msmq - Can someone tell me if SQL Server Service Broker is needed for this scenario? -

my first ever question on stack overflow please go easy. have long running windows application continually processes sql server commands. have web front end users use use update same db. i've noticed (depending on windows application processing @ time) if user submits db receive out of memory exceptions on server. realise need dig around bit more , optimise code. cannot afford server go down , expect in future i'll allowing more , more users on frontend. need system queue users requests (they not time critical) , process them when db ready. i'm using sql 2012 express. is sql service broker best solution, i've looked msmq. if can point me in right direction appreciate. in search i'm finding lot of things don't think need. cheers it depends on you're doing persistence work, , / or calculations. if you're doing hard work in windows application, using service broker queue won't worthwhile, doing receiving message service broke...

Matlab : getrect alternative? -

i'm looking select area of image in matlab using mouse, returning x/y of corners user. looking online, getrect function in image processing toolbox don't have image processing toolbox. is open source alternative i.e. on matlab file exchange? mark if okay using global variables , callbacks, following do. create function passes (for example) image wish display function extractblock(i) % clear global variables (or specific app) clear global; % display image figure; image(i); % set callbacks handling of mouse button down, motion, , % events against figure set(gcf,'windowbuttondownfcn', @mybuttondowncallback, ... 'windowbuttonupfcn', @mybuttonupcallback, ... 'windowbuttonmotionfcn', @mybuttonmotioncallback); end now define callbacks. start mouse button down event record mouse button has been pressed , position (this callback , others can placed in same file above funct...

php - How to automatically share file with a specific email address / user? -

i using google api client upload , convert file user's google drive. how can automatically share file 1 specific user? $file = new google_service_drive_drivefile(); $file->title = $title; $chunksizebytes = 1 * 1024 * 1024; // call api media upload, defer doesn't return. $client->setdefer(true); $request = $service->files->insert($file, array( 'convert' => true, )); the webapp html form creates document based on user data. document needs later edited myself, saved in google drive, , deleted user's google drive. what best/easiest way achieve this? to share file drive api use permissions.insert() type "user", role of either "reader", "writer", or "commenter", , value email address. more information sharing files available in this developer guide .

java - Use File-class to find readable file in res/raw-directory Android -

i have text-file in res/raw-folder , tried create file-object file file = new file("res/raw/textfile.txt"); . got filenotfoundexception , file.exists() returned false . i want create object in different class , package mainactivity-class guess have pass context(or "this" ?) use reference(?). i've tried several methods this: file file = context.dosomething("file-path"); end getting filenotfoundexception . , file.exists() returns false . i have use file because need use file.touri() later on. is possible find file-path in res/raw-directory , use file object? edit: got advice put file in assets-folder. this: assets/textfiles/textfile.txt . i need path string put in file file = new file("file-path"); . edit: tried this: inputstream input = context.getassets().open("textfiles/textfile.txt"); file file = new file(input.tostring()); didn't work either. maybe file-class of no use in android-project...

ruby on rails 3 - ActiveRecord::ConfigurationError - Association named 'whatever' was not found -

i have complicated case i'm developing rails 3 engine , intermittently error in title. here's stacktrace: activerecord::configurationerror - association named 'whatever' not found; perhaps misspelled it?: activerecord (3.2.18) lib/active_record/associations/preloader.rb:150:in `block in records_by_reflection' activerecord (3.2.18) lib/active_record/associations/preloader.rb:146:in `records_by_reflection' activerecord (3.2.18) lib/active_record/associations/preloader.rb:139:in `grouped_records' activerecord (3.2.18) lib/active_record/associations/preloader.rb:130:in `preload_one' activerecord (3.2.18) lib/active_record/associations/preloader.rb:109:in `preload' activerecord (3.2.18) lib/active_record/associations/preloader.rb:98:in `block in run' activerecord (3.2.18) lib/active_record/associations/preloader.rb:98:in `run' activerecord (3.2.18) lib/active_record/relation.rb:181:in `block in exec_queries' activerecor...

c++ - Changing struct to class (and other type changes) and ABI/code generation -

it well-established , canonical reference question in c++ structs , classes pretty interchangeable, when writing code hand. however, if want link existing code, can expect make difference (i.e. break, nasal demons etc.) if redeclare struct class, or vice versa, in header after original code has been generated? so situation type compiled struct (or class), , i'm then changing header file other declaration before including in project. the real-world use case i'm auto-generating code swig, generates different output depending on whether it's given structs or classes; need change 1 other output right interface. the example here (irrlicht, svertexmanipulator.h) - given: struct ivertexmanipulator { }; i redeclaring mechanically as: /*struct*/class ivertexmanipulator {public: }; the original library compiles original headers, untouched. wrapper code generated using modified forms, , compiled using them. 2 linked same program work together. assume i'm us...

arrays - How do I use the Trim Function -

i'm converting web project vb c#, , can't figure out how implement trim function. have write specific function, or there way use in context of project? here functional vb code i'm trying convert. if need more details, please ask. protected sub buttonsetup(byval dr datarow, byval btn button) btn.visible = true btn.text = dr("floor_name").tostring.trim() btn.commandargument = dr("floor_file").tostring.trim() btn.cssclass = "greybuttonstyle" addhandler btn.click, addressof me.schematic_button_click end sub indexer c# uses square bracket [] access element of indexer instead of parentheses () event handler addhandler , addressof both vb keyword. in order add handler event, use += operator event left operand , handler right operand. protected void buttonsetup(datarow row, button button) { button.visible = true; button.text = row["floor_name"].tostring().trim(); button.commandarg...

Is the `chrome.runtime` API no longer available from regular pages? -

several months ago, played code used chrome.runtime api within regular page's js runtime (meaning, not extension's background script). now, using same code, chrome.runtime undefined . did change? i've got background script listens external messages, , i'd send message extension using chrome.runtime.sendmessage() page. chrome.runtime.sendmessage should available page if have installed extension lists site externally_connectable . see here .

Kafka does not start on Windows - key not found: \tmp\kafka-logs -

i have put effort getting kafka run on windows 32 (company issued laptop - not choice..). i successful create handful of topics. after stopping/restarting kafka unable re-read topics. here startup logs [2014-05-29 12:26:23,097] info [replicafetchermanager on broker 0] removed fetcher partitions [vip_ips_alerts,0],[calls,0],[dropped_calls,0],[calls_online,0],[calls_no_phone,0] (kafka.server.replicafetchermanager) [2014-05-29 12:26:23,106] error [kafkaapi-0] error when handling request name:leaderandisrrequest;version:0;controller:0;controllerepoch:4;correlationid:5;clientid:id_0-host_null-port_9092;leaders:id:0,host:s80035683-sc01.mycompany.com,port:9092;partitionstate:(vip_ips_alerts,0) -> (leaderandisrinfo:(leader:0,isr:0,leaderepoch:3,controllerepoch:4),replicationfactor:1),allreplicas:0),(calls,0) -> (leaderandisrinfo:(leader:0,isr:0,leaderepoch:1,controllerepoch:4),replicationfactor:1),allreplicas:0),(dropped_calls,0) -> (leaderandisrinfo:(leader:0,isr:0,leaderepoc...

xcode - Cordova 3.5 iOS Compile Error -

i upgraded phonegap project cordova 3.5 , can't compile app anymore. here output xcode: undefined symbols architecture armv7: "_objc_class_$_cdvfile", referenced from: objc-class-ref in cdvcapture.o (maybe meant: _objc_class_$_cdvfiletransfer, _objc_class_$_cdvfiletransferentitylengthrequest , _objc_class_$_cdvfiletransferdelegate ) "_objc_class_$_cdvfilesystemurl", referenced from: objc-class-ref in cdvfiletransfer.o "_cgimagedestinationcreatewithurl", referenced from: -[readerthumbrender main] in readerthumbrender.o "_cgimagedestinationaddimage", referenced from: -[readerthumbrender main] in readerthumbrender.o "_objc_class_$_cmmotionmanager", referenced from: objc-class-ref in iphone_sensors.o objc-class-ref in cdvaccelerometer.o objc-class-ref in libqcar.a(libqcar.a-armv7-master.o) "_cgimagedestinationfinalize", referenced from: -[readerthumbren...

html - JQuery Putting a header tag inside of a div tag -

attempted attach simple header div element. confused why not working. h1 tag indicates value of loading. <div data-role="page" id="addviewtask"> <div id="header" data-role="header" data-theme="a" data-position="fixed"> <div style="text-align:center;margin:20px"> <h2 class="header-font"> page </h2> </div> </div> <div data-role="main" class="ui-content"> <div class="ui-grid-a"> <a href="#" class="ui-btn ui-corner-all ui-shadow">view tasks</a><br> <a href="#" class="ui-btn ui-corner-all ui-shadow">add task</a><br> </div> </div> <div id="footer" data-theme="a" data-role="footer" data-position="fixed"...

php - My PDO Insert data not working -

i wanted add data type in inputs database current code wont work. code tutorials i've watched in youtube. problem not adding data inputed database. index.php <?php require_once('header.php'); ?> <html lang="en"> <head> </head> <body> <form method="post" action="index.php"> name: <input type="text" id="name" name="name" /><br /> age: <input type="text" id="age" name="age" /><br /> address: <input type="text" id="address" name="address" /><br /> <input type="radio" name="gender" id="gender" value="male" />male <input type="radio" name="gender" id="gender" value="female" />female<br /> <input type="submit" value="add" /> </form> </body> </htm...

javascript - show details of the file before file upload -

i want populate table dynamically filename, filesize , operations delete file once user selects file upload, showing details of file selected upload, in table format after user selects file using jsp, javascript. have tried below code, i'am not sure how file size , perform delete operation without upload has performed.whenever user choose file upload,a table should generate showing details of file file size,file path, name of file etc before user submits form. please find similar scenario in http://jsfiddle.net/s98tw/4/ jsp code: <table border="1"> <tr> <td> <input type="file" name="fileupload" size="50" id="file1" onchange="addfiledata(this)" multiple /></td> </tr> </table> <table border="1"> <tr> <th>sno</th><th>filename</th><th>filesize</th...

How to write a unit test with neo4j-in-memory-server -

i have written webservice , write unit tests it. stumbled across michael hunger's in memory server . due sparse documentation, have hard time setting 1 unit test. cloned project, included in workspace , added dependency project. in order test web service, wrote method create in-memory neo4j server: @beforeclass public static void setupinmemoryserver() { communitybootstrapper s = new communitybootstrapper(); int status = -1; try { status = s.start(); } catch(exception e) { system.out.println("could not start server"); e.printstacktrace(); system.out.println(e.getmessage()); system.out.println(e.getcause()); system.out.println(e.getlocalizedmessage()); } system.out.println(hostavailabilitycheck()); system.out.println("status = "+status); } public static boolean hostavailabilitycheck() { try (socket s = new socket("127.0.0.1", 7474)) { ...

eclipse - Override back button in app android -

made application in android, buttons handled, web site? if so, these buttons programmed button or whether default applications? thanks... android requires existence of button (along power , volume control). either hardware button or software, visible navigation bar. in general default handling of button work in instances. go through app's previous activities , close app once reaches end of stack. same can configured work fragment stacks too. you can opt override default implementation though if choose to. in activity want manually control action when user presses back: @override public void onbackpressed() { // custom actions }

php - How to upload file into different directory based on url token value -

this code html <form enctype="multipart/form-data" action="l.coursepage.php?id=<?php echo $id;?>" method="post"> <input type="hidden" name="max_file_size" value="100000" /><br> choose file upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="upload file" name="upasg"> </form> this php code: if(isset($_post['upasg'])) { //folder save in $targetpath = $id."/download/assignment"; if (!is_dir($targetpath)){ mkdir($targetpath); } $targetpath = $targetpath . basename($_files['uploadedfile']['name']); $_files['uploadedfile']['tmp_name']; if ($_files['uploadedfile']['size'] < 2000) { if (move_uploaded_file($_files[...

ruby - Authority Gem rails app needs to restart for every change to be reflected? -

hi using authority app add permissioning rails app. reason, have restart app everytime want changes in app/authorizers/ folder reflected. is standard? why happening? is there way around this? even small change changing default true false requires app restart register authory app/authority/application_authorizer.rb # other authorizers should subclass 1 class applicationauthorizer < authority::authorizer # class method authority::authorizer isn't overridden # call authorizer's default method. # # @param [symbol] adjective; example: `:creatable` # @param [object] user - whatever represents current user in app # @return [boolean] def self.default(adjective, user) # 'whitelist' strategy security: not explicitly allowed # considered forbidden. true end end thanks

Pass a Python dict to a Java map possibly with JSON? -

i calling java file within python code. currently, passing several parameters java sees in string[] args array. prefer pass 1 parameter python dictionary (dict) java can understand , make map. know have pass python dictionary string. how can this? should use json? you pass json, , parse info out of json in java. if data more simple, make every other string in java's string[] args parameter represent key or value, , have code loop through , add them map.

bit manipulation - Can I input/output bits in C++ -

i figuring out how compress files , wondering if bit manipulation output file. current have string of variable size n contains 0's , 1's. ex: 010111001010110 i want output file contains n bits instead of n characters. also, if possible, how can read bits , convert string? thank you. update: if cannot write out bits directly , have pack bytes, mean can convert 8 bits char , output list of char? if so, happens if try store "00000000", means null? you can't write bits out directly, have pack them @ least in eights. yes, means writing out bytes. note output padded bytes , have it. to convert string containing 0s , 1s raw data, easiest way either use std::bitset , if know length, or write loop advances eights, in for (auto = 0; < str.size(); += 8)

RSS news feed to Java Application -

this question has answer here: how write rss feed java? 1 answer i trying add sidebar java application have news feed website, computerweekly.com, , display recent stories link title online article. i pretty sure need somehow use rss feed, @ least that's seems me easiest way. i'm sure how this. let's wanted articles rss feed: http://www.computerweekly.com/rss/all-computer-weekly-content.xml show on side panel of project, tell me how started in doing so? if didn't explain enough, i'd happy try again, all! i know year ago if still working on recommend: http://rometools.github.io/rome/ i hope helps.

xml - How to XQuery an {http://schemas.xmlsoap.org/soap/encoding/}Array element -

: i'm trying query array element xquery transformation in osb oepe, , put queried elements in array element. this example of need query <complextype name="querytoneevt"> <sequence> ... <element name="allowedchannel" nillable="true" type="impl:arrayof_xsd_string"/> ... </sequence> </complextype> the arrayof_xsd_string element this: <complextype name="arrayof_xsd_string"> <complexcontent> <restriction base="soapenc:array"> <attribute ref="soapenc:arraytype" wsdl:arraytype="xsd:string[]"/> </restriction> </complexcontent> </complextype> then, query on allowedchannel element, did operation for $i in $querytoneevt/allowedchannel/? return ¿? from this, have few questions? the xpath route correct element? how determine type of root array member , target array m...

tomcat - Configure Connection Pool with EclipseLink -

i working in project with: jsf 2.1.2, eclipselink 2.4.1, sql server 2008 windows authentication , apache tomcat 7.0 i set connection , jndi , works fine. there requierement, have configure connection pool because have 1 connection (because of win authentication), know best way configure connection pooling jpa? posible? thanks in advance if have 1 web application on tomcat can use internal eclipselink connection pool . (you might check this ) but if have several applications or need different connection pool should first disable eclipselink internal pool , setup datasource in tomcat , use tomcat connection pool (or other solution). finally, should modify persistence.xml point datasource.

android - master/detail actionbar fragments -

i have found https://github.com/abidk/android_masterdetail_tab_issue , base app, great work abidk. executes perfect on tablet , adding more fragments easy on phone producing error: reason , how fix it? d/dalvikvm(3695): late-enabling checkjni d/androidruntime(3695): shutting down vm w/dalvikvm(3695): threadid=1: thread exiting uncaught exception (group=0x41b192a0) e/androidruntime(3695): fatal exception: main e/androidruntime(3695): java.lang.runtimeexception: unable start activity componentinfo{com.example.example.masterdetail_tabs/com.example.example.masterdetail_tabs.itemlistactivity}: android.view.inflateexception: binary xml file line #1: error inflating class fragment e/androidruntime(3695): @ android.app.activitythread.performlaunchactivity(activitythread.java:2092) e/androidruntime(3695): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2117) e/androidruntime(3695): @ android.app.activitythread.access$700(activitythread.java:134) e/androi...

java - Dynamically extend Spring MVC powered REST api with access to application jar only -

i in situation have nascent rest api architecture each method has tons of ceremony (validation, db connection acquisition/release, authentication), raw request/response objects parameters, , hard-coded json strings output. want use spring mvc @ least of these issues (auth & db stuff i'll need hold off on). render lot of current architecture unnecessary. pretty easy except 1 feature of current architecture: dynamically adding api calls. the entry point (servlet) architecture reads xml file contains path request , corresponding class load. class must implement interface contains 'execute' method has logic request. servlet calls execute method after loading class. allows dynamic extension of api follows. app packaged jar associated config (xml) files , given client. client includes jar in project, creates class implements aforementioned interface, , adds mapping request url class in included xml file. runs app , gets access both original api , custom api. example: ...

c# - Forcing DateTime.Parse to Fail for Invariant Dates -

i'll brief start, give details @ end. consider following code: cultureinfo culturetotest = new cultureinfo("hu-hu"); thread.currentthread.currentculture = culturetotest; datetime testdatetime = new datetime(2014,12,13,23,24,25); string teststring = testdatetime.tostring(cultureinfo.invariantculture); datetime actualdatetime = datetime.parse(teststring); the question whether there possible value of culturetotest either cause datetime.parse call throw exception or return wrong value? context: this set of unit tests. there body of code calls datetime.parse without specifying culture. concern when code passed date in invariant or en-us cultures, code fail in cultures. proposed solution change code use datetime.parse(string, cultureinfo.invariantculture) in these cases. in order unit test change, need call new code culture have made original datetime.parse(string) fail, show changed code succeed. the problem haven't yet found culture me. i'm g...

javascript - Get each element's attribute through $.each() -

trying $('div').attr('data', 'ip') through .each() returns undefined . let's have 4 divs <div class="box" data-ip="ipvalue">content</div> <div class="box" data-ip="ipvalue">content</div> <div class="box" data-ip="ipvalue">content</div> <div class="box" data-ip="ipvalue">content</div> and need iterate each 1 , data-ip value. my code, returns undefined (server, serverobj, variables). var serversobj = $('.server'); serversobj.each(function(index, el) { return $(this).data('ip'); }); what doing wrong? here code should markup sample gave. var serversobj = $('.box'), ipvals = []; serversobj.each(function(index, el) { ipvals.push( $(this).data('ip')); }); console.log( ipvals); you can use $.map() return same array.

r - Creating a new column in a data frame whose entries depend on multiple columns in a another data frame -

i want make new column in data set values determined values in data set, it's not simple values in 1 column being function of values in other. here's example: >df1 chromosome position 1 1 1 2 1 2 3 1 4 4 1 5 5 1 7 6 1 12 7 1 13 8 1 15 9 1 21 10 1 23 11 1 24 12 2 1 13 2 5 14 2 7 15 2 8 16 2 12 17 2 15 18 2 18 19 2 21 20 2 22 and >df2 chromosome segment_start segment_end segment.number 1 1 1 5 1.1 2 1 6 20 1.2 3 1 21 25 1.3 4 2 1 7...

xml to csv using xslt - download the result -

i've got xml file in following format <result_set> <results> <review> <byline>name</byline> <display_title>title</display_title> <mpaa_rating>r</mpaa_rating> <publication_date>2014-1-1</publication_date> <headline>text</headline> <summary_short>summary</summary_short> </review> </results> </result_set> and xsl follows: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <html> <body> <xsl:for-each select="result_set/results/review"> <div> <xsl:value-of select="byline"/>,<xsl:value-of select="display_title...

ruby on rails 4 - Content duplication Prawn -

i'm create user can see content online or download it. i have nested table duplication , cannot see why. def header table header_container_table columns(1..2).align = :center columns(0..2).border_width = 2 end end def header_container_table contenido_header = [[{image: "#{rails.root}/app/assets/images/logo.png", scale: 0.6}, header_inner_table_rows]] end def header_inner_table inner_content = [["line 1"], ["line 2"], ["line 3"], ["line 4"]] end def header_inner_table_rows table header_inner_table rows(0).size = 18 columns(0).align = :center rows(2..3).size = 8 end end what i'm doing wrong? i found solution issue. avoid duplication of content have use method nested table make_table . so based on code above should be: def header_inner_table_rows make_table header_inner_table rows(0).size = 18 columns(0)....

javascript - Report as a PDF attachment in CRM 2013 online is not working -

code working fine in crm 2013 online responsebody undefined.i made code cross browser compatible , working fine in organizations code attaching corrupted pdf in crm 2013 online organizations. referred link http://xrmmatrix.blogspot.in/2011/06/creating-report-as-pdf-attachment-in.html ? help?

ios - One-to-Many Relationship: CoreData -

i'm new coredata , have been stuck on issue. assistance appreciated. information: have core data app entities; list , task. list , task have one-to-many relationship. task.h @class list; @interface task : nsmanagedobject @property (nonatomic, retain) nsstring * task; @property (nonatomic, retain) nsstring * note; @property (nonatomic, retain) list *list; @end list.h @class task; @interface list : nsmanagedobject @property (nonatomic, retain) nsstring * name; @property (nonatomic, retain) nsdate * datecreated; @property (nonatomic, retain) nsnumber * sortorder; @property (nonatomic, retain) nsset *task; @end @interface list (coredatageneratedaccessors) - (void)addtaskobject:(task *)value; - (void)removetaskobject:(task *)value; - (void)addtask:(nsset *)values; - (void)removetask:(nsset *)values; @end i create lists using; nsmanagedobjectcontext *context = [self managedobjectcontext]; if ([self.listtextfield.text length] == 0) { // quit here if no text ent...