Posts

Showing posts from March, 2014

javascript - Pass a parameter into Bloodhound from Typeahead? -

i setting form typeahead. have 2 input fields next each other, , need autocomplete on each of them. html looks this: <select id="numerator"> <option value="presentation">presentation</option> <option value="chemical">chemical</option> </select> <input id="numeratorid" class="typeahead" type="text" /> <br/> <select id="denominator"> <option value="presentation">presentation</option> <option value="chemical">chemical</option> </select> <input id="denominatorid" class="typeahead" type="text" /> each of input fields autocomplete looking @ api endpoint. should of form /api/1.0/code?type=presentation&code=123 or /api/1.0/code?type=chemical&code=123 . the value of type parameter in api call should depend on value of <select> element next each

ios - Complements / intersection of two generic array filled with NSIndexPath -

Image
ipstoreload.filter { !contains(self.ipstoinsert, {$0.row == $1.row}) } i want expression work. need complements of 2 generic array: ipstoreload \ ipstoinsert . idea doing wrong? this definition: var ipstoinsert = [nsindexpath]() var ipstodelete = [nsindexpath]() the trouble have 2 nested closure expressions (the 1 filter , , 1 contains ). within closure expression, $0 , $1 refer arguments local closure expression – in case, writing expression contains takes 2 arguments ( $0 , $1 ), , closure argument filter looks if takes no arguments (hence swift complaining can't pass ()->_ argument filter ). try naming arguments, so: ipstoreload.filter { reload in !contains(ipstoinsert) { insert in reload.row == insert.row } }

Python - Asynch Multiprocessing from RabbitMQ Consumer -

i have python program acts consumer rabbitmq. once receives job queue, want program split job using multiprocessing, i'm running issues logistics of multiprocessing. i've simplified code readability. my rabbitmq consumer functionality: connection = pika.blockingconnection(pika.connectionparameters('localhost')) channel = connection.channel() channel.queue_declare(queue="jobreader", durable=true) logging.info('waiting messages..') def callback(ch, method, properties, body): job_info = json.loads(body) logging.info('start time: ' + time.strftime("%h:%m:%s")) split_jobs = split_job(job_info) process_manager.runprocesses(split_jobs) ch.basic_ack(delivery_tag=method.delivery_tag) my multiprocessing functionality: #!/usr/bin/python import multiprocessing import other_package def worker_process(sub_job): other_package.run_job(sub_job) def runprocesses(jobs): processes = [] sub_job in

javascript - Node hangs on POST request when using http-proxy and body-parser with express -

i've posted to relevant issue on http-proxy . i'm using http-proxy express can intercept requests between client , api in order add cookies authentication. in order authenticate client must send post request x-www-form-urlencoded the content-type. using body-parser middleware parse request body can insert data in request. http-proxy has problem using body-parser supposedly because parses body stream , never closes proxy never never completes request. there solution in http-proxy examples "re-streams" request after has been parsed have tried use. have tried use connect-restreamer solution in same issue no luck. my code looks this var express = require('express'), bodyparser = require('body-parser'), httpproxy = require('http-proxy'); var proxy = httpproxy.createproxyserver({changeorigin: true}); var restreamer = function (){ return function (req, res, next) { //restreame req.removealllisteners('data

When does the non-static block get executed in java? -

i expected non-static blocks execute @ time of object creation. in following example called static method non-static block executed. i've not created object why non-static block execute? class example { static void mark() { system.out.println("mark method"); { system.out.println("hello"); } } } public class staticobject { public static void main(string[] args) { example.mark(); } } result: mark method hello you don't have non-static initialization block in example. block inside of method code gets executed part of method. (nested code blocks introduce new scope, can create variables not visible outside of block.) it's initializer if it's within class outside of method declaration. if change code move block outside of method: class example { static void mark() { system.out.println("mark method"); } // it's instance initializer { system.out.println(&

android - How can I conditionally hide last row of Listview inside ArrayAdapter? -

i have 2 fragments, contain lists (listview). in second fragment, each row (despite last one) contain checkbox. last row contain different layout (text + button) - that's because want displayed after list ends (not @ bottom of screen). want achieve is: when no checkbox checked last row visible, otherwise last row invisible. haven't find solution yet.. use getchild() refers visible items. have idea? thanks! here getview method in arrayadapter: public view getview(final int position, view convertview, final viewgroup parent) { viewholder holder = null; final int last = this.getcount()-1; int thetype = getitemviewtype(position); if (convertview == null) { if (thetype == 0) { convertview = inflater.inflate(layoutresourceid, null); holder = new viewholder(); holder.name = (textview) convertview .findviewbyid(r.id.name); final checkbox checkbox = (checkbox) convertview.findviewbyid

Can't run Rails server because of json gem error -

i error while trying run rails server. seems can't install json gem properly. when first tried install gems, got 1.8.2 version of json gem. reason got same error messages attached when tried run server. in order install 1.7.7 version of json, have uninstalled 1.8.2 gem. does know how fix problem? thank in advance:) $ rails s not find json-1.7.7 in of sources run `bundle install` install missing gems. $ bundle install fetching gem metadata https://rubygems.org/........ fetching version metadata https://rubygems.org/... fetching dependency metadata https://rubygems.org/.. using rake 10.0.3 [...] using rack-ssl 1.3.3 errno::eacces: permission denied @ rb_sysopen - /users/annemarit/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/json-1.7.7/.gitignore error occurred while installing json (1.7.7), , bundler cannot continue. make sure `gem install json -v '1.7.7'` succeeds before bundling. $ gem install json -v '1.7.7' error: while executing gem ... (errno::eacc

How to ensure matrix/array shape when performing slicing and other operations in Python? -

i have been running interesting problem when performing operations on matrices , arrays in python. i'm converting code matlab python , quirk of python generating significant amount of bugs in code. for example: say want perform operation in python nx1 array import numpy np numpy.random import randn ... n = 50 u = np.cumprod(rand(n,1))**(1.0/np.arange(n,0,-1)) rather getting element wise power of 2 arrays resulting in vector, massive matrix , not example, on inspection found example shape of np.arange(..).shape in case (n,) null dimension size, if slice matrix eg. x[:,3].shape = (n,) and rather getting 2 column matrices multiplied broadcasting assumes want matrix when multiplying (n,1)*(n,) = (n,n) when want = (n,1) how can perform these operations , ensure dimensions? i.e. want able top slice matrix , column vector or find np.cumprod() or np.cumsum() in 1 dimension of matrix , vector.. to avoid broadcasting, inputs need match in shape. thus giv

ruby on rails - Models where HABTM exists for all of the child models in search_array -

suppose search_array = [1, 3, 6] , model has_and_belongs_to_many childmodels i want return models have habtm link all of childmodels in search_array . my code, asked # find drivers driver has of availables in array chunk = start block_ids = [] while chunk <= ending block_ids << block.where(hour: chunk.hour, day: chunk.wday).take.id chunk += 1.hour end drivers = drivers.where( availables: block_ids ) # line issue currently, code find drivers driver has of availables in array block_ids

wordpress - Month and name permalink not working but id is working fine -

my wordpress permalink structure not working advertised. when have set post id or default setting works fine, when change month , name, use breaks top level menu items. any idea whats going on, looks fine .htaccess file it file permission issue. in reason, wp can't read .htaccess rules. should change file permission of root or .htaccess file 755 or 777. similar issue happened me.

jsf - Ajax request while session is expired returns <partial-response> XML plain to browser -

this i'm getting in browser after page makes ajax request , session has been timeout, i'm implementing omnifaces fullajaxexceptionhandler . this xml file not appear have style information associated it. document tree shown below. <partial-response id="j_id1"> <changes> <update id="javax.faces.viewroot"> <![cdata[ <html xmlns="http://www.w3.org/1999/xhtml"><head><link type="text/css" rel="stylesheet" href="/webworkflow/javax.faces.resource/theme.css.xhtml?ln=primefaces-smoothness" /><link type="text/css" rel="stylesheet" href="/webworkflow/javax.faces.resource/css/xpm2.css.xhtml" /><script type="text/javascri ]]> <![cdata[ pt" src="/webworkflow/javax.faces.resource/jquery/jquery.js.xhtml?ln=primefaces&amp;v=5.1.13&amp;v=5.1.13"></script><script type="text/javascrip

sql server - T-SQL cursor loop syntax -

just simple style question i've been curious about. the canonical forward cursor loop goes this. declare table_data forward_only cursor select c1, c2 t1; declare @c1 int; declare @c2 int; open table_data; fetch table_data @c1, @c2; while @@fetch_status = 0 begin -- @c1, @c2 fetch table_data @c1, @c2; end; close table_data; deallocate table_data; there's minor code style issue in fetch statement repeated verbatim. there reason "standard" loop when written this? open table_data; while 1 = 1 fetch table_data @c1, @c2; if @@fetch_status != 0 break; -- @c1, @c2 end; i'm not looking opinions on way better. i'm curious if there's reason first way seems overwhelmingly standard can argued have drawback. there problem infinite loop version i'm not seeing? i'm guessing reason break recent t-sql addition, i'm having trouble finding changelog of t-sql language confirm hypothesis. the common way see first way.

installer - Read a File in Installshield and fill a form -

im trying find way read/write config file using c# library, im running installshield 2014 in visual studio 2013, have dialog box. added custom action of type= "call public method in managed assembly" option "installed product" , selected primary output source targeting class , method in question, not working. don't know wrong it, dialog should appear prior installation. ideas? as debugging guideline, @ verbose log. expect tell in case assembly cannot found. if so, because calling assembly installed product, before said assembly has been installed. (there may or may not issues referencing output group; don't believe i've ever tried that.) depending on needs you'll have choose between 2 approaches: reschedule action assembly available, or make assembly available @ current scheduling choosing different location (such binary table).

excel - Calculate total number of open item at each month in Powerpivot -

i want find way calculate total amount of open items in each month in powerpivot. data looks this... id team createddate closeddate 01 aaa 1/30/2014 5/13/2014 02 bbb 2/9/2014 2/18/2014 03 ccc 5/10/2014 9/15/2014 result should this... month count jan2014 1 feb2014 2 mar2014 1 apr2014 1 may2014 2 jun2014 1 jul2014 1 aug2014 1 sep2014 1 is way this? tia...

jquery - Show DIV on Mouse Movement Towards Closing Browser Tab Cross-Platform -

my client wants attractive div show when tries move mouse close browser tab, , works cross-platform in latest browsers. what jquery technique detecting particular kind of mouse movement? you'll need determine users operating system. can done user agent detection. see question: how check website viewer's operating system? then, 1 option put fixed position hidden div in corner , on hover, show div. psuedo code like html: <div id="trigger-div" class="trigger-div"></div> <div id="annoying-div" class="hidden">please don't leave me!</div> css: .hidden {display: none} // may or may not appropriate. use visibility or opacity .trigger-div {position: fixed; height: 100px; width: 100px; top: 0;} .trigger-div.windows {right: 0;} .trigger-div.mac {left: 0;} psuedo js: jquery(function () { var os = navigator.platform; if (os === 'macintel') { jquery('#trigger-div&#

Android Service doesnt restart by itself -

in application have activity , service (extends intentservice ). service's onstartcommand looks below @override public int onstartcommand(intent intent, int flags, int startid) { super.onstartcommand(intent, flags, startid); return start_redeliver_intent; } my onhandleintent method: @override protected void onhandleintent(intent intent) { while(continueloop){ //continueloop controlled binder //do stuff } } i bind service activity, can break infinite loop. started app , it's service, , started other applications, after while activity got stopped , destroyed, service. when close other applications using task manager , service doesn't start itself. i waited , launched app, activity launched service started. thought android system restart service automatically when memory available. missing or should wait longer. thanks in advance if read intentservice you'll see that onstartcommand(intent intent, int flags, int startid

php - Laravel Istallation " Your requirements could not be resolved to an installable set of packages." -

i'm trying create laravel project. i'm new laravel , composer. composer.json file reads { "name": "jrodriguez/sapme", "description": "sap replacement server.", "license": "proprietary", "authors": [ { "name": "myname", "email": "myemai" } ], "require": { "laravel/framework": "~5.0" } } when run composer diagnose says ok. when run composer create-project laravel/laravel --prefer-dist error requirements can't resolved. any here?

optimization - Make interpreter execute faster -

i've created interprter simple language. ast based (to more exact, irregular heterogeneous ast) visitors executing , evaluating nodes. i've noticed extremely slow compared "real" interpreters. testing i've ran code: i = 3 j = 3 has = false while < 10000 j = 3 has = false while j <= / 2 if % j == 0 has = true end j = j+2 end if has == false puts end = i+2 end in both ruby , interpreter (just finding primes primitively). ruby finished under 0.63 second, , interpreter on 15 seconds. i develop interpreter in c++ , in visual studio, i've used profiler see takes time: evaluation methods. 50% of execution time call abstract evaluation method, casts passed expression , calls proper eval method. this: value * eval (exp * exp) { switch (exp->type) { case exp_addition: eval ((additionexp*) exp); break; ... } } i put eval methods

javascript - AngularJS ngModel Directive with select field and ngOptions -

i'm trying have code run during link callback of ngmodel directive using angularjs on select field uses ngoptions. module.directive("ngmodel",function(){ console.log('ng-model called'); return { restrict: 'a', priority: -1, // give lower priority built-in ng-model link: function(scope, element, attr) { console.log('watching'); scope.$watch(attr.ngmodel,function(value){ if (value){ console.log("changing"); } }); } } }); see fiddle demonstrates problem: http://jsfiddle.net/d3r3zwlj/3/ the first select field populated using ng-options, while second has options explicitly written out in html. if open console, can see see "changing" message when change second select field. changing first nothing. you'll notice see 'ng-model called' , 'watching' once, though there 2 fields ng-model

ssh - How to enable or browse web service running on EC2 on local machine? -

i have ec2 instance has port forwarding enabled emr cluster. ganglia monitoring service running on emr. able browse ganglia ec2 instance following using "text browser" lynx. lynx http://localhost:5000/ganglia however, want access service local machine ( mac yosemite ). did research , found need x11 port forwarding. have x11 port forwarding enabled. echo $display gives me following on ec2 instance localhost:14.0 i able run "xclock" , launches clock on local machine. i tried ssh ec2 instance syntax . ssh -c -c blowfish -n -l:1050:myec2server:5000 myuser@myec2server then if type http://127.0.0.1:1050/ganglia in google chrome message saying no data received. can point out going wrong ? tried verbose log local machine ec2 instance , has following message - channel 2: open failed: connect failed: connection refused in short, want able see ganglia local machine. appreciated. ~cheers i tested ssh command line own laptop

android - Gmail API: Authentication using token retrieval -

i have read whole article authentication using oauth2.0. didn't find suitable method on android application. please suggest method access token can build gmail service object , access inbox or other method. this example given them in link : googlecredential credential = new googlecredential().setaccesstoken(accesstoken); plus plus = new plus.builder(new nethttptransport(), jacksonfactory.getdefaultinstance(), credential) .setapplicationname("google-plussample/1.0") .build(); invoke below method token , google account used in mobile. method first retrieves google account setup in mobile , later retrieves token. can save token , account name using preferences later use dont have retrieve token each time. private void chooseaccount() { intent intent = accountpicker.newchooseaccountintent(null, null, new string[]{"com.google"}, false, null, null, null, null); startactivityforresult(intent, 9009); } aft

Duplicate symbol error in C++ and Xcode -

i'm trying declare class acts enum. if include more once, several "duplicated symbol" errors. this itemtype.h file #ifndef darksnake_itemtype_h #define darksnake_itemtype_h #define color_item_1 0xffff00ff #define color_item_2 0xffff03ff #define color_item_3 0xffff06ff class itemtype { public: static const itemtype none; static const itemtype item_1; static const itemtype item_2; static const itemtype item_3; static itemtype values[]; static itemtype getitemtypebycolor(const int color) { (int = 0; 3; i++) { if (color == values[i].getitemcolor()) { return values[i]; } } return none; } bool operator ==(const itemtype &item) const; bool operator !=(const itemtype &item) const; int getitemcolor() { return this->color; }; private: const int color; itemtype(const int _color) : color(_color) {} }; bool itemtype::operator == (const itemtype

Oracle Apex - Using Multiple tabs with the same session state -

i providing support existing oracle apex 4.2.5 application. 1 of pages (page 1003) contains process submits information page 1003 page items (e.g. p1003_item1) our database tables. contents of these page items associated primary key (assessment id) in database table page items submitted. of few dozen or page item variables, primary key 1 of 3 variables passed in through url. url follows: https://[domain]/f?p=[application id]:[page number]:[session id]:select:no:1003:p1003_entity_id,p1003_assessment_id,p1003_parent_id:353767,700177,5716 we have encountered issue occurs when our users load page 1003 in multiple tabs in browser different assessment#'s. every time new page 1003 loaded in new tab, session variables previous tab overwritten. regardless of tab user submits first, variables submitted database ones last tab loaded user. i've seen few examples online of how handle similar issues other programming languages, i'd know if there apex specific solution might h

node.js - IBM DB2 using nodejs is throwing connection error as "SQL1042C An unexpected system error occurred. SQLSTATE=58004" -

i using ibm_db module connect ibm database using nodejs. referring db2nodejs . followed post , used sample code given in post. following steps. 1. installed nodejs 2. installed ibm_db 3. downloaded nodedb2test.js file 4. changed database details per db2 database 5. ran file. i getting following error error: [ibm][cli driver] sql1042c unexpected system error occurred. sqlstate=58004 i new db2 using nodejs. think provided details correctly except db2 driver value driver={db2}. should value driver? never installed database related driver before. please help. are using osx ? there's overall problem db2 when installing latest 10.10.3 . see here os x 10.10.3 - sql1042c unexpected system error occurred

.net - Exception is thrown by SOS -

i'm getting started windbg/sos , created simple console application testing (that throws unhandled exception). seems after load sos exception on next call. for example: ntsd consoleapplication1.exe .symfix .reload g .loadby sos clr if call: !threads "c0000005 exception in c:\windows\microsoft.net\framework\v4.0.30319\sos.threads pc: 592b7713 va: 00000000 r/w: 0 parameter: 00000000" if call: !clrstack c0000005 exception in c:\windows\microsoft.net\framework\v4.0.30319\sos.clrstack pc: 592b7713 va: 00000000 r/w: 0 parameter: 00000000 every call after 1st call work (it's first call fails after loading sos). i tried recommendation , recompiled code native code debugging enabled did not make difference. version of windbg: 6.3.9600.16384 x86 this seems problem of windbg. tried .net 4.0 console application, x86 target. did not check checkmark enable native code debugging , since never did before. i can reproduce problem in

java - android studio drawable images iteration -

i put images res/drawable folder. named (s1.png, s2.png, s3png.., 2n.png). i want loop (and process) them. like: (int = 1; < n; i++) { havingfunwithpngs(r.drawable.s + inttostr('i')); } ofcourse thats not how works. how it? in advance. edit: coreproblem is, convert filename-strings corresponding ressourceid's android-studio assigns. if want drawable id, way (passing string imagename ): int id = getresources().getidentifier(imagename, type, package); if want see code, please @ this answer. should pass image name in string variable, think should rather use way: string imagename = "s" + i; because looks better, don't need convert (java automatically) , readable.

Phonegap Consuming Web Service PHP -

the next problem try consume web service. try plugins , pure xml result still "null". the code this. function soap(imei,clave) { var divtobeworkedon = "#res"; var webserviceurl = ''; var parameters = '<?xml version="1.0" encoding="utf-8"?> \ <soap:envelope xmlns:xsi=" http://www.w3.org/2001/xmlschema-instance " xmlns:xsd=" http://www.w3.org/2001/xmlschema " xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/"> \ <soap:body> \ <registra_imei> \ <request> \ <imei>'+imei+'</imei> \ <clave>'+clave+'</clave> \ </request> \ </registra_imei> \ </soap:body> \ </soap:envelope>'; $.ajax({ type: "post", url: webserviceurl, data: parameters, contenttype: "text/xm

javascript - jQuery hover Issue with div -

i want show/hide data on mouse hover on div tag. my html: <div id='container'> <div id="box" style="visibility: hidden"> <a href="#" class="bt btleft">highlight it</a> <a href="#" class="bt btright">reset</a> </div> </div> my jquery: <script> $(document).ready( function() { $("#container").hover( function () { $(this).children("div").show(100); }, function () { $(this).children("div").hide(100); });​ }); </script> but, hover doesn't anything!! please suggest way around. .show() , .hide() toggle display property, not visibility . if want animate visibility, animate opacity css prope

angularjs - Multiple directives [arValidations, datepickerPopup] asking for new/isolated scope on -

i got following error when trying combine custom directive datepicker: multiple directives [arvalidations, datepickerpopup] asking new/isolated scope on... so guess need remove isolated scope, problem don't know how. here directive: app.directive('arvalidations', [ 'basevalidator', '$injector', function(basevalidator, $injector){ return { restrict: 'a', scope: { arvalidations: '@?' }, require: '?ngmodel', link: function(scope, element, attrs, ngmodel){ scope.validations = json.parse(scope.arvalidations); scope.validator = $injector.get(scope.validations.validator); scope.pristine = true; scope.basevalidator = basevalidator; scope.$watch(function(){ return ngmodel.$modelvalue }, function (attr) { var label = scope.validations["attribute"]; var types = scope.validator.attributes[label].types; var validated = scope.basevalidator.validatevalue(t

How can I get the full hex string of a blob via SQL Server Management Studio? -

if have blob in database , select it, following result: blob ------ 0xabcdef1234567890... what query can perform, or options can set retrieve full hexadecimal string can copy , paste out of ssms? i want string it's displayed in grid view, in hexadecimal format, truncates it. i aware can export data, generate file, or hook .net clr , retrieve data way, sake of question, process must work when connected remote database, , must use ssms features. no exports, no files, result in ssms (e.g. "0x12345...") copy , pasteable. i don't think can. if @ advanced options (tools -> options -> query results -> sql server -> results grid), largest option non-xml data 65535 bytes. maybe cast xml , remove mark up.

C++ Constructor Implicit Return Type -

i having trouble understanding return type constructors, professor stated ​that "a constructor doesn't return code standpoint. meaning, when declare it, don't declare return value. it implicitly returns pointer (meaning, can't change behavior), however. side note, returns 'this' pointer. of out of hands of programmer though." is saying when create object constructor passes pointer, or off here? if called "initializer" rather "constructor" make more understandable? a constructor not create object. initializes object. there nothing return. object created using new or auto or static allocation.

automata - Can the intersection of 2 non-regular languages be a regular language? -

can intersection of 2 non-regular languages regular language ? suppose 2 non-regular languages distinct , have no strings in common. intersection of these 2 languages empty set, since no string exists in both languages. the empty set regular language, can happen sometimes.

c++ - Returning ::iterator from function does not compile -

this question has answer here: where , why have put “template” , “typename” keywords? 5 answers the following repo compiles fine: #include <tuple> #include <vector> class foo { public: typedef std::tuple<int, int> foo_type; std::vector<foo_type>::iterator find() { return listeners.begin(); } std::vector<foo_type> listeners; }; int main() { foo foo; auto = foo.find(); } but when template tuple on p, q in following repo, error: syntax error : missing ';' before identifier 'find' #include <tuple> #include <vector> template<typename p, typename q> class foo { public: typedef std::tuple<p, q> foo_type; std::vector<foo_type>::iterator find() { return listeners.begin(); } std::vector<foo_type> listeners; }; int mai

c++ - opengles 3D graphics raspberry pi -

i can't find tutorial use of opengles 3d graphics in c++, on raspberry pi can program video game c++ , also, cannot find raspberry pi compatible opengles library. edit : at time, couldn't find library working opengl / opengles , such glfw . google broadcom opengl es , start here http://elinux.org/raspberry_pi_videocore_apis

java - Error - Didn't find class "javax.naming.ldap.LdapName" -

i'm using unirest camfind result. the full error log : 04-14 18:24:39.574 1880-2300/projectco.project e/androidruntime﹕ fatal exception: thread-120 process: projectco.project, pid: 1880 java.lang.noclassdeffounderror: failed resolution of: ljavax/naming/ldap/ldapname; @ com.mashape.relocation.conn.ssl.abstractverifier.extractcns(abstractverifier.java:277) @ com.mashape.relocation.conn.ssl.abstractverifier.getcns(abstractverifier.java:265) @ com.mashape.relocation.conn.ssl.abstractverifier.verify(abstractverifier.java:157) @ com.mashape.relocation.conn.ssl.abstractverifier.verify(abstractverifier.java:140) [...] more "at"s at bookshotco.bookshot2.mainactivity$1.run(mainactivity.java:100) @ java.lang.thread.run(thread.java:818) caused by: java.lang.classnotfoundexception: didn't find class "javax.naming.ldap.ldapname" on path: dexpathlist[[zip file "/data/app/projectco.project-1/base.apk"],nativ

javascript - Hidden Divs - Jquery Closing and Efficiency -

i'm trying create multiple divs can closed click of button. being novice @ jquery, i'm sure there better ways this. my question is: there better ways this? edit: there way have 1 div open , cancel out , open 1 in case user not close it?? //hidden divs $(document).ready(function () { $(".x").click(function () { $("#tcm_content").hide(); }); }); $(document).ready(function () { $(".x").click(function () { $("#bazinga_content").hide(); }); }); //thumbnails $("#tcm").click(function () { $("#tcm_content").show("600", function () {}); }); $("#bazinga").click(function () { $("#bazinga_content").show("600", function () {}); }); here's fiddle: http://jsfiddle.net/0t6uqwlm/13/ you can close multiple divs in click event this $(document).ready(function () { $(".x").click(fu

json - Issue upgrading from Jackson 1.9 to 2.5 using Spring 3.1.2 - ProviderBase class not found -

Image
i'm trying upgrade current project jackson 1.9 2.5. going until tried startup 7 server , receive error: org.springframework.beans.factory.cannotloadbeanclassexception: error loading class [com.fasterxml.jackson.jaxrs.json.jacksonjaxbjsonprovider] bean name 'jaxbprovider' defined in servletcontext resource [/web-inf/spring/applicationcontext-configuration.xml]: problem class file or dependent class; nested exception java.lang.noclassdeffounderror: com.fasterxml.jackson.jaxrs.base.providerbase this appears in relation trying register jackson provider in web.xml below: <!-- jackson provider --> <bean id="jaxbprovider" class="com.fasterxml.jackson.jaxrs.json.jacksonjaxbjsonprovider" > <property name="mapper" ref="jacksonobjectmapper"/> </bean> <bean id="jacksonobjectmapper" class="com.fasterxml.jackson.databind.objectmapper" > <property name="a

Function editing lists in Python -

this question has answer here: how pass variable reference? 22 answers so i've observed in python3 if like a = 5 def addfive(x): x+=5 return x print(addfive(a),a) the output "10 5" since not changed function. same not happen lists: a = [1,2,3] def b(x): z = x z.append(10) b(a) print(a) when run function changes actual list. now question: why happen, can read more this(honestly have no idea how word google search) , how can avoid this. please feel free redirect me other articles common problem couldn't find similar. thanks in advance :) use copy module. import copy = [1,2,3] def b(x): z = copy.deepcopy(x) z.append(10) return z b(a) print(a) this prints [1, 2, 3, 10] [1, 2, 3]

android - Failed to find provider info for pioperation.tregliapi.computercomesifa.SolutionProvider -

i have search page called "searchitem" on i've implemented searchdialog. when try search between suggestions, android keeps on complaining saying: failed find provider info pioperation.tregliapi.computercomesifa.solutionprovider my androidmanifest.xml following: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="pioperation.tregliapi.computercomesifa" > <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainpage" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <c

c# - Hiding public members of an interface in IL -

consider these lines of code: concurrentdictionary<string, object> error = new concurrentdictionary<string, object>(); error.add("hello", "world"); //actually throws compiler error and idictionary<string, object> noerror = new concurrentdictionary<string, object>(); noerror.add("hello", "world"); i figure out have change il make add function private. now in spirit of decoupled code i'd use interface seems concurrent dictionary isn't found of add method. is safe use add (i can't view il don't know if it's thread safe.)? or should use concrete type of concurrentdictionary<tkey, tvalue> , explicitly use tryadd . yes, it's safe. have @ reference source concurrentdictionary . method idictionary<tkey, tvalue>.add calls tryadd , throws exception if key exists. the hiding of members of interface not requires il modifications done. can done through explicit inter

How do I use ack or ag within vim with Unite.vim? -

i have found lot of pages config examples such as: let g:unite_source_grep_command = 'ag' let g:unite_source_grep_default_opts = \ '--line-numbers --nocolor --nogroup --hidden --ignore ' let g:unite_source_grep_recursive_opt = '' or " use ag searching let g:unite_source_rec_async_command = \ 'ag --follow --nocolor --nogroup --hidden -g ""' let g:ackprg = 'ag --nogroup --column' nnoremap <space>/ :unite grep:.<cr> unfortunately, don't understand these doing or why. i've played around , have gotten parts of want working. ideally, i'd similar ack.vim does: i hit key mapping, let's / i put in search query that opens unite.vim buffer split @ top asynchronously uses ack or ag searches search query i can navigate through results , select 1 or open in splits perhaps i'm missing spirit of question, if need configure unite ag, that's straightforward: in .vimrc add: let g

php - array_keys error from PHPUnit_Extensions_Database_DataSet_YamlDataSet -

trying load phpunit dataset using: public function getdataset() { return new phpunit_extensions_database_dataset_yamldataset("/path/file.yml"); } i array_keys() expects parameter 1 array, integer given on command line. i can't tell if error because phpunit_extensions_database_dataset_yamldataset::addyamlfile() doesn't input, or if constructor returning phpunit_extensions_database_testcase doesn't like. the yaml file created using phpmyadmin's yaml export feature. else run this? the direct export phpmyadmin not match requirements in phpunit. take @ official documentation: https://phpunit.de/manual/current/en/database.html and take @ file generated phpmyadmin. differs. in phpmyadmin table names comments. you have reformat file usable phpunit.

r - Paste values together based on a grouping variable -

i'm new @ r programing , im trying rearrange data frame. have column ids , column y string values. there's more 1 y per id multiple rows same id different y. want 1 row per id , y value concatenated in same cell in other column. there function ? original data id y apple b pear c grape grape b apple c grape transformed data id y apple,grape b pear, apple c grape you can use aggregate here paste unique elements each id together ggregate(y ~ id, unique(dat), paste, collapse = ", ") data dat <- read.table(text="id y apple b pear c grape grape b apple c grape", header=t) edit added collapse argument re @pdb comment , changed unique re @davidarenburg

Vertical Scrolling - Add content below visible area and Design UI - Windows Phone 8.1 XAML C# -

Image
i want add vertical scroll-able content page. i have split vertical space using 5 grid heights of 300 pixels each , added scroll viewer , works fine. the problem visual studio shows 2 grid heights in xaml visual editor, , remaining 3 goes bottom , nothing visible. however, if designate items remaining grids using xaml code, in place. how view them in visual editor , design ui? thanks. there might better way, post workaround below. in <page> specify maximum design height so: <page x:class="your_class.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:your_class" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" background="{themeresource applicationpa

ruby on rails - Iterating over JSON objects with HAML Partial -

i relatively new ruby on rails , haml. want name json object in haml. i have in .rb file campaigns = '[{"name":"campaign_1"},{"name":"campaign_2"},{"name":"campaign_3"}]' render "evaluate" , :locals => {:campaigns => campaigns} i want print out "campaign_1", "campaign_2" ... name. have in haml file. have tried several variations of loop none have quite worked. latest one. this have in haml file: - campaign in @campaigns %input{:type => "checkbox"} - campaign.name this gives me undefined method `each' nil:nilclass` any appreciated. thank you! important note: haml file partial you can use locals pass values views. in controller code, need convert json hash , fix locals syntax: json_campaigns = '[{"name":"campaign_1"},{"name":"campaign_2"},{"name":"campaign_3

c# - Using Autofac and Moqs with Delegate Factories -

i trying unit test class uses factory injection. have class instantiates 2 copies of same object (with different config) control hardware. i'm trying test behaviour of classes while simulating hardware calls. i've injected set of factory delegates constructors class can instantiate hardware classes required. can't work out how control or create factory methods within autofac.extras.moq package. seems functionality isn't supported in package. i'm looking equivalent call : mock.provide<ihwcontroller>(//created factory delegate) i want create specific mock object behaviour, based on parameters used instantiate hwcontroller. i'm trying possible? class systemundertest { systemundertest(ia a, ib b, ic c, /** 15 other things **/ func<func<uri, ihwcontroller>, hwtype, ihwmanager> hwmanagerfactory, func<uri, ihwcontroller> hwcontrollerfactory) { } } class hwmanager() { public func&l

java - Propagation.REQUIRES_NEW seems to not work -

using spring (mvc, batch, , persistence) have following piece of interface defined: public interface jobstatusservice { @transactional(readonly = false) @modifying jobstatus save(jobstatus status); @transactional(readonly = true, propagation = propagation.requires_new) optional<jobstatus> get(resultsidentifier identifier); } note requires_new it's on broken method. this interface implemented in: @override public jobstatus save(jobstatus status) { if (status.getuserid() == null) { status.setuserid(userservice.getcurrentuser()); } status.setlastupdatetime(new date()); return repository.save(status); } @override public optional<jobstatus> get(resultsidentifier identifier) { return repository.findbyjobidentifier(identifier); } where repository jpa repository following: public interface jobstatusrepository extends repository<jobstatus, resultsidentifier> { jobstatus save(jobstatus status); optional<jobst

html - Making FA change color on :hover with <li> -

i'm working on basis of side navigation bar enabled old hamburger button. /* * navigation menu * hambuger open * */ .navigation-container { height: 100%; width: 240px; background: #ffffff; border-right: 2px solid #252525; position: fixed; top: 0; left: 0; } .navigation { width: 80%; padding: 0; margin: 0; margin-left: 10px; } .navigation ul { margin: 0; padding: 0; margin-top: 90px; margin-left: 20px; } .navigation ul li { /* setting area */ list-style: none; margin: 0 auto; padding: 20px 0px; /* typography changes */ text-decoration: none; color: #dddddd; font-size: 14px; font-weight: 600; letter-spacing: 1.5px; /* styling */ border-bottom: 1px solid #dddddd; -webkit-transition: .25s ease-in-out; -moz-transition: .25s ease-in-out; -o-transition: .25s ease-in-out; transition: .25s ease-in-out; } .navigation ul .fa { padding: 0; margin: 0; p