Posts

Showing posts from May, 2012

angularjs - Angular properties (variables) use in the view -

i have list of schools , list of teachers. schools [ { "id": 1, "nameofinstitution": "summer elementary", "schoollevel": "01304" }, { "id": 2, "nameofinstitution": "grady middle", "schoollevel": "02400" } ] teachers [ { "id": "1", "school": "1", "name": { "lastorsurname": "harrison", "firstname": "john", "middlename": "" } }, { "id": "2", "school": "1", "name": { "lastorsurname": "nelson", "firstname": "darren", "middlename": "" } }, { "id": "3", "school": "2", "name": { "lastorsurname": "stewart...

Is it still possible to retrieve the user url using the YouTube Data API (v3) -

i've heard new youtube data api (v3) not retrieve user url anymore? correct? i product owner of community software , enrich public profile of user social network content. so example community member want connect community account youtube account (google+) can display , share url of youtube account other community members. thanks with channels.list method, you'll both g+ username channel url.

graph - Getting non-unique results from METIS when different compiler is used -

i'm trying use metis 5.1.0 partitioning large graphs. have compiled metis source code in windows (using cygwin), linux (using gcc), , mac (using different version of gcc). unfortunately, results in various platforms different. tried 2 different versions of cygwin on windows , surprisingly affected results too. on other hand, using same binary on different machines (same platform) gives unique results. i understand metis performs graph partitioning using heuristics compiler/platform dependency not acceptable in use case. have developed java application calls metis binary file , it's quite important me same result across various platforms.

svg - Is there a way to add a highlight to pie chart in d3? -

i hope i'm using correct term, trying create highlight along top of pie chart in d3. i've seen lot's of things adding drop shadows have been unable make work highlight. so, tried adding arc on top of chart , adding gaussian blur it, there 2 issues it: doesn't transition rest of chart , highlighting extends above chart, can't seem stay within edges of chart. here's example: http://jsfiddle.net/hf3adsj5/ the code i'm using try add highlighting follows: var arc2 = d3.svg.arc() .innerradius(innerradius) .outerradius(outerradius) .startangle(math.pi/4) .endangle(-7/12*math.pi); var filter2 = defs.append("filter") .attr("id","highlight"); filter2.append("fegaussianblur") .attr("in","sourcealpha") .attr("stddeviation",2) .attr("result","blur"); filter2.append("fecolormatrix") .attr("in", "blur") ...

c# - Is it possible to hide SQL connections from 3rd party developers? -

we hired 3rd party finish c# web project , need access our sql database. how can hide our user name , password them still give them access? efforts far include: creating wcf realize not have control of servers hosting our web site. creating dll able find actual connection string digging through watch window @ break point while debugging. encrypting connection strings within web config. using watch window @ break point, can find decrypted connection string. create new database , change user name , password , let them access that.

c# - How to serialize a Class contains BitmapImage? -

i have deepcopy method, serializes object passed in parameter , returns deserialized object make deep copy. my method is: public static class genericcopier<t> { public static t deepcopy(object objecttocopy) { using (memorystream memorystream = new memorystream()) { binaryformatter binaryformatter = new binaryformatter(); binaryformatter.serialize(memorystream, objecttocopy); memorystream.seek(0, seekorigin.begin); return (t)binaryformatter.deserialize(memorystream); } } } it works well, if object passed parameter doesn't contain bitmapimage field , properties. public class myclass { public string teststring {get; set;} public bitmapimage testimage { get; set;} } if make deepcopy of myclass, myclass orginal = new myclass(){ teststring = "test"}; myclass copy = genericcopier<mycla...

php - msqli_fetch_array() doesnt work? -

i have following code: <?php $link = mysqli_connect( 'localhost', 'root', '', 'pruebatiendas'); mysqli_error($link); $que = "select * categoria"; $result = mysqli_query($link,$que) or die(mysqli_error($link)); ?> <!doctype html> <html lang="es-co"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>imagenes</title> </head> <body> <?php while($row=mysqli_fetch_array($result)) { ?> <a href="prueba.html"><?php echo $row['nombre_c']?></a><br/> <?php } ?> </body> </html> but not show me links, wrong? if understand correctly, that's need: <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("pruebatiendas") or die(mysql_error()); $query = mysql_que...

python - Same view with multiple URL patterns and optional arguments -

i trying design urlconf file, 1 of views accepts 2 optional parameters: date , account_uuid . views.py : @login_required def dashboard(request, date=none, account_uuid=none): # unrelated code... urls.py : urlpatterns = patterns( 'app.views', url(r'^dashboard$', 'dashboard', name='dashboard'), #what here?? ) user may visit url contains 1 or both parameters. without arguments: http://example.com/dashboard with date (ddmmyyy format) should like: http://example.com/dashboard/01042015 with account uuid only: http://example.com/dashboard/e1c0b81e-2332-4e5d-bc0a-895bd0dbd658 both date , account uuid: http://example.com/dashboard/01042015/e1c0b81e-2332-4e5d-bc0a-895bd0dbd658 how should design urlconf? should easly readable , fast. thanks! using multiple patterns easiest way achieve this: urlpatterns = patterns('app.views', url(r'^dashboard$', 'da...

Rails: Relate two records after creation -

i have model in rails: class commission < activerecord::base has_and_belongs_to_many :books end class book < activerecord::base has_and_belongs_to_many :commissions end this model generates 3 tables: commission, book , books_commissions. in first process of app generate , save commissions , books without relating entries. question : how create record in books_commissions if know book_id , commission_id? lets have object book model book , object commission model commission. then book.commissions << commission should trick.

osx - Using regular expressions to get parts of file name -

on mac (os x) have directory many images named this: img_250x333_1.jpg img_250x333_2.jpg img_250x333_3.jpg ... i need rename of them to: img_1.jpg img_2.jpg img_3.jpg ... i think using unix command line "mv" , kind of regex job, don't know how! can please help? thanks! what happens if there's img_111x333_1.jpg , img_444x222_1.jpg? risk mangling/overwriting something... but if want, can this: #!/bin/bash f in *.jpg; new=${f/_*_/_} echo mv "$f" $new done if doing, remove word echo .

php - Call objects in array values -

i set array variable this: $app = [ "page" => function(){ echo "ok"; }, "test" => function(){ testfunc(); }, ]; now, want know how can call or run objects in array, i trying use eval($app['test']) not work! you can use call_user_func() ie. call_user_func($app['page']);

Pasting multiple images from the clipboard into PowerPoint using VBA -

is there way paste 2 images clipboard powerpoint using vba? have been able paste 1 image, copied, using .shape.paste . however, cannot figure out how select previous 1 well. or alternatively, can every item in clipboard pasted @ same time? any appreciated.

c# - Clon canvas to dynamic viewbox WPF -

having main window , canvas class graphcontext animations , several shapes interact like: xaml <dockpanel name="stackpanel2" dockpanel.dock="left" margin="10,10,10,10" lastchildfill="true" > <myctrl:graphcontext x:name="graphsurface" background="black" > </myctrl:graphcontext> </dockpanel> code public class graphcontext : canvas { ellipse _fixedcircle; internal int cavaswidth { get; set; } internal int cavasheight { get; set; } public void drawsinglepoint(solidcolorbrush color) { this.children.clear(); _fixedcircle = new ellipse(); _fixedcircle.width = 25; _fixedcircle.height = 25; _fixedcircle.stroke = color; _fixedcircle.fill = color; _fixedcircle.strokethickness = 3; // center x , y coordinates double x = this.actualwidth / ...

jquery - How to pass variables to a function and return some of their properties javascript -

i have drop down menu , when select element want see list of information element. drop down , selection work since have lot of options (more showing) try make function return information element selected don't repeat code. function give me error message:"cannot read property 'top_1' of undefined" console.log(obj.top_1) works fine. var obj = { top_1 :"bla", top_2 :"bla bla", objdetail_1 :{ top_1 :"bli", top_2 :"bli bli", name1:"aaa", name2:"aaaa" }, objdetail_2 :{ top_1 :"blo", top_2 :"bli blo", name1:"bbb", name2:"bbbbb" } }; $(document).ready(function() { $('.mystuff li ul li').click( function(event){ $(document).find('#description').css('visibility', 'visible'); var idelement = $(this).attr('id'...

javascript - Using D3 in Rails ActiveAdmin -

i building application in ruby-on-rails 4. have designed administration site using activeadmin. works great add chart index pages using d3.js through rendering of partial. have been impressed d3.js library, realy new @ have been trying developments training. i have not found thsi specific case on internet try nice tutorial : using d3 in rails . have included d3.js library followinh tutorial. partial looks this: #app/views/admin/_chart.html.erb <h3>hello world!</h3> <svg id="graph"></svg> and admin user.file looks : #app/admin/user.rb collection_action :data, method: :post respond_to |format| format.json { render :json => [1,2,3,4,5] } end end then have script below in assets/javascript/graph.js: $.ajax({ type: "get", contenttype: "application/json; charset=utf-8", url: 'data', datatype: 'json', success...

Install R packages on remote linux server via RSclient on a windows machine -

we using r ubuntu server in cloud hosted aws run our models on. can connect server r studio on desktop rsclient: library(rsclient) c <- rsconnect(host="*confidential*", port = *confidential*) rseval(c, "require(rodbc)") [1] true but when try install additional packages in same way, fails , takes 5 minutes before msg: rseval(c, "install.packages('surv')") error in rseval(c, "install.packages('surv')") : remote evaluation failed since server set third party , not ask them time need additional package, install myself. have no experience linux hoping possible r on own machine. any appreciated! best regards, tim

inheritance - Hibernate does not use discriminator in query with InheritanceType.JOINED -

i have following entities: @entity @table(name = "employee") @inheritance(strategy = inheritancetype.joined) @discriminatorcolumn(name="type") public class employee {} @entity @table(name = "regular_employee") @primarykeyjoincolumn(name = "id") @discriminatorvalue("r") public class regularemployee extends employee{} the problem hibernate not use discriminator value in queries. select employee0_.id id1_1_, employee0_.name name2_1_, employee0_.type type3_1_, employee0_1_.pay_per_hour pay_per_1_0_, case when employee0_1_.id not null 1 when employee0_.id not null 0 end clazz_ employee employee0_ left outer join regular_employee employee0_1_ on employee0_.id=employee0_1_.id shouldn't hibernate use discriminator value in "left jouter join" section? like: left outer join regular_employee employee0_1_ on employee0_.type='r' , employ...

python - how to use GridSearchCV with custom estimator in sklearn? -

i have estimator should compatible sklearn api. trying fit 1 parameter of estimator gridsearchcv not understand how it. this code: import numpy np import sklearn sk sklearn.linear_model import linearregression, lassolarscv, ridgecv sklearn.linear_model.base import linearclassifiermixin, sparsecoefmixin, baseestimator class elm(baseestimator): def __init__(self, n_nodes, link='rbf', output_function='lasso', n_jobs=1, c=1): self.n_jobs = n_jobs self.n_nodes = n_nodes self.c = c if link == 'rbf': self.link = lambda z: np.exp(-z*z) elif link == 'sig': self.link = lambda z: 1./(1 + np.exp(-z)) elif link == 'id': self.link = lambda z: z else: self.link = link if output_function == 'lasso': self.output_function = lassolarscv(cv=10, n_jobs=self.n_jobs) elif output_function == 'lr': ...

html - fixed header not pushing content down in only some browsers -

Image
i have page here css files here the header , nav should remain fixed @ top of page carousel started below this. it looks fine in browsers when tested in browserstack of browsers display carousel image gets pushed behind nav , header top: i cannot figure out missing in css. ideas? thanks! i think ie having problems <main> tag. if explicitly set main#wrapper { display: block; } fix this. reference

asp.net mvc - IIS 8.5 server 2012 not returning json -

at localhost iis express, doesn't give me error, when copy iis 8.5 on server 2012, gives me "internal server error 500" when request json result. here code. controller [httpget] public jsonresult ticketsabertos(string username) { computer computer = new computer(); computer.gethostdetails(); //return json(jsonconvert.serializeobject(result), jsonrequestbehavior.allowget); string json = jsonconvert.serializeobject(computer.getopentickets(computer.user)); return json(json, jsonrequestbehavior.allowget); // return this.json(computer.getopentickets(computer.user), jsonrequestbehavior.allowget); } model public list<computer> getopentickets(string user_) { list<computer> listar = new list<computer>(); dictionary<string, string> list = new dictionary<string, string>(); //int result; string connetionstring = null; sqlconne...

Wordpress Database Gone but Site Online... Rebuild Possible? -

the database site yokebreak.com has gone awol. no idea how or why, , host mediatemple claims not have backups nor have made effort explain happened. (very disappointed in great mt customer service right it's been week no real answers.) anyway, what's done done, , need site rebuilt. considering cached site , content still online, wondering if had ideas or experience restoring db still-live wordpress site? is possible or @ least there faster way done copying , pasting old content? any tips or advice much, appreciated! thanks! cheers, kyle duck unfortunately, if database gone , looking @ cached version of website, there not way recover database except form of backup. as have stated there no backup available, best thing can try , salvage of site possible sources content might reside such saving images cached version, copying , pasting text, or perhaps or else involved in original build may still have content, images, text, files on offline disk.

socket error in python 2.7, sending public rsa key to client -

i'm programming client-server communication encrypted rsa, using tcp sockets. generate public , private keys, when want exchange public keys between client , server error: typeerror: must convertible buffer, not publickey this server code: import socket import rsa print "generating keys" (public, private) = rsa.newkeys(1024, poolsize=2) print "keys generated." tcpsocket = socket.socket(socket.af_inet, socket.sock_stream) tcpsocket.setsockopt(socket.sol_socket, socket.so_reuseaddr,1) tcpsocket.bind(("0.0.0.0", 1025)) tcpsocket.listen(1) print "waiting client..." (client, (ip, port)) = tcpsocket.accept() print "connection received from: ", ip client.send(public) #this error i've tried line too: client.send(str(public)) with can send public key, can't use encrypt data (because public key string). thank ! you can use pickle or cpickle: import cpickle to_send=cpickle.dumps(the_key) sock.send(...

ios - Can we apply gravity behavior to centre of screen? -

i using uidynamicbehavior (uigravitybehavior) . played gravitydirection not make focused on centre of screen. is there way around make gravity focused in centre on screen. basically want show views (circles) converged centre of screen move them apart. any suggestion of great help. edited: added code uigravitybehavior *gravitybehaviour = [[uigravitybehavior alloc] initwithitems:@[ballview]]; gravitybehaviour.gravitydirection = cgvectormake(0, -1.0); we can give gravity direction move along line , if want set gravity act in centre of screen. i.e if objects anywhere getting attracted centre of screen if center of screen acting origin of gravity . :)

android - Cannot set spinner's selected item -

i want set selected item of spinner : adapter = new arrayadapter<rue>(this, android.r.layout.simple_spinner_item, db.getallrues()); // db.getallrues() has data adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); rueppale.setadapter(adapter); rueppale.setselection(adapter.getposition(db.getrue(p.getdec_decoup_terri_code())), true); // p.getdec_decoup_terri_code() has data code of db.getrue : public rue getrue(string decoup_terri_code) { rue r = new rue(); string[] columns = {"decoup_terri_code","decoup_terri_nom"}; cursor c = bd.query(t_decoup_territ, columns, "decoup_terri_code=?", new string[]{decoup_terri_code}, null, null, null); if (c != null && c.getcount() > 0 ) { c.movetofirst(); r.setdecoup_terri_code(c.getstring(0)); r.setdecoup_terri_nom(c.getstring(1)); } return r; } the problem @ runtime spinner not scroll automatically desired item ! bad ...

ios - EZAudio Plot Mirror Not Consistant -

i implemented ezaudioplotgl in 4 different view controllers. @ times top part of showing , though shouldmirror set yes @ times. suggestions ? i have used "ezaudioplot.h" class rather "ezaudioplotgl.h". resolves issue of inconsistent wave form , works same "ezaudioplotgl.h" and implemented clear method in "ezaudioplot.m" class because not have implementation or clear method. -(void)clear { float empty[_changinghistorysize]; // figure out better way for(int = 0; < _changinghistorysize; i++ ) { empty[i] = 0.0f; } for(int = 0; < _scrollhistorylength; i++) { _scrollhistory[i] = 0.0f; } _scrollhistoryindex = 0; [self setsampledata:_scrollhistory length:(!_setmaxlength?kezaudioplotmaxhistorybufferlength:_scrollhistorylength)]; }

How to iterate this PHP array using foreach -

i use code data api in form of array: $getcurrentstock = $myapi->getcurrentstock('array'); print_r($getcurrentstock); i getting data in form of array this: array ( [status] => ok [returnval] => array ( [0] => array ( [name] => alcatel [model] => hero ot-8020x [color] => black [warehouse] => hu11 [bar_code] => a20200125 [in_stock] => <20 [exp_delivery] => 0 [exp_available] => <20 [delivery_date] => - [price] => 301.90 [properties] => array ( [eu_warranty] => no [keypad] => touch screen [manual] => hun [simlock] => sim free [remarks] => data cable, headset [language] => ger, eng, esp, fra, ita, hun, ned, por, rom, tur [country] => china ) [ean] => [image] => http://www.mobileshop.bz/phone-pictures/api/3531-alcatel-hero-ot-8020x.jpg [id] => 3531 [category] => mobile ) [1] => array ( [name] => alcatel [model] => idol 2 mini ot-6016x [color] => gray [warehouse] => hu11 [bar_...

html - How can I force set the distance between my divs? -

Image
i not sure why margin:13.5px; doesn't take effect. want set them aside each other 27px . : can me give space between them ? here have : jsfiddle you need make sure container div right size inner div - @ moment small inner div isn't showing margin. if remove margin .tl-box , add following styles (makes outer box correct width it's contents , adds margin it), should fix issue: .slide .col-lg-2 { width:239px; margin:13.5px; } example

regex - Extract number embedded in string -

so run curl command , grep keyword. here (sanitized) result: ...dir');">town / village</a></th><th><a href="javascript:setfilter(3,'listpublicasdf','asdfdir');">phone number</a></th></tr><tr class="rowodd"><td><a href="javascript:calldialog('asdf','&mode=view&hellothereid=42',600,800);"... i want number 42 - command line one-liner great. search string hellothereid= extract number right beside (42 in above case) does have tips this? maybe regex numbers? i'm afraid don't have enough experience construct elegant solution. you use grep -p ( perl-regexp ) parameter enabled. $ grep -op 'hellothereid=\k\d+' file 42 $ grep -op '(?<=hellothereid=)\d+' file 42 \k here job of positive lookbehind. \k keeps text matched far out of overall regex match. references: http://www.regular-expressions.i...

c# - Entity Framework Relationship Error -

i following error when using entity framework: unable determine principal end of association between types 'xxx.domain.entities.usersettings' , 'xxx.domain.entities.user'. principal end of association must explicitly configured using either relationship fluent api or data annotations. here 2 entity classes: public class user { [key, column("un")] public string username { get; set; } public int level { get; set; } public virtual usersettings usersettings { get; set; } } public class usersettings { [key] public string username { get; set; } public int activerefresh { get; set; } [foreignkey("username")] public virtual user user { get; set; } } i not sure how resolve error. stuck database design can't update fix issue. there way using fluent api these associations working? a user can have usersettings object. relationship desired. it looks need 1 zero-or-one relationship // configure ...

scala - Is it possible to write typeclass with different implementations? -

this follow-up previous question suppose have trait converterto , two implementations: trait converterto[t] { def convert(s: string): option[t] } object converters1 { implicit val toint: converterto[int] = ??? } object converters2 { implicit val toint: converterto[int] = ??? } i have 2 classes a1 , a2 class a1 { def foo[t](s: string)(implicit ct: converterto[t]) = ct.convert(s) } class a2 { def bar[t](s: string)(implicit ct: converterto[t]) = ct.convert(s) } now foo[t] call use converters1 , bar[t] call use converters2 without importing converters1 , converters2 in client code. val a1 = new a1() val a2 = new a2() ... val = a1.foo[int]("0") // use converters1 without importing ... val j = a2.bar[int]("0") // use converters2 without importing can done in scala ? import converters in class. class a1 { import converters1._ private def fooprivate[t](s: string)(implicit ct: converterto[t]) = ct.convert(s) def foo...

ios - Apple Watch app installation issue - NSExtensionPointIdentifier -

i'm trying install app watchkit app , watchkit extension onto ios8.1 phone, xcode 6.2. i have deployment target set @ 8.1 , base sdk @ 8.2. i error: this app contains app extension specifies extension point identifier not supported on version of ios value of nsextensionpointidentifier key in info.plist i've seen similar questions not found solution works. there way programmatically handle lower ios version? to answer (using @lovo's comment) - fixed issue changing deployment target 8.2 in extension's build settings (not in main app's build settings). the main app's deployment target can set @ lower deployment target, mine 7.0.

javascript - JQuery - Why is JQuery animation simultaneous? -

<!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("#a").hide(1000); $("#b").hide(1000); $("#c").hide(1000); }); </script> </head> <body> <p id="a">paragraph 1</p> <p id="b">paragraph 2</p> <p id="c">paragraph 3</p> </body> </html> javascript single threaded, think functions executed 1 one. in sample above, seems 3 paragraphs start hide animation simultaneously , ended @ same time, if there 3 threads each running 1 distinct animation. why animations not run 1 one ? there not simultaneous. starting animation not block execution of code. start 1 after others run "almost" simultaneously. jquery animations in fact similar setinterval, update opacity each x milliseconds. b...

linux - Assembler - adding big (128b) numbers (AT&T assembly syntax) - where to store results? -

i trying add 2 128 bits numbers using att assembly syntax in linux ubuntu 64b , debugging in gdb know after every loop result of adding 2 parts correct how store 4 results together?? considering adding every result stack can't add register content stack, right? doing correctly? real beginner in assembler need uni :/ exit_success = 0 sysexit = 1 number1: .long 0x10304008, 0x701100ff, 0x45100020, 0x08570030 number2: .long 0xf040500c, 0x00220026, 0x321000cb, 0x04520031 .global _start _start: movl $4, %edx clc pushf _loop: dec %edx movl number1(,%edx,4), %eax movl number2(,%edx,4), %ebx popf adcl %ebx, %eax cmp $0, %edx jne _loop popf jnc _end push $1 _end: mov $sysexit, %eax mov $exit_success, %ebx int $0x80

xcode - SQLite Query statement - Objective C -

my problem cant values select query executes 101 error. i think problem has quotes in select statement sqlite3 * database ; nsstring * path = [[[ nsbundle mainbundle ]resourcepath ] stringbyappendingpathcomponent : @"cars.sqlite"]; int returncode = sqlite3_open ([ path cstringusingencoding : nsutf8stringencoding], &database) ; sqlite3_stmt * statement ; char * st ; nsstring *querysql = [nsstring stringwithformat: @"select brand,model cars brand=%@;", tmpbrand]; const char *query_stmt = [querysql utf8string]; st = sqlite3_mprintf (query_stmt); if(sqlite3_prepare_v2 ( database , query_stmt , -1 ,& statement ,null )==sqlite_ok){ returncode = sqlite3_step ( statement ) ; // statement returns record while ( returncode == sqlite_row ) // while there rows { models*tmp=[[models alloc]init]; char* n=(char*)sqlite3_column_text(statement,0); tmp=[nsstring stringwithcstring:n encoding:nsutf8stringencoding]; char* model=(char*)sqlite3_colum...

python - Integration of a function of two variables -

Image
i have function func(rp,pi) i have values . have values of rp , pi . i need integrate function within limits of 0 pi how go using quad scipy solve this? doubt have is, how quad know integral limits pi , not rp ? i tried: from scipy.integrate import quad integral = [] in func: result,error = quad(lambda func:a,0,pi) integral.append(result) integral = np.array(integral) here func list has values of function. give me values, not sure if right? here download link file rp,pi,func . first column rp , second column pi , third column func

python - print output of subprocess call into a label tkinter -

i trying create gui in tkinter. gui mcp23017 . trying configure input , output pins user change them according choice.. there option make inputs/outputs high or low.. now trying read pin using 'i2cget'(using seperate function).. need display output of subprocess call label on gui.. this code looks like: def read_p22(): output = subprocess.call(['i2cget -y 0x20 0x12 0xfd'],shell=true) x=print (output) label(tableframe,textvariable=x).grid(row=2,column=20) root.after(5000, read_p22) when function excutes(by pressing button), prints value '1' on python shell alternatly when press button... dont know how redirect output label.. suggest something? update:: on executing suggested commands: process = subprocess.popen(['i2cget -y 0x20 0x12 0xfd'], stdout=pipe, stderr=pipe, shell=true) output, code = process.communicate() i printed 'output' , 'process' , gave me follwing respectivley: b'' <subprocess...

.htaccess - Cloudfront max-age together with TTL usefull? -

for image gallery use amazon cloudfront. i have set @ origin: cache-control:max-age=31536000 (1 year) 1 . usefull set ttl 0 (24 hours) 1 year too when have set max-age? 2 . amazon check file ttl0 every 24 hours when have set max-age 1 year? amazon saying: objects cached greater of value of cache-control max-age directive or value of cloudfront minimum ttl amazon saying: if object in edge location isn't requested, cloudfront might evict object—remove object before expiration date—to make room objects more popular. in case, think usefull set ttl year, because images stay sure , not before? please correct me. thanks clarification. this question answered in answer cloudfront ttl not working although question not duplicate. no, minimum ttl not useful if setting own cache-control: headers. no, cloudfront not check every 24 hours if minimum ttl or cache-control: headers specify age longer 24 hours. if object going checked cloudfront, object needs...

curl - skip certificate validation on "vagrant up" -

i'd skip curl certificate validation on vagrant up since our proxy mitms https, curls' usual ssl cert error pops up. i tried vagrant --insecure puppetlabs/debian-7.8-32-nocm didn't change anything. next tried config.vm.box_download_insecure , config.vm.box_download_insecure = "puppetlabs/debian-7.8-32-nocm" in vagrantfile, alas - no luck. what's url config.vm.box_download_insecure if use boxes atlas? is there possibility make curl skip cert checks? it expecting boolean (true/false). config.vm.box_download_insecure = true https://www.vagrantup.com/docs/vagrantfile/machine_settings.html config.vm.box_download_insecure - if true, ssl certificates server not verified. default, if url https url, ssl certs verified.

wpf - Confused about navigation in modal / non modal windows in prism - Need guidance -

i confused going implementing in prism. scenario in 1 liner how achieve prism navigation (regionmanager.requestnavigate) in view shown separate modal/non modal window on main window. taking code this article , able show separate window, confused navigating in regions of window shown. try put code below clarify situation. this code in roombandviewmodel launches dialog private void manageroomfacility() { dialogservice.showdialog<roomfacilitymainwindowview>(this, container.resolve<roomfacilitymainwindowview>()); regionmanager.requestnavigate(regionnames.main_region, new uri("roomfacilitymainview", urikind.relative)); as can seen, launch dialog shows view (code shown below), , tries navigate in 1 of region of view the popup window roomfacilitymainwindowview <window x:class="hotelreservation.main.view.roomfacilities.roomfacilitymainwindowview" <view:roomfacilitymainview prism:regionmanager.regionname="{x:stat...

intellij idea - How to speed up WebStorm -

in huge project webstorm (it can other product of jetbrains ) thinking , loading something. this annoying me! here recipe how speed lovely webstorm: go preferences , next: appearance & behaviour > system settings > updates : disable auto update appearance & behaviour > system settings > usage statistics : uncheck allow sending data usage statistics jetbrains editor > live templates : disable all, leave use editor > emmet : disable emmets editor > intentions : leave only: css, declaration, javascript , language injection plugins : leave next ( * - can disabled in case don't need them): coffeescript * css suport cvs integration git integration html tool intellilang javascript debugger * javascript intention power pack javascript support nodejs * perforce integration sass suport * project > directories : exclude don't use languages & frameworks > javascript > libraries : leave only: html , html...

php - SMTP connect() failed -

smtp connect() failed error on php code. i referred solutions in stack overflow nothing work on code i using php, mysql , server version 5.1.30 no message send recipient address. i uncomment below line extension=php_openssl.dll php_openssl.dll file exists in ext folder. email.php <?php include "phpmailer-master/class.phpmailer.php"; include "phpmailer-master/class.smtp.php"; $mail = new phpmailer(); $mail->issmtp(); // send via smtp $mail->smtpauth = true; // turn on smtp authentication $mail->host = "smtp.gmail.com"; $mail->port = 465; echo !extension_loaded('openssl')?"not available":"available"; $mail->username = "jansiantony92@gmail.com"; // smtp username $mail->password = "xxxxxxxxx"; // smtp password $webmaster_email = "asha.it33@gmail.com"; //reply email id $email="aasha.vkm@domain.com"; // recipients email id $name="name"; // rec...

google calendar - Time zone issue with day light saving in java -

in web application using google calendar . due day light savings issue day light savings time added when saved events in google calendar through application. my application uses java 1.6 , google calendar v3 . what best solution handle every time zone in world? you may use simpledateformat class stated here before java8 or may use zoneddatetime in java 8 mentioned here hope helps.

javascript - How to only show specific columns in ui-grid.js -

i have json data (rest response) many (partly nested) parameters want show specif ones. how hide , enable specific ones? parameters shown columns. so not want hide one-by-one excludeparameters or columndef visible = false (because list of parameters can different based on rest response). do have idea? intension change default visibility false , wanted parameters true (via columndef visible). solution that? thanks in advance, chris

r - How to sum 10 step rows of matrix in Rcpp? -

i want following results using rcpp. when big data, r slow. therefore, tried coding in rcpp. x <- matrix(1:150, ncol = 5) z <- matrix(nrow = nrow(x) / 10, ncol = 5) (i in 1:5) { (j in 1:(nrow(x) / 10)) { k = (j - 1) * 10 + 1; z[j, i] <- sum(x[k:(k+9), i]) } } x [,1] [,2] [,3] [,4] [,5] [1,] 1 31 61 91 121 [2,] 2 32 62 92 122 [3,] 3 33 63 93 123 [4,] 4 34 64 94 124 [5,] 5 35 65 95 125 [6,] 6 36 66 96 126 [7,] 7 37 67 97 127 [8,] 8 38 68 98 128 [9,] 9 39 69 99 129 [10,] 10 40 70 100 130 [11,] 11 41 71 101 131 [12,] 12 42 72 102 132 [13,] 13 43 73 103 133 [14,] 14 44 74 104 134 [15,] 15 45 75 105 135 [16,] 16 46 76 106 136 [17,] 17 47 77 107 137 [18,] 18 48 78 108 138 [19,] 19 49 79 109 139 [20,] 20 50 80 110 140 [21,] 21 51 81 111 141 [22,] 22 52 82 11...

python compare tuples and dictionary -

i have compare 2 sets , find differences in python: >>> mysql_orders = ((50434l, 5901l), (50733l, 5901l)) >>> opera_orders = [{'orderid': 'web050434', 'accountid': '00t001'}, {'orderid': 'web050733', 'accountid': '00t001'}, {'orderid': 'doc075185', 'accountid': '00t001'}, {'orderid': 'web081859', 'accountid': '00t001'}] one list of tuples , other list of dictionaries first item in list orederid without web / doc prefix. what correct way find missing orderid's not in mysql_orders list? with regex strip off alphabets, provided numbers come later, import re mysql_orders = ((50434l, 5901l), (50733l, 5901l)) opera_orders = [{'orderid': 'web050434', 'accountid': '00t001'}, {'orderid': 'web050733', 'accountid': '00t001'}, {'orderid': 'doc075185...

oracle - Missing expression error in application used to submit SQL but when works fine in SQL Developer -

when wrote code below in oracle sql developer works fine, when pasting code webwise tool use create reports, errors saying missing experession? copy , paste code , works fine... code : select o.wh_id, o.bill_to_code, (case when d.pick_area 'gps%' 'gps' else d.pick_area end) pick_area, count(*) ouc t_order o inner join t_pick_detail d on o.order_number = d.order_number o.wh_id = '~wh_id~' group o.wh_id, o.bill_to_code, (case when d.pick_area 'gps%' 'gps' else d.pick_area end) order o.bill_to_code; to finalize post, remove ';' ensure works. as added note. underlying mechanism runs sql may have different interpreter , in cases, cause issues. when dealing various tools interact same platform, ensure syntax correct per documentation of system.

android - I need to display view like below -

Image
i have list view header when tapping list view headers. need show view , 1 more condition list view columns dynamic, when tapping listview header need show please see below images. when tapping on name need show ascending , descending view same, view need show when tap on level r pv or rank also. you can use visibility toggle function show or hide controls when clicked.

centos - Failed opening required 'Net/SSH2.php'? -

Image
i have installed ssh2 per these instructions . checked in phpinfo, , can see ssh working. i.e. showing up. however, code still bombs: it bombs out with: fatal error: require(): failed opening required 'net/ssh2.php' (include_path='.:/usr/lib/php:/usr/local/lib/php.:/usr/lib/php:/usr/local/lib/php/phpseclib') in sshconnect.class.inc on line 5 i tried: locate ssh2.php and can't find files anywhere. have no idea why not working? ideas? you installed libssh2 , trying use phpseclib. if want use phpseclib can install via composer or via pear. or can go http://phpseclib.sourceforge.org , download *.zip , put where-ever like, long it's in include_path.