Posts

Showing posts from June, 2014

c# - Error after upgrading ASP.Net WebAPI nuget package -

i have updated webapi nuget package 5.2.2 5.2.3 , started getting error, the type 'system.web.http.apicontroller' exists in both 'c:\program files (x86)\microsoft asp.net\asp.net mvc 4\assemblies\system.web.http.dll' , '\packages\microsoft.aspnet.webapi.core.5.2.3\lib\net45\system.web.http.dll' i tried cleaning solution/deleting reference , stuff not working. please help. update#: reverting packages helped. still not sure if missed in upgrade. i got same problem when getting microsoft.aspnet.webapi. at nuget package manager console write this: update-package -projectname 'yourprojectnamegoeshere' -reinstall this update packages , solve problem.i hope helps

java - Getting statistics from resultset -

i have resultset returns 5 values. set data in pojo, , added pojo list. datapojo = new outputviewdatapojo(); datapojo.settime(resultado.getint(1)); datapojo.setcommanddesc(resultado.getstring(2)); datapojo.setokerror(resultado.getstring(3)); datapojo.setresultdesc(resultado.getstring(4)); datapojo.setresultcode(resultado.getint(5)); listpojo.add(datapojo); [description:call connect, timestamp:0, okerror:ok, resultcode:0, resultdesc:null.] [description:waiting open complete, timestamp:2468, okerror:ok, resultcode:0, resultdesc:null.] [description:reading card, timestamp:0, okerror:ok, resultcode:0, resultdesc:null.] [description:waiting read card, timestamp:10329, okerror:ok, resultcode:0, resultdesc:null.] [description:reading card, timestamp:0, okerror:ok, resultcode:0, resultdesc:null.] [description:waiting read card, timestamp:6671, okerror:ok, resultcode:0, resultdesc:null.] [description:reading card, timestamp:0, okerror:ok, r...

php - isset() not giving expected results -

i have form <form action="addnote.php" method="post"> <input type="hidden" name="tid" <?php echo"value='$id'"; ?> > <div class="input_fields_wrap1"> <label>note</label> <input type="text" id="coa" name="notes[]" > <button class="add_field_button1">add more notes</button> </div> <label>next call date</label> <input type="date" name="call" > <div class="form-group"> <label class="col-md-3 control-label" for="example-text-input"></label> <div class="col-md-3"> <input input type="submit" value="submit " > </div> </div> </form> and php code <?php include 'db.php'; $id...

css - How can I align my logo and menu icon on a mobile device -

i using wordpress , have responsive theme using well. when view website on mobile device, menu turns icon 3 horizontal lines; slide out menu. on mobile device menu above 3 lines towards left instead of them aligning with each other. this code menu icon: .section-navi .pl-nav > li > { line-height: 50px; padding: 0 13px; /* opacity: .7; */ } and code logo: .section-navi .navi-container { height: 36px; padding: 7px; } please visit: surveillanceshack.com , view on mobile device. try adding following code: you might pick suiting @media query here , if you're targeting iphones. almost every phone starts @ min-device-width: 320px , it's decide want top limit. // iphone 5 & 5s in portrait & landscape @media screen , (min-device-width: 320px) , (max-device-width: 568px) { .section-navi .navi-container { min-height: 50px; padding-right: 0; box-sizing: border-box; text-align: left; } } ...

rabbitmq - Is it good practice to create AMQP queues manually or programmatically? -

i'm in process of implementing various remote methods/rpcs on top of amqp (rabbitmq in particular). when worker (or client) comes online, could, in theory, declare (create) queue on exchange. other approach start using queue , assume exists on exchange. which approach more common? creating queues manually has higher administrative cost, maybe; however, can result in more consistent environment if decouple queue management queue usage. it depends requirement. if have fixed number of queues , dont need generated dynamically, go manual. example : integration application , know have 3 consumers a,b,c manually create 3 queues. example in chat application every logged in user want create queue, in case queues should created programatically. , in case manual creation, have more control implement permissions , acls.

datagridview - How To Move Row In DataBound DataGrid In C# without Knowing The Object Type -

i have number of datgridgs want able reorder rows for. sortablebindinglist<> : list<> types contain different objects. tried casting datagridview's datasource sortablebindinglist<object> .removeat() & .insert() cast failed. tried pass object type function using type failed. type objtype; ... var x = (sortablebindinglist<objtype>) datagridview.datasource; but doesn't work either, nether 'typeof(objtype)`. not sure how proceed. turns out can dynamic types. dynamic list = dgv.datasource; var item = list[rowindexfrommousedown]; list.removeat(rowindexfrommousedown); if (rowindexofitemundermousetodrop == -1) list.add(item); else list.insert(rowindexofitemundermousetodrop, item);

xml - Do current CKAN instances in the field support the JSON-LD DCAT format? -

i'm working on graduate course project develop query client ckan , dcat catalogs. i've read lot of documentation , specs, yet lot of things seem still proposals figured needed reach out ask knows. the project open data site discusses dcat format json-ld based format particular schema. schema makes sense there lot of push in class around targeting federal government data data.gov , runs ckan (as many of these data sharing systems according research). everywhere i'm looking, people suggesting ckan supports dcat, i'm not finding that. for instance, http://catalog.data.gov/api/3/action/package_show?id=national-stock-number-extract shows different json format. appears have values used translate json-ld dcat object. the following properties in dcat schema, of document doesn't conform. looks of translation json-ld dcat. { key: "bureaucode", value: [ "007:15" ] }, { key: "accrualperiodicity", value...

php - update multiple columns in mysql database using $_GET -

i want update 3 fields in row in 3 columns don't know how it. searched google , searcedh here couldn't find solution it. want change title , paragraph , category of blog post using $_get using way: <?php $id = $_get['id']; ?> <div class="middle"> <div class="content" style="width:100%;"> <div class="context" style="width:100%"> <?php if(isset($_post['submit'])){ $title = $_post['title']; $txt = $_post['txt']; $query = ("update tbl_post set title='$title' id=$id"); $query = ("update tbl_post set txt='$txt' id=$id"); when use 1 of $_title or $_txt , works. couldn't find way update both fields , couldnt update category selection. full code of update.php page : <?php require_once("config.php"); ?> <?php require_once("header.php"); ?> <?php $id = $_get[...

python - POST request results in "internal server error", most of the times but not all (!?) -

edit: tl;dr: how post image using python request flask app can use opencv manipulate it? long version of question , stuff i've tried out: i trying post image 1 python flask app another. problem facing seems work sometimes, not. app receives data: @app.route("/post", methods=['get', 'post']) def post(): print "in post" req = request.files['file'] # req = open('pug.jpg', 'r+b') arr = np.asarray(bytearray(req.read()), dtype=np.uint8) img = cv2.imdecode(arr,-1) # 'load is' print img cv2.imwrite('result.png',img) return "hello" app sends data: def hello(): url = 'http://ip_address/post' #this image not work image = open('path/to/image/pug.jpg', 'r+b') #but image work!? #image = open('path/to/image/res_tile.png', 'r+b') files = {'file': image} r = requests.post(url, files=fi...

spring - SpringBatch - how to set up via java config the JsonLineMapper for reading a simple json file -

how change "setlinetokenizer(new delimitedlinetokenizer()...)" "jsonlinemapper" in first code below? basicaly, working csv want change read simple json file. found threads here asking complex json not case. firstly thought should use diferent approach csv way, after read sbiach05sample.pdf (see link , snippet @ bottom), understood flatfileitemreader can used read json format. in almost similiar question , can guess not in wrong direction. please, trying find simplest elegant , recommended way fixing snippet code. so, wrapper below, unless obligated work way, seems go further. additionally, wrapper seems me more java 6 style tentative takes advantage of anonimous method java 7 (as far can judge studies). please, advise higly appreciated. //my code @bean @stepscope public flatfileitemreader<message> reader() { log.info("itemreader >>"); ...

node.js - How to pass multiple arguments in node imagemagick module convert function -

i using node imagemagick module's convert function when using command through terminal working fine convert /home/manish/downloads/new_images/slim_fit_double_breasted_coat_base.png /home/manish/desktop/medium-vichy-9274-fabric-gauloise-058.jpg \( -clone 0 -auto-level \) \( -clone 1 -clone 0 -alpha set -virtual-pixel transparent -compose displace -set option:compose:args -5x-5 -composite \) fabric2.png but when passing same command in node module not giving expected result. here code var im = require('imagemagick'); im.convert(['/home/manish/downloads/new_images/slim_fit_double_breasted_coat_base.png','/home/manish/desktop/green-flower-lavender-eye-pillow-fabric.jpg', '-clone', '0', '-auto-level','-clone','1','-clone','0','-alpha' , 'set' ,'-virtual-pixel','transparent','-compose','displace','-set','option:compose:args -5x-5 ...

stl - unlocking std::unique_lock without destroying it -

if create unique_lock below, can unlock without destroying or getting out of scope? in other words safe/acceptable? std::mutex queuemutex; // understanding locks mutex std::unique_lock<std::mutex> lk(queuemutex); { // critical section } // unlocking properly, or have pop stack? lk.unlock(); thx! it safe , acceptable, calling unlock() unlock mutex , make unique_lock forget not unlock again in dtor. having said that, scoping preferable in cases readability because if function/scope long , unlock inside if or conditional construct might hard reader follow.

web services - How to document a metro based JAX-WS application -

Image
i've developed jax-ws web services using metro implementation. now want add these web services somehow documentation. metro, itself, generates "simple" doc html file, includes location of wsdl , more. so i've been doing research , i've found enunciate, helps generate documentation , web services' client(s) in several programming languages (which reeaaally helpful). i'm interested in generation of documentation, time being. can see supports apache cxf, jax-ws, jax-rs doesn't support metro, or haven't been able find plugin. so, able generate documentation web services? is there other tool generate documentation of jax-ws application (metro based)? thank in advance enunciate have found indeed powerful, goes beyond documenting service. however, if searching documentation, there neat tool our team using quite time - tomi vanek's wsdl viewer . it simple use, attach provided .xsl file in addition existing .wsdl file, enhance ....

c# - Correct Position For Specific Code, Controller, Model or somewhere else -

i have started learning c# mvc 5 room inventory project working on work. using active directory authenticate users , store these details in database can assign users rooms , tenancies have items assigned them. i used stock mvc 5 template comes visual studio 2013 have month project coming in no previous knowledge , dont have time code fancy looking html / css front end , relying on comes out of box. i have written code once user logged on using form authentication linked ad runs check see if user exists in database, if not creates one, if does, checks see if has been set inactive , reactivates if needed. i have placed code in accountcontroller under login httppost action. new mvc wanted check see if correct position, or if should create new class functionality, or if should in model area create database using entity framework code first. best practice? here code , in advance help. apologize long winded post , less stellar code. dont hold criticism rather right make mistakes ...

How to know whether a file copying is 'in progress'/complete in java (1.6) -

this question has answer here: java nio watcher: how detect end of long lasting (copy) operation? 2 answers i writing directory monitoring utility in java(1.6) using polling @ intervals using lastmodified long value indication of change. found when polling interval small (seconds) , copied file big change event fired before actual completion of file copying. i know whether there way can find status of file in transit, complete etc. environments: java 1.6; expected work on windows , linux. there 2 approaches i've used in past platform agnostic. 1/ ftp transfers controlled put, may not directly relevant. basically, whatever putting file file.txt will, when it's finished, put small (probably zero-byte) dummy file called file.txt.marker (for example). that way, monitoring tool looks marker file appear and, when does, knows real file complete...

Is there any way to restrict access by configuring in WildFly? -

is there way restrict access configuring in wildfly. know whether can add list of ips can access server? there way blacklist ips in server level? i checking feature this: http://boseca.blogspot.in/2010/12/programmatically-addremove-ip-security.html you can implement ip filter on jboss level adding filter-ref , expression filter shown below <subsystem xmlns="urn:jboss:domain:undertow:3.0" statistics-enabled="true" instance-id="instanceid"> <buffer-cache name="default"/> <server name="default-server"> <ajp-listener name="ajp" max-connections="1200" write-timeout="600000" read-timeout="30000" allow-equals-in-cookie-value="true" record-request-start-time="true" socket-binding="ajp"/> <http-listener name="default" allow-equals-in-cookie-value="true" socket-binding=...

javascript - Update data on the form / tokens -

what wnat build : (first must havent got accounts on web site) example have form input field every 1 can fills, after can submit form , if correct forwarded page !that contains! url filed form (previous page form filled) easy explaine : fills form click submit button if ok go page contains button url filed form (for example if want fix data on it) problem : how build this, if havent got users own form. have heard tokens never worked them. can ? can me ? forward me right way

javascript - Ember CLI- conditional output within an each loop using a component instead of itemController -

in ember cli app, i'm using {{#each}} helpers output rows of table. 'name' 'created_date' , 'type' defined in related model. {{#each model |job|}} <tr> <td>{{job.name}}</td> <td>{{job.created_date}}</td> <td>{{job.type}}</td> <td> {{#if typezero}} <p>content display if value of 'type' 0.</p> {{/if}} </td> </tr> {{/each}} in fourth table cell of each row, i'd display content if value of 'type' record 0. i first tried adding itemcontroller each helper: {{#each job in model itemcontroller="jobrowcontroller"}} ...... {{/each}} this gave me error: "uncaught error: assertion failed: value #each loops on must array. passed ***@controller:array:, should have been arraycontroller" i found itemcontroller deprecated, , components should used instead . i created component named job-table-row...

windows 7 x64 - QVTKWidgetPlugin in QT Creator 5.4 -

i'm working qt 5.4 , vtk 6.2 have problems qvtkwidgetplugin . specifically, can see qvtkwidget option in qt designer don't see in qt creator when work file .ui . copied qvtkwidgetplugin.dll in c:\qt\5.4\msvc2013_64\bin , in c:\qt\5.4\msvc2013_64\plugins\designer , qvtkwidgetplugin.lib in c:\qt\5.4\msvc2013_64\lib don't know wrong. please! thanks! :) p.s.: work on windows 7 x64 first, need make sure compiling plugin same settings used compile qt creator, may not same the ones using (qt version, visual studio version, 32/64bits). to see information, in qt creator go help, , select qt creator. tell settings used compile it. example, downloaded qt5.6 vs2015 64 bits, included qt creator (v3.6.1) compiled using qt5.6 vs2013 32bits. can see, not compiled using same toolset installed.

ios - Unable to set Size defaults in Swift 2.0 Spritekit -

i in process of migrating game ios 9, swift 2.0 , xcode 7.3. in following section attempting set default anchorpoint t0 0.5. doesn't want work. the follow code inside gamescene:skscene class file. override init(size: cgsize) { super.init(size: size) anchorpoint = cgpoint(x: 0.5, y: 0.5) } required init?(coder adecoder: nscoder) { fatalerror("init(coder:) has not been implemented") } i getting below error: fatal error: init(coder:) has not been implemented: you have write (and initialize of own variables): required init?(coder adecoder: nscoder) { super.init(coder: adecoder) }

unity3d - How to load image from resource folder and set it to source image of UI Image in unity5 -

how load image resource folder , set image source image of ui image? place sprite in folder begins resources, e.g. mine in "resources/images/test" [serializefield] private unityengine.ui.image image = null; private void awake() { if( image != null ) { image.sprite = resources.load<sprite>( "images/test" ); } } http://docs.unity3d.com/462/documentation/scriptreference/ui.rawimage.html http://docs.unity3d.com/scriptreference/resources.load.html

jquery - How to increase page speed for my website -

how optimize website?how increase page speed. have done minified javascript , css. done images optimzation.but still google penalizing pages. there many ways can increase page speed of website, include - minify css minify js minify html compress images defer loading javascripts use browser caching compressing using gzip

Kibana and groovy scripting -

i looking way calculate ratio on kibana. after many researches found way : using "json input" feature in visualisation. i have informations in index, 2 types of documents (boots , reboots). i looking script count number of documents type boots, same reboots type divide second first. sounds easy, not find way after researches, , not used groovy enough yet myself. i found many ways manipulate documents values (doc['mydocname'].values etc), nothing type. thanks in advance. edit : tried this { "aggs" : { "boots_count" : { "value_count" : { "_type" : "boots" } } } } supposed count number of fields (here field _type) in index. when put "json input" in visualisation, results in error : error: request elasticsearch failed: {"error":"searchphaseexecutionexception[failed execute phase [query], shards failed; shardfailures {[bbxj0o6trxa_ocybfycgjq][informationbe][0]: searchparseexc...

html - How to enable title bar in Cordova Application? -

below code... not able enable title bar in application. how enable ? config.xml <widget id="com.example.hello" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <preference name="loglevel" value="debug" /> <feature name="whitelist"> <param name="android-package" value="org.apache.cordova.whitelist.whitelistplugin" /> <param name="onload" value="true" /> </feature> <allow-intent href="market:*" /> <name>helloworld</name> <description> sample apache cordova application responds deviceready event. </description> <author email="dev@cordova.apache.org" href="http://cordova.io"> apache cordova team </author> <content src="index.html" /> ...

ruby - How do I transfer from using state_machine to assm? Rails App -

i have code written using state_machine gem how make equivalent code using assm gem? state_machine :state, initial: :pending after_transition on: :accept, do: :send_acceptance_email state :requested event :accept transition => :accepted end end this whats done after accepting friendship request def self.request(user1, user2) transaction friendship1 = create!(user: user1, friend: user2, state: 'pending') friendship2 = create!(user: user1, friend: user2, state: 'requested') friendship1.send_request_email friendship1 end end def send_request_email usernotifier.friend_requested(id).deliver end def send_acceptance_email usernotifier.friend_accepted(id).deliver end user.rb has_many :friends, through: :user_friendships, conditions: { user_friendships: { state: 'accepted' } } has_many :pendi...

python - Use regex to process log file: combine regex expressions -

i have file contains string output shown in code below. want extract data: how use regex achieve this? can combine 2 regex expressions using one? i need ignore "dropped" string well port: dropped-packets s1-eth1: 21 s1-eth2: 12 ... processqdisc.py output = ''' qdisc pfifo_fast 0: dev eth0 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 sent 47002846 bytes 549464 pkt (dropped 0, overlimits 0 requeues 1) backlog 0b 0p requeues 1 qdisc htb 5: dev s2-eth2 root refcnt 2 r2q 10 default 1 direct_packets_stat 0 direct_qlen 1000 sent 25845 bytes 186 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 qdisc htb 5: dev s2-eth3 root refcnt 2 r2q 10 default 1 direct_packets_stat 0 direct_qlen 1000 sent 24941 bytes 182 pkt (dropped 0, overlimits 0 ...

javascript - Jquery autocomplete - how modify returned data -

i have code this: $(document).ready(function () { if ($('#au').length <= 0) { return; } var $project = $('#au'); $project.autocomplete({ minlength: 4, source: function (request, response) { $.ajax({ datatype: "json", type: 'post', cache: false, data: {term: request.term}, url: '/movies/ajax/', success: function (data) { if (isnan($('#au').val())) { response($.map(data, function (item) { return { label: item.movies__name + " " + "(" + item.movies__id + ")", value: item.movies__name } })); } else { response($.map(data, func...

in metaworks, when I use TreeFace.ejs, Error message 'Please add @Name for the nameField to...' in metaworks3 application -

eventhough have added @name field in domain class, error message treeface.ejs (actually treenodeface.ejs) couldn't find name field. there must getter , setters, found have missed defining setter in case: @name @face(displayname = "name") public string getdisplayname() { return displayname } after adding setdisplayname(string dispname), error has been gone.

image - Scrape a jpg file on webpage, then saving it using python -

ok i'm trying scrape jpg image gucci website. take 1 example. http://www.gucci.com/images/ecommerce/styles_new/201501/web_full/277520_f4cyg_4080_001_web_full_new_theme.jpg i tried urllib.urlretrieve, doesn't work becasue gucci blocked function. wanted use requests scrape source code image , write .jpg file. image = requests.get("http://www.gucci.com/images/ecommerce/styles_new/201501/web_full/277520_f4cyg_4080_001_web_full_new_theme.jpg").text.encode('utf-8') i encoded because if don't, keeps telling me gbk cannot encode string. then: with open('1.jpg', 'wb') f: f.write(image) looks right? result -- jpg file cannot opened. there's no image! windows tells me jpg file damaged. what problem? i'm thinking maybe when scraped image, lost information, or characters wrongly scraped. how can find out which? i'm thinking maybe information lost via encoding. if don't encode, cannot print it, not mention wri...

objective c - Not able to add .pch file in iOS 8 -

Image
i trying add .pch file in xcode project ios sdk 8.3, getting error: no such file or directory: '/users/classic/downloads/appname/appname/appname-prefix.pch' i following link: pch file in xcode 6 can help? try below code : goto > project > build settings > apple llvm 6.1 language set precompile prefix header : yes prefix header : paste file name here (eg sample-prefix.pch) . given in below image . note: select combined in level easy understand . showing in below image :

R data.table multi column recode/sub-assign -

this question has answer here: fastest way replace nas in large data.table 7 answers let dt data.table: dt<-data.table(v1=sample(10), v2=sample(10), ... v9=sample(10),) is there better/simpler method multicolumn recode/sub-assign this: dt[v1==1 | v1==7,v1:=na] dt[v2==1 | v2==7,v2:=na] dt[v3==1 | v3==7,v3:=na] dt[v4==1 | v4==7,v4:=na] dt[v5==1 | v5==7,v5:=na] dt[v6==1 | v6==7,v6:=na] dt[v7==1 | v7==7,v7:=na] dt[v8==1 | v8==7,v8:=na] dt[v9==1 | v9==7,v9:=na] variable names arbitrary , not have numbers. many columns (vx:vx) , 1 recode pattern (name==1 | name==7, name:=something). and further, how multicolumn subassign na's else. e.g in data.frame style: data[,columns][is.na(data[,columns])] <- a_value you use set replacing values in multiple columns. based on ?set , fast overhead of [.data.tab...

python - Creating an image from a dictionary using PIL -

i have dictionary maps coordinate tuples (in range (0,0) (199, 199) grayscale values (integers between 0 , 255.) there way create pil image has specified values @ specified coordinates? i'd prefer solution uses pil 1 uses scipy. as martineau suggests putpixel() ok when you're modifying few random pixels, it's not efficient building whole images. approach similar his, except use list of ints , .putdata() . here's code test these 3 different approaches. from pil import image random import seed, randint width, height = 200, 200 background = 0 seed(42) d = dict(((x, y), randint(0, 255)) x in range(width) y in range(height)) algorithm = 2 print('algorithm', algorithm) if algorithm == 0: im = image.new('l', (width, height)) in d: im.putpixel(i, d[i]) elif algorithm == 1: buff = bytearray((background _ in xrange(width * height))) (x,y), v in d.items(): buff[y*width + x] = v im = image.frombytes('l'...

swift - Can I change the Associated values of a enum? -

i reading swift tour document, , facing problem. here code: enum simpleenum { case big(string) case small(string) case same(string) func adjust() { switch self { case let .big(name): name += "not" case let .small(name): name += "not" case let .same(name): name += "not" } } } the function adjust() won't work, wonder if there way change associated value of enum, , how? your immediate problem you're attempting change value of immutable variable (declared let ) when should declaring var . won't solve particular problem though since name variable contains copy of associated value, in general need aware of. if want solve this, need declare adjust() function mutating function , reassign self on case case basis new enum value associated value composed old 1 , new one. example: enum simpleenum{ case big(string) case small(...

node.js - Express app - Host on Heroku and use Parse as backend -

for express app want use parse handle data. parse's hosting options web apps seem limited (caped @ 500 files , 500mb), want use heroku host app. have managed set express app on heroku, can not quite figure out how access parse app in it. i've searched around, there not seem documentation on this, , struggling work. here index.js express app: var express = require('express'); var bodyparser = require('body-parser') var app = express(); app.set('port', (process.env.port || 5000)); app.use(express.static(__dirname + '/public')); // views directory template files app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.use(bodyparser.urlencoded({ extended: true })); app.use(bodyparser.json()); app.get('/', function(request, response) { response.render('pages/public'); }); app.get('/login', function(request, response) { response.render('pages/login');...

ios - Accessing MKLocalSearchResponse item (swift) -

when println(localsearchresponse) , mapitem object, includes ton of details location. in example, ucsd. here output showing in log. <mklocalsearchresponse: 0x1c53d640> { boundingregion = "<center:+32.87514836, -117.23958822 span:+0.00725621, +0.00825332>"; mapitems = ( "<mkmapitem: 0x1c538090> {\n iscurrentlocation = 0;\n name = \"university of california, san diego\";\n phonenumber = \"+18585342230\";\n placemark = \"university of california, san diego, 9500 gilman dr, la jolla, ca 92093-5004, united states @ <+32.87529400,-117.23961000> +/- 0.00m, region clcircularregion (identifier:'<+32.87514837,-117.23958825> radius 557.57', center:<+32.87514837,-117.23958825>, radius:557.57m)\";\n url = \"http://www.ucsd.edu\";\n}" ); } notice how outputs placemark = university of california... , has address? how value , store variable? here c...

Symfony 2 - Generate PDF with Knp-Snappy output HTML -

i have problem knp-snappy bundle in symfony2 project. followed link install : http://knpbundles.com/knplabs/knpsnappybundle . whenever click on link generate pdf twig view, renders me html page , doesn't generate pdf. here's print part of controller. $html = $this->renderview('pacescollebundle:classement:generationpdf.html.twig', array( "passercolles" => $passercolles, "colle" => $colle, "moyenne" => $moyenne, "mediane" => $mediane, "effectif" => $effectif, "note100" => $note100 )); return new response( $this->get('knp_snappy.pdf')->getoutputfromhtml($html), 200, array( 'content-type' => 'application/pdf', 'content-disposition' => 'attachment; filename="classement.pdf"' ) ); my gues...

javascript - How to make HTML form fields automatically change when an option selected on a select field -

let's have form in codeigniter project. <?php echo form_open(); ?> <select> <?php foreach($status_list $status): ?> <option value="<?php echo $status->id; ?>"><?php echo $status->name; ?></option> <?php endforeach; ?> </select> <!-- show if status type is, let's "e" --> <input type="text" name="e_happened"> <!-- show if status type is, let's "s" --> <input type="text" name="s_happened"> <?php echo form_close(); ?> what want if user select 1 status, according it's type, show text field input. i've made way type of status this: http://localhost/myapp/index.php/status/type/ {status_id} users can pass status id , "echo" type of status. i want receive html page via javascript method , show text input fields. how do that? thank you. :) ...

android - Samsung Galaxy E5/S5 ADB -

i have question first: have root samsung galaxy e5? bought yesterday because want pursue career in android app development, since laptop slow handle avd. next, have spent 3 hours searching how make phone emulator in projects in eclipse. used last year, then, old phone rooted. what have tried: installed android studio , eclipse (i though android studio faster installed it, realize should stick eclipse). installed sdk. installed google driver. windows 8.1 automatically installed driver phone, why when plug in laptop, card , phone memory storage pops up! i tried installing this: https://www.youtube.com/watch?feature=player_embedded&v=lbaq6d2du0u i discovered path sdk, c:\users\myuser\appdata\local\android\sdk\platform-tools , performed command: adb devices listed no device. that's all. when plug in phone, there's no other options, media , camera something. so, have root it? i'm afraid warrant might voided rooting phone. you should install samsun...

ejb 3.0 - circular ejb dependencies: what does the spec say? -

i know experience injection of circular dependencies in ejb work, @ least in application servers. i've done multiple times self-injection (e.g. ejb proxy @transactionattribute, @rolesallowed, @asynchronous etc. work). i've done more complex graphs (a->b->a etc.), work too. i've done @ least in glassfish 3/4, weblogic, , jboss 7.3. maybe weblogic, not sure. now, i've been trying find precise guarantee specification, without success. there provisions in cdi, couldn't find explanation on why works ejbs. there indirect one, maybe? i'm looking references ejb specifications regarding this. i don't believe ejb specification explicitly disallows self-injection, means implicitly allows since there no reason bean's own interface different interface of other ejb. in practice, self-injection can work stateless (and singleton in ejb 3.1) , not stateful since each lookup/injection of stateful bean creates new instance, result in infinite ...

mongodb - How to use connection file of mongo db in other files of node.js application -

i have file, connection.js want use in file. how can use file in file inserting , updating database. example have file named item.js in want add item details database. var mongodb = require('mongodb'); module.exports = function() { this.getconnection = function(callback) { var mongoclient = mongodb.mongoclient; var url = 'mongodb://localhost:27017/shoppingcart'; console.log(url); mongoclient.connect(url, function(err, db) { if (err) { console.log('unable connect mongodb server. error:', err); return; } else { console.log('connection established to', url); return callback; } //else }); //mongoclient.connect }; //connection }; //constructor item.js in file additem function takes json object want store in database. need connect database , insert result, don't understand how connect dat...

benchmarking - Measuring processor ticks in C -

i wanted calculate difference in execution time when executing same code inside function. surprise, however, clock difference 0 when use clock()/clock_t start , stop timer. mean clock()/clock_t not return number of clicks processor spent on task? after bit of searching, seemed me clock_gettime() return more fine grained results. , indeed does, instead end abitrary number of nano(?)seconds. gives hint of difference in execution time, it's hardly accurate how many clicks difference amounts to. have find out? #include <math.h> #include <stdio.h> #include <time.h> #define m_pi_double (m_pi * 2) void rotatetest(const float *x, const float *c, float *result) { float rotationfraction = *x / *c; *result = m_pi_double * rotationfraction; } int main() { int i; long test_total = 0; int test_count = 1000000; struct timespec test_time_begin; struct timespec test_time_end; float r = 50.f; float c = 2 * m_pi * r; float x = 3....