Posts

Showing posts from January, 2013

java - HttpClient : How to send post request to page that auto generate random field name? -

a page auto generating random name every time text input field. how can name before executing post request, can use name @ time of adding post parameters in arraylist<namevaluepair>. i solved problem using regex. file name has pattern of 6 character capital characters. used regex : .*id=\"([a-z]{6}).*

angularjs - Angular UI Grid autocomplete with ui-grid-cellnav -

i have autocomplete in ui grid working fine when put ui-grid-cellnav directive keyboard , down arrow not working autocomplete. <div class="grid nonproductivetimegrid" ui-grid="nonproductivetimegridoptions" ui-grid-resize-columns style="width: 100%;" ui-grid-edit ui-grid-cellnav ui-grid-auto-resize ui-grid-draggable-rows ui-grid-selection></div> and controller code grid column var _columnsdefs = function (islocked) { var cols = [{ field: 'responsibleparty', displayname: 'responsible party', enablecelledit: !islocked, editablecelltemplate: '<div><form name="inputform"><input type="input_type" typeahead-append-to-body="true" ng-class="\'colt\' + col.uid" ui-grid-editor ui-grid-edit data-ng-model="model_col_field" name="label" maxlength="100" required validate-required-cell data-typeahead=&q

javascript - Move values from one array to another and remove them -

i have 20 number array. pick (randomly) 5 of these , wanna put them empty array. how can do? , also, how can hide them first array when they're displayed? thank all. var tennumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 42, 178, 54, 76, 32, 12, 38, 154, 234]; var randomnumbers = document.getelementbyid("demo"); randomnumbers.innerhtml = tennumbers[math.floor(math.random()*tennumbers.length)]; seems should able use splice remove random element original array, push result onto new array: var tennumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 42, 178, 54, 76, 32, 12, 38, 154, 234]; var outarray = []; for(var i=0; i<5; i++) { outarray.push(tennumbers.splice(math.floor(math.random()*tennumbers.length), 1)[0]); } document.write(outarray + "<br />" + tennumbers);

c# - Storing a variable in project -

i looking @ simple wpf c# project calculate employee tax payment uk company. need store uk tax allowances updated infrequently. these values shall 10000 , 45000 ( these not actual numbers know), may need updated in future. plan store app on central network. i have considered using resources store these values take ability of user update these values away, not want do. i have looked @ isolated storage like here think different users change tax limits when need each allowance stored , updated ever user update. everything have read app.config file suggests not right place either such variable. so should store data? guess put down txt or xml file, fine in case, not strike secure option , linking sql db seem on top what best practice in case pls? thank you if security extension doesn't matter serialize values file. json nice , simple (using json.net). if need have more allowances, make array instead of upper , lower. define class; public class allowances

docusignapi - DocuSign for Salesforce - Custom Button Code Email Subject and Messages for multiple recipients -

we have multiple recipients in our template workflow , different email subject , email message each recipient. have custom button code put customize subject , message initial recipient, need on how add different signers/roles. routing: order 1: broker 1 order 2: client 2 order 3: broker 1 here's current code: {!requirescript("/apex/dsfs__docusign_javascript")} //********* option declarations (do not modify )*********// var rc = '';var rsl='';var rsro='';var rros='';var ccrm='';var cctm='';var ccnm='';var crcl=''; var crl='';var oco='';var dst='';var la='';var cem='';var ces='';var stb='';var ssb='';var ses='';var sem='';var srs='';var scs ='';var res=''; //*************************************************// // modify individual options here: // custom email message (default in config) cem =

java - How to use AppBaseActivity and ActionBarActivity both in MainActivity -

i'm using theme i.e theme.appcompat.light.darkactionbar in application can action bar in main activity.for must extends mainactivity actionbaractivity.and register or unregister activity had created 1 separate class appbaseactivity can close activity @ time of logout. question java doesn't support multiple inheritance how can use these both classes in mainactivity. appreciated. use multilevel inheritance instead. extend appbaseactivity base activity actionbaractivity , extend other activity appbaseactivity . believe trick you.

javascript - How to add html/js query to gwt app using gwt-rpc? -

we have web client built gwt talks server via gwt-rpc. 1 part of app use html/js replace gwt gui , want part talk server not via gwt-rpc. ways there migrate gwt-rpc call work none gwt client? today send , receive java collections contain object graphs list of order objects have them self order detail objects , on. thanks your best bet using rest . data sent using json, part of javascript understood on client-side. on server side there shouldn't problems finding suitable library handle rest (ha-ha, it?). if you're using gwt on client , server side now, resty-gwt , jersey popular combo. there talk it on last gwt.create conference, it's starting point.

psr 4 - psr4 changes after upgrade have class not found symfony 2,4 -> 2,8 -

i use "symfony/symfony": "~2.4", , configuration "autoload": { "psr-0": { "": "src/", "mea":"vendor/", "mea":"vendor/mea/corebundle/", "place":"vendor/mea/" } }, i create new project "symfony/symfony": "2.8.x-dev", first error [invalidargumentexception] non-empty psr-4 prefix must end namespace separator. so add "autoload": { "psr-4": { "": "src/","mea\\":"vendor/", "mea\\":"vendor/mea/corebundle/", "symfonystandard\\": "app/symfonystandard/" } }, and have classnotfoundexception when try access classes in folder example : $a = \mea\pattern\view::inst(); give attempted load class "view" namespace "mea\pattern". did forget "u

java - ConcurrentModificationException with Maven 3.3.3 and Sonar Maven plugin 2.6 -

java 7 maven 3.3.3 sonar plugin 2.6 [02:41:27][com.company:company] [error] failed execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project company: null: mojoexecutionexception: concurrentmodificationexception -> [help 1] [02:41:27][com.company:company] org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project company: null [02:41:27][com.company:company] @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:216) [02:41:27][com.company:company] @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) [02:41:27][com.company:company] @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) [02:41:27][com.company:company] @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:116) [02:41:27][com.company:company] @ org.apache.maven.lifecycle.in

javascript - How to automatically sum input value boxes on each row in a HTML table -

i have html table columns of input boxes (quantity, price, discount , total). made js function adding many rows need. make total column, each row, display automatically value of formula: (quantity * price) - ( quantity * price * (discount/100)) . i tried numerous javascript code, have been unable correctly work. html: <table id="mytable"> <tr> <th width="65%"></th> <th align="center" width="5%">q<br>-ty</th> <th align="center" width="10%">price,</br>$</th> <th align="center" width="5%">discount,<br>%</th> <th align="center" width="15%">total, $<br>(without tax)</th> </tr> <tr> <td width="65%"><input class="left" size="100" type="text" name="description"></td> <td align="center" width="

ruby on rails - Redirect to Index if user is not logged in -

i have in application_controller.rb: private def require_user_signed_in unless user_signed_in? # if user came page, can send them back. otherwise, send # them root path. if request.env['http_referer'] fallback_redirect = :back elsif defined?(root_path) fallback_redirect = root_path else fallback_redirect = "/" end redirect_to fallback_redirect, flash: {error: "you must signed in view page."} end end and added in application.html.erb (the layout page) right after start of body: <% require_user_signed_in %> my question is how why not working? getting undefined local variable or method error. not calling method correctly? have define somewhere usable in layout erb? thank you. add method application_helper.rb instead or make helper method, if want keep in application_controller.rb , remove private , add following line helper_method :require_user_si

PowerShell - iterating over computer names in Active Directory -

i'm new powershell , i'm attempting write script query ad machine names, check ones responding , write output file. far have this: $computers = get-adcomputer -filter {(name -like "pc*")} | select-object -property name foreach ($computer in $computers) { if((test-connection -cn $computer -buffersize 16 -count 1 -ea 0 -quiet)) { "machine $computer connected." | out-file "out.txt" -append } else { "machine $computer not connected." | out-file "out.txt" -append } #end if } #end foreach what in output text file looks following: ... machine @{name=pc-0649} not connected. machine @{name=pc-1541} not connected. machine @{name=pc-1574} not connected. ... i think problem lies select-object -property name part of first line. running debugger, looks powershell formatting each iteration of $computer include header line. [dbg]: ps y:\>> $computer name

php - apache htaccess Header Set only working for static files -

i have php application directs urls don't point static file index.php (configured in .htaccess ) i added following configuration add header requests in .htaccess file, header applied urls go static files. header set access-control-allow-origin * what prevent header being applied index.php? so problem mod_header module wasn't working php fastcgi. started working after switching mod_php.

ruby on rails - Run `rake sunspot:solr:start` before `rake test` -

i forget run rails_env=test rake sunspot:solr:start before run rake test after reboot machine, or happen find myself in new environment. is there way me make sure solr running while run tests? either within test helper files, or perhaps rake magic hook tasks each other. our project uses sunspot_test . described(auto start|stop solr in test).

c# - Object Reference Error when adding Role to the User in ASP.NET Identity -

i developing asp.net mvc app , tried add role user following code: [httppost] [validateantiforgerytoken] public actionresult roleaddtouser(string username, string rolename) { applicationuser user = context.users.where(u => u.username.equals(username, stringcomparison.currentcultureignorecase)).firstordefault(); var account = new accountcontroller(); account.usermanager.addtorole(user.id, rolename); viewbag.resultmessage = "role created !"; var list = context.roles.orderby(r => r.name).tolist().select(rr => new selectlistitem { value = rr.name.tostring(), text = rr.name }).tolist(); viewbag.roles = list; return view("manageuserroles"); } but when usermanager calls addtorole function gives object reference error in account controller in method in following code: public applicationusermanager usermanager {

swift - App crashing only on Device -

this strange crash happens running on devices, while in simulator works normally. debugging line line, noticed occurs while append string value array of doubles. convert double using extension: extension string { func todouble() -> double? { return nsnumberformatter().numberfromstring(self)?.doublevalue } } so crashing line is: litros.append(temp_litros.todouble()!) //litros array , temp_litros string the error: fatal error: unexpectedly found nil while unwrapping optional value i don't understand why works in simulator , doesn't on devices. anyone have ideia happening here? in advance! crash report: incident identifier: 49f378a2-e7d9-4985-b208-99f529ae8813 crashreporter key: fe58b29412047d4d8980b9cb66ae017f1c2db7d5 hardware model: iphone7,2 process: nuvem [9479] path: /private/var/mobile/containers/bundle/application/8989627a-4064-428c-888b-c09f00a3ea0b/nuvem.app/nuvem identifier: br.com.gimenez.nuvem

scrapy - How to exclude certain paths of xpath without getting scraped? -

i tried scrap data neccesary, when trying exclude part not needed, unable that. please in scraping data necessary? case - 1: <div class="abc xyz"> <div class="aaaaaa bbbbbb"> "i dont want include this" </div> ***"i want scrap this"*** </div> case - 2: <div class="abc xyz"> <div class="aaaaaa bbbbbb"> </div> ***"i want scrap this"*** </div> both cases, output tried "i want scrap this". already tried scraping using './/div[contains(@class,"abc")]//text()' - in first case giving output "i dont want include thisi want scrap this", in second case expected output scraped. this 1 have garbage in result, job: result = response.xpath('//div[@class="abc xyz"]/text()').extract() result = "".join(result)

Rails 4 / RSpec - Create my own custom arguments to pass to include/exclude certain tests from running? -

my app uses braintree process payments. unfortunately fake_braintree gem depreciated current braintree api, forced hit braintree sandbox servers tests, extremely slow (if can issue or recommend alternative, that'd awesome too). my question is, group or tag tests hit braintree servers, , not run them default, , specify argument run tests including those? ideally i'd want 'rspec' command skip tests, , running 'rspec --include-braintree' run tests, including ones hit braintree servers. i feel happy medium don't sit around waiting on external api calls every time run test suite. yes, can use: # spec/spec_helper.rb rspec.configure |config| config.filter_run_excluding braintree: true unless env['braintree'] end mark test tag (or entire block if want): it "does stuff", braintree: true end and can do: braintree=1 rspec run tests including braintree tests

ios - Overriding default layer type in UIView in swift -

i want subclass uiview in swift, , use cashapelayer layer type subclass - overriding layer type layerclass(). how access properties in cashapelayer, not in calayer - such path in example below. code below not compile because path not member of calayer. override class func layerclass() -> anyclass { return cashapelayer.self } override func awakefromnib() { var path: uibezierpath = uibezierpath.init(ovalinrect: cgrectmake(0, 0, 30, 10)) self.layer.path = path.cgpath } note self.layer returns generic calayer inside uiview, have typecast specific class make sure has correct type. can following make sure call path cashapelayer not calayer class type. override class func layerclass() -> anyclass { return cashapelayer.self } override func awakefromnib() { guard let shapelayer = self.layer as? cashapelayer else { return } let path: uibezierpath = uibezierpath.init(ovalinrect: cgrectmake(0, 0, 30, 10)) shapel

c# - How do I actually store the randomly chosen word as a word? -

so working on hangman program. pull list of 126 different words , randomly select 1 of words. output "_" each character. but now, when i'm trying determine 'correct guess' of word, can't figure out how store value of randomly chosen word. sounds funny, have you. lol. string[] mywordarrays = file.readalllines("wordlist.txt"); random randomword = new random(); //int linecount = file.readlines("wordlist.txt").count(); int activeword = randomword.next(0, mywordarrays.length); string userselection = ""; console.writeline("are ready play hangman? yes/no: "); userselection = console.readline(); if(userselection == "yes") { foreach(char letter in mywordarrays[activeword]) { //the console.write(activeword) shows line number o.0. //when try print out .wri

java - Akka fire-forget on remote system delivers not all messages -

i've got following scenario: akka remote system a akka remote system b b analysis engine, sends brunch of fire , forget messages a. system b stops after it's analysis. but if b calls after it's analysis system.shutdown , not messages delivered a. actor system of b buffering messages? how i'm able ensure b messages in a's inbox? can determine, when it's safe b disconnect? how disconnect b a? thank advice! you create several child actors send messages , kill done sending messages. supervision wait child actors terminated , after shutdown system. imo should enough messages sent.

javascript - Can input value artribute be defined as empty? -

Image
i have following code: <input type = "text" value="" class="myclass"/> can value declared empty? in chrome debugger, appears following, doesn't correct however onkeypress event never fired. i'm guessing it's because "value" attribute looks bit weird , causing break, dont know sure. works in firefox. yes, can. var myinput = document.getelementbyid('ourinput'); if(myinput.value.length == 0) myinput.value = "empty"; note: myinput.value =="" too.

java - Limiting the number of connections to a server -

i have multi-threaded server in java, want limit number of connected clients 2. it's basic application, being used testing. on server have int userno attribute assigns clients value of either 0 or 1. my question is, there better way of handling this. want 2 clients connect, , want application ignore further requests. pseduo code: if(userno == 0) { player 1; } if (userno == 1) { player 2; } else { nothing } i this: int connectedclientcount = 0; // ... while(true) { serversocket ss = ... socket s = ss.accept(); if(connectedclientcount == 2) { // stuff tell connected client rejected because of max clients... } else { connectedclientcount++; // cool stuff... } } and somewhere else in code (which gets executed on client disconnect) public void clientdisconnected() { connectedclientcount--; } because of sake of simplicity don't use thread synchronization in example..

c++ - I use CRegKey to open some, but this m_hKey != 0 -

i want jdk path registry, path is: hkey_local_machine\\software\\javasoft\\java development kit\\1.8 when use: cregkey.open(hkey_local_machine, l"software\\javasoft\\java development kit\\1.8") it throws expression m_hkey != 0. what's happening ? how fix bug? here code: // java environment variable install path cregkey key; wchar_t javahome[40]; ulong szjavahome = 40; bool rest = key.open(hkey_local_machine, l"software\\javasoft\\java development kit\\1.8"); if (key.m_hkey == 0) messagebox(l"11"); rest = key.querystringvalue(l"javahome", javahome, &szjavahome); you cannot use cregkey variable key after trying open it, without checking return value of it. auto retopenkey = key.open(...); //long not bool if (error_success == retopenkey) { //ok stuff key } else auto err = getlasterror(); system error codes , / or formatmessage you can in implementation of function, , debug in there, inline in he

java - org.hibernate.criterion - I need to OR together an arbitrary number of criterion? -

i have java application using (quite old) hibernate mapping oracle 11 database. i'm using org.hibernate.criterion class generate queries (at least piece). i hit bug 1 of queries i'm generating using org.hibernate.criteria produces large 'in' clause. here's how java console displays generated query: select this_.foo foo_1_2_3, this_.bar bar_2_3_4, this_.id id_5_6_7 some_table inner join some_other_table inner join blah=bloo , this_.id in (?, ?, ?, ?, ?, ......................... ?, ?, ?, ?) order this_.id asc where number of ? elements >1000. this in clause large triggers ora-01795: maximum number of expressions in list 1000 error in our database. here's java code adds 'in' clause: criteria.add(restrictions.in("id", getmassivelistofids() ) ); (where i'm adding >1000 element in clause, in other words) according this stackoverflow question using multiple smaller 'in' clauses solution. makes sense. i'v

amazon web services - Upload files to s3 AWSCognitoCredentialsProvider ios -

i try upload file s3 , got next error message 2015-08-05 14:35:53.931 bellybuds[47981:2189296] upload failed: [error domain=com.amazonaws.awss3errordomain code=0 "the operation couldn’t completed. (com.amazonaws.awss3errordomain error 0.)" userinfo=0x7fd40a40d8f0 {hostid=wo/bhfvnqjguilic3ihl+jicvfeicur6m4hxz/nb9wrt/t09h16bbr77nkqkngzj, bucket=bbbname, endpoint=bbstagemusic.s3.amazonaws.com, message=the bucket attempting access must addressed using specified endpoint. please send future requests endpoint., code=permanentredirect, requestid=6d250a718c640210}] awscognitocredentialsprovider *credprovider = [[awscognitocredentialsprovider alloc] initwithregiontype:awsregionuseast1 identityid:[params valueforkey:@"identityid"] identitypoolid:[params valueforkey:@&qu

ruby - Why does `BasicObject` answer methods `superclass` and `class`? -

if object < basicobject , , #superclass , #class defined in object , how possible class < basicobject answers a.superclass , a.class ? a.ancestors : [a, basicobject] going further (according new answers): if a instance of object why doesn't have in ancestors? class b;end b.ancestors # => [b, object, kernel, basicobject] superclass might defined in kernel , a doesn't have kernel in ancestors. kernel included in object (from object.rb ): class object < basicobject include kernel end p.s git issue confused me enough ask it class < basicobject end here, class a instance of class class . a.class #=> class a answers .class , .superclass because class supports them. what thinking instance of a , in case: a.new (object doesn't support #inspect) =>

Global device variables in CUDA: bad practice? -

i designing library has large contingent of cuda kernels perform parallel computations. kernels acting on common object, computational grid, defined using c++ style objects. computational domain doesn't need accessed host side, creating on device side , keeping there makes sense now. i'm wondering if following considered "good practice": suppose computational grid class called domain . first define global device-side variable store computational domain: __device__ domain* d then initialize computational domain using cuda kernel __global__ void initdomain(paramtype p){ d = new domain(p); } then, perform computations using domain other kernels: __global__ void docomputation(double *x,double *y){ d->dothing(x,y); //... } if domain remains fixed (i.e. kernels don't modify domain once it's created), ok? there better way? tried creating domain object on host side , copying on device, turned out hassle because domain relativel

generics - Type inference and type bounds in Scala -

consider following classes: class type { def +(other:type):type = this} class subtype extends type now want create wrapper object takes binary function operating on type or derived types, let's start with: case class fct(f:(type,type) => type) i can instantiate fct class using _+_ apply method, cannot pass function using subtype class, expected: val f1 = fct(_+_) // ok val f2 = fct((x:subtype,y:type) => y) // error: found: (subtype, type) => type, required: (type, type) => type now can define fct using generics , type bounds accept subtypes: case class fct[t <: type, u <: type, v <: type](f:(t,u) => v) now f2 working expected, f1 not valid anymore, , don't understand why: val f1 = fct(_+_) // error: missing parameter type val f2 = fct((x:subtype,y:type) => y) // ok is there syntax accept both f1 , f2 ? edit (reply m-z) there way around variance issues factory? like: class fct(f:(type,type) => type) object fct

spring-integration is losing headers when sent to a subscriber -

i using spring-integration hornetq. problem have put custom header in message (method), when hits subscriber header no longer available. there sort of configuration property need setup preserve headers? an application receives message (i can see method header in console log know getting correct message). routes message onto outbound queue client can subscribe (if there cleaner way please let me know) <int:channel id="partschannel" /> <int-jms:message-driven-channel-adapter id="jmspartsinbound" acknowledge="transacted" destination-name="parts.in" channel="partschannel" connection-factory="jmsconnectionfactory" /> <!-- error-channel="partsinboundfailedchannel" --> <int-jms:outbound-channel-adapter id="jmspartsoutbound" destination-name="parts.out" channel="partschannel" connection-factory="jmsconnectionfactory&

javascript - node js server random crash -

i have node js server runing on digitalocean. server crashes without reason can catch, @ random times. error gives me: bash: line 1: 22671 killed bash -l -c '"node" "--nocrankshaft" "--nolazy" `node --version | grep -vqe "v0\..\." && echo --nodead_code_elimination` "--debug-brk=15454" "/root/server.js" if can put me on right direction solve great. try log, happens because have 500, in order don't offline can use forever or lib

c# - Best solution for async chicken and egg story -

i have been applying async best practices libraries. means: only use async when it's async (libraries shouldn't lie) define synchronous method if , if have faster synchronous method won’t dead lock. postfix async methods async i worked on library synchronous nature. means has sync methods. if user wants run work on separate thread ui thread, can using task.factory (responsibility of caller). however, inside handler / method / extensibility point, want show user message box. async method (for example, winrt showdialogasync ). gives following options: a. move async (so have option use await in our handlers , don't block anything). public async task mymethodasync() { await _messageservice.showasync(); } the advantage users can add async methods without having use .wait(). downside lying library (it's not async). i have considered making everything async, don't think that's idea either. make libraries lie prepare them in case need it. re

Sql server pivot table or inner join for daterange and sum column -

i have sql problem , not sure how go because i'm not expert in sql. my outcome is: **month | 2011 | 2012** 1 8894108.372544 9200915.88732 2 8987154.877656 8188366.52079 3 8135004.323592 9383008.68889201 4 8374239.052416 9660272.13007201 5 9525066.469164 8578163.904876 6 7475397.368328 8606525.720634 7 8992114.52414401 9365367.617496 8 9358753.61943 11048712.924366 9 8853398.95447799 8499947.810022 10 8577323.223498 9225470.14965 11 9265685.67622799 9226157.80527 12 8887908.50775001 8318114.32842 here sql. select month( ts.transactiondate) [transactiondate], isnull(sum(cast([saleprice] float)), 0) "sum([saleprice]) 2011", s.[sum([saleprice]]) 2012] [tablesales] ts inner join (select month( t.transactiondate) [transactiondate], isnull(sum(cast([saleprice] float)), 0) "sum([saleprice]) 2012" [tablesales] t [transactiondate] between '2012-01-01' , '2012-12-31' group month( t.transactiondate

momentjs - JavaScript - Detecting the difference between positive zero and negative zero -

this question has answer here: differentiating +0 , -0 8 answers i using momentjs calculate difference between 2 times. weird thing library difference between today , today 0. difference between today , tomorrow -0. my question is, how differentiate between 0 , -0. seems javascript treats them same. so example if write following code: if (tomorrow === -0) console.log('it tomorrow!'); else if (tomorrow === 0) console.log('it today!'); here's example on jsfiddle how handles returned values (i in australia depending on in word may have adjust today , tomorrow dates) 1/val > 0 want. returns true positive , false negative. this works because 1/-0 returns negative infinity, , 1/0 returns positive infinity, comparable. 1/val == infinity .

javascript - Keypress event not triggered sometimes -

when hit ~ , other punctuation keys ('``´) , keypress event not triggered. this makes attempt keycode , string.fromcharcode fail , validation fails well. need return false when script detects these chars is there way work? there workaround? obs: i'm using chromium on ubuntu usually use keydown this you can know more here : https://api.jquery.com/keydown/ $("#id").keydown(function(ev){ console.log(ev); });

javascript - jQuery I cant get both zip lists to show up on map -

here code: jquery(document).ready(function() { var nhzips="77014, 77015, 77032, 77060, 77064, 77067, 77065, 77066, 77068, 77069, 77070, 77073, 77090, 77301, 77302, 77304, 77338, 77354, 77355, 77362, 77373, 77375, 77377, 77379, 77380, 77381, 77382, 77384, 77385, 77386, 77388, 77389"; var nehzips="77032, 77044, 77336, 77339, 77345, 77346, 77347, 77357, 77365, 77396"; var acworthzips="30101, 30102" $("#nhzips").html(nhzips); $("#acworthzips").html(acworthzips) var searcharr = [[nhzips+", "+nehzips,"north-houston"]]; $( "#zipform" ).submit(function() { var inarray=false var searchval=$("input.search-box").val(); (var i=0;i<searcharr.length;i++){ searchstr=", "+searcharr[i][0]+","; gotoloc=searcharr[i][1]; if(searchstr.indexof(", "+searchval+",")>=0){ $( "a#pric-loc-btn" ).a

c# - WIX: Unable to perform Major Upgrade using Orca at run time -

i using wix create msi file . problem if change package code , product code without changing upgrade code using orca , not doing major upgrade previous version , rather creates new independent instance. when create new msi same upgrade code upgrades previous instance rather creating new one. below product.wxs <?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/utilextension"> <product id="*" name="prananirvana" language="1033" version="1.7.1.35" manufacturer="nirvana solutions" upgradecode="5f546b4e-65b3-42d3-b4f3-f7153319dedc"> <package installerversion="200" compressed="yes" installscope="permachine" /> <majorupgrade downgradeerrormessage="a newer version of [productname] installed." allowsameversionupgrades=&quo

angularjs - Placing HTML within directive tags -

so far, i've been adding html directive via template/templateurl, wanted able vary template of directive based on page called on. looked online , saw mention of putting html directly in directive tags (in main html file), , i've done that, of code put in html works off root scope rather directive scope, when spoke said should work off directive scope. is there way bind html in directive tags not imported templates directive scope they're in? or have separate different file , import via templates? basically, can this: <setup-itemized> <input type="text" ng-model="si.value"> </setup-itemized> where si.value defined , setup in setupitemized directive rather in root scope? http://plnkr.co/xcuzuromv8ydykhwnhfi there many ways achieve that, take example: http://jsbin.com/sasexum/edit?html,js,console,output index.html <div ng-controller="mainctrl ctrl"> <setup-itemized value="ctrl.

asp classic - CreateObject randomly fails since recent windows security update that does not seem related -

we use mswc.browsertype (browscap.dll) in our classic asp website identify user agents. since july 21 our code began throw server.createobject failed errors when trying create object. works of time, randomly fails several times each day. i on vacation when problem began, know didn't change in our code or system configuration, thing see windows update kb3079904 installed on july 21, not seems related because font driver !? i wonder if else have same problem or have idea how solve it, did research intermittent createobject failing didn't find relevant. i may try restore system checkpoint before update see if cause, important security update , have re-install after may not solve problem. it turned out related other post, object creation failed because component uses cookie collection. response.cookies collection seems corrupted , causes error

arrays - Classic Linker Mach error in C++ -

i don't know c++ , i'm teaching myself adt's , data structures. unfortunately every time need compile code classic xcode error: mach link error. tend understand these errors when they're in objective-c (because means i'm missing file). made sure add file target avoid issue, didn't seem work. neither did classic turn xcode on , off trick. below error , code: undefined symbols architecture x86_64: "arraybag<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::getindexof(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from: arraybag<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::remove(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in main.o "arraybag<i

unit testing - Karma error - Unknown provider: $$asyncCallbackProvider -

trying run karma test through grunt getting error: error: [$injector:modulerr] failed instantiate module ngmock due to: error: [$injector:unpr] unknown provider: $$asynccallbackprovider i removed 'nganimate' not resolve it. how can run grunt karma test without error? i had same problem now, , fixed making sure version of angular-mock dependancy same angular. you can in bower.json file (change "angular-mocks": "~1.3.0" "angular-mocks": "^1.3.0" or specific version).

c# - how to get Json nested properties to primary one -

i have below scenario: this class structure : public class user { public string firstname { get; set; } public string lastname { get; set; } public system.collections.objectmodel.collection<likes> likes { get; set; } } public class likes { public string sport { get; set; } public string music { get; set; } public string food { get; set; } public string place { get; set; } } when serialize object of user class generate below json string : {"firstname":"naresh", "lastname":"parmar", "likes": [{"sport":"cricket", "music":"classic", "food":"gujarati", "place":"india"}] } i want generate above json string below: {"firstname":"naresh", "lastname":"parmar", "sport":"cricket", "music":"class

java - Serial ports writing/reading in linux -

Image
i need implement communication between 2 devices through serial ports on raspberry pi (with last raspbian on board). both uses cp2102 controller , connected pi. terminal: pi@pi ~ $ ls -l /dev/serial/by-id total 0 silicon_labs_cp2102_usb_to_uart_bridge_controller_0001-if00-port0 -> ../../ttyusb2 pi@pi ~ $ ls -l /dev/serial/by-path total 0 platform-bcm2708_usb-usb-0:1.2.1:1.0-port0 -> ../../ttyusb1 platform-bcm2708_usb-usb-0:1.2.4:1.0-port0 -> ../../ttyusb2 platform-bcm2708_usb-usb-0:1.3:1.0-port0 -> ../../ttyusb0 normally when send command serial a, device replies through serial , sends data through serial b. after need retranslate data device b (serial c) , receive answer serial c. the problem serial reply appears on serial b , serial b data appears on serial a. i've tried different languages , serial libraries result same. questions are: why happening when using raspberry pi? how can implement functionality on raspberry pi? p.s. both devices working