Posts

Showing posts from May, 2015

node.js - InfluxDB composite query -

why function don't bring results? in influxdb. select * items.movement time > now() - 7d , oldcontainerid='aaaaaa' , newcontainerid='aaaaaaa' thanks. i solved this: select * series time > now() - 7d , newcontainerid = 'aaaa' limit 100; select * series time > now() - 7d , oldcontainerid = 'aaaa' limit 100

sql - Get a count of a number of records with same create date -

i have table containing records create date. want select records created in january 2014 , have count of how many created each day. i've gotten far selecting records created month i'm unsure how proceed output of days month , count of how many records created. select type ,part_id ,desired_qty ,received_qty ,create_date work_order datepart(year,create_date) = 2014 , datepart(month,create_date) = 01 order create_date asc the information i'm selecting in statement isn't important, it's there in query i'm selecting something. is looking for? aggregation query count: select cast(create_date date) date, count(*) work_order datepart(year, create_date) = 2014 , datepart(month, create_date) = 01 group cast(create_date date) order cast(create_date date) ; the cast() needed if create_date have time component. reason query uses cast() same structure work on multiple months. i want add, better write query this: select cast(create_date da...

javascript - Explicitly Rendering ReCaptcha - Onload Function Not Firing -

from documentation understood in order change language of recaptcha have render explicitly. the problem is, however, it's not showing up, , onload not called. when try render automatically work. here's code: in html head: (i have tried putting @ end of body tag) <script src="https://www.google.com/recaptcha/api.js?onload=recaptchacallback&render=explicit&hl=iw" async defer></script> in html form: <div id="recaptcha"></div> javascript: var recaptchacallback = function() { console.log('recaptcha ready'); // not showing grecaptcha.render("recaptcha", { sitekey: 'my site key', callback: function() { console.log('recaptcha callback'); } }); } i copied code, used own site key , works. the code used is: <html> <body> <p>recaptcha test</p> <div id="recaptcha"></div> <script ...

c# connection string change due to database move -

we moving database 1 server another. there many connection strings of applications needs changed due this. there generic way can keep connection string if move database again issue doesn't arise?? there many ways resolve problem. ultimately sounds want centralize database connection strings in such way database migration (mostly) transparent application. can think of few options here: use "control database" houses connection strings , configurations. if migrate new database server, have update single connection string in application, , perform data updates else. use. use central xml configuration file parsed on application startup. use sql server aliases and/or add additional ips machine can migrate between servers. way when move new database server can still bring along existing aliases/ips server (unless need run in parallel of course) , theoretically not need update in code, provided you've referenced appropriate aliases. see here more info...

javascript - Dynamic downloadURL( ) call -

i'm building website has, among others, photo gallery feature. in gallery page, there's map (google) several markers , every marker related specific photo. i've got 'markers' table in database: markers: id | name | address | lat | lng | gallery_id _______________________________________________________ 1 | .. | .... |.. | .. | 2 2 | .. | .... |.. | .. | 2 3 | .. | .... |.. | .. | 3 4 | .. | .... |.. | .. | 3 5 | .. | .... |.. | .. | 10 ...................... all fields populated geolocated data , every row represents specific photo uploaded user, gallery_id, holds id of gallery owns photo. in gallery page there's javascript build google map: <script type="text/javascript"> function load() { var map = new google.maps.map(document.getelementbyid("map"), { disabledefaultui: true...

Add PowerPoint slide to textbox with CommandButton VBA -

i have command button , text-box in slide master of powerpoint presentation. trying retrieve powerpoint's properties such slideid, slideindex , name of corresponding file , post them text box on click of command button. at moment have code giving me error: sub commandbutton1_click() dim index long dim slideid long dim filename string textbox1.text = "slideindex:" & index & "slide id:" & slideid end sub i want page 1 of power point read slideindex 1 slideid 1 , file name. , slide 2 want two's , on... thanks in advance! you can use command button if like; or can use powerpoint shape want draw, assign action setting of run macro , choose macro want run when clicked. either way, should work: sub reportstuff() dim osl slide dim osh shape set osl = slideshowwindows(1).view.slide ' test see if shape's there: set osh = isitthere(osl, "my text box") ' if it's n...

amazon web services - DynamoDB create index on map or list type -

i'm trying add index attribute inside of map object in dynamodb , can't seem find way so. supported or indexes allowed on scalar values? documentation around seems quite sparse. i'm hoping indexing functionality similar mongodb far approaches i've taken of referencing attribute index using dot syntax has not been successful. or additional info can provided appreciated. indexes can built on top-level json attributes. in addition, range keys must scalar values in dynamodb (one of string, number, binary, or boolean). from http://aws.amazon.com/dynamodb/faqs/ : q: querying json data in dynamodb different? no. can create global secondary index or local secondary index on top-level json element. example, suppose stored json document contained following information person: first name, last name, zip code, , list of of friends. first name, last name , zip code top-level json elements. create index let query based on first name, last name, o...

api - Restart Python Script after BadStatusLine Error -

i have program here streams market prices , executes orders based on prices, however, every once in while (few hours or so) throws error: exception in thread thread-1: traceback (most recent call last): file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) file "/users/mattduhon/trading4.py", line 30, in trade execution.execute_order(event) file "/users/mattduhon/execution.py", line 34, in execute_order response = self.conn.getresponse().read() file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/httplib.py", line 1073, in getresponse response.begin() file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/httplib.py", line 415, in begin v...

ios - Is a __block variable assignment thread-safe to read immediately after the block? -

__block nshttpurlresponse *httpresponse; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); nsurlsessiondatatask *task = [session datataskwithrequest:request completionhandler:^(nsdata *data, nsurlresponse *response, nserror *error) { if (!error) httpresponse = (nshttpurlresponse *)response; } dispatch_semaphore_signal(semaphore); }]; [task resume]; dispatch_semaphore_wait(semaphore, dispatch_time_forever); is safe read httpresponse after this? semaphore waits block compete execution. if there no error, assignment seen or have synchronise or create memory barrier outside block? does waiting on semaphore implicitly perform synchronisation makes __block variable safe read immediately. if done thread.join() in java instead of semaphore, safe since guarantees happens-before relationship assignment in "block". the short answer yes. the semaphore lock forces thread operating stop execution until receives enough unlock signals ...

Adding compression to existing mongodb collection -

is possible add compression existing collection created prior mongodb 3.x? if so, how? i found example of how create new collection compression, haven't found far strategies adding compression existing one. http://www.mongodb.com/blog/post/new-compression-options-mongodb-30 version prior 3.x mongodb had 1 storage engine - mmapv1 still not support compression. 3.0 mongodb introduced pluggable storage engines, , 1 of them - wiredtiger storage engine supports compression. the problem cannot use data files created 1 storage engine (say mmapv1 ) 1 (e.g. wiredtiger ). so thing can mongodump , initialise mongod --storageengine wiredtiger using data directory (with --dbpath ), , mongorestore new mongod instance.

multithreading - Mule ESB, Synchronize custom java class within flow -

Image
i wrote custom java class, special http connector in flow request-response mule-http connector. but if there many requests calls flow, illegalstateexception occured. as far know data or variables 1 thread copies thread , illegalstate... how can synchronize data in connector? may forget implement interfaces? public class myhttpconnector { ... } i synchronize methods in class , solve problem. assistance.

add alternating classes to existing jquery object -

i know can following: $('#mytable').find('tr:odd').removeclass('even'); $('#mytable').find('tr:even').addclass('even'); what if have $('#mytable').find('tr') . how efficiently add alternating classes? filter() works selector argument using function argument var $rows = $('#mytable tr');//cache rows // specific class of rows $rows.filter('.even').dosomething().dosomethingelse() for specific case, do: $(function() { var $rows = $('table tr'); //cache rows // specific class of rows $rows.removeclass('even').filter(':even').addclass('even') })

c++ - Conflicting types for 'memchr' -

i'm trying modify library (asn.1 compiler), written in c, can compile , use in c++ builder (xe6). doing that, i've encountered error "conflicting types 'memchr'" (in cstring). after research, seems problem comes fact c , c++ code mixed. however, can't use solutions suggested article in read since related gcc compiler, when i'm using c++ builder , compilers. what can solutions solve error? thank you you mix including cstring , string.h . not this. the former declares: void * memchr(void *, int, size_t); the latter does void * memchr(const void *, int, size_t); those not of same type.

sql - How can I change this query into a subquery -

select c.name, c.tel customer c, vehicle c, hire h c.cid=h.cid , v.vid = h.vid , (dropoff-pickup) > 1 , v.make = 'suzuki' dropoff , pickup date fields select c.name, c.tel customer c join hire h on c.cid = h.cid join vehicle v on h.vid = v.vid v.make = 'suzuki' , (h.dropoff-h.pickup) > 1 not answer question don't need subquery here please structure query make more obvious trying (you getting customer name , telephone number vehicles make suzuki length of hire longer 1 day right?) structuring queries make more readable people don't know trying , make finding mistakes in query logic easier or others

java - Serial port over USB in Linux changes unexpectedly -

i have problem custom electronic device communicating workstation via rs232 on usb interface. device connected, receive, says, address /dev/ttyusb0 , after (random ) time of sending receive commands, device appear hang. looking @ device events ( dmesg ), found following error: ftdi_sio ttyusb0: failed modem status: -32 ... usb disconnect, device number 29 [66208.321174] ftdi_sio ttyusb0: ftdi usb serial device converter disconnected ttyusb0 [66208.497613] usb 1-1.5: new full-speed usb device number 30 using ehci-pci [66208.589052] usb 1-1.5: new usb device found, idvendor=0403, idproduct=6001 [66208.589055] usb 1-1.5: new usb device strings: mfr=1, product=2, serialnumber=3 so apparently system notices device disconnection/reconnection, thus, device mounted port, ie / dev/ttyusb1 , causing further communication failure. creating test bed changes behavior: error seems appear less frequently, while using complete application error appears recurrently. application uses jssc-2.8....

.net - Google Sheets API returns null for inputValue -

i'm trying formula out of cell not final value // a1 www.google.com // b1 =a1 cell.inputvalue // value null. want value: =a1 cell.value // equals www.google.com. again not value i'm looking for. according googles api documentation formula suppose in inputvalue property https://developers.google.com/google-apps/spreadsheets/#working_with_cell-based_feeds thoughts? the answer basic url not contain inputvalue formula. https://spreadsheets.google.com/feeds/cells/spreadsheetid/worksheetid/private/values you have use full projection hydrated properties. cellquery cellquery = new cellquery(key, "od6", "private", "full");

Python and CSV: Reading JSON from CSV -

i have function reads csv file , dumps contents file of choice. contents of csv file column each rows contains series of json objects this(validated jsonlint): [{"classname": "merchant", "__type": "pointer", "objectid": "s8igowbn8y"}, {"classname": "merchant", "__type": "pointer", "objectid": "psnnxwfvmv"}, {"classname": "merchant", "__type": "pointer", "objectid": "ihcc9ikkbj"}, {"classname": "merchant", "__type": "pointer", "objectid": "rvprbh5nwx"}, {"classname": "merchant", "__type": "pointer", "objectid": "47zjn9rrov"}, {"classname": "merchant", "__type": "pointer", "objectid": "cogtlmgzyo"}, {"classname": ...

web services - Is there an easy way to tell all the actions available in a restful webservice? -

if webservice exposed odata, see objects exposes , can manipulate objects without having need documentation. (for example if add odata service in linqpad, shows objects available , use linq manipulate them.) if consume wcf, go wcf url see actions available. similarly if gives me restful url (not odata, plain rest), there way tell objects/actions available?

angularjs - How to include data/scope from controller in a dynamically added directive? -

i'm trying figure out how include scope directive add dom on click event in controller. step 1. on click event, call function in controller adds directive this $scope.addmydirective = function(e, instanceofanobjectpassedinclickevent){ $(e.currenttarget).append($compile("<my-directive mydata='instanceofanobjectpassedinclickevent'/>")($scope)); } //i'm trying take `instanceofanobjectpassedinclickevent` , make available in directive through `mydata` the above, part of got from answer , adds directive (and directive has template gets added dom), however, inside directive, i'm not able access of scope data mydata says it's undefined . my directive app.directive('mydirective', function(){ return { restrict: 'ae', scope: { mydata: '=' //also doesn't work if mydata: '@' }, template: '<div class="blah">yippee</div>', ...

android - Select/Unselect a recycler view inside a fragment -

i want activity below structure, ---> actionbaractivity -----> fragment (viewpager horizontal swipe) ----> recycler views ---> has button now need achieve is, when user long press button in recycler view, should selected , activity's action bar should show contextual menu. after selecting first item(using longpress) user should able select/deselect other items click. but main problem here how can send long press of button main activity when recycler exists in fragment.

Storm data structures - map vs separated values? -

i'm using storm parse , save data kafka . data comes in identifiers , map<string,string> of varying size. after munging end goal cassandra. should send data 1 block of tuples or split map , send each piece separately? a tuple should represent "unit of work" next bolt in stream. if think of map single entity gets processed single, albeit complex, object map should emitted single tuple. if want different bolts independently processing different map attributes, break map subsequently processable subsets of attributes , emit multiple tuples.

geoip - How to use GeoLite City, how to obtain startIpNum and endIpNum -

alright downloaded http://dev.maxmind.com/geoip/legacy/geolite/ geolite city database. the values in geolitecity-blocks.csv startipnum,endipnum,locid "16777216","16777471","17" however have no idea how convert ips these startipnum , endipnum range. cant find on site , link here what algorithm convert ip v4 ? thank much it depends programmation language use. in php, can use ip2long , long2ip work ips. string long2ip ( string $proper_address ) function long2ip() generates internet address in dotted format (i.e.: aaa.bbb.ccc.ddd) proper address representation. http://php.net/manual/en/function.long2ip.php example ips give: http://sandbox.onlinephpfunctions.com/code/3decd3d4818a02d65b9a80cf2dc1c70297b0d2d5

Weblogic set system property and use in java -

i'm running weblogic locally, run run in production on server instances administred weblogic server i have set system property in weblogic using, " -druntime_environment=localhest " under menu item in servers -> configuration-> server start -> arguments: i java file, have system.out.println("envr_:" + system.getproperty("runtime_environment")); and prints null, there argument have missed? i believe settings on page apply if node manager used. need start application server node manager , not using command line or other means.

javascript - How to use ng-transclude in directives -

i have 2 directives free-form , free-form-canvas <div ng-repeat="controls in ctrls"> <free-form></free-form> </div> free-form.html <div id="{{controls.uicontrolinstanceid}}"> <free-form-canvas data-controls="controls"></free-form-canvas> </div> free-form-canvas.html <div> <!-- ctrl --> <div ng-switch on="ctrl.controlprops[1].containerinstance.uicontainertypeid"> <div ng-switch-when="navigator"> <navigation></navigation> </div> <div ng-switch-when="carousel_view"> <carousel></carousel> </div> <web-tile ng-switch-when="web_tile" class="drag_tiles" tilegroup="tilegroups"> </web-tile> <!-- <news-bulletin data-bulletin="" ng-switch-when="web_bulletin_board"></news-bulletin> --> ...

selenium window_handles not correct when new window is opened wtih Python -

i want use selenium python open multi-tabs in 1 browser , scraping real-time betting odds simultaneously multi-tabs. the website home page generate list of games. however, there no way link of game unless find game element , use click()(the website ajax heavy), open game in same tab. solution open multi-tabs list of game manually open new tab home-page first loaded , click on game different index in list. however, find driver.window_handles array include 1 item , current tab instead of tabs opened manually in browser. can tell me goes wrong or if can give better solution issue? the problem simplified code in following: from selenium import webdriver selenium.webdriver.common.keys import keys # create new firefox session driver_temp = webdriver.firefox() driver_temp.implicitly_wait(30) driver_temp.get("https://www.google.com") body = driver_temp.find_element_by_tag_name('body') # manually open second tab body.send_keys(keys.control + 't') drive...

c# - VSTO Excel preserve Ribbon state -

i have simple vsto excel 2013 application level add-in custom ribbon, includes toggle button , checkbox. if open 2 files (workbooks) can see ribbons not preserve state across multiple windows, meaning if click on checkbox or toggle button on second workbook same checkbox state shown on first workbook , vise versa. found article describes similar situation outlook : https://www.add-in-express.com/creating-addins-blog/2013/01/30/preserve-outlook-ribbon-controls-state/ unfortunately inspector window event not available in excel. idea on how deal it? you need use callbacks instead of attributes in ribbon xml. when user changes active window need call invalidate/invalidatecontrol method of iribbonui interface force office applications (excel in case) call callbacks current state of controls. it's pretty easy... you can read more ribbon ui (aka fluent ui) in following series of articles in msdn: customizing 2007 office fluent ribbon developers (part 1 of 3) customiz...

ios - FSAudioController music transitions -

i'm using fsaudiocontroller play mp3's service. have url list , i'm playing songs shuffling list. what want is, 5 seconds before current song ends, next song start playing , there soft transition between songs. couldn't find how play 2 songs @ same time. i thought using 2 different fsaudiocontroller objects, wanted ask if there smarter way first. thanks in advance! unfortunately fsaudiocontroller not support crossfade option have use 2 different fsaudiocontroller objects.

java - Android Realm copyToRealmOrUpdate creates duplicates of nested objects -

i have following classes: public class note extends realmobject { @primarykey private string id; private template template; // other primitive fields, getters & setters } public class template extends realmobject { private string name; private string color; // other primitive fields, getters & setters } i data backend via retrofit & gson, have ready-to-use java objects in response. let's imagine backend returns me same 3 notes each time call it. when list of note objects, following: private void fetchnotesandsave() { list<notes> notes = getnotesviaretrofit(); realm realm = realm.getinstance(mcontext); realm.begintransaction(); realm.copytorealmorupdate(notes); realm.committransaction(); realm.close(); } after call these lines check count of stored objects: int notescount = mrealm.where(note.class).findall().size(); int templatescount = mrealm.where(template.class).findall().size();...

entity framework - Using Moq with EntityFramework graphdiff -

i have added graphdiff in existing entity framework solution utilizing moq framework testing. tests using moq in insert , update methods failing since method _context.updategraph throws following exception: system.nullreferenceexception: object reference not set instance of object. graphdiff on github https://github.com/refactorthis/graphdiff updategraph extension method: https://github.com/refactorthis/graphdiff/blob/develop/graphdiff/graphdiff/dbcontextextensions.cs how should hookup moq graphdiff? we had problem well. how solved it. so in icontext interface: t updategraph<t>(t entity, expression<func<iupdateconfiguration<t>, object>> mapping = null) t : class, new(); dbentityentry<tentity> entry<tentity>(tentity entity) tentity : class; dbentityentry entry(object entity); dbcontextconfiguration configuration { get; } this in base context: public virtual t updategraph<t>(t entity, expression<fun...

c - What is SOCKET accept() error errno 316? -

on osx keep getting socket error of 316 after calling accept() on bound & listening socket. valid socket returned, , believe use fine, (though may not be, need double check this, accepting hundreds of connections @ moment) errno has been set. i'm trying understand the documentation on unix accept(2) man pages notes (which, incidentally, missing apple's accept() documentation ) linux accept() (and accept4()) passes already-pending network errors on new socket error code accept(). behavior differs other bsd socket implementations. reliable operation application should detect network errors defined protocol after accept() , treat them eagain retrying. now, 316 works out 256 or'd etimedout(60). so, i'm curious how should handling this; if error set after accept(), should accept() again? should close() socket accept did return? are unix errno code's 8 bit? (all codes see <128) , erroneous bit set in memory, or special flag, warning (i c...

c - RPC windows get client IP address -

i have read loads of microsoft documentation regarding rpc programming , still not figure out how rpc server ip address of connecting client. i sure there simple way client ip address server when connecting, not know how :/ thanks helping, simple pointer documentation great. no - there no documented way accomplish this. windows rpc design abstracts network transport (and associated metadata network addresses) it's clients. if need this, bake interface (e.g. implement connect() method client provides it's ip address stash in context handle ). assumes of course, can trust clients provide valid ip addresses...

html - Why doesn't my external css-file work? -

here´s css code: body { background-image: url(http://relevantfl.org/wp- content/uploads/2013/07/light_grey_3000x3000.jpg); color: white; font: 12px/1.4em arial,sans-serif; } here´s html code: <!doctype html> <html> <head > <link href=”/users/edvinhedblom/library/mobile documents/com~apple~clouddocs/design.css” rel=”stylesheet” type="text/css" media="all" /> </head> the problem when run code in browser shows html-code , no style @ all. you have used bad quotes, use " or ' . <link href="/users/edvinhedblom/library/mobile documents/com~apple~clouddocs/design.css" rel="stylesheet" type="text/css" media="all" /> then remember linking file local machine, remote server can find if move html server.

android - OkHttp, is the automatic GZIP disabled when using a custom interceptor? -

i using okhttp 2.3.0 in android app. question transparent gzip feature. according documentation, should silently there. cannot see ("accept-encoding", "gzip") header in request. i using custom interceptor add authentication: @override public response intercept(chain chain) throws ioexception { request request = chain.request(); // 1. sign request [get token] if (!textutils.isempty(token)) { // have token. let's use sign request request = request.newbuilder() .header(auth_header_key, bearer_header_value + token) .build(); } // 2. proceed request log.d("t", "headers " + request.headers()); <--- no gzip header here response response = chain.proceed(request); the log statement shows header have added: authorization: bearer xxxxxxxxxxxxxxxxxxxxxxxxxx but nothing gzip encoding. should else, or maybe header added after invoke chain.proceed(request) ...

jquery ui - Dragging is flickery when containment's overflow property is scroll? -

i want make element draggable in fixed area has overflow property set scroll. if use containment property in draggable element, dragging downwards or right becomes flickery. mean when edge of dragged element hits edge of container, not scroll until cursor hits edge well. i can prevent not setting containment property on draggable setup. when drag left or top, dragged element becomes invisible being dragged negative x/y position. how can prevent flicker when using containment property? plunkr -> http://plnkr.co/edit/pmgo6lswasjtwmsc1bxe?p=preview #container { border:1px solid red; min-height:3in; overflow:scroll; margin-left:120px; } .widget { background: beige; border:1px solid black; height: 100px; width:100px; } <div id="container"> <div class="widget"></div> </div> $(function(){ $('.widget').draggable({ scroll:true, containment: '#container' // comment o...

c# - Entity Framework - Relationships -

i looking create currency , crossrates in entity framework. from sql perspective crossrates table quite simple. date |fromcurrency|tocurrency|rate 01/01/2000|usd |eur |1.5 01/01/2000|eur |usd |0.67 how take above idea , apply within entity framework? here have far... public class currency { public int id { get; set; } public string name { get; set; } //navigation public virtual list<crossrate> crossrates { get; set; } } public class crossrate { public int fromcurrencyid {get;set;} public int tocurrencyid {get;set;} public datetime date {get;set;} public decimal rate {get;set;} } i think need create 2 one-to-many relationships, currency must have 2 collection of crossrate . can't have single collection referenced 2 fks, unless pk of entity composite (like in post ), currency have 1 pk. try model: public class currency { public int id { get; set; } ...

how to create a cuda shared library used in python -

i have created c shared library used in python works when test it. compile this: gcc -shared -std=c99 -i/usr/include/python2.6 -fpic -lpython2.6 -opymod.so pymod.c i have cuda source code "pymod.cu" same "pymod.c" , don't know how compile nvcc. thank in advance. you need first compile using nvcc , build shared library using gcc : nvcc -c test.cu -o test.o -xcompiler -fpic gcc -shared -fpic -o libtest.so test.o

linux kernel - vm_area_struct - find MAP_ANONYMOUS mapping -

how can detect area represented vm_are_struct mapped anonymous? assume vm_flags field contains vm_xxx flags doesn't contain map_xx flags. besides vm_page_prot field contains unexpected. by checking anon_vma pointer (which should set non-null) , vm_file (which should null, if mapping related file): if(vma->anon_vma != null && vma->vm_file == null) { // map_anon } but anon_vma seem lazily allocated (not initialized after mmap() called).

oracle - executing a procedure inside a package -

there package abc , many procedures inside it. want execute single procedure inside (say xyz). used below commands begin abc.xyz; end; i not able run same. can 1 getting unexpected symbol "begin" error create package specification : create or replace package pkg procedure xyz; end; create package body : create or replace package body pkg procedure xyz dbms_output.put_line('hi'); end end; executing exec pkg.xyz or begin pkg.xyz; end; now, verify code , see have done wrong in code.

Couldn't Run the Emulator on Android Studio -

i couldn't run emulator on android studio. it says, emulator: error: x86 emulation requires hardware acceleration! please ensure intel haxm installed , usable. cpu acceleration status: hax kernel module not installed! but installed intel hax , enabled hyper v bios i'm using windows 8.1 pro check in android sdk manager if intel x86 packages installed.

jsf 2 - How to pass a value on selected row change? -

i have permanent problem, have datatable value="#{mybean.items}" var="itms" , , want pass selected item bean class. in columns, use <f:setpropertyactionlistener value="#{itms}" target="#{mybean.selectedrow}" /> pass value, want rows. how that?, , put listener?. thank much. what richface version using? for richfaces 4.3.x, following example might trick: xhtml: <rich:extendeddatatable id="mytable" value="#{crudbean.rows}" var="rowitem" rowclasses="odd-row, even-row" selection="#{crudbean.actionform.selection}" rows="#{crudbean.actionform.occurrences}" rowkeyvar="idx" > <a4j:ajax event="selectionchange" listener="#{crudbean.actionform.selectionlistener}" immediate="true" /> <rich:column width="100px" styleclass="#{rowitem.classname}"> ...stuff... </r...

html - Gulp SASS random() failing on ubuntu server -

this question has answer here: sass: randomly pick background-image list 1 answer i having issues random() function in sass when compiling on ubuntu server. currently working fine locally if run gulp tasks on ubuntu box gulp-sass output generated once. this sass: @function multipleboxshadow($stars, $opacity) { $value: '#{random(2000)}px #{random(2000)}px rgba(255, 255, 255, #{$opacity})'; @for $i 2 through $stars { $value: '#{$value} , #{random(2000)}px #{random(2000)}px rgba(255, 255, 255, #{$opacity})' } @return unquote($value) } @mixin starbase($speed, $size, $amount, $opacity) { box-shadow: multipleboxshadow($amount, $opacity); animation: animstar $speed linear infinite; } #stars { @include starbase(50s, 1px, 700, 1); } and output on ubuntu box when using gulp-sass: #stars { animation: animstar 100s linear infinit...

Where to find the PostgreSQL db file in Cloud9? -

i switched sqlite postgresql , using cloud9 ide (rails). sqlite there file db/development.sqlite open examine db contents. can find similar file i've switched postgresql? you should able use following: sudo sudo -u postgres psql to access postgresql server. here's documentation cloud9 regarding postgresql.

SQL Server XML XQuery select where clause attribute -

Image
i have table following content id | guid | xmldefinitionid 1 | 5a0bfc84-13ec-4497-93e0-655e57d4b482 | 1 2 | e28e786b-0856-40b6-8189-0fbd68aa3e45 | 1 and in table following xml structure stored: <actionactivity displayname="displayname 1" isskipped="false" id="5a0bfc84-13ec-4497-93e0-655e57d4b482">...</actionactivity> <p:sequence displayname="prerequisites"> <actionactivity displayname="inner displayname 1" isskipped="false" id="e28e786b-0856-40b6-8189-0fbd68aa3e45">...</actionactivity> </p:sequence> <actionactivity displayname="displayname 2" isskipped="false" id="dcc936dd-73c9-43cc-beb4-c636647d4851">...</actionactivity> the table containing xml have following structure: id | xml 1 | (xml structure defined above here) based on guid want show displayname. @ moment have following query r...

asp.net - Stream.WriteAsync throws The remote host closed the connection exception -

i have asp.net webforms application , retrieve video database saved in varbinary format , show html5 video tag. after googled it, found way should play asynchronously using asp.net webapi , works fine first problem when video played first time , user click on play button replay video, the remote host closed connection. error code 0x800704cd exception throws @ line await outputstream.writeasync(buffer, 0, bytesread); . second problem when user click on seek bar, video goes played first. note internet explorer 11 plays video without problem, firefox , chrome have both problems. how can solve problem? here codes: public static class webapiconfig { public static void register(httpconfiguration config) { config.enablecors(); config.maphttpattributeroutes(); config.routes.maphttproute( name: "videoapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparamete...

SQL Matrix to array -

i working t-sql , have table looks matrix (8x8). objective make matrix (table) array using pivot ... have read forums , more stuff managed find still can't make code ... id bucket b1 b2 b3 b4 5 1 20 21 45 12 6 2 12 18 19 48 7 3 19 78 40 78 8 4 72 34 12 17 so need make "three dimensional array" table, , save row, column , value ... this row column value 1 1 20 1 2 21 1 3 45 1 2 12 etc etc etc 4 3 12 4 4 17 does have idea how write code in t-sql? ps. reason i'm doing this, because want multiply matrix itself. it's easier multiply if have in pivot table. thank you try unpivoting data : declare @table table (id int, bucket int, b1 int, b2 int, b3 int, b4 int) insert @table values (5,1,20,21,45,12), (6,2,12,18,19,48), (7,3,19,78,...

php - Object of class CI_DB_mysqli_result could not be converted to string -

here code : class mymodel extends ci_model { public function getinstitution() { $course = "programming"; $location = "jakarta"; $price = "price2"; $data = $this->db->query('select * coursesplace 1=1'); if($course) $data .= "and course=\"$course\" "; if($location) $data .= "and location=\"$location\" "; if($price) $data .= "and price=\"$price\""; return $data->result_array(); } } i want filter computer course places based on 3 variables (course, location , price), string data type. have "programming", "jakarta", , "price2" example. but, have error : a php error encountered severity: 4096 message: object of class ci_db_mysqli_result not converted string filename: models/mymodel.php line number: 14 ---> line 14 : if($course) $data .= "and course=\"$course\...

excel - How to add IList<IWebElement> in Arrays Selenium -

i new both c# , selenium . this sample code, working fine, know it's not standard way of coding don't know standard code instance. i have extract 5000-10000 elements each string, there fastest , standard code this, think solution slow. ilist<iwebelement> arnum = driver.findelement(by.xpath("sumxpath1")); ilist<iwebelement> mpnum = driver.findelement(by.xpath("sumxpath2")); ilist<iwebelement> mgnum = driver.findelement(by.xpath("sumxpath3")); int rowarnum=1; foreach(iwebelement artnum in arnum) {//for first column rowarnum++; xlworksheet.cells(rowarnum, 1) = artnum.text; } int rowmpnum =1; foreach(iwebelement mpnum in mpnum){ //for second column rowmpnum++; xlworksheet.cells(rowmpnum, 1) = mpnum.text; } int rowmgnum =1; foreach(iwebelement mgnum in mgnum){ //for third column rowmgnum++; xlworksheet.cells(rowmgnum, 1) = mgnum.text; } try this, should speed processing. maybe try , add ...

PHP - Decoding data sent from paypal into friendly readable format -

i have basic php paypal script works fine (i'm working on sandbox) my issue response paypal unreadable , cannot therefore use want i.e update database here's i'm getting: array ( [token] => ec%xxxxx0t [billingagreementacceptedstatus] => 0 [checkoutstatus] => paymentactioncompleted [timestamp] => 2015%2d05%2d15t08%3a23%3a58z [ack] => success [version] => 109%2e0 [build] => 16684246 [email] => mymail%40gmail%2ecom [payerstatus] => verified [firstname] => myfname [lastname] => mylname [countrycode] => [shiptoname] => fname%20lname [shiptostreet] => 1%20main%20st [shiptocity] => san%20jose [shiptostate] => ca [shiptozip] => 95131 [shiptocountrycode] => [shiptocountryname] => united%20states [addressstatus] => confirmed [currencycode] => usd [amt] => 96%2e00 ......... as shown i'm getting above response inst...

java - Prevent previously loaded entity being updated in transactional method -

i have following method in 1 of services @override @transactional public void createuserinfo(long userid, userinfo userinfo) { user olduser = userservice.finduserbyid(userid); if (olduser.infoisthesame(userinfo)) { return; } user updateduser = userservice.adduserinfo(userid, userinfo); feedservice.addfeed(feedaction.info_update, olduser, updateduser); } as can see finduserbyid() , adduserinfo() methods in same service, marked @transactional itself. as userservice.finduserbyid() executes in same transaction createuserinfo() started, olduser instance affected change of user info inside adduserinfo() (as loaded managed entity in same transaction). so problem when trying addfeed() olduser , updateduser same after service method calls. so question if there way change olduser not affected? note changing adduserinfo() start new transaction not option me, used in several other places. i tried copy olduser (...

dom - get attributes of an appended element by jquery -

this question has answer here: jquery doesn't work after content loaded via ajax 5 answers i want id of appended element jquery, cant, code: append elements: $(document).ready(function(){ $("#addslide").click(function(){ var slideid="slide"+n; var nslide="<td><img class='projimgs'id='"+slideid+"'onclick='opencustomroxy()' src='' style='width:75px;height:55px'/> <input id='sldaddr' name='"+slideid+"' type='hidden' value='' /> </td>"; $("#slidetr").append(nslide); }); and code atrribute 'id' : $(".projimgs").click(function(){ var id= $(this).attr('id'); console.log(id); var source= "http://localhost/exx/admin/fileman/index.html?integration=custom&type=files&i...

python - Get a lot of errors (Exceptions) while trying to call Java-classes (Neo4j) with JPype -

i'm trying work java , python bridge jpype, neo4j (which graph database). when try run simple java-program jpype, there no problems. import jpype jp jp.startjvm(jp.getdefaultjvmpath(), "-ea") javaclass = jp.jclass('jpype_test.a2') javainstance = javaclass() javainstance.callme(2, 3) jp.shutdownjvm() and class in java just: package jpype_test; import helloworld.embeddedneo4j; import java.io.ioexception; public class a2 { public a2() { super(); } public string callme(final int a, final int b) throws ioexception { final int res = math.abs(a - b); try { embeddedneo4j.main(null); } { system.out.println("i can't this!"); } return ("hello, world!" + res); } } but when try run "same" helloworld-program written including neo4j, there lot of errors , don't understand i'm doing wrong. package helloworld; import java.io.file; ...

asp.net mvc - Horizontal scrollbar never appears in Kendo Grid -

i'm trying make horizontal scrollbar appear when table width less total column widths. i have set width each column, somehow treats numbers ratios. if define 2 columns same width value, columns have 50% width. for example, columns.bound(p => p.column1).width(40); columns.bound(p => p.column2).width(40); would rendered same way like columns.bound(p => p.column1).width(100); columns.bound(p => p.column2).width(100); so, if columns have 20 , 30, columns 40% , 60% of width respectively. considering have set width each column, miss? picture: http://i.imgur.com/0utiwe8.png <style> @media (max-width: 800px) { .gridclassname { overflow-x: scroll; } } <style> //change max width number upto scroll should appear

javascript - Is it possible to test flow using Protractor without login flow? -

i want test flow using protractor occurs after login page, can bypass or skip or avoid login while testing flow? one option instead of opening fresh browser instance each test, open firefox loading firefox profile saved when logged in. aside many other things, profile contains cookies, used login session validation: log in application via firefox open help->troubleshooting information->profile folder->show in finder (for mac os) copy path profile use setfirefoxprofile howto learn how load profile every time run tests

javascript - Pass data from chrome extension to webpage -

i able pass data webpage chrome extension. code goes follows. var id = "myextensionid"; chrome.runtime.sendmessage(id, { messagefromweb: "sample message" }, function (response) { }); i able tab id @ extension side. how can send data extension tab? following code correct? chrome.runtime.onmessageexternal.addlistener( function(request, sender, sendresponse) { if (request.messagefromweb) { console.log(request.messagefromweb); } chrome.tabs.sendmessage(sender.tab.id,{ greeting: "hello" }); } ); the code, chrome.tabs.sendmessage(sender.tab.id,{ greeting: "hello" }); not throw error. how should listening @ web page events extension? from content script website script because content script , scripts in website can see same dom, can use communicate between them. easy as: content script: // data want sent var data = { random: 'some data', more: 'more dat...

rounding - round profile image in android -

this question has answer here: cropping circular area bitmap in android 13 answers i use below code making round profile picture in android http://www.androidhub4you.com/2014/10/android-custom-shape-imageview-rounded.html but in main activity used listfragment instead of activity imageviewround = imageview)parentview.findviewbyid(r.id.imageview_round); bitmap icon = bitmapfactory.decoderesource(getresources(),r.drawable.noimage_square); imageviewround.setimagebitmap(icon); i'm getting error 05-15 12:21:27.359: e/androidruntime(25107): caused by: java.lang.nullpointerexception: attempt invoke virtual method 'void android.widget.imageview.setimagebitmap(android.graphics.bitmap)' on null object reference try these com.androidhub4you.crop.roundedimageview imageviewround =(com.androidhub4you.crop.roundedimageview) parentview.findviewbyid(...

html - how to pass values from child pop up window to parent page using angular js -

i have parent page in through 1 link pop window appears , want pass input values parent page when ok button pressed. have used service store value think service methods called when page loads , since have pass value child parent page not loaded again values not persisting. can please me out in this. this parent page : <!-- here want show values got child. in tree-data="domain" not getting values pass child html --> <swt-tree tree-data="domain" tree-control="statementtree" label-provider="domainlabelprovider" content-provider="domaincontentprovider" expand-level="-1"> </swt-tree> <!-- here child html load --> <div ui-view></div> this child.html <form ng-controller="domaincontroller"> <input type="text" ng-model="busdomain.name" ng-change="namechanged()"> ...

Obtaining handle to Collection/Array object in @PreFilter and @PostFilter in Spring Security -

in spring security, @prefilter , @postfilter can used trim/prune argument/return object , filterobject references each element in object , used loop through argument/return collection/array. however, need handle actual collection/array whole , not specific elements in context. there way this? the reason creating externalized authorization service used spring security query , prune collection/array , service supports querying multiple answers in single question. once reference object whole, can iterate though elements myself create request externalized service. can done in spring security? implementing custom express handler. assuming return value modifiable, can use @postauthorize. example: @postauthorize("@mysecurityfilter.filter(authentication, returnobject)") list<string> findallmessages(); this assumes created bean name of "mysecurityfilter" looks this: @component public class mysecurityfilter { public boolean filter(authentic...