Posts

Showing posts from June, 2015

symfony - codeception symfony2 unit test throws a fatal error -

using classical phpunit style generate:test symfony2 helper. can service , can assert ok. // tests public function testgetserviceurl() { $ecservice = $this->getmodule('symfony2')->grabservicefromcontainer("ecservice"); $this->assertequals("https://ecoconnect2.niwa.co.nz/services", $ecservice->getserviceurl()); $this->assertequals("xxx", $ecservice->getserviceurl()); } however in second case assertion fails exception: trying test service url (demotest::testgetserviceurl) - failed php fatal error: call member function getresponse() on non-object in /users/watkinsav/workspace/cd/ecoconnect_web/vendor/codeception/codeception/src/codeception/util/framework.php on line 30 php stack trace: php 1. {main}() /users/watkinsav/workspace/cd/ecoconnect_web/vendor/codeception/codeception/codecept:0 php 2. symfony\component\console\application->run() /users/watkinsav/workspace/cd/ecoco...

linux - can not restore table which was dropped using mongorestore -

i test mongorestore utility the following test procedure: mongo 127.0.0.1/mytest -u alex -p alex > db.createcollection("test1") { "ok" : 1 } > db.test1.insert({id:1,name:"alex"}) > db.test1.find() { "_id" : objectid("519b3d7808b450e533c8ea5e"), "id" : 1, "name" : "alex" } > show collections; system.indexes system.users test1 testtable > exit ps -ef|grep mongod root 3201 3180 0 16:46 pts/1 00:00:00 vi /etc/mongod.conf root 3583 1 0 17:27 ? 00:00:00 /opt/mongodb/bin/mongod -f /etc/mongod.conf root 3600 3267 0 17:28 pts/3 00:00:00 grep mongod kill -9 3583 do file backup using mongodump /opt/mongodb/bin/mongodump --dbpath /data/db/ --journal --out /data/dump tue may 21 17:26:38.107 [tools] journal dir=/data/db/journal tue may 21 17:26:38.107 [tools] recover begin tue may 21 17:26:38.107 [tools] recover lsn: 33813 tue may 21 17:26:38.107 [tools] r...

ruby on rails - Using a form and a button to call a method in view -

beginner rails question here. created web scraper populate model information , wanted call method button view. more importantly, wanted pass contents of form parameter method. i'm kinda lost on how using forms, far have: i placed method directory app/helpers/admin_pages_helper.rb module adminpageshelper def populate(term) . . end end i have view located @ app/views/admin_pages/index.html.erb i'm unsure of how go using form_tag/text_field_tag/submit_tag parameter; of examples i've seen involve database queries using forms instead. thanks the simplest form of usage - firstly need route form can submit to: # in routes.rb match "/admin_pages/my_action" => "admin_pages#my_action", as: "my_admin_pages_action" this route request "/admin_pages/my_action" "my_action" action in adminpagescontroller. gives several helper methods can use build url string in views and/or controllers. # in view <%...

MySQL - How to select Multiple rows from Multiple tables -

i have question sql statement, reason script not working properly.. scenario; have 6 tables patient -patientid -patientname -employerid fk employer.employerid. employer -employerid -employername carrier -carrierid -carriername appointment -appointmentid -aptdatetime -patientid fk patient.patientid insuranceplan -planid -groupname -employerid fk employer.employerid -carrierid fk carrier.carrierid inssub -insubid -dateeffective -planid fk insplan.planid -suscriber fk patient.patientid my script: need rows 5 tables,, not sql indexes validation, that's why script not working ! select p.patientname, e.employername, c.carriername, ip.groupname, a.aptdatetime, i.dateeffective patient p, employer e, inssub i, insuranceplan ip, carrier c, appointment e.employernum = p.employernum , i.subscriber = p.patientid , i.planid = ip.planid , ip.carrierid = c.carrierid , ip.employerid = e.employerid , ip.planid = i.planid , a.patientid = p.pat...

javascript - Ajax progress bar with a big list -

i have ajax call grabbing large json list. there way can make progress bar gets real value of json load (for example status bar says 1 out of 200 loaded)? right have pretty basic ajax call function sendajax(urlmethod, jsondata, returnfunction) { $.ajax({ type: "get", contenttype: "application/json; charset=utf-8", url: urlmethod, data: jsondata, datatype: "json", success: function (msg) { if (msg != null) { returnjson(msg); } }, error: function (xhr, status, error) { // boil asp.net ajax error down json. var err = eval("(" + xhr.responsetext + ")"); // display specific error raised server alert(err.message); } }); } try using ajaxstart on application global scope. means can put code in layout file, , if processing long, show progress indicator... $(...

java - Got Findbugs issue “NP_NULL_ON_SOME_PATH” when null test is in a separate method. Is this a false alarm? -

i have code similar following snippet: public void foo(order o) { ... checkinput(o, "some error message"); dosomehing(o.getid()); } private void checkinput(object o, string message) { if (o == null) { throw new someruntimeexception(message); } } and got findbugs reporting 'np_null_on_some_path' issue. here description: there branch of statement that, if executed, guarantees null value dereferenced, generate nullpointerexception when code executed. of course, problem might branch or statement infeasible , null pointer exception can't ever executed; deciding beyond ability of findbugs. my questions are: can treat false positive in example? is practice put null test in separate method? actual null check method bit longer sample method don't want repeat code everywhere. thanks! it looks findbugs not able detect case, @ least 2.0.2 in eclipse. 1 workaround return value checkerror , annotate method @nonnull...

c# - AES CBC Not Producing Correct Vectors -

i have 2 methods encryption , decryption in cbc mode. have ready verified ecb methods , function properly. issue when test encryption in cbc test vectors passes them. , when test cbc decryption same vectors make sure can go other way, passes tests well. when pass encryption decryption, don't same vector back. doesn't make sense me. public byte[,] encrypt(byte[,] datatoencrypt, byte[] givenkey, byte[] initializationvector) { //xor data iv (int row = 0; row < 4; row++) { datatoencrypt[row,0] ^= initializationvector[4*row]; datatoencrypt[row, 1] ^= initializationvector[(4 * row) + 1]; datatoencrypt[row, 2] ^= initializationvector[(4 * row) + 2]; datatoencrypt[row, 3] ^= initializationvector[(4 * row) + 3]; } ecb encryptor = new ecb(); return encryptor.encrypt(datatoencrypt, givenkey); } public byte[,] decrypt(byte[,] datatodecrypt, byte[] givenkey, byte[] initiali...

javascript - Map ajax response data to google line chart -

i'm using following code create line chart using google charts api. var array = []; ajaxpost(action, "getdata", params, function(data) { var response = toobject(data).response; var chartdata = new google.visualization.datatable(); for(var = 0; < response.occdata.length; i++){ chartdata.addcolumn("string",response.occdata[i].reservationrowtype); } new google.visualization.linechart(document.getelementbyid('chart_div')). draw(chartdata, {vaxes:[ {title: 'title 1', titletextstyle: {color: '#ff0000'}}, // left axis {title: 'title 2', titletextstyle: {color: '#ff0000'}} // right axis ],series:[ {targetaxisindex:1}, {targetaxisindex:0} ],curvetype: "function"}); }); i'm iterating through ajax response relevant data 2d array but, it's confusing me! ajax response. {"response...

javascript - What's the event for leaving the IE tab? -

i want javascript trigged when: the current ie tab switched out when multiple ie tabs open. when current ie tab closed . i don't want js code trigged in-page pops dialogs. when whole ie window closed. the lose focus event may not work me because there pop diaglogs in page, when pops out, ie tab lose focus, since tab not switched or closed , don't want javascript trigged here. is there solution? wondering if there's entering tab / leaving tab , or tab-switching events? some interesting links, not resolve question. is there way detect if browser window not active? hook tab changed event of browser if use 'jquery', can . $(window).blur(function(){ // code }); $(window).focus(function(){ // code }); here link provides 1 more method it.

Is there anyway to use a regex grouping in a static directory url handler in Google App Engine (Python) -

i've tried work in app.yaml file: - url: /([^\\]+)/static static_dir: /apps/\1/static a static_dir must fixed prefix. however, instead use static_files , utilizes regex groups.

installation - How to set up a local LESS environment -

how set local environment allow see less in-browser, locally? far, can work remote server, , it's totally aggravating. i've downloaded simpless, , it's done virtually nothing me. can't sort out issue is, figure if loads of people use less, there's got better way? i think want use less.js , official less development. beware not idea if not local testing. another way have see less "in-browser" using less live preview tool.

ember.js - Possible to use application outlet when using nested routes? -

i have app based on posts. when nest routes this: this.resource('posts', function() { this.route('post', {path: ':post_id'}); }); and try access /posts/id link render template if place {{outlet}} posts template. here code working based on github . has functionality except renders parent outlets , not application outlet. would possible have show, new or edit template render template in application {{outlet}}? you can override rendertemplate(controller, model) hook route , call this.render : rendertemplate: function(controller, model) { this.render('post', { into: 'appplication', // template render }); } other options can pass outlet (to select named outlet), , controller (to use controller of choice). see routing guide more details.

c++ - C# : DLLImport - DLL Not Found exception -

suppose want call c++ functions c# code, having following problem: case 1: class abc { private : int ; public : int getvalue() { return 100; } }; int getcounter() { abc* p = new abc(); int = p->getvalue(); return i; } this case when calling function c# throws me dll not found exception. case 2: int getcounter() { int = 333; return i; } the case when calling function c# works fine. any ideas why? how can fix it? use sample line of code in cpp project (mathfuncsdll.h) extern "c" __declspec(dllexport) double add(double a, double b); extern "c" __declspec(dllexport) double sub(double a, double b); extern "c" __declspec(dllexport) double mul(double a, double b); extern "c" __declspec(dllexport) double div(double a, double b); in c# code use [dllimport("mathfuncs.dll", callingconvention = callingconvention.cdecl)] public static extern double add(double a, d...

android - How to detect movement to the left, right, up and down -

i wonder if it's possible use ontouch method below detect if user moving finger left, right, och down on screen. have grid objects , want user able move 1 of object in 4 directions. my idea use action_down event x , y position , check objects in list see object whitin x , y value. using action_move start moving in 1 of directions. @override public boolean ontouch(view v, motionevent event) { switch (event.getaction()) { case motionevent.action_down: log.i("test","down"); break; case motionevent.action_pointer_up: break; case motionevent.action_move: log.i("test","move"); break; } public class mainactivity extends activity { ... // example shows activity, use same approach if // subclassing view. @override public boolean ontouchevent(motionevent event){ int action = motioneventcompat.getactionmasked(event); switch(action) { case (motioneven...

Jar file versus reference to the Android Library -

you make day explaining following nuissance. l library. application using l, ca class, declared in extending class cl in library l. untill recently, place l.jar in lib folder of project. purchased new hard disk, reset eclipse, adt plugin , sdk, transferred project new location. when started. if place in a reference project l (via project/properties/android/library), still works right. jar file, gives "no class defintion found" error ca class, though belongs same class calling method! to avoid sceptical remarks: l has no resources in it. compiler version 1.6 i cleaned both projects millions of times. both projects compiled same api version. no obfuscation used , checked cl class present in l.jar. tried placing l.jar in build path, topmost, bottommost - no help. thank anticipated help. it rather silly of me: in "order , export" panel of buildpath configuration had android dependencies ticked, android provite libraries unticked. what ...

android - Does Facebook API allow sending and accepting friend requests? -

i have tried comb through facebook developers documentation http://developers.facebook.com/ haven't been able answer question. i able send facebook friend requests , accept friend requests in webapp. facebook api allow/enable such function? have tried ? recommended option since api doesnt allow add randomly people call. http://developers.facebook.com/docs/reference/dialogs/friends/ edit: here have reference dialogs in android sdk https://developers.facebook.com/docs/reference/androidsdk/dialog/

google app engine - GAE, searching multiple indexed fields -

i have gae entity in python 2.7 4 string fields. need search 4 string fields partial matches search operation. in terms of gae efficiency , cost overheads, best way create entity? is, 4 separate indexed fields or fifth combined indexed field (original 4 unindexed)? appreciate links helpful resources. update first, first gae/python application - i'm learning lot here. i don't have gae source code yet - thinking out of things have porting small application gae. upon further reading found gae not support substring matches -> implemented in sql operator on fields. select * entity e.fld1 '%xxx%' ... etc. however, dataset fixed, less 10,000 records. there reasonable way efficiently?

ruby - How to add Ruboto path to android sdk? -

i new ruboto gem. working on android ruboto. know android. have installed requirements rubuto. try created sample project using following command, $ ruboto gen app --package org.sample.rubotoapp --target android-17 output: android sdk not in path /bin/sh: android: not found please can solve problem. thanks.... it looks android sdk tools directory not in path. if check path variable echo $path it not contain android sdk tools directory. also, can check if "android" command in path using which android you empty response. if use ruboto 0.12.0, should able use ruboto setup to configure environment. recently, in android sdk r22, path build tools changed. break setup, , have add <android sdk location>/build-tools/17.0.0 to path manually. fixed ruboto 0.13.0 released in june.

c# - Run silent install in different thread - searching for solution without busy waiting -

i'm building installer project need dowload many installation files internet (downlading operation executed in parallel) , start installing files 1 one. installing sequence not important. when file complete downloaded inserted queue , have other worker taking queue files , install them 1 one. implemented , have problem in installation process. i'm installing downloaded files in silent mode wih next method: private void install() { var item = _installitems.dequeue(); item.progstage = progressstage.install; refreshpgbars(); system.diagnostics.processstartinfo psi = new system.diagnostics.processstartinfo(); //insert psi arguments , file name here system.diagnostics.process.start(psi);//start installing } i calling method background thread: thread worker = new thread(() => install()); worker.isbackground = true; worker.start(); worker.join(); ...

c# - Missing operand after '=' operator -

i have line of code uses dataview view_1 , i'm trying filter datagridview product_name , size using rowfilter . here code: view_1.rowfilter = "product_name = '" + cboproduct.text + "' , size = " + cbosize.text + ""; and when try run application says missing operand after '=' operator . missing operand? you have missing white-space @ 'and so replace 'and with ' , is size string-column or int-column? if it's string need quotation marks around too: and size = '" + cbosize.text + "'"; or better, use string.format others have commented since insreases readability: view_1.rowfilter = string.format("product_name = '{0}' , size = '{1}'" , cboproduct.text , cbosize.text);

c++ - Loading an interface fails -

i'd use com function : createinstance http://msdn.microsoft.com/en-us/library/k2cy7zfz%28v=vs.80%29.aspx like this ipointer p=null; hresult hr=p.createinstance(xxx); however don't have clsid of xxx know interface name isubpointer can see interface description inside tlb file when view file oleview . should use createinstance ? there 2 ways this: 1st: classfactory ,and 2nd: helper function create pointer. i found this : int main() { imath* pimath; hresult hr; // 1. initialize com library coinitialize(null); // 2. call cocreateinstance imath interface pointer hr = cocreateinstance ( __uuidof(cmathcomp), null, clsctx_inproc_server, __uuidof(imath), (void**) &pimath ); if ( failed(hr) ) { return 0; } // 3. call interface functions int sum = pimath->add(1, 3); printf("sum = %d \n", sum); int sub = pimath->sub(4, 3); printf("sub = ...

java - Passing anonymous function to a method, storing it and executing it? -

i need pass function method, storing on variable visible inside class, , lately executing ( without parameters ). in actionscript 3 : private var latecall : function; .. function getthelatecall( o : function ) : void { latecall = o; } ... function somefunction() : void { latecall(); } is there equal in java ? no you can though have alternates, 1 via interface interface ifunc { void somefunction(); } class func1 implements ifunc { void somefunction(){..} } class func2 implements ifunc { void somefunction(){..} } void getthelatecall(ifunc func) { func.somefunction(); } so caller instantiate specific ifunc implementation , pass getthelatecall . 1 way of doing it..

Hadoop: How do datanodes register with the namenode? -

do hadoop datanodes register namenode calling namenode, or namenode have list of datanodes , reaches out them. i want understand better troubleshoot problem new namenode brought (after namenode failure) doesn't see of datanodes (but has fsimage correct). data nodes heartbeat in name node. name node not reach out data nodes. even when retrieving data, name node not reach out data nodes. name node inform client data , client retrieve data nodes. (to clarify, during mr workflow job tracker finds name node data , assigns task trackers appropriately.)

android - get coordinates by clicking on map (openstreetmaps) -

how can coordinates of point clicking on in open street maps? tried: public void onclick(view v) { projection proj = mapview.getprojection(); igeopoint p = proj.frompixels(v.getx(), v.gety()); system.out.println("x: "+ v.getx() + " y: "+ v.gety()); } cheers, thanasio use dispatchtouchevent() method. works because mapactivity inherits dispatchtouch event, not ontouchevent activity class. @override public boolean dispatchtouchevent(motionevent ev) { int actiontype = ev.getaction(); switch (actiontype) { case motionevent.action_up: projection proj = mapview.getprojection(); geopoint loc = proj.frompixels((int)ev.getx(), (int)ev.gety()); string longitude = double.tostring(((double)loc.getlongitudee6())/1000000); string latitude = double.tostring(((double)loc.getlatitudee6())/1000000); toast toast = toast.maketext(getapplicationcontext(), "longitude: ...

java - reuse cache in all junit test cases -

we have multiple test cases loads data cache , run test case .the test cases runs fine when ran test cases once takes lot of time cache loaded every time each test case.is there way load cache once , use cache across test cases. one way of doing put test cases in 1 class defeats purpose result difficult analyze(there around 5-10 test method in each class , there around 30 test classes report gets generated large , not organized). tried using test suite cache getting shutdown after each test case runs them 1 one. you can create abstract class base class test cases. cache should initialized class , stored in static member. tests should use cache. alternative solution implement custom test runner manage cache. have mark test cases need cache using annotation @runwith , pass test runner class there.

javascript - Changing source in videos-js eating memory until leak -

i'm using video-js media player flash fallback dynamically play , change mp4-videos (h.264 - source available) on site i'm working on. my problem is, every time i'm changing video/source, browser eats more , more memory until out of memory , crashes. problem occurs on every browser, flash player hardware acceleration enabled , disabled. player initialized this: _v_.options.flash.swf = "../scripts/thirdparty/video-js.swf"; _v_.options.flash.iframemode = true; //false didn't _v_.players = {}; _v_("main_video", { "techorder": ["flash", "html5"] }).ready(function () { $.b4dvideo.videoplayer = this; if (!$.b4dvideo.contentinitialised) { $.b4dvideo.contentinitialised = true; $.b4dvideo._loadcontent(); } this.on("pause", function () { thi...

c++ - Qt - Why add '&' to the string? -

qpushbutton *quitbutton = new qpushbutton("&quit"); why add & quit ? removing & , seems code behaves same. the ampersand makes button respond particular key-combination. in case, if press alt + q force button pushed. from qt the qpushbutton widget provides command button. the push button, or command button, perhaps commonly used widget in graphical user interface. push (click) button command computer perform action, or answer question. typical buttons ok, apply, cancel, close, yes, no , help. a command button rectangular , typically displays text label describing action. shortcut key can specified preceding preferred character ampersand in text. example: qpushbutton *button = new qpushbutton("&download", this); in example shortcut alt+d. see qshortcut documentation details (to display actual ampersand, use '&&').

excel - DIR function in vba works diffrent when passing a value directly and by a variable -

hi have files *in particular folder in system when use *the below** code gives files in folder (passing path directly) filenm = dir("c:\documents , settings\murugan.k\desktop\daily report automation\eve report\trial\") until filenm = "" activesheet.cells(ctr, 12).value = filenm ctr = ctr + 1 filenm = dir() loop but when store same path in variable , pass varible dir function gives me 2 files (autoexec.bat & bar.emf) filenm = dir(pth) until filenm = "" activesheet.cells(ctr, 12).value = filenm ctr = ctr + 1 filenm = dir() loop could 1 please me in resolving problem because can't hard code path in macro has dynamic (changes per user) try different attributes dir() function . path = "c:\documents , settings\murugan.k\desktop\" & _ "daily report automation\eve report\trial\" filenm = dir(path, vbnormal) until filenm = "" activesheet.cells(ctr, 12).value = filenm ctr = ctr + 1...

c - How to save void * data into a header file? -

i working on images , procedurally generate images convert them dds or rtc1. due constrains of program, cannot open external files want them embedded code. i found out gimp has "c header" exporter i'd myself generated textures. using void* allow used types of data. update: clarify things, thinking outputting unsigned int this: void exporttoheader(const void* data, const uin32_t size, const char* name) { uint32_t* pdata = (uint32_t*)data; printf("void* %s = {\n"); // todo: handle last case (int = 0; < size; ++i) { printf("%s, ", pdata[i]); } printf("};\n"); } will compiler able understand ? if understand correct want import binary image c code. so in case is, write simple program dumps file list of bytes , write output this: char mydata[] = { 122, 334, 45, ... }; then can include file , reference texture other c array. to dump file rather simple (in pseudocode). ...

sql - Replace XML node -

i have table in there column named "serviceconfig" datatype xml. i have record xml below : <config> <services> <service name="pro" /> <service name="postdata" /> </services> </config> now, want replace <service name="pro" /> <service name="pro" username="u" password="p"/> . resultant xml <config> <services> <service name="pro" username="u" password="p"/> <service name="postdata" /> </services> </config> how achieve it? one way add new attributes this... declare @xmltest table (serviceconfig xml) declare @username varchar(15) = 'u' declare @password varchar(15) = 'p' declare @xml xml insert @xmltest values ('<config> <services> <service name="pro"...

iphone - Check if current date is between two given dates -

this question has answer here: how check if nsdate occurs between 2 other nsdates 7 answers i want check if current date between 2 given dates. following nsdate *now = [nsdate new]; nslog(@"now %@",now); nscalendar *mycalendar = [[nscalendar alloc] initwithcalendaridentifier: nsgregoriancalendar]; nsdatecomponents* components = [mycalendar components:nsyearcalendarunit|nsmonthcalendarunit|nsdaycalendarunit fromdate:[nsdate date]]; [components setyear:2013]; [components setmonth:06]; [components setday:28]; [components sethour:5]; [components setminute:00]; nsdate *startdate1 = [mycalendar datefromcomponents:components]; nsdateformatter *formatter = [[nsdateformatter alloc] init]; formatter.timezone = [nstimezone localtimezone]; formatter.dateformat = @"yyyy-mm-dd hh:mm:ss"; nslog(@"start ...

django - Zinnia Blog doesn't use custom auth user model -

i using zinnia blog module django app. have django app , have custom user model. have added following setting: auth_user_model = 'account.member' however, when try create new entry in blog foreign key constraint error. exception type: integrityerror exception value: (1452, 'cannot add or update child row: foreign key constraint fails (`example`.`zinnia_entry_authors`, constraint `author_id_refs_id_410656e2874b02ff` foreign key (`author_id`) references `auth_user` (`id`))') it references default auth model (which doesn't exist in database) instead of specified auth model. how make zinnia use correct table. thanks.

c++ - Resolving compiler error: pointer potentially uninitialized -

i need resolve error compiler picking on - understand why it's picking on error need resolve since function (throwing error) execute when pointer is initialized. here pseudo code: if (incoming_message_exists) { msg_class* current_msg; /*current_msg become either value_1 or value_2*/ /*code block 1*/ if (condition_is_fulfilled) { current_msg = value_1; } /*code block 2*/ else { current_msg = value_2; } /*code block 3*/ /*bool function performed on current_msg throwing error*/ if (function(current_msg)) { //carry out function } } i prefer not perform code block 3 within 1 , 2, if that's solution will. in advance! are if , else branches show 2 different if statements? if are, current code capable of leaving current_msg uninitialised. crash when reach function(current_msg) . if you've shown 2 branches same if statement, compiler wrong - there no danger of cur...

Azure Cloud Services - Publish incremental changes only -

i have c# asp.net mvc4 web role deployed on windows azure cloud services using package , publish. first time uploaded entire package , site has been running fine. when wanted publish next set of changes, publish option trying upload entire package again. i have configured remote desktop , web deploy , enabled incremental updates per guidelines stated in article publishing cloud service using windows azure tools . but seems not working , publish trying upload entire package again , again. has faced issue , come fix? nope. currently there no out-of-the-box solution support incremental changes deploy. when working cloud services highly suggest not use web deploy else development/testing. reason changes made via web-deploy , other non-full-package-upload process wiped out instance in being recycled/healed. i've been working on project allow rolling out partial changes. unfortunately supports update "bin" folder currently. can take @ this project here ....

apache - Rewrite with relative path -

i going nuts on reqrite rule on local machine... i enabled rewrite log , single page load on url should rewrite: ip - - [21/may/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (2) init rewrite engine requested uri /catdev/sc/eprocure/ajax/articlesearch/searchengine/getinitialdata ip - - [21/may/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (3) applying pattern '^/catdev/sc/eprocure/ajax/(.+)/(\w+)/(\w+?)$' uri '/catdev/sc/eprocure/ajax/articlesearch/searcheng$ ip - - [21/may/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (2) rewrite '/catdev/sc/eprocure/ajax/articlesearch/searchengine/getinitialdata' -> '/catdev/sc/eprocure/ajax/handler.php?pa$ ip - - [21/may/2013:08:13:18 +0200] [scxx/sid#7f6580ce32b8][rid#7f65810069e0/initial] (3) split uri=/catdev/sc/eprocure/ajax/handler.php?path=articlesearch&class=searchengine&method=getinitialdata -> uri=/catde$ ip - - [21/may/20...

Directive not working -

i fiddling angular directives don't know why simple example not working: http://plnkr.co/edit/vmhqa0huv60ff7k3bjwc?p=preview the first character of directive name needs lowercase :) ("custominput")

android - Dynamically drawing polygons in Google map -

Image
i new android. i've been trying apply field of view current location in google map. image shows fov on google map in ios. so did similar thing adding 5 triangles different alpha in order make whole fov gradiant. i have update fov according azimuth of device, remove triangles ,recompute them , add them again. for(int i=0; i<5;i++){ if(triangles[i]!=null){ triangles[i].remove(); } //triangles=null; la = mvalues[0]-hang/2; lx = lon+i*math.sin(math.toradians(la))/2775; ly = lat+i*math.cos(math.toradians(la))/2775; ra = mvalues[0]+hang/2; rx = lon+i*math.sin(math.toradians(ra))/2775; ry = lat+i*math.cos(math.toradians(ra))/2775; triangles[i] = map.addpolygon(new polygonoptions().add(new latlng(lat,lon), new latlng(ly,lx), new latlng(ry,rx)).strokecolor(color.transparent).fillcolor(color.argb(50, 0, 0, 50))); } the fov blinking, , gc_concurrent happens. possible make not...

java - What are these extra methods in the Selenium Webdriver code? -

so record steps of website using selenium ide , export using java /junit 4 / webdriver . , open in eclipse , find 4 methods in code. don't understand purpose of methods, don't deal alert windows or finding element. here methods @after public void teardown() throws exception { driver.quit(); string verificationerrorstring = verificationerrors.tostring(); if (!"".equals(verificationerrorstring)) { fail(verificationerrorstring); } } private boolean iselementpresent(by by) { try { driver.findelement(by); return true; } catch (nosuchelementexception e) { return false; } } private boolean isalertpresent() { try { driver.switchto().alert(); return true; } catch (noalertpresentexception e) { return false; } } private string closealertandgetitstext() { try { alert alert = driver.switchto().alert(); string alerttext = alert.gettext(); if (acceptnextalert) { alert.accept(); } else { alert.dismiss(); } return alerttext; } { acceptnex...

vb.net - Mean value of data with varying time step -

i have number of dataseries timestep varying between few seconds , maybe 120 minutes represented in decimal hours after january 1st. example 1 value can given @ time 4692.759994 , next @ 4692.769281. values can both positive , negative. calculate mean values given time (usually 1 hour) , wonder of have made similar. code probable in vba or vb.net. thanks if use vb.net might find useful: dim dtbase new datetime(now.year, 1, 1) dim t1 datetime = dtbase.addhours(4692.759994) dim t2 datetime = dtbase.addhours(4692.769281) dim interval timespan = t2 - t1 'the result 00:00:33.4340000

compatibility - Why is our Android Application unsupported by some devices -

our android application not supported devices, , can't figure out why. for instance, huawei c8812. it's recent phone, running android 4.0, so.. what's happening? below aapt dump of our apk, have more general question: google play provides list of unsupported devices given apk. that's helpful, why can't have, specific unsupported device, list of items tell me precisely why device unsupported (like android.permission.camera . @ least narrow search.. ). any appreciated :) sdkversion:'8' targetsdkversion:'15' uses-permission:'com.livetrekker.permission.maps_receive' uses-permission:'android.permission.internet' uses-permission:'android.permission.access_network_state' uses-permission:'android.permission.access_wifi_state' uses-permission:'android.permission.camera' uses-permission:'android.permission.write_external_storage' uses-permission:'android.permission.read_external_storage' use...

ssh - How to get modulus and pubExp in java? -

is possible retrieve modulus , pubexp ssh public key such 1 below: ssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqc9t1iuplxcsaame3qpxib4g1btzhh4ok4ti2phgfoedlsvwrhycx+f8gbnnratonkgjodh9wwku1eibbd2qpsfrryowvme85teqxrt1mjpmsxrdkrla4a9nlghtarozpntxkubhjdqkfgmnid/ryuw3maj+khw1luex+wpalylntnjp0rfgo72x47wnelvolczttastqrnch1clcy2wq4kmfovzago1srtrolc/6k17oeo7eqrwgt4iwjls9hynxniccn5hg313iryjj6zq/er/ormm7t8lmh8479qzdxinsk3gnccw3xrdzyd/zclsagkwuna+0g0judxezqpgmhr user@mc-s08347cdc1.local i need these parameters somehow key above can execute code below generate , public key in java rsapublickeyspec ks = new rsapublickeyspec(modulus, pubexp); rsapublickey pubkey = (rsapublickey)keyfactory.generatepublic(keyspec); apparently ssh keys use format defined in rfc 4253 . can base64 decode data (e.g. using apache commons codec library) , parse binary result yourself. this output of base64 decoded string (you may need postfix 2, 3 or 4 '=' characters decoder work, need multiple of 4 bas...

django - TemplateDoesNotExist at /website/, extended template -

sorry if question not written or anything, first time posting here. so, i'm trying django , tries use generic templates of django. create parent template named "layout.html". has 3 blocks, created child extended "layout.html", check files : layout.html : <!doctype html> <head> <link rel="stylesheet" href="style.css" /> <title>{% block title %}bleh bleh{% endblock %}</title> </head> etc... index.html : {% extends "layout.html" %} {% block title %} amazing index !!!{% endblock %} etc... these 2 files in same folder. but, here error : templatedoesnotexist @ /rubriques/ (yes, rubriques namespace) here sample of error : request url: http://127.0.0.1:8000/rubriques/ django version: 1.5.1 exception type: templatedoesnotexist exception value: layout.html exception location: /home/thomas/.virtualenvs/site/local/lib/python2.7/site-packages/django/templ...

overriding with difference access specification c++ -

i came across question while taking ikm test. there base class 2 abstract methods private access specifier. there derived class overriding these abstract methods protected/public access specifier. i never came across such thing overridden methods in derived class had different access specification. allowed ? if yes, comply "is a" relation between base , derived (i.e. safely substitutable). could point me references can provide more details on such usages of classes ? thank you. as many of guys pointed out legal. however, "is-a" part not simple. when comes "dynamic polymorphism" "is-a" relation holds, i.e. can super can derived instance. however, in c++ have referred static polymorphism (templates, of time). consider following example: class { public: virtual int m() { return 1; } }; class b : public { private: virtual int m() { return 2; } }; template<typename t> int fun(t* obj) { ...

sql - How to delete rows using CTE and INNER JOIN? -

how can delete data table using cte , inner join? valid syntax, should work: with my_cte ( select distinct var1, var2 table_a ) delete table_b b inner join my_cte on var1 = b.datecol , var2 = b.mycol; in oracle neither cte nor inner join valid delete command. same applies insert , update commands. generally best alternative use delete ... ... in : delete table_b (datecol, mycol) in ( select distinct var1, var2 table_a) you can delete results of subquery. covered (though lightly) in docs .

javascript - jquery selector-accessing anchor from with table -

i want access anchor tag in jquery nested follows. want select each anchor , add click event in jquery . <table id="table1"> <tr> <th>tags</th> <th>id</th> <th>batch id</th> <th>source</th> <th>date</th> <th>details <div id="detailsdiv"> <a href="#" id="default">default</a>&nbsp;|&nbsp; <a href="#" id="wrap">wrap</a> </div> </th> <th>account name</th> <th>col15</th> <th>col16</th> <th>col17</th> <th>col18</th> </tr> select anchor tags using following: $("table #detailsdiv a") and apply click functionality using .on() method: $("table #detailsdiv a").on("click", function() { //use select eleme...

objective c - How to get old UDID in my new upgraded app -

i using udid save , retrieve data remote db , apple had depreciated udid. how can retrieve saved data if update app new version developed using ios5. you can not, unless saved udid where, nsuserdefaults . apple not allow apps use [uidevice uniqueidentifier] method more. if used in code apple reject app.

Android JellyBean BigTextStyle Notification not working - HTC One X AT&T -

i have implemented bigtextstyle/inboxstyle notification shown normal notification shown before jellybean (means in gingerbread, ics etc) on htc 1 x at&t (which 4.1.1). action buttons not shown. i have check code emulator (with jellybean 4.2) , working. it looks new notification system of jellybean not implemented version of htc 1 x. htc 1 x at&t device info android version - 4.1.1 htc sense version - 4+ software number - 3.18.502.6 710rd htc sdk api level - 4.63 htc extension version - htcextension_sesnse45_2 source code @targetapi(build.version_codes.jelly_bean) private void shownotificationjb(reminder reminder, intent intent) { log.v(tag, "showing bigtext notification"); notification.builder builder = new notification.builder(this); builder.setcontenttitle("ezeetrak scheduler"); additionaldatastore store = reminder.getstore(); string passedby = store.optstring("passedby"); builder.setcontenttext(...

php - Explaining an HTTP "GET" request -

i have many times implemented http "post" requests in projects, more importantly because understand how request worked in code. now need make "get" request , bit confused on how can accomplish it. i have html-jquery page , when launched sends "id" (post request) php server. , need php server , in database in events "id" subscribed , return events. so need make "get" request , send parameter "id" , json file events. how php file like? mean , can write php script accepts "id" input ,makes right sql queries events , create json file them. how return html-jquery page though? or should "get" request target xml/json files? way see described till jquery makes post request server id , server makes post request web page events. not "get" ... there multiple ways want. with jquery , ajax this: $.get("yourpage.php", {id: 5}, function(jsonresult){ // whatever json resul...

javascript - Applying multiple extenders in knockout -

i have following javascript code function appviewmodel(){ this.myvalue = ko.observable().extend({ minnumber: "5"}).extend({ maxnumber: "20" }); } ko.extenders.minnumber = function(target, minvalue){ target.haserror = ko.observable(); target.errormessage = ko.observable(); function validate(newvalue){ target.haserror(parseint(newvalue) < parseint(minvalue) ? true : false); target.errormessage(parseint(newvalue) < parseint(minvalue) ? "minval" : ""); } validate(target()); target.subscribe(validate); return target; }; ko.extenders.maxnumber = function(target, maxvalue){ target.haserror = ko.observable(); target.errormessage = ko.observable(); function validate(newvalue){ target.haserror(parseint(newvalue) > parseint(maxvalue) ? true : false); target.haserror(parseint(newvalue) > parseint(maxvalue) ? "maxval" : ""); } vali...

c++ - The sizeof several casts -

why function sizeof not return same size when getting used on struct itself? i need cast because of winsock program im working on. help, true. #include <iostream> #include <string> using namespace std; struct stringstruct { string s1; string s2; }; int main() { stringstruct ss = {"123","abc"}; char *nx = (char*)&ss; cout << sizeof(nx) << endl << sizeof(*nx) << endl; cout << sizeof(&ss) << endl << sizeof(ss) << endl; getchar(); return 0; } the example above outputs 4 1 4 64 sizeof tell size of given expression's type. in both sizeof(nx) , sizeof(&ss) , result 4 because pointers on machine take 4 bytes. sizeof(*nx) , dereferencing char* , gives char , , char takes 1 byte (and does), output 1. when sizeof(ss) , ss stringstruct , size of stringstruct , appears 64 bytes.

java - Drag and Drop switch case, unreachable code? -

why code unreachable , how fix it? public void draggingevent() { image15(); final int thisletter = currentletter; mimageview15.getdrawable(); mimageview15 = (imageview) findviewbyid(r.id.imageview15); mimageview15.setondraglistener(new ondraglistener() { public boolean ondrag(view v, dragevent de) { // todo auto-generated method stub final int action = de.getaction(); switch(action) { case dragevent.action_drag_started: if (de.getclipdescription().hasmimetype(clipdescription.mimetype_text_plain)) { v.invalidate(); return (true); } break; case dragevent.action_drag_entered: v.invalidate(); return (true); break; //un reachable here case dragevent.action_drag_location: //ignore if (de.getx() == 250 && de.gety() == 195) { mimageview17.setimageresource(thisletter); ...

unit testing - Justification of test cases -

hi guys have been asked write justification of test cases traces business rules, data dictionary , data volume requirements. but thing have no idea how write justification test cases, have test cases done, have created own loaded test data need justify test cases. edited: sorry forgot ask question, question how write justification test cases? this means must write why test case relevant. can lot of unuseful tests. justify why 1 in particular useful.

avqueueplayer - How can I play movies on the toppest screen in IOS? -

i trying play movies view controller. using code below that: videoplayerviewcontroller* movieplayer = [self.storyboard instantiateviewcontrollerwithidentifier:@"videoplayercontroller"]; movieplayer.view.frame = rect; uiwindow *window = [[[uiapplication sharedapplication] windows] lastobject]; [window.rootviewcontroller presentviewcontroller:movieplayer animated:no completion:nil]; [movieplayer playmoviesforitems:items]; normally works fine. sometimes, movie starts cannot see video, can hear sounds. what best way play video on top of everything? nsstring *path = [[nsbundle mainbundle] pathforresource:@"myvideo" oftype:@"mp4"]; mpmovieplayercontroller *myplayer = [[mpmovieplayercontroller alloc] init]; myplayer.shouldautoplay = yes; myplayer.repeatmode = mpmovierepeatmodeone; myplayer.fullscreen = yes; myplayer.moviesourcetype = mpmoviesourcetypefile; myplayer.scalingmode = mpmoviescalingmodeaspectfit; myplayer.contenturl =[nsurl fileu...

html5 video: fastest fast forward and slowest slow motion? -

wondering bounds variable rate playback html5 video. i seem min , max out playing demo: http://www.w3.org/2010/05/video/mediaevents.html i've done cursory glance @ specification , don't see there. i have tested on different computers cpu powers, , found there no upper limit. however, fastest effective speed dependent on cpu power. got 15x maximum speed on corei7 -4770k @3.5ghz , got around 10x on less powered haswell corei5 @2.5ghz. these chrome extensions used changing speed: chrome extension chrome another chrome extension modifiable hotkeys (but needs added chrome loading unpacked extension) update : here related internet explorer: the playbackrate property represents multiplier of video's intrinsic or normal playback rate, default setting of 1. if set property 2, doubles playback speed, while .5 play @ half speed. if playbackrate set negative value, in windows internet explorer 9, rounds zero, pausing playback. in internet explorer 10, n...

yii - PHP: write in php://input -

i know how write in "php://input". actually know if can use stream superglobal. example $_post file1: $_post['param'] = "test"; file2: $param = $_post['param']; what want file1: ????????????? file2: $param = file_get_contents('php://input'); do need throw post request file1 file2? thanks read me :) have nice day michaël s. php://input read-only stream allows read raw data request body. ( php docs ) maybe, find unix-sockets , or shared memory useful?

sql server - How to match patterns stored in SQL table -

i'm trying setup system can store phrases containing data placeholders in table can matched user's input string. example, today [date] stored in column , potentially positively matched phrase today tuesday . solution need fast. backend mssql , .net. ideas? your matching options in sql like: where columnname = 'today tuesday' or where columnname 'today %' or where columnname in ('today monday', 'today tuesday', 'today wednesday') any of fast. use .net code build in list of potential placeholder replacements. just beware of query like: where columnname '% today' this slower because leading wildcard makes impossible sql server use columnname index (if 1 exists), , instead perform table scan.

java - Spring configuration not finding with Configured name -

this question has answer here: why spring mvc respond 404 , report “no mapping found http request uri […] in dispatcherservlet”? 3 answers the following configuration file configured web-inf/classes/applicationcontext.xml searching web-inf/applicationcontext.xml <?xml version="1.0" encoding="utf-8"?> <web-app id="starter_anil" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>anil-spring</display-name> <!-- servlets --> <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class>org.springframew...