Posts

Showing posts from July, 2015

html - JavaScript error with XML when trying to read empty node -

i trying render catalog xml document , works, although when trying show default image if there no image present in xml node, disables parent node therefore forcing not show of , reads me error in console saying: uncaught typeerror: cannot read property 'getelementsbytagname' of undefined which pointing part of code: if (records[i].getelementsbytagname("image")[0].childnodes.length > 0) { so question in code below error causing not load xml node? ps: if needs more of code please let me know, , happy post it. for (var = fromitem; < nextmaxitem; i++) { if (records[i].getelementsbytagname("image")[0].childnodes.length > 0) { xmlcontent += '<article class="post ' + records[i].getelementsbytagname("category")[0].childnodes[0].nodevalue + '" id="">' + '<div class="col-sm-4 col-lg-4 col-md-4"><div class=...

security - Debug Java SSL Handshake using -Djavax.net.debug=all -

my node.js client connecting java server ssl. seems work until certificateverify cache session, , client prints ssl couldn't authorize. here snippet of java server debug statements logged ssl handshake using -djavax.net.debug=all. problem is, java not explicitly raise red flags couldn't verify signature. tail of log stops. note: added ellipses after cache server session @ end of log. can me decipher log output determine why ssl handshake failing? i'm guessing can't verify signature of certificate, not see being explicitly stated. pool-1-thread-2, read: tlsv1.2 handshake, length = 264 *** certificateverify signature algorithm sha512withrsa [read] md5 , sha1 hashes: len = 264 0000: 0f 00 01 04 06 01 01 00 1e f6 13 87 8c 77 81 2d .............w.- 0010: e3 33 eb e0 8f 80 49 c6 90 f9 b5 4c 9b a0 69 77 .3....i....l..iw 0020: b1 14 6c e3 b2 15 15 1f 26 d5 69 31 64 36 0d d1 ..l.....&.i1d6.. 0030: da ad ba 58 bf 76 6d 25 1d 49 ba 4a c6 80 1c 49 ....

ios - UIView --> UIImage for non-visible view? -

i'm trying go work around inability use custom ui elements in watchkit. app uses custom uibuttons (mroundedbutton) , i'm trying replicate them on watchkit interface creating images of them , using background wkinterfacebutton. problem i'm not able convert uiviews uiimage when view isn't visible. code i'm using, it's giving me index out of bounds error on drawviewhierarchyinrect . - (uiimage *)convertbuttontoimage:(mroundedbutton *)button { uigraphicsbeginimagecontextwithoptions(button.bounds.size, yes, 0); [button drawviewhierarchyinrect:button.bounds afterscreenupdates:yes]; uiimage *image = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return image; } since there no screen/window in watchkit extension, how go creating images would-be views? rather drawviewhierarchyinrect, try using renderincontext on layer. i ran same problem describe. using drawviewhierarchinrect didn't work - black sc...

import - Issue with Standalone in Processing -

i have sketch running in processing 2.1.2 , , runs fine sketch window. when try export standalone windows application, processing creates application.windows folder, contains 'lib' , 'source' subdirectories. when double-click application, showing me blank window. can guide me on how resolve issue? coding of program given below: import toxi.geom.*; import toxi.geom.mesh.*; import toxi.processing.*; import processing.serial.*; trianglemesh mesh; toxiclibssupport gfx; pimage img; string input; serial port; int x,y,z; void setup() { size(448, 299,p3d); println(serial.list()); port = new serial(this,serial.list()[0], 9600); port.bufferuntil('\n'); mesh=(trianglemesh)new stlreader().loadbinary(sketchpath("check.stl"),stlreader.trianglemesh); gfx=new toxiclibssupport(this); img=loadimage("imagei.jpg"); } void draw() { background(img); translate(width/2,height/2,0); rotatex(radians(x)); // pitch rotatey(radians(y)...

java - Clock and dynamic layout -

how can show hour minutes , seconds of clock in textview continuously using dynamic linear layout`this format works on static layout not on dynamic layout please me thanks? list item public class buttonactivity extends activity { button b; scrollview scrollview; int count = 4;`enter code here` private int mhour,mminute,msecond; int min,hr,sec; private handler mhandler = new handler(); public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_button); runnable mupdate = new runnable() { @override public void run() { calendar c = calendar.getinstance(); mhour = c.get(calendar.hour_of_day); mminute = c.get(calendar.minute); msecond = c.get(calendar.second); min = mminute; hr = mhour; sec = msecond; string timeset = ""; if (hr > 12) { hr -= 12; timeset = "pm"; } else if (hr == 0) { hr +...

kill - Execute method when Android app process is finished -

i'm working on android app , need know when os killed process, can make http request server. i've tried start service , put request in ondestroy() method, service stops when kill manualy (with start_sticky). use start_not_sticky, service ends app, not execute ondestroy() method. my manifest looks this: <service android:name=".checksessionendservice" android:enabled="true" android:exported="false" > </service> when process killed it's gone. can't execute anymore. ondestroy() called after service stopped, either stopservice() or stopself() (and service isn't bound), not mean process has been killed. if you're concerned user swiping app recents try http://developer.android.com/reference/android/app/service.html#ontaskremoved(android.content.intent) or http://developer.android.com/reference/android/content/pm/serviceinfo.html#flag_stop_with_task

How to get multiple text colors for a single NSTextField in Swift? -

textfield.stringvalue = "this part red - here blue" all inside 1 textfield in 2 different colors. could put html code inside textfield? because want provide url link inside textfield, solve 2 problems. look nsmutableattributedstring class achieve this. example: attrstring = nsmutableattributedstring(string: "hello world", attributes: [nsfontattributename:uifont(name: "arial", size: 18.0)!]) attrstring.addattribute(nsforegroundcolorattributename, value: uicolor.redcolor(), range: nsrange(location:0,length:2)) this example creates nsmutableattributedstring , adds attribute sets string have red font color characters @ location 0 2. documentation: https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/classes/nsmutableattributedstring_class/index.html

javascript - resize divs to auto and then to same height as one another upon window resize? -

i have 3 column divs resize same lenghth. have been able upon page load executing following function (which found on though unfortunately unable find give attribution, update if can find it): function resizeit() { var largest = 0; $(".feature").each(function(){ //loop through each section var findheight = $(this).height(); //find height if(findheight > largest){ //see if height greater "largest" height largest = findheight; //if greater, set largest height 1 } }); $(".feature").css({"height":largest+"px"}); } this works fine, want divs resize each time window resizes. modified function , call each time window resizes , call function upon page load. here modified function (first line of function addition) plus function call window resize: function resizeit() { $(".feature").css({"height: auto"}); var largest = 0; $(".feature").each(function(){ //loop through each section ...

ruby on rails - Open & populate infowindow via ajax on "click" with Gmaps4Rails -

i trying populate google map infowindow content partial (via ajax) when map marker clicked. apneadivings wiki post here has helped: https://github.com/apneadiving/google-maps-for-rails/wiki/adding-an-id-to-markers-and-access-them-later i have id model instance want retrieve in marker (from source: "marker.json({ :id => user.id })"). cannot figure out how use attach listener markers click action, , put resulting html infowindow. after create markers: markers = handler.addmarkers(...); _.each(markers, function(marker){ google.maps.event.addlistener(marker.getserviceobject(), 'click', function(){ $.get(expectedurl) .done(function(data){ //only know how `data` structured var infowindow = new google.maps.infowindow({content: 'content' }); infowindow.open( handler.getmap(), marker.getserviceobject()); }) }) });

go - Golang Couchbase integration throwing errors on setting/getting -

implementing https://github.com/couchbase/go-couchbase however - no matter - various types of connections - errors when setting/getting keys. vbmap smaller vbucket list: 18119 vs. [] code example below (have tried many variations) b, err := couchbase.getbucket("http://somebucket:somepassword@myserver:8091/", "default", "somebucket") mf(err,"con") err = b.set("somekey", 0, map[string]interface{}{"x": 1}) mf(err, "set") you trying connect memcached bucket. go-couchbase doesn't support buckets of type memcached.

sas - Ignore part of sentence with regex -

what i'm trying ignore parts of sentence regex. i'm working getting last value of sentence: gleason score 3+4=7 what's important part of bigger picture, regex gets part of sentence, why i'm looking value 7. per i've got regex mark whole sentence: gleason score\s+\d.\d.\d is there whay can latest value? thanks. you use pattern [^=]+$ explanation: [^=] # character not in [=] class + # (one or more)(greedy) $ # end of string/line

jquery - Configuring Carousel to scale down to certain size and center in dedicated area - Also scaling high res images down -

i'm trying configure carousel bootstrap center images on webpage, scale them down there original size 1 set , move navigation buttons further in edges of webpage, can't figure out why i'm doing isn't working. i've made class around entire carousel in attempt make smaller/align center doesn't work. here's looks like: http://i.imgur.com/qh7cdwx.png here's i've been trying do: http://i.imgur.com/0nui6pk.png i'd grealy appreciate you. it's hard me figure out how defined carousel classes , ids without seeing codes if using default bootstrap carousel, should center carousel images: .carousel-inner img { display: block; margin: 0 auto; }

visual studio - Load Dev Express data grid row values into textboxes in VB.net -

i trying load values datagrid have set using dev express, text boxes when click respective cell. i using normal datagrid comes vs 2013: private sub datagridview1_cellclick(sender object, e datagridviewcelleventargs) handles datagridview1.cellclick if e.rowindex >= 0 dim row datagridviewrow row = me.datagridview1.rows(e.rowindex) tbid.text = row.cells("id").value.tostring tbfirstname.text = row.cells("firstname").value.tostring tblastname.text = row.cells("lastname").value.tostring tbaddress.text = row.cells("address").value.tostring end if end sub but cannot seem find way exact same thing in dev express' gridview , have found other topics explain how in c# not vb.net . take @ obtaining , setting cell values help-article - obtain row cell value can use columnview.getrowcellvalue method follows: tbid.text = gridview1.getrowcellvalue(2, "id").tostrin...

Crystal viewer inside of Visual Studios 2012 "OK" and "Cancel" buttons not working -

i trying view report crystal reports viewer inside of vs2012. after enter parameter values cannot go further because "ok" , "cancel" buttons nothing. viewer date, , parameters work inside of cr2011. help. you need manage buttons do, go code , write in events.

c# - Combination of ScrollViewer and Grid not working as expected -

i defined following dialogwindow: <ui:dialogwindow x:class="codeelementratingwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ui="clr-namespace:microsoft.visualstudio.platformui;assembly=microsoft.visualstudio.shell.12.0" title="codeelementratingwindow" height="600" width="800"> <grid name="root"> <grid.rowdefinitions> <rowdefinition height="60px"></rowdefinition> <rowdefinition height="510px"></rowdefinition> <rowdefinition height="30px"></rowdefinition> </grid.rowdefinitions> <label grid.columnspan="2" grid.row="0" grid.column="0" name="titlelabel" content="please rate difficulty perce...

jquery - How to show row numbers greater than 9999 in free jqgrid -

code answer set rownumbers false dynamically in jqgrid is used create button toggles row numbers. $grid.jqgrid("navbuttonadd", "#grid_toppager", { buttonicon: "fa-list-ol", iconsovertext: true, caption: '', id: "rownumbers", onclickbutton: function (options, e) { var $me = $(e.currenttarget); if ($grid.jqgrid('getgridparam', 'rownumbers') && $grid[0].p.colmodel[0].hidden ) { $grid.jqgrid('showcol', 'rn'); $me.addclass("ui-state-active"); } else { $grid.jqgrid('hidecol', 'rn'); $me.removeclass("ui-state-active"); } resizegrid(); savewindowstate(); } }); if (iscolstate && mycolumnsstate.rownumbers) { $("#rownumbers").click(); } if ro...

What is the future of dl() function in php? -

i reading in php documentation dl function deprecated. mean should stop using dl function scripts. if that's case how can load .so php scripts. or missing something. you should stop using it, because deprecated , removed. should use php.ini file in order configure extensions on server. you can use extension_loaded('extension_name') see whether extension loaded , throw error if it's not.

windows - Passing Params From One Proc to Another in x86 Assembly -

so im having trouble understanding how pass parameters 1 proc another, both in different .asm file. im using tasm on 64 bit. so lets have main proc: extrn addproc: proc, putint: proc main proc mov ax, n ;where n integer call addproc main endp end main how send n addproc , use add 2 (just example) addproc proc add ax, 2 addproc endp end addproc

node.js - Grunt cwd option issue -

i trying configure grunt-svg-sprite plugin in project , per documentation here http://gruntjs.com/configuring-tasks : cwd src matches relative (but don't include) path. src pattern(s) match, relative cwd. and per https://www.npmjs.com/package/grunt-svg-sprite however, path/to/assets become part of shape ids, want add working directory in cases: your_target: { expand : true, cwd : 'path/to/assets', src : ['**/*.svg'], dest : 'path/to/css/dir', options : { // target-specific options } }, now, grunt file has section: svg_sprites: { options: { }, cw_sprites: { expand: true, cwd: 'public/assets/dist/svgs/', src: ['**/*.svg'], dest: 'public/assets/stylesheets/svg-sprites', options: { shape : { dimension: { ...

Android (Studio) FileNotFoundException but File is on SD card -

so sometime ive been trying implement joanzapata's pdfview, from: " http://joanzapata.com/android-pdfview/ " the main focus api-10+ friendly. no matter keep getting 1 error or another, somehow have project working (apparently) when find pdf file , try , load same code projects sample, following issue. firstly code: ... //file currentloc = new file(string_pdfloc); ... //file thepdf = currentloc; //thepdf of type file if( thepdf != null ) { log.d("mydebug", "1/3 file not null"); if( thepdf.exists() ) { log.d("mydebug", "2/3 file exists"); if (thepdf.canread()) { log.d("mydebug", "3/3 file can read"); log.d("mydebug", "thepdf: " + thepdf.getabsolutepath()); //------ pdf should exist ---------------------- log.d("mydebug","should load thepdfview"); ...

enterprise architect - SQL query in Sparx EA returning multiple rows for tagged values -

i’m trying sql query return single row per attribute don’t have particular tagged value assigned them, or if have tagged value empty. the query below returns after except returns multiple rows because of different tags assigned them. i’ve tried getting group work return single rows no avail. select t_package.name subpackagename , t_object.name xtable , t_attribute.name attributename ( (t_package t_package_1 inner join (t_package inner join t_object on t_package.package_id = t_object.package_id) on t_package_1.package_id = t_package.parent_id) inner join t_attribute on t_object.object_id = t_attribute.object_id) left join t_attributetag on t_attribute.id = t_attributetag.elementid (((t_package_1.name)='x') , ((t_object.object_type)='class') , ((t_attribute.type) not 'tns:%') ) , (t_attributetag.property <> 'dm_fieldref' or (t_attributetag.property = 'dm_fieldref' ...

php - Get process resource by PID -

Image
i want write web ssh console, , found 2 problems. what want do. first want execute start.php file have following code. $process = proc_open('start', array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "a") ), $pipes); second want run command.php file run command on created process in start.php file , results it. $pid = 12345; print_r(process_command('ping google.com', $pid)); i want access process ( cmd ) created in past, send command , result. why problem, if can create new process each command.php execution? because new process new session, if login mysql in past command.php execution, in next executions must login mysql again, because new process not remember logged. example on windows. i create new process ( cmd ) in php, current directory c:\webserv\ . i write cd / command, current directory c:\ . this example, dont want c...

c# - Empty client-side models -

i'm working on windows phone 8.1 app, , i'm having trouble getting client's model objects obtain values database i'm hosting on azure. code i've written seems work (at least iterate correctly), problem bars objects empty. don't know how them obtain values stored in db (barid, barname, etc). i've built working services project i've published azure website. project contains dtos, context, , controllers. client project contains models , views. need change architecture? if so, how should change it? here's code that's being called in controller: public class barscontroller : apicontroller { private gatoradeshowerdb db = new gatoradeshowerdb(); // get: api/bars // [route("http://gatoradeshower.azurewebsites.net/api/bars/all")] public iqueryable<bar> getbars() { return db.bars; } // get: api/bars/5 [responsetype(typeof(bar))] public async task<ihttpactionresult> getbar(int ...

android - Real time updates for mobile apps -

im working on mobile application , i'm trying incorporate real time updates. i'm trying sense of options available me , community thinks solution. i've been considering consuming api using type of polling technique receive server side updates, feel there better solution. i'm trying figure out solution server can push notifications native mobile app. thanks guys you use c2dm (cloud device messaging). instead of polling server every often, method pushes information clients when ready. for tutorial, see here: http://www.vogella.com/tutorials/androidcloudtodevicemessaging/article.html

ios - UIRefreshControl Exact Content offset trigger height -

what exact contentoffset trigger uirefreshcontrol? doing own testing debug messages seems fluctuate around +-100 px, know exact number. have insight matter? thanks you can print value of tableview.contentoffset.y in refresh selector call. trigger point.

raspberry pi python pwm continue after program done -

i have robot working on , controlling pwm. way controlling script sets pwm , exits. need set pwm , keep running. reason need exit because calling script through ssh connection each time x , y values change. normal digital outputs continue after program exits pwm doesn't way have setup. here code far. contains lot of print statements try me figure out problem was. #filename: setmotors.py import rpi.gpio gpio sys import argv time import sleep motor_en_1_pin = 14 motor_a_1_pin = 15 motor_b_1_pin = 18 motor_en_2_pin = 23 motor_a_2_pin = 24 motor_b_2_pin = 25 def mixxy(x, y): """ mixes x , y joystick values 2 motor drive system input: x (int or float), y (int or float) output: (leftmotor (float), rightmotor (float)) tuple """ leftmotor = y + x rightmotor = y - x return (leftmotor, rightmotor) def setmotorpwms(leftmotor, rightmotor): #left motor if leftmotor == 0: print("left motor 0...

sparql - Looking for Winston_Churchill data -

i cannot imagine why work: select * { <http://dbpedia.org/resource/mahatma_gandhi> dbpedia-owl:birthname ?name. optional{<http://dbpedia.org/resource/mahatma_gandhi> dbpedia-owl:birthdate ?birthdate} optional{<http://dbpedia.org/resource/mahatma_gandhi> dbpedia-owl:restingplace ?restingplace} optional{<http://dbpedia.org/resource/mahatma_gandhi> dbpedia-owl:deathdate ?deathdate} } and - not (empty bindings): select * { <http://dbpedia.org/resource/winston_churchill> dbpedia-owl:birthname ?name. optional{<http://dbpedia.org/resource/winston_churchill> dbpedia-owl:birthdate ?birthdate} optional{<http://dbpedia.org/resource/winston_churchill> dbpedia-owl:restingplace ?restingplace} optional{<http://dbpedia.org/resource/winston_churchill> dbpedia-owl:deathdate ?deathdate} } on http://live.dbpedia.org/sparql upd this answer when tried vincent_van_gogh - same problem dbpedia:mahatma_gandhi has dbpedia-owl:birthname a...

windows - AttributeError: 'module' object has no attribute 'testmod' Python doctest -

when ever try doctest in python, whenever run code if __name__ =="__main__": import doctest doctest.testmod() i response interpreter attributeerror: 'module' object has no attribute 'testmod' i can run code fine, whenever run on windows machine, doesn't work. my machine running windows theirs os x, running python 2.7.5. thank :) it looks there different module called doctest being imported instead of standard one. to find out module being imported exactly, add following print : if __name__ =="__main__": import doctest print doctest.__file__ # add doctest.testmod() the print should produce similar c:\python27\lib\doctest.pyc , depending on location , version of python you're using. other output means importing wrong module, , explain why you're getting error.

c# - Register default Castle Windsor components while allowing custom components -

i trying implement convention based registration castle windsor, cannot figure out how deal swapping out default implementations of services. in framework, might have interface service , default implementation: public interface ilogger { void info(string message); } public class logger : ilogger { public void info(string message) { console.writeline(message); } } in typical use case, want castle windsor register logger ilogger service. however, there use cases client code might provide alternate implementation of ilogger: public class customlogger : ilogger { public void info(string message) { console.writeline("[log]: {0}", message); } } in use case, want castle windsor register customlogger ilogger service instead of logger. so far, i've tried tiered approach attempt register default interfaces, followed non-default interfaces: using (var container = new windsorcontainer()) { container.register( ...

javascript - Cannot use GLOB with JSHint in Windows? -

i'm doing poc of npm build tool ( http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/ ). i'm new using npm. now, have jshint , mocha installed. packagae.json attached. now, when run "npm run lint" in command line (windows 7), gives me error: c:\project>npm run list mynpmproject@1.0.0 lint c:\project jshint test/*.js error: can't open test/*.js it works when change script "lint": "jshint test/test.js". can use glob jshint? please advise , thank in advanced. you shouldn't need glob, give directory , scan js files in there.

python - Cipher program losing accuracy -

i have program in python takes 2 strings. 1 plain text string, cipher key. go on each of characters , xors bits cipher characters. when going , forth few of letter not seem change properly. here code: //turns int bin string length 8 def bitstring(n): bin_string = bin(n)[2:] bin_string = ("0" * (8 - len(bin_string))) + bin_string return bin_string //xors bits def bitxor(b0, b1): nb = "" x in range(min(len(b0), len(b1))): nb += "0" if b0[x] == b1[x] else "1" return nb //takes 2 chars, turns them bin strings, xors them, returns new char def cypherchar(c0, c1): return chr(int(bitxor(bitstring(ord(c0)), bitstring(ord(c1))), 2)) //takes s0 (the plaintext) , encrypts using cipher key (s1) def cypherstring(s0, s1): ns = "" x in range(len(s0)): ns += cypherchar(s0[x], s1[x%len(s1)]) return ns for example in long string word 'test' cipher 'eest', , stuff that i h...

Java constructor confusion, what goes where? -

unsure should placed constructor , should field, notice can add things initialized without them having in constructor. here 2 examples, i'm unsure best use , reasons behind it. example 1: public class purchaseorder { private string date; private string customerid; private string productcode; private int quantity; private int discountrate; private int priceperunit; private customerdetails customer; // part i'm changing public purchaseorder(orderdate date, string id, product product, int quantity) { this.discountrate = customer.getdiscountrate(); this.date = date.getdate(); this.customerid = customer.getcustomerid(); this.productcode = product.getproductcode(); this.quantity = quantity; this.priceperunit = product.getpriceperunit(); } example 2: public class purchaseorder { private string date; private string customerid; private string productcode; private ...

database - adding a trigger in mysql to change a content on update -

i want add mysql trigger on update function. should triggered on updating specific column of 1 table 'available teachers' , update specific column of table 'available subjects'. how achievable? i believe checking change in old , new field after update of teachers table update available column of subjects it. if not (new.teachers.available <=> old.teachers.available) set new.subject.available = new.teachers.available; end if;; it should right?

asp.net - how to split the string in c# -

i want split string "this regarding problem of {pro} in {statement}" i want output this regarding problem of {pro} in {statement} you try this regex : ([^{]+|{[^}]*}) it matches each group of characters defined either: a sequence of characters (at least one), none of { ; or a { character, followed number of characters not } , followed }

java - HIBERNATE: cant extract data from MySQL using hibernate -

sorry bothering you. i'm newbie hibernate , have silly problem. can't deal on own. every time i'm trying select data db, i'm getting syntax error, decided dummy table (but problem same before): create table `test` ( `id` int(10) unsigned not null auto_increment, name` varchar(45) default null, primary key (`id`) ) engine=innodb default charset=utf32; hibernate config file: <?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.password">qayxsw</property> <property name="hibernate.connection.url"...

amazon web services - How to use "aws s3 cp" to output a directory or wildcard to stdout -

i have been able use --recursive multiple files , "-" destination stdout can not seem use them together. example: this works: aws s3 cp s3://mybucket-ed/test/ . --recursive download: s3://mybucket-ed/test/upload-0 ./upload-0 download: s3://mybucket-ed/test/tower.json ./tower.json and works: aws s3 cp s3://mybucket-ed/test/upload-0 - ... upload-0 file contents ... but returns nothing: aws s3 cp s3://mybucket-ed/test/ - --recursive any suggestions short of listing out directory contents , doing individual cp commands each file? note need of files in s3 directory sent out stdout (and not recursive option).

java - Will my singleton be killed? -

i have application create foreground service make sure user initiated upload continues if user quits app or app killed memory pressure. both service , app use singleton pass data around. know not best solution, kindly ask refrain comments bad-bad singletons question not in in following: when close app, foreground service continues running , can access singleton. there risk of singleton being garbage collected due memory pressure or there other memory related risks of using singleton in case? static variables destroyed when application killed. won't randomly disappear while service running. if entire service restarts have account possibility of not having singleton when restarts.

angularjs - getting Error: [$injector:unpr] Unknown provider -

factory angular.module('searchapp') .factory('queryfactory', ['$http', function($http) { var urlbase = 'http://localhost:9002/v1/search?rs:q=oil'; var queryfactory = {}; queryfactory.getqueryresults = function () { $http.defaults.headers.common['authorization'] = 'basic' + btoa('admin' + ':' + 'admin'); return $http.get(urlbase + '&rs:searchcategory=allegro'); }; controller angular.module('searchapp') app.controller('searchresultscontroller', ['$scope', 'queryfactory', function ($scope, queryfactory) { $scope.status; $scope.searchresults; getqueryresults(); function getqueryresults() { queryfactory.getqueryresults() .success(function (data) { $scope.searchresults = data; }) .error(function (error) { $scope.status = 'unable load search results: ' + error.message; })...

javascript - Change async workflow to Promise (Bluebird) -

i have been trying wrap head around promises. basic concepts understand, once gets nested, little bit confused. feedback appreciated here code trying refactor promises (bluebird) var getindividualdata = function(url, donegetindividualdata) { var $, data; request(url, function(err, res, body) { if (!err && res.statuscode === 200) { $ = cheerio.load(body); data = { title: $("#itemtitle").children()["0"].next.data, condition: $("#vi-itm-cond").text(), price: $("#prcisum_bidprice").text(), imgurl: $("#icimg")[0].attribs.src, createdat: chance.date(), likes: chance.integer({min: 0, max: 1000}) }; donegetindividualdata(null, data); } else { donegetindividualdata(err); } }); }; var getlisting = function(url, donegetlisting) { var ...

iphone - Can I set frame for UIView when use Adaptive Layout -

i trying use setframe uiview, use auto layout on it. trouble can setframe uiview, in spite of use setframe(x, y, w, h) it. realise because of adaptive layout deny it, can setframe first @ runtime before adaptive layout adapt? thank you if trying use adaptive layout auto layout should not think in terms of frames. however, edge cases, auto layout engine allows "fine tuning" after has calculated position of elements. in uiview code set layout constraints - (void)updateconstraints { [self applymyviewconstraints]; [super updateconstraints]; } after system updates constraints, call layoutsubviews in uiview. @ stage frames related items set , final. can overwrite auto layout frames desire. - (void)layoutsubviews { [super layoutsubviews]; self.myview.frame = cgrectmake(0, 0, 10, 200); }

Removing JavaFX Accordion Border -

i'm working on project , theming javafx application css go. i'm having trouble removing border around content of javafx titledpane in accordion. there appears 1px line @ bottom cannot seem remove (screenshot: http://i.stack.imgur.com/ciinc.png ). has faced similar issue before? accordion.setstyle("-fx-box-border: transparent;"); reasoning behind why works explained in answer similar question: how rid of border around split pane in javafx?

semantics - Searching semantically tagged documents in MarkLogic -

can 1 please point me simple examples of semantic tagging , querying semantically tagged documents in marklogic ? i new in area,so beginner level examples do. when "semantically tagged" mean regular xml documents happen have triples in them? discussion , examples @ http://docs.marklogic.com/guide/semantics/embedded pretty that. start enabling triple index in database. insert test doc. xml, sem:triple element represents semantic fact. xdmp:document-insert( 'test.xml', <test> <source>ap newswire</source> <sem:triple date="1972-02-21" confidence="100"> <sem:subject>http://example.org/news/nixon</sem:subject> <sem:predicate>http://example.org/wentto</sem:predicate> <sem:object>china</sem:object> </sem:triple> </test>) then query it. example query pretty complicated. understand what's going on i'd insert variations o...

How to check if we are in cart page Shopify -

how can check if current page cart page in theme.liquid? tried page.handle=='cart' not working. you don't need handle filter, can use: {% if template == 'cart' %} ... {% endif %}

What is wrong with my code in sml? -

i don't know why code doesn't work. fun lookup _ [] = 0 | lookup key ((k,v)::entries) = if k = key v else (lookup key entries) that's happened when tested in cmd. val lookup = fn : ''a -> (''a * int) list -> int - lookup (1,[(1,2),(2,3)]); val = fn : ((int * (int * int) list) * int) list -> int there's nothing wrong code, didn't call lookup enough arguments. make common mistakes among beginner sml programmers coming other languages. i'll try clarify that. first, important thing know functions in standard ml this: all functions in standard ml take 1 argument. you might confused @ point, because lookup function looks if it's taking 2 arguments. kind of does, not really. there 2 main "workarounds" (i'm using quotes because great feature of language) representing functions take multiple arguments: 1. using curried functions if need write function which, conceptually, needs...