Posts

Showing posts from January, 2010

mongoose - Find all subdocuments that match with node.js mongodb -

Image
i have schema looks like: var user = new schema({ id: string, firstname: string, lastname: string, password: string, username: string, position: [{ title: string, location: string, start: string, term:number, description:string, date: {type: date, default: date.now} }] }); i have 2 users, each 2 embedded position documents. user1: "position" : [ { "title" : "business analyst", "location" : "dublin", "start" : "may 2017", "term" : 6, "description" : " lorem ipsum dolor sit amet, consectetur adipiscing elit. vivamus quis erat vitae dsit amet, consectetur adipiscing elit. vivamus quis erat vitae dolor tempus euismod non in mi", "_id" : objectid("58d6b7e11e793c9a506ffe0f") }, { "description&

Which version of Jsp is the lastest? -

i downloaded jsp-api https://repo.maven.apache.org/ , found versions weird. maven dependecies: <dependency> <groupid>javax.servlet.jsp</groupid> <artifactid>jsp-api</artifactid> <version>2.1</version> </dependency> <dependency> <groupid>javax.servlet.jsp</groupid> <artifactid>jsp-api</artifactid> <version>2.2</version> </dependency> version2.2 has 3 packages: javax.servlet.jsp javax.servlet.jsp.el javax.servlet.jsp.tagext version2.1 has 4 packages: javax.el javax.servlet.jsp javax.servlet.jsp.el javax.servlet.jsp.tagext some classes deprecated in javax.servlet.jsp package, javax.servlet.jsp.el.elexception replaced javax.el.elexception . however, in version2.2, there isn't javax.el package. why javax.el package disappear in version2.2? in addition, searched jsp-api in http://mvnrepository.com , found version2.3.1. after downloading it,

Social Media sharing Buttons in Ruby on Rails -

i'm trying add custom social media sharing buttons in blog app in ruby on rails. important me pop-up window show sharing "post" meaning want include javascript. unfortunately code not work: <!-- twitter --> <a oneclick="javascript:window.open('http://twitter.com/share?text=<%= @post.title %> martin bortowski - &amp;url=<%= url_for([@post, {only_path: false}]) %>', '_blank', 'width=800, height=500, top=200, left=300');void(0);"><i class="fa fa-twitter"></i></a> <!-- facebook --> <a oneclick="javascript:window.open('http://facebook.com/sharer.php?u=<%= url_for([@post, {only_path: false}]) %>', '_blank', 'width=800, height=500, top=200, left=300');void(0);"><i class="fa fa-facebook"></i></a> <!-- google plus --> <a oneclick="javascript:window.open('https://plus.

r - How to export syntax highlighted RMarkdown code to PDF? -

for thesis, attach code (not output) of .rmd document, ideally pretty syntax highlighting rstudio does. is there way export highlighted rmarkdown code file, ideally pdf? i check out. http://rmarkdown.rstudio.com/pdf_document_format.html#appearance_and_style i think should simple --- title: "habits" output: pdf_document: highlight: tango ---

scala - Time to live on host-level akka-http client connection -

i have service running on production, calls dependency service using : http().newhostconnectionpoolhttps[promise[httpresponse]] each time new stack of dependency service deployed, service dns cache updated setting : java.security.security.setproperty("networkaddress.cache.ttl" , "60") problem connections inside pool lives on forever , resolves dns once @ initiation time. keeps calling old dependency stack . i searching away set max connection's time live. akka-http has functionality build in, can settings in reference config in short have put following key config (application.conf likely): akka { io { dns { inet-address { # set time cache name resolutions # possible values: # default: sun.net.inetaddresscachepolicy.get() , getnegative() # forever: cache forever # never: no caching # n [time unit]: positive timeout unit, example "30 s" positive-ttl =

linux - Can sar display date and time? -

on centos, can sar command display both date , time? found sar can display time : 17:42:40 cpu %user %nice %system %iowait %steal %idle 17:42:42 0.31 0.00 0.69 0.06 0.00 98.93 i expect this: 2017-03-28 17:42:40 cpu %user %nice %system %iowait %steal %idle anyone knows how format? in sar output first displays date below =============== linux 2.6.32-642.12.1.e16.x86_64 (ap.pm.pk) 2017-05-03 . _x86_64 . (24 cpu) 12:00:01 cpu %usr %nice %sys %iowait %steal %irq %soft %guest %idle 12:10:01 30.70 0.00 2.2 2.95 0.00 0.00 0.21 0.00 63.88 =============== to check older/previous date sar report need run sar command on var/log/sysstat/sa* file sar -f /var/log/sysstat/sa13 here 13 date

unity3d - Unity Multiple displays not working -

i using unity 5.4.1f1 personal edition , working on windows standalone build. want use multiple displays in game. have 2 cameras , set target display of 1 camera display 1 , target display of second camera display 2. also, have activated display display.displays.length one on editor on build. so not display on second screen. should display on second screen? you need activate each additional display in code display.activate . see the docs says: the best time activate additional displays upon creating new scene. way attach script component default camera. make sure call display.activate once during startup. may find helpful create small initial scene test it. and example, in start() method: if (display.displays.length > 1) display.displays[1].activate(); if (display.displays.length > 2) display.displays[2].activate(); note: once monitor has been activated, cannot deactivate it.

clojure - How can I only use conforming values of a map? -

in forbidden keys in clojure.spec , accepted answer states can't forbid keys because should ignore values you're not interested. however, there way map, containing keys validated , specced? (s/def ::category (s/keys :req-un [::name ::description])) (s/conform ::category {:name "hugo" :description "asdf" :other 1}) gives me {:name "hugo", :description "asdf", :other 1} but i'd get {:name "hugo", :description "asdf"} of course don't want specify keys twice, defeat purpose. want make sure noone later uses keys aren't specced.

Use of undefined constant SERVICE_HTTP_PATH - assumed 'SERVICE_HTTP_PATH' in YII2 -

service_http_path not getting recognised although has been added xml file contains web service url.do need include xml file in controller? if yes how? the problem because trying use zend format along yii2. there no config.inc.in file in yii2 have read properties of xml file using different functions , run foreach on achieve desired url value.

ionic2 - Ionic 2 : EXCEPTION: Unexpected token < in JSON at position 0 -

i want send data database , when click on submit button, exeption : exception: unexpected token < in json @ position 0 i dont know :/ can check code on github: https://github.com/majlo23/makeorder-ionic , here php code: https://github.com/dmikulasova/make-order_server

java - Mocking a List and attempting to iterate over it -

currently using mockito test method 1 of classes. class contains list, , method takes in object of same class. issue when attempt iterate on list object. i'm getting null pointer list. below see code snippets. private shipment shipment; private shipment shipment2; @mock private order mockorder1; @mock private order mockorder2; @mock private order mockorder3; @mock private arraylist<order> mockshipmentorders; @mock private arraylist<order> mockshipmentorders2; @before public void setup(){ mockitoannotations.initmocks(this); mockshipmentorders.add(mockorder1); mockshipmentorders.add(mockorder2); mockshipmentorders2.add(mockorder3); shipment = new shipment(1, mockshipmentorders); shipment2 = new shipment(2, mockshipmentorders2); } @test public void test_mergeshipments_increasesbyonewhenashipmentofoneaddedtoashipmentordersizeoftwo(){ shipment.mergeshipments(shipment2); assertequals(3, shipment.getshipmentorders().size()); } above ca

xcode - How can I disable Automatically managing signing option in jenkins -

i'm making ci using jenkins , xcode plugin. failed log that check dependencies unity-iphone has conflicting provisioning settings. project automatically signed, provisioning profile <> has been manually specified. set provisioning profile value "automatic" in build settings editor, or switch manual signing in project editor. code signing required product type 'application' in sdk 'ios 10.2' ** build failed ** the following build commands failed: check dependencies (1 failure) build step 'xcode' marked build failure finished: failure so searched solution. , found solutions. first. setting custom xcodebuild argument in xcode plugin in jenkins. made argument below. "provisioningstyle = manual" "provisioning_profile_specifier=<<name>>" "development_team=<<team>>" "iphoneos_deployment_target=8.0" but failed same log. second. use

Native messaging in window 10 anniversary edge browser -

is native messaging possible in window 10 anniversary edge browser. anniversary update, edge supports extension. cloned secureinput edge extension github uses native messaging not working in window 10 anniversary. https://github.com/microsoftedge/microsoftedge-extensions-demos/tree/master/secureinput please let me know steps make run if possible run in window 10 anniversary if needs window 10 creators, need wait it. as per api roadmap page in documentation ( https://docs.microsoft.com/en-us/microsoft-edge/extensions/api-support/extension-api-roadmap ), native messaging supported in build 15002 , later. result, you'll able use native messaging in creators update, or can sign windows insider preview builds ( https://insider.windows.com ) early. for more information, see https://docs.microsoft.com/en-us/microsoft-edge/extensions/guides/native-messaging

android - How return response using okhttp library from class method in activity method -

i want response using enque process in okhttp did not exact solution here code activity code public void homefragmentdataimplementation() { notification notification = new notification(); kprogresshud = notification.activityindicator(mactivity); new thread(new runnable() { @override public void run() { okhttprequest okhttprequest = new okhttprequest(); homeapiresponse = okhttprequest.getokhttprequest(urls.homescreen_api +utility.getdeviceid(mfragment.getcontext())); handler.sendemptymessage(1); }}).start(); } private handler handler = new handler(){ @override public void handlemessage(message msg) { if(msg.what==1) { notification notification = new notification(); notification.scheduledismiss(kprogresshud); swipecontainer.setrefreshing(false); new jsonreadingmodel(mactivity,homeapiresponse); homescreenbusinessadapter.notifydatasetchanged(

ios - Setting a BBSectionInfo using BBSettingsGateway fails for unclear reason -

i’m attempting create solution end-to-end testing suite set user permissions (contacts, photos, notifications, etc.) on simulator . reason doing because permission alerts displayed springboard, , interfere testing suite. i’ve tried using xcuitest suite, not work expected regarding springboard alerts, , inconvenient use in general. so idea modify system files in order set permissions on-demand. found tcc database, , seems pretty straightforward. noticed notification permissions saved under different file, /library/bulletinboard/sectioninfo.plist . file cached bbserver object in springboard process. managed change file, , if springboard terminated, changes file accepted. want change happen during tested app’s process runtime. after digging, noticed when settings app (preferences) makes change notification settings, uses xpc connection notify has made change. i trying accomplish same thing in tested process. create bbsectioninfo object contains settings notifications, , try

python - Reading http responses from a stream -

this in python 2.7 i have socket receiving multiple http responses consecutively. there way read bodies of each of http responses using built-in module in python. can read responses socket , convert stream using stringio, still need separate each responses there. i thought of using content-length header @ first, doesn't work chunked responses. before writing code handle chunked responses well, wanted know if possible using builtin module in python.

python - Loop through data looking for values from another list and add that to a dictionary -

the output of geochemical model i'm using generates 3000+ steps 300ish chemical species per step. i have list of values species i'm interested in. how can loop through data (main), using list of species i'm interested (species) in , add second value of relevant species list key in dictionary without having type out 100 if statements if x=='y':list['x'].append(value) each species? this simplified version of code: main =[['a',1,2,3],['b',4,5,6],['c',7,8,9],['a',10,11,12],['b',13,14,15],['c',16,17,18] species = ['a', 'b', 'c'] maindict={'a':[],'b':[],'c':[]} value in main2: x in value: if x=='a':maindict['a'].append(value[2]) elif x=='b':maindict['b'].append(value[2]) elif x=='c':maindict['c'].append(value[2]) what i'm looking bit simpler like: for value in main:

How to get the value from a valuelist in XSLT -

i'm creating web page has dropdown list , button. page updates value of original dropdown new selected one. so have declared template this: <xsl:template name="custtype"> <xsl:param name="custtypelbl" select="$lang.custtypelbl"/> <xsl:param name="valuelist"/> <xsl:param name="disable" select="'false'"/> <xsl:param name="controlname" select="'customertype'"/> <xsl:param name="onchange" select="''"/> <xsl:call-template name="selectbox"> <xsl:with-param name="selectboxlabel" select="$custtypelbl"/> <xsl:with-param name="controlname" select="$controlname"/> <xsl:with-param name="disable" select="$disable"/> <xsl:with-param name="valuelis

python - is there a way to add 2 yticks and 2 bars in one matplotlib plot? -

Image
hello want ask if there way add yticks bars in same plot? this example: here possible way, using ax.set_yticklabels : import matplotlib.pyplot plt import numpy np; np.random.seed(0) x = np.arange(8) y1 = np.random.rand(4) y2 = np.random.rand(4) fig, ax = plt.subplots() ax.barh(x[::2], y1, color="c3") ax.barh(x[1::2], y2, color="c0") t = range(len(x)) ax.set_yticks(t) t[0::2] = ["another tick"]*(len(x)/2) t[1::2] = ["tick {}".format(i+1) in range((len(x)/2))] ax.set_yticklabels(t) plt.tight_layout() plt.show()

c++ - Inserting filter between custom source and SmartTee leaks COM object -

we have directshow graph consisting of our own source filter rendered using capturegraphbuilder. in preview mode graph results in [source] -> [smarttee] -(previewpin)-> [decoder] -> [renderer]. our own filter has custom allocator , notifies smarttee it. exiting fine, objects released. now trying insert filter between our own source filter , smarttee filter. when connecting newly created filter our source filter new allocator created @ source filter. when connecting new filter (which propose custom allocator on output pin itself) smarttee filter smarttee proposes allocator created in first connection between source , smarttee. smarttee should have dropped allocator due breakconnect. exiting application results in 1 remaining source allocator object allocator created in first connection. the source filter, inserted filter have initallocator function on output pin propose allocator. you can check source of decideallocator function in cbaseoutputpin class. output

mysql - How to automatically design a dynamic table when fetching row (PHP /MySQLi) -

Image
i'd design dynamic table when fetching row in php/mysql. please see attached image of example. see code below, works vertical bar in middle doesn't seems fit well. for ($i = 0;$i<$result->num_rows;$i++){ $row = $result->fetch_array(mysqli_num); //echo "* ".$row["0"]."<br>"; // work great //echo "* " .$row["0"] .$row["1"] ."<br>"; echo "| " .$row["1"] ."&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp" ." | " ."&nbsp&nbsp&nbsp" .$row["2"] ."<br>"; } what want do: that example of how echo html tables php code echo "<table><thead></thead><tbody>" ($i = 0;$i<$result->num_rows;$i++){ $row = $result->fetch_array(mysqli_num); echo &qu

Get static image from Google map for given area -

i know google maps provides api getting static images: https://developers.google.com/maps/documentation/static-maps/intro however api gets input center point, zoom level , output image size. in case, need image fits given area taking input nw (top-left) , se (bottom right) coordinates describing rectangle of area. don't see option within google maps api, i'm wondering if there way accomplish this. you can omit center , zoom parameters if specify @ least 1 marker. in case can show area marker. for example, have bounds of barcelona in spain: 41.320004,2.069526 , 41.469576,2.22801 i can calculate center position of bounds: 41.39479,2.148768 now, let's put marker in center of bounds , use visible parameter of static maps api specify nw , se. visible (optional) specifies 1 or more locations should remain visible on map, though no markers or other indicators displayed. use parameter ensure features or map locations shown on google static maps a

sms - WAP - Got into some troubles with the PDU formatting -

i'm learning phone's technologies , got troubles understanding wap wsp specification. now i'm trying send html pages via wap push on sms following pdu : [sms pdu] - 0041000c91xxxxxxxxxxxx0004 + length of following bytes (tp-udl) [udhi] - 06 05 04 0b84 23f0 (port scheme - src: 9200, dst: 2948) [wsp] - 01 06 01 02 (tid=1, pdu=push, headerslen=1, content type=text/html) html tags my questions are: is udhi , wsp right? how should encode html tags? simple ascii->hex "encoding"? as far understand, push message should open browser given html right? thanks helpers :)

ios - SKStoreReviewController requestReview doesn't prompt for review -

i want use new feature added in 10.3 ask users reviews. in docs , apple states when method called "a rating/review request view displayed". i getting rating view( can select how many stars rate), not able write review. have mention tested in simulator. is correct behaviour? in development mode “submit” button disabled. once app in app store, button becomes active , user given option write review after hit “submit”.

postgresql - too long select request -

i have sql query empty table this: select * test_table i use pgadmin after request see how long execute request db. request 12 msec(milliseconds). long empty table. if table have 2k rows request execute 150-200 msec. what problem? use postgresql 9.6 , have default configuration mean setup postgres tutorial i don't have similar database on computer or server. setupe postgresql localy , 1 request db. mysql similar request 800 microseconds. postgresql.conf: postgresql.conf СВОЙСТВА СТАТИСТИКА Сегодня С Вы загрузили 1 объект 15:15 Текст postgresql.conf Статистики до 28 марта 2017 г. нет # ----------------------------- # postgresql configuration file # ----------------------------- # # file consists of lines of form: # # name = value # # (the "=" optional.) whitespace may used. comments introduced # "#" anywhere on line. complete list of parameter names , allowed # values can found in postgresql documentation. # # commented-out settings shown

CRM 2013 - Plugin to retrieve username -

i have autonumber plug-in invokes when user presses save, i've received requirement append initials of person creating record end of ticket. for example: 0001-0327-rbs i have been able guid of user creating record, have no idea how literal value outside of sql. haven't been able figure out how can user name of active user creating record. possible within plug-in? any appreciated. thanks. you should iorganizationservice iserviceprovider var context = (ipluginexecutioncontext)serviceprovider.getservice(typeof(ipluginexecutioncontext)); var servicefactory = (iorganizationservicefactory)serviceprovider.getservice(typeof(iorganizationservicefactory)); var service = servicefactory.createorganizationservice(context.userid); now can retrieve systemuser using service: var systemuser = service.retrieve("systemuser", context.userid, new microsoft.xrm.sdk.query.columnset(true)); in columnset can specify columns want retrieve (so example "firstname&

android getSystemService error with extends BroadcastReceiver -

i have 2 activities public class mainactivity extends appcompatactivity { .............. @override protected void oncreate(bundle savedinstancestate) { .............. .............. } } public class incomingsms extends broadcastreceiver{ public void onreceive(context context, intent intent){ .............. .............. } public string getcelldata() { telephonymanager telephonymanager = (telephonymanager) getsystemservice (context.telephony_service); gsmcelllocation celllocation = (gsmcelllocation) telephonymanager.getcelllocation(); .............. .............. return somestring; } i want return string getcelldata public void onreceive. there error on getsystemservice in getcelldata(). can do. thanks. getsystemservice() method on context . broadcastreceiver not inherit context . however, passed context onreceive() . so, call getsystemservice() on context parameter.

android - how to send Data to a BLE server -

i able connect ble device following https://developer.android.com/samples/bluetoothlegatt/src/com.example.android.bluetoothlegatt/bluetoothleservice.html ,but unable find how send data ? callback implementation follows :- private final bluetoothgattcallback gattcallback = new bluetoothgattcallback() { @override public void onconnectionstatechange(bluetoothgatt gatt, int status, int newstate) { switch (newstate) { case bluetoothprofile.state_connected: gatt.discoverservices(); break; case bluetoothprofile.state_disconnected: break; default: system.out.println("device 3: other_state !!"); } } @override public void onservicesdiscovered(bluetoothg

amcharts not rendering India map correctly in worldmap -

while amcharts shows india map correctly (showing disputed regions part of india) when displaying india ( http://jsfiddle.net/zxhseguw/5/ ) "dataprovider": { "map": "indialow", "areas": [ { "id": "in-ka", "value": 4447100, }, { "id": "in-up", "value": 38763 }] }, it shades differently when rendering on world map ( http://jsfiddle.net/zxhseguw/6/ ) "dataprovider": { "map": "worldlow", "areas": [ { "id": "in", "value": 4447100, }, { "id": "au", "value": 387633 }] }, i wonder, if there way make render india correctly, possible in google charts setting origin='india' i'm assuming you're referring region around kashmir, correct? try using worldindialow instead of worldl

c++ - Why is the return value of the function not part of the symbol name -

the return type not part of symbol name. makes overloading of function based on return type impossible. idea behind approach? the reason given bjarne stroustrup part of post in newsgroup comp.lang.c++, dated 12 january 1998 is the reason c++ doesn't allow overload resolution based on return type (so need use explicit qualification in examples below) wanted overload resolution bottom up. example, can determine meaning of subexpression a+b without considering complete expression a+b part of. overload resolution can subtle though knew how use return types part of resolution (ada showed how), decided not to. result of decision, a+b means same in a+b+c in a+b+d. agree or not, rationale behind design decision.

Akka HTTP WebSocket client equivalent of this node.js -

i have user documentation expresses how use websocket node snippet: var socket = io(“host:port”); socket.on('request-server', function() { socket.emit('server-type', 'red') }); what equivalent client code in akka http? i have derived following example in akka documentation. isn't quite i'd write, because i think need connect , wait request-server event before sending events & don't know how that i don't know how format textmessages in source equivalent `socket.emit('server-type', 'red'). it prints "closed" implicit val system = actorsystem() implicit val materializer = actormaterializer() import system.dispatcher val incoming: sink[message, future[done]] = sink.foreach[message] { case message: textmessage.strict => println(message.text) case z => println(z) } val outgoing = source(list(textmessage("'server-type': 'red'"))) val websocketflow = http().webso

Predicate in prolog -

i need define predicate in prolog takes list input , sums squares of numbers >= 5 , subtract sum of absolute value of numbers <=2. this have :- pred([], 0). pred([head|tail], result) :- gr85(head), pred(tail, total), result head*head + total. pred([head|tail], result) :- leq2(head), pred(tail, total), result total - head. gr85(number):- number >= 5. leq2(number):- number =< 2. my question how exclude between 2 , 5. if input 3 in list, returns false. expected input pred([3,6,2,-1], result). expected output result= 33 (6*6 -2-1) add 'skip all' clause: weird_sum([_|tail], result) :- weird_sum(tail, result). i think gain insight prolog working when analyze where clause should added.

cron - Magento not updating Sitemap automatically -

my sitemap not generating automatically. have enabled google sitemap in system -> configuration -> catalog -> google sitemap -> generation setting , entered values. but sitemap not updating in catalog -> google sitemap. i have tried truncate cron_schedule table no luck that.

java - JMeter not decoding base64 correctly - Results in blank PDF -

in jmeter, base64 encoded pdf in response extract using regex extractor. working great. then need decode base64 encoded document , write out file, i'm doing following in beanshell post processor: import org.apache.commons.io.fileutils; import org.apache.commons.codec.binary.base64; // set response variable string response = vars.get("documenttext"); // remove carriage return hex code , condense single string string encodedfile = response.replace("&#xd;","").replaceall("[\n]+",""); // decode encoded string vars.put("decodedfile",new string(base64.decodebase64(encodedfile))); // write out decoded file output = vars.get("decodedfile"); f = new fileoutputstream("c:\\users\\user\\desktop\\decodedfile.pdf"); p = new printstream(f); this.interpreter.setout(p); print(output); p.flush(); f.close(); my problem file gets decoded , written out opens blank pdf. in troubleshooting this, wrote o

ios - Ad-ID (IDFA) and Google Framework -

i developing app ios iphone google admob intergrated within it. implementetd other firebase functions firebase messaging, because planning push notifications. as stated google, google uses apple idfa , conforms guidelines. therefore, assume submitting app, should select idfa. but in same time, planning bring exact same app without ads, still google framework being integrated within it, because, said, planning push notifications. my question is: should remove google admob interface before submitting ad-free app? if no need so, should select idfa on submission? if has removed, , should remove? thanks lot! here have done: in ad-free version, removed complete framework , reinstalled using "pod install" time installing 'firbase', 'firebase/core' , 'firebase/messaging" without admob. my app got accepted without selecting idfa upon submission.

uitableview - How to make table scroll up when button lifts above keyboard? Swift 3 -

Image
i adding size of keyboard bottomconstraint of button in order lift above keyboard when textfield edited. how can make textfield visible user can edit it?

angular - Angular2: Route change keep view -

i'm trying make transition between routes, using host animations [@routertransition] doesn't work me, because animation dynamic. so i'm looking way prevent component being destroyed when changing routes, , when animation finished component should destroyed. there isn't go on subject suspect i'll have extend router outlet , magic there. could point me in right direction, links or better examples great.

convert string elements in list as integers in python -

i have list named newlist newlist=[['24,4,17,46,0,43'], ['11,43,17'], ['33,17,43,4'], ['74,21'],['21,43,43,74,68,21']] i need convert each list element integers.i.e. newlist=[[24,4,17,46,0,43], [11,43,17], [33,17,43,4], [74,21], [21,43,43,74,68,21]]. can me please. python 3: newlist=[['24,4,17,46,0,43'], ['11,43,17'], ['33,17,43,4'], ['74,21'],['21,43,43,74,68,21']] mylist = list(map(lambda x : list(map(int, x[0].split(','))) , newlist)) print(mylist) python 2: newlist=[['24,4,17,46,0,43'], ['11,43,17'], ['33,17,43,4'], ['74,21'],['21,43,43,74,68,21']] mylist = map(lambda x : map(int, x[0].split(',')) , newlist) print mylist

jpa - Hibernate JPQL Constructor Expression doesn't work with OneToMany field -

when try use constructor expression in jpql query class companyprojection { string name; list<employee> employees; public companyprojection (string name, list<employee> employees) { ... } } class company { string name; @onetomany(mappedby = "company") list<employee> employees; } class employee { @manytoone company company; } select com.foo.companyprojection(c.name, c.employees) company c i org.hibernate.hql.internal.ast.querysyntaxexception: unable locate appropriate constructor on class [com.foo.companyprojection]. expected arguments are: java.lang.string, com.foo.employee[........] from stacktrace above, understand hibernate expects second constructor argument have employee.class type instead of list.class. but c.employees list. don't understand if bug in hibernate, or if i'm misusing it? user error. using multi-valued fields in select clause of jpql illegal syntax. see

rust - How do I determine the actual values of certain Objective-C constants? -

i'm using objective-c functions in rust application through layer of different bindings. far simple call objective-c functions , implement required functionality without problems. seems found impediment don't know how solve, of functions coregraphics require several constants work properly. so question how can actual value of particular constant? instance, let's want value of cgrectinfinite constant (coregraphics), possible it? for integer constants/enums quite simple -- opened xcode , navigated appropriate header file, contained required values, copy-pasted values application. if constant cgrect ? extern const in c can declared in rust static . extern { pub static cgrectinfinite: cgrect; } the use of cgrectinfinite unsafe. you'd better provide safe wrapper access it. impl cgrect { pub fn infinite() -> cgrect { unsafe { cgrectinfinite } } } the actual value of cgrectinfinite , way, is: #[cfg(target_pointer_width=&qu

android - Update polyline when user is out of existing polyline google map -

i implementing google map draw route between 2 locations in android app. route showing, not able update route when user goes out of route during ride (runtime). q. how check if user goes out of route , how update route on google map without refreshing map. please help. thanks, nisha

Fine tuning a pretrained tensorflow model to generate image captions -

i fine tuning pretrained im2txt model in tensorflow explained in tensorflow models-im2txt tensorflow models-im2txt . i use new image+sentence dataset while pretrained model(2m steps) trained on ms coco dataset. 1m fine-tuning steps didn't end yet tested latest checkpoints images. unfortunately, captions ". ", "and " , etc. word counts, used new wordcounts new dataset guess mistake. new deep learning , tensorflow, explain, how should use wordcounts? should use 1 ms coco, or fine-tuning dataset or combination? or missing whole point or crucial?

wai aria - Bootstrap 3 Tabs - Accessability -

are bootstrap 3 tabs not accessible according wai ? i found wai-aria specification tabs keyboard behavior: https://www.w3.org/tr/wai-aria-practices-1.1/examples/tabs/tabs.html https://www.w3.org/tr/wai-aria-practices/#tabpanel which says: when focus on tab element in horizontal tab list: left arrow: moves focus previous tab. if focus on first tab, moves focus last tab. optionally, activates newly focused tab (see note below). right arrow: moves focus next tab. if focus on last tab element, moves focus first tab. optionally, activates newly focused tab (see note below). as seems bootstrap 3 tabs documentation samples fail meet requirements. pressing left , right arrow keys, have no effect ever. <ul class="nav nav-tabs"> <li role="presentation" class="active"><a href="#">home</a></li> <li role="presentation"><a href="#">profile</a></li> <l

magento - Unable to start the MGT Development Environment -

i'm trying setup mgt development environment as per instructions on site . i'm running ubuntu 16.04 , native docker. i did fresh pull before trying of this. after running container browser @ 127.0.0.1:3333 shows general http 500 error. running docker logs on container shows following log entries: docker logs 7b1f04c29bf2 /usr/lib/python2.7/dist-packages/supervisor/options.py:296: userwarning: supervisord running root , searching configuration file in default locations (including current working directory); want specify "-c" argument specifying absolute path configuration file improved security. 'supervisord running root , searching ' 2017-03-28 14:03:53,908 crit supervisor running root (no user in config file) 2017-03-28 14:03:53,908 warn included file "/etc/supervisor/conf.d/supervisord.conf" during parsing 2017-03-28 14:03:53,916 info rpc interface 'supervisor' initialized 2017-03-28 14:03:53,917 crit server 'unix_http_ser