Posts

Showing posts from August, 2013

javascript - Maintain five section in DOM at a time -

i creating ebook reader, want fetch sections of ebook link : http://tmaserv.scem.uws.edu.au/chapters/?n=0 fetch section number 0 http://tmaserv.scem.uws.edu.au/chapters/?n=1 fetch section number 1 .. on number of sections can obtained url http://tmaserv.scem.uws.edu.au/chapters now, able fetch section, want reader should maintain 5 sections of document in dom @ time.also can fetch 1 section @ time. first 5 fetched document loads,then additional sections fetched on request. code: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>ebook</title> <script> var requestnum = 0; // assume had fetched number of sections in varibale sectioncount function do_exercise () { var x = new xmlhttprequest(); // adjust url reflect new n value , request before x.open('get', 'http://tmaserv.scem.uws.edu.au/chapters/?n=' + requestnum, true); x.onreadystatechan...

uinavigationcontroller - UISearchController always display scope bar -

i adding search controller in app part of tab bar controller. trying scope show, not when search bar active. have tried subclassing , overriding method show it, , have tried using uisearchbar , uisegmentedcontrol separate seem scope showing. issue navigation bar height won't change. best/easiest way of doing this? (also, people have used uisearchcontroller, how can background extend under status bar when uisearchbar active, in mail app)

php - Array to string conversion error when indexing array -

this question has answer here: reference - error mean in php? 29 answers it says i'm getting these errors: notice: array string conversion in c:\xampp\htdocs\team_aveera_website\inc\user_functions.php on line 19 array notice: array string conversion in c:\xampp\htdocs\team_aveera_website\inc\user_functions.php on line 22 when try index array. i'm doing getting rows database , adding value row array. random object array: <?php function getrandomadminstream($db) { try { $twitchnames[] = array(); $sql = $db->prepare('select * users'); $sql->setfetchmode(pdo::fetch_assoc); $sql->execute(); $i = 0; while($row = $sql->fetch() !== false) { if($row['rank'] == 1) { $twitchnames[$i] = $row['twitchus...

javascript - Loop through IDs with jQuery and make them droppable -

i've got container #itemgrid , few children-divs. unique. code far: $('#grid-top').droppable({ drop: drophandler, accept: ".top" }); $('#grid-assc').droppable({ drop: drophandler, accept: ".assc" }); as may see, accepting class in id of element. have more divs want make droppable, work. how can loop through these elements? $("#itemgrid div[id^=grid-]").each(function() { var accept = $(this).attr("id").split("-")[1]; $(this).droppable({ drop: drophandler, accept: "." + accept }); });

artificial intelligence - When is one heuristic better than another? -

i answered question in 2 heuristics given a* conducted find path start state goal state. one of heuristics found path expanding 1 node less - reason, heuristic better other? thanks! we cannot 1 heuristic "better" because expands fewer nodes on 1 example of problem. on next example, "better" heuristic might expand many more nodes other. we know heuristic estimate can't go on actual distance if admissible. in other words, heuristic function must constructed in such way never overestimate distance goal under circumstances. it make sense, then, if 1 heuristic gets closer actual distance without going over, can considered "better". if used heuristic said distance between 2 nodes 1 (or value less shortest edge length) end expanding lot of nodes. estimate gets closer actual distance make more can eliminate paths earlier. there are, of course, other ways of defining "better", such being easier calculate.

No Project Shown - Google Developers Console -

i have been assigned project in google developers console. have logged in before, seen project, made changes , saved several times. now, project no longer listed. others on project can see it, etc. you not logging in right console. there 1 google play , regular developer console .

java - Changing interface method arguments -

let's have interface myinterface has method do() . have classes implement interface. interface called throughout code , calls specific implementation via factory. later on decide change do() method adding argument it, let's - do(numberoftimes) . clients broken when call myinterfaceold.do() implementation do() method not found. can add do() method argument, breaks clients well. straightforward way change do() method in myinterface , update clients, there way without needing update clients?

html - Pass an id with mysql_insert_id() of a .php to another .php -

i trying create variable 1 id of last insert , trying past page. in first page code: $insert= "insert resources (name,description,place,time) values ('$name','$description','$place',curdate())"; mysql_query($insert); $last_id= mysql_insert_id(); header("location:new_page.php?last_id=$last_id"); and in second page code: <?php echo "this id of resource : $last_id"; ?> i can't work it, solution? thanks! regards you can't pass variable through more pages this. you need write using $_get, because it's in url. echo $_get['last_id']; if want work later, use session or cookie .

List of all unsupported commands in redis cluster -

i can't find complete list of commands may unsupported redis cluster (as example eval technically can execute if keys point same slot). think it's nice have list, helps migrate codebase redis redis-cluster. all commands supported afair, except select . multi-key commands, transactions , lua scripts special because if use them have make sure keys referenced mapped same slot (with hashtags example). eval , btw, requires keys input precisely because of consideration - if you're programmatically generating key names you're using wrong :)

centralized API documentation for microservices -

my team , building multiple services in parallel. have benefit of building services scratch. ability automatically display api endpoints, services, in 1 page/site. helpful because (among other things): i don't have go multiple documentation sites see available endpoints in entire "system". it'll first step determine if of services should split, combined or refactored. some of our services in django , rest-swagger module great help. don't see how can combine rest-swagger documentation multiple services single documentation page/site. i'm looking through this site , related netflix experience not find solution problem. maybe centralized documentation isn't big deal 600+ services @ netflix, that's hard believe. can suggest tool or method have combined api documentation services in microservice architecture? my ideal scenario of happens when service changed: i click on link see list of endpoints in system. a teammate updates servi...

javascript - Can Mesh.setGeometry pass through an image using Famo.us Engine -

so new famo.us stupid question (i hope not). var mesh = require('famous/webgl-renderables/mesh'); ..... var mesh = new mesh(meshnode).setgeometry('circle'); i can pass through multiple types of shapes through setgeometry there way pass through image. example, logo? thanks! you cannot pass image geometry of mesh, can pass image apply material mesh . use mesh.setbasecolor , pass in material.image . var scene = famousengine.createscene('body'); famousengine.init(); // add child node add our mesh to. var node = scene.addchild(); // pass child node new mesh component. var mesh = new mesh(node); // give mesh geometry. mesh.setgeometry('circle', { detail: 100 }); mesh.setbasecolor(material.image([], { texture: 'https://i.imgur.com/xn7lvcw.jpg' })); run example snippet below (spinning sphere) var famousengine = famous.core.famousengine; var mesh = famous.webglrenderables.mesh; var material = famous.webglmaterials...

graph - BEMSimpleLineGraph X-Axis Labels not showing for phones newer than iPhone 5 -

Image
i've created line graph using bemsimplelinegraph pod, but, life of me, can't figure out why x-axis labels aren't showing on device newer iphone 5. edit: should mention enablexaxislabel = yes default. here code lay out graph: #import "weightchartcell.h" @implementation weightchartcell @synthesize viewcell, arrayplots, mygraph, labelweighthistory; - (void)awakefromnib { } - (void)layoutsubviews { [super layoutsubviews]; float width = viewcell.bounds.size.width; self.mygraph = [[bemsimplelinegraphview alloc] initwithframe:cgrectmake(-20, 40, width+20, 150.0)]; self.mygraph.datasource = self; self.mygraph.delegate = self; self.mygraph.colortop = [uicolor whitecolor]; self.mygraph.colorbottom = [uicolor colorwithred:190/255.0 green:218/255.0 blue:246/255.0 alpha:1]; self.mygraph.colorline = [uicolor colorwithred:124/255.0 green:181/255.0 blue:236/255.0 alpha:1]; self.mygraph.colorpoint = [uicolor colorwithred:124/255....

c# - How to access value out of dictionary whose key is complex type? -

in writing insurance premium calculator basic scheme follows: points assigned predetermined number of attributes, such car-value, num-incidents-in-past, years-experience-driving etc. hene, if car worth $3800, lies within 3001 4000 range warrants 30 points in premium calculation. if num-incidents-in-past 3 or below, warrants 0 points. if 4-5 num-inc points warranted 5. if years-exp between 1-5, warrants 12 points. idea arbitrary value being assigned range of values given number of attributes. premium calculations tallying points warranted each attribute category , multiplying factor i.e 2.5. trying use b. liskov's power of abstractions , srp neatly assign responsiblities design calculator extensible , designed. based on answer provided drharris here is there c# type representing integer range? how access value out of following dictionary key generic type range defined drharris? //************************abstractions************************ public abstract class absp...

html - How to change vertical alignment of content with a button element? -

i'm working on project there row of controls, each of button element. there content inside of buttons, , laid out in row flexbox. button element centers content vertically, , can't figure out how override vertically align @ top of button. controls need same height , same width, , clicking anywhere in borders must count click on button. this codepen shows problem clearly: http://codepen.io/anon/pen/rppqdz .wrapper { display: flex; flex-direction: row; width: 80%; } button, .object { font-family: sans-serif; font-size: 1em; padding: 1em; background: #fff; flex: 1; border: 1px solid red; text-align: left; } <h1>what looks like</h1> <div class="wrapper"> <button>i content</button> <button>i longer content goes here , here</button> <button>i content</button> </div> <h1>what want like</h1> <div class="wrapper"> <div c...

try catch - real-time TCL exec output -

i have following scenario: if { [catch { exec echo calling big script } exec_msg] } { puts "nok" puts "output of big script: $exec_msg" } else { puts "ok" puts "output of big script: $exec_msg" } are there solutions print $exec_msg in real-time, in sync execution of big script? if do: exec echo calling big script >@stdout # wrapped around exec same; omit brevity then output script written straight standard out. however , lose ability read tcl script. read script, can try (on unix): exec echo calling big script | tee /dev/tty however tend delay output until accumulates few kilobytes @ time (a feature of how programs output non-terminals). fixing requires use of expect, lot more complicated, or maybe creating pipeline , handling asynchronously. it's substantial step in trickiness you've been doing, , it's because you're starting fight against how programs work naturally. frank, you're ...

ruby on rails - Custom validation message (in model file) that includes a path not working -

in user model file have included: validates :email, uniqueness: { case_sensitive: false, message: "you can reset password " + link_to("here", new_password_reset_path) } on loading page on development server, generates error: undefined local variable or method `new_password_reset_path' #<class:0x007f4d36863460> the alternative code below has same result/error message. validates :email, uniqueness: { message: "you can reset password #{link_to("here", new_password_reset_path)}" } is not possible refer path in model file? if not, how implement intended here? update: @ first seemed solutions included rails.application.routes.url_helpers in model file worked. , indeed in development worked. however, turned out, don't work in production. crash site on heroku. this post seems refer similar , seems indicate should not use rails.application.routes.url_helpers in model file. after pushing heroku, when try open website...

How to use VB.net with an Excel sheet to count and sort data -

Image
just title says, i've been using vb.net various things on excel , kinda new. if have excel sheet various data including staff , things sold, how can select 2 columns , sort them counts how many of each items sold each person messagebox or listbox? for eg, output i'm looking like staff sold how many name1 - product1 - amountsoldbyname1 name1 - product2 - amountsoldbyname1 name1 - product3 - amountsoldbyname1 name1 - product4 - amountsoldbyname1 name2 - product1 - amountsoldbyname2 name2 - product2 - amountsoldbyname2 , on... the furthest i've gotten counting how many of each staff member there in 1 column go step further on , 2 columns , count each product sold each person unclear how go it. private sub getexcelfile_click(byval sender system.object, byval e system.eventargs) handles button3.click dim excelfile new openfiledialog() excelfile.showdialog() if (excelfile.showdialog() = dialogresult.cancel) return else dim fil...

regex to find lines starting with `*` and ending with `)` in eclipse using regex search -

i trying use regular expressing in eclipse find lines mentioned below. i have text file text.txt : teeet() *test() *test * () test asdgaer () * test() i want find regex find lines starts * , ends ) sample output : *test() * () * test() here have far : grep "^\* . )$" test.txt the output blank. i tried : grep "^\*" test.txt the out put : *test() *test * () * test() also tried : grep ")$" test.txt the output : teeet() *test() * () asdgaer () * test() combined them, didn't work expected. you can use: grep '^\*.*)$' file *test() * () * test() or else: grep -e '^\*.*\)$' file you must keep .* between starting * ending ) match arbitrary data in between.

javascript - Adding an Image to DOM Dynamically Using Range.insertNode() -

how can dynamically insert img element dom using range.insertnode() ? my html: <div class="css_class_for_div" style="height: 250px;" contenteditable="true"> <img src="/path/to/my/image/myimage.png" alt="/myimage.png" title="/myimage.png" class="css_class_for_image" e_resid="/myimage.png" /> <br /> <br /> <span class="css_class_for_span"></span> </div> <input id="mybutton" type="button" value="insert image" /> my js: var button = document.getelementbyid("mybutton"); button.addeventlistener("click", function(e){ var src = "/path/to/my/other/image/image2.png"; var title = "/image2.png"; var cssclassname = "css_class_for_image"; var list = document.getelementsbyclassname("css_class_for_div"); var el = list[0]; var ...

Hive Query Error - While copy existing table data to another table -

i have loaded web file table using serde in hive. able view table data. want copy data new table. if run new table -create table new_xxx select * xxx ; - job failing. error in log file: execution error,return code 2 org.apache.hadoop.hive.ql.exec.mapredtask run time exception:error in configuring object. since using serde load web data 1st table serialize , deserialize table data while insert , select. so, in second table trying insert data should aware of serde used. use following syntax might you. create table new_table_xx row format serde "org.apache.hadoop.hive.serde" select .....

How to extract the numbers after a character in windows batch files -

hi need extract last part of string after last dot example: 1.2.37 ==> need 37 1.2.567 ==> need 567 as can see number of characters after dot not fixed expressions base=%fullver:~0,-2% can't used. how can achieve this? @echo off setlocal enableextensions disabledelayedexpansion set "fullver=1.2.456" %%a in ("%fullver:.=\%") set "base=%%~na" echo %base% the trick replace dots backslashes, process string path , retrieve name of last element in it. alternatively, if elements need retrieved, instead of for , for /f used tokenize variable using dots separators @echo off setlocal enableextensions disabledelayedexpansion set "fullver=1.2.456" /f "tokens=1-3 delims=." %%a in ("%fullver%") ( set "major=%%a" set "minor=%%b" set "build=%%c" ) echo [%major%] [%minor%] [%build%]

c# - Handling asynchronous anonymous method errors -

Image
i have base framework designed deal errors generically; however, when error occurs, appear not catching in framework. following code simplified version of i'm trying achieve: class program { static void main(string[] args) { runmethod<decimal>(() => { decimal x = 0; decimal y = 1 / x; return y; }); } private static async task<t> runmethod<t>(func<t> method) { try { var result = await tryrunningmehod<t>(method); return result; } catch (dividebyzeroexception ex) { system.diagnostics.debug.writeline("error"); return default(t); } } private static async task<t> tryrunningmehod<t>(func<t> method) { var returnvalue = await task.run<t>(method); return returnvalue; } } what happens when r...

javascript - Tumblr like button not working for my tumblr blog -

tumblr button not working tumblr blog, button's color change after clicking after refreshing page no updates happen url: http://cs.jumzler.com/ html code: ` {block:posts}<p align="right"><div class="my-like" data-reblog="{reblogurl}" data-id="{postid}" title="like"></div></p>{/block:posts} css: <style> .my-like { background-image: url(data:image/png;base64,ivborw0kggoaaaansuheugaaabmaaaarcayaaaa/mjfhaaabh0leqvq4y62t30vcubigv/9yuhblkca08fdogrffyfeuhhznccqosesiioii68pl5qv6s8eb7+smhxns6s7ejz3zva+cct4bicofvs88dj7w8vqg8wqc754k17lpjrx3z3l8d4yovaqirwbcjnbzahefnzjfxpdy5b0jso/irqmxupmsbnhz2bx1ql79gpbpeepmzhdsyw8fbdl0sk68hwigct2s3nikreapzp7qrrnpzshpwm4kmnqkybqikdejzv8hk2ubs4ny75md6wu8qzexkrhvtoblwsjuhc4kyo99v8bwbnm0/imiz542myq2bspskcmr/zpos7lvp8lv/ngd+/n6c2xq2kcxhiy6qv1rxwotu3n/nhf8fgw+g9hfshjljuyljcgaaaaasuvork5cyii=) !important; height:17px; width:19px; cursor:pointer; disp...

android - How to disable changing email in Navigation Drawer? -

i want display email address without possibility replace it. , without arrow. how disable arrow icon? cannot post image, unfortunately! getsupportactionbar().setdisplayhomeasupenabled(false);

python - Pandas duplicate columns with a shift -

i have pandas time series object 3 series , time axis. want train neural network time window , reason need create matrix of duplicated pandas columns different shifts. pandas.concat manually, that'd take long time , won't flexible. i'm trying is: # make 40 columns original dataframe first column , # make 20 columns original dataframe second column param_array = pandas.dataframe() in range(1, 41) : param_array = pandas.concat([param_array, input[[0]].shift(i * 2)], axis=1, ignore_index=true) in range(1, 21) : param_array= pandas.concat([param_array, input[[1]].shift(i * 2)], axis=1, ignore_index=true) but appends time series @ end of first one, doesn't make new columns. i suspect reference 'input[[0]]' not correct. example of trying own code below. new columns shifted values of original data: import pandas pd d = {'one': pd.series(range(20)),'two':pd.series(range(20)[::-1])} df = pd.dataframe(d) print df param_array ...

c - Print the 5th letter of each word read from a text file -

i wanted find 5th letter every word after reading text file. not know wrong. after entering file path, getting pop window reading read.c has stopped working. the code: #include<stdio.h> #include<conio.h> int main(void){ char fname[30]; char ch[]={'\0'}; int i=0; file *fp; printf("enter file name path\n"); gets(fname); fp=fopen(fname,"r"); if(fp==0) printf("file doesnot exist\n"); else{ printf("file read successfully\n"); do{ ch[i]=getc(fp); if(feof(fp)){ printf("end of file"); break; } else if(ch[i]=='\n'){ putc(ch[4],stdout); } i++; }while(1); fclose(fp); } return 0; } you can use following snippet. code need know maximum length of line . code prints 5th character on each line on each word if length 5 or more. . hope work you. #include <s...

prestashop - PHP stream wrapper for Google Cloud Storage -

i in process of setting prestashop installation in cluster of 3 gce instances, managed kubernetes. use cloud sql db , seems running well, except, of course images part, since prestashop in each pod uploads , shows images to/from it's local filesystem. in app engine cloud use stream_context_set_default() , allow me use "gs://mybucket" regular path. there way in compute engine? if possible, making prestashop use cloud storage bucket can done in 2 lines of code. there streamwrapper amazon s3 service need: http://hiousi.tumblr.com/post/94824087894/prestashop-images-hosted-on-amazon-s3 use cloud storage. the source code stream wrapper can downloaded @ https://github.com/googlecloudplatform/appengine-php-sdk/tree/master/google/appengine/ext/cloud_storage_streams . it has couple of dependencies on other gae apis such app identity & urlfetch. may need stubbed out or replaced equivalent services on gce.

regex - Java RegExp Underscore -

i want replace content (double underscores left , right, see code) in given string, can't work. this: string test = "hello! content: __content__"; test.replaceall("__content__", "yeah!"); system.out.println("output: " + test); so output should be: "output: hello! content: yeah!" regular expression in first parameter of replaceall wrong, don't know correct one. knows how? you forgot assign return value of replaceall original string. replaceall (or other string method) doesn't change original string: string test = "hello! content: __content__"; test = test.replaceall("__content__", "yeah!"); system.out.println("output: " + test); btw don't need regex here, use replace : test = test.replace("__content__", "yeah!");

android - R.Java went missing in all projects -

i working around project when noticed appcompat_v7. didn't know was, deleted it. , now, none of projects generating r.java, after cleaning , rebuilding. did find on net, in vein. managed appcompat_v7 making new project, wasn't generating r.java. i've messed now, next? how r.java? strange fix workes right-click on "appcompat_v7" project , go -> properties -> android. target build should set @ latest build (in case android 5.0.1). click other android package (apart current target) , click "apply". click "ok" close box. re-open properties box same method time check latest build (in case android 5.0.1) project build target. click "apply", "ok" close box. clean appcompat_v7 project. you'll need clean/build other projects reference library. solved me.

Insert TYPE_NUTRITION in Google Fit -

i user input (calorie) , want insert in google fit insertion not work. private dataset insertnutritiondata(){ calendar cal = calendar.getinstance(); date = new date(); cal.settime(now); long endtime = cal.gettimeinmillis(); datasource nutritionsource = new datasource.builder() .setapppackagename(getapplicationcontext().getpackagename()) .setdatatype(datatype.type_nutrition) .settype(datasource.type_raw) .build(); dataset dataset = dataset.create(nutritionsource); datapoint datapoint = datapoint.create(nutritionsource); datapoint.settimestamp(endtime, timeunit.milliseconds); datapoint.getvalue(field.field_nutrients).setkeyvalue(field.nutrient_calories,calorie); dataset.add(datapoint); return dataset; } the insertion done in asynctask : private class insertandverifynutritiontask extends asynctask<void, void, void> { protected void doinbackground...

regex - Regular Expression does not match correct words -

i have problem. have regex: ([\w ]*[^'entre']{1}) entre ([\w ]*) y ([\w ]*) and possible strings match are: av cordoba entre medrano y gascon esmeralda entre av rivadavia y lavalle av cor1doba entre entre rios y suipac2ha monroe entre aizpurra y av de los constituyentes the thing is, regular expression matches first 3 strings, other not being matched , don't know why can me? thanks in advance edit the strings names of streets , intersections of them. so, want find expression , replace in form: street1/street2-street3 for first example string, replacement looks like av cordoba/medrano-gascon and ^['entre] there because street name can contain string "entre", , must take name of street edit i found solution. have use *([\w ]*(?<!entre)) entre ([\w ]*) y ([\w ]*)* thank all $pattern = (.*?)(?: entre )(.*?)(?: y )(.*?$) see demo it can match string containing "entre" first street name.

mercurial - How to manage multiple small parts of a library with version control -

i'm new source version control, don't want make mistake in choosing wrong setup project. have kind of "library" made of many small "procedures" (they written in pseudo-language specific of third paty software). each procedure small stand alone "package" of 2/3 files (just procedure itself, documentation, , maybe 1 or 2 other sub-procedures needed main one). so have hundreds of procedure-packages, archived in subfolders depending on area of application, , of them more complex may use others more basic. i modify procedures pretty in stages, improve them, of course modifications break compatibility since thei involve adding/removing input/output parameters, suppose must somehow "tag" versions of each procedure if single piece of software... so i'm wondering what's best way manage them version control (i'm using mercurial): supposed make hundreds repositories? o_o or keep in 1 big repository , tag everytime procedure rev...

java - JPA truncates nanoseconds when using date criteria & SQL datetime2 -

i'm trying create clause involving sql server datetime2 field (accurate 100 nanoseconds); using jpa & hibernate. my code looks this: criteriabuilder cb = em.getcriteriabuilder(); list<predicate> predicates = new arraylist<>(); criteriaquery(x) q = cb.createquery(x.class); root<x> root = q.from(x.class); java.sql.timestamp mysqltimestamp = timestamp.valueof("2015-06-04 11:31:53.2119339"); predicates.add(cb.greaterthan(root.get("datemodified"), mysqltimestamp)) q.where(predicates.toarray(new predicate[predicates.size()])); em.createquery(q).getresultlist(); sql server profiler reveals timestamp parameter value truncated 2015-06-04 11:31:53.210 - weird, that's not rounding. needles say, have inaccuracies in result set. if manually change param full value 2015-06-04 11:31:53.2119339 good. question is, how jpa not truncate date? alternatively, how inject own parameter value serializer timestamp fields? help appreciat...

java - Direct Generic Exceptions -

my question follow-up question: why doesn't java allow generic subclasses of throwable? the question answered perfectly, on indirect generic exception, that's: public class myexception<t> extends exception { what left void, direct generics: public static <t extends exception> void checkforexception(class<t> extype) { try { // code } catch (t e) { e.printstacktrace(); } } why not allowed? though, reason think not allowed, t type, explicitly caught: // if t ioexception catch(t e) { } catch(ioexception e) { } but reason block it? same effect, done without generics too: catch(exception e) { } catch(ioexception e { } here's documentation of above restriction. because in java type variables, i.e. t , not reifiable due type erasure . this means compiler not have t @ runtime @ all. hence there no way catch block of yours ever know t was. , no, can't treat base type. different. i...

c# - WPF stop and reverse Storyboard animation when new animation starts -

i have 2 datatrigger animates background color of button (with reverse), part works fine. the problem when 2 triggers fired in overlapping times, first trigger fired not reverse color, when second trigger stops reverses color whatever color when previous animation stopped. what should do? this example code: <datatrigger binding="{binding isup}" value="true"> <datatrigger.enteractions> <stopstoryboard beginstoryboardname="isdownstoryboard"/> <beginstoryboard name="isupstoryboard"> <storyboard> <coloranimation storyboard.targetproperty="background.gradientstops[0].color" to="#b4e391" duration="0:0:1" autoreverse="true" repeatbehavior="2x" /> <coloranimation storyboard.targetproperty="background.gradientstops[1].color" to="#61c419" duration="0:0:...

mysql - SQL error code 1054 unknown column -

this query: create table if not exists applications ( idresearch int not null, idprof char(10) not null, primary key (idresearch, idprof), foreign key (idresearch) references research(idresearch), foreign key (idprof) references professor(idprof) ); and table: insert `university`.`applications` (`idresearch`, `idprof`) values ('10', '123456789'); insert `university`.`applications` (`idresearch`, `idprof`) values ('10', '432156789'); insert `university`.`applications` (`idresearch`, `idprof`) values ('10', '789654321'); insert `university`.`applications` (`idresearch`, `idprof`) values ('11', '876098432'); insert `university`.`applications` (`idresearch`, `idprof`) values ('11', '234567890'); insert `university`.`applications` (`idresearch`, `idprof`) values ('12', '432156789'); insert `university`.`applications` (`idresearch`, `idprof`) values ('12', ...

android - Using JSON Parse push to open fragment -

i have got ios app open views according value stored in json push , trying same in our android app. this message being sent: { "alert": "test push ", "title": "new test push", "view": "circles" } there have been quite few questions on stack overflow i'm afraid don't understand particular code snippets can go, or how make open fragment rather root activity. my question is, without asking of code written me, functions, calls , classes need use in order achieve this? i implement parse push solution: open activity clicking on push notification parse you best bet writing intent reader detect if activity started clicking push message. above link has example you: try { intent intent = getintent(); bundle extras = intent.getextras(); if (extras != null) { string jsondata = extras.getstring("com.parse.data"); // data parse push json jsonobject json; json...

server - How to integrate NewRelic App Monitoring tool with Cloudify? -

i looking forward integrate newrelic agent existing cloudify 2.7 environment. since cloudify apps running in individual paths , each deployment takes apps running on different paths, it's not possible assign app server newrelic. how can on come this? it's not entirely clear trying accomplish. you recipe can install newrelic agent , configure connect newrelic. alternatively, if newrelic agent has api or cli, can add a monitors{ } section recipe. section collect required stats local agent , publish them cloudify manager. more information available here: http://getcloudify.org/guide/2.7/plugins_and_probes/probes.html the collected monitors available using manager rest api. can use separate process poll metrics manager api , send them newrelic. at: http://getcloudify.org/guide/2.7/restapi/restdoclet.html and api at /{version}/deployments/{appname}/service/{servicename}/instances/{instanceid}/metrics

python urllib3 pip install error linux -

i trying install urllib3 using pip , error posted @ bottom of message. i have wrestled issue few days days trying many things have found online without success, posting here. unfortunately don't know quite enough know bits of have tried might relevant, here goes. i want install urllib3 because trying create simple twitter bot based on various tutorials have found online, , regularly getting error: 'importerror: no module named urllib3'. though thought had installed urllib3 (via synaptic - says have). prior this, attempting follow advice here https://urllib3.readthedocs.org/en/latest/security.html#pyopenssl because getting insecureplatformwarning @ bottom of page, when trying bot working. (before attempting install urllib3 installed python-pip, following, using command: 'pip install pyopenssl ndg-httpsclient pyasn1' per instructions on page. appears have worked... i see in error permissions denied/root statements after trying various things not sure how...

asp.net mvc - How to display message before redirecting to another page? -

i have problem... have registration form , when user has registred redirect him home page..i want display popup message before redirecting him successfuly registred , redirect him home page. controller: tempdata["successmessage"] = "a confirmation email sent address you've entered shortly"; return redirecttoaction("index", "home"); view: <script> if (@tempdata["successmessage"] != null) { alert('@tempdata["successmessage"]'); } </script> store redirect url way viewbag.redirect = "your url "; and java script mention below <script> if (@tempdata["successmessage"] != null) { alert('@tempdata["successmessage"]'); window.settimeout(function () { location.href = @viewbag.redirect; }, 5000); } </script>

matlab - application of the metropolis criterion on neighbour in simulated annealing algorithm -

i'm working on simulated annealing , have problem application of metropolis criterion. use 2 methods: first, apply metroplolis criterion on every neighbour generated , when in algorithm (i'm working matlab), algorithm refuses neighbour , accepts 2 or three, not best solutions,and @ end have result not desired optimum. second, when generated new neighboor,i compare energy energy of current solution , if less , keep neighbour , if not case applied criterion of metroplis on see if keep or not. in way satisfactory results. wonder if it's logic of simulated annealing, because don't yet know when apply metropolis criterion. on every generated neighbour? if case, second method correct? , random should between 0 , 1?or possible generate random in other interval? thank

Replace the characters in every line of a file, if it match a condition - Unix -

i have file "dummy" in which: if 15 character of file matches "r" , 28 character of file matches "d" 53-56 characters should replaced 0. i have tried using below script, it's not working. for in `cat dummy` if [[ `echo $i | cut -c15` = "r" ]] && [[ `echo $i | cut -c28` = "d" ]] sed -e 's/./0/53' -e 's/./0/54' -e 's/./0/55' -e 's/./0/56' fi done input file: dummy 05196220141228r201412241308d201412200055sa1155we130800031300sl07y051 05196220141228r201412241308a201412220350sa0731su1950lax c00020202020 05196220141228r201412241308d201412200055sa1155we130823455300sl07y051 05196220141228n201412241308a201412240007tu0548we1107mel c00000000015 07054820141228n201412220850d201412180300th1400mo085000040300ul180001 output should be: 05196220141228r201412241308d201412200055sa1155we130800001300sl07y051 05196220141228r201412241308a201412220350sa0731su1950lax c00020202020 05196220141228r20...

php - paypal live - getting response code 400 PERMISSION_DENIED with RestAPI -

edited: seems having trouble business account. know how set business account restapi? i did restapi payment in symfony paypal rest-api sdk. works in sandbox fails in live. the paypal account actived account payment solution setted website payments standard api client , secret key changed live credentials api context mode changed live here code: $clientid = $this->container->getparameter('paypal_client_id'); $secret = $this->container->getparameter('paypal_secret'); $paypalmode = $this->container->getparameter('paypal_mode'); // live $oauthcredential = new oauthtokencredential($clientid, $secret); $apicontext = new apicontext($oauthcredential); $apicontext->setconfig( [ 'log.logenabled' => true, 'log.filename' => $logdir.'/paypal.log', 'log.loglevel' => 'fine', 'mode' => $paypalmode, ] ); $payer = new payer(); $payer->setpa...

What keys does the default Java Keystore contain? -

i understand default java truststore contains root certificates , other certs related trust. however, keys stored in default java keystore? far i've understood, keystores used for which authentication credentials should sent remote host authentication during ssl handshake. if ssl server use private key during key exchange algorithm , send certificates corresponding public keys client, certificate acquired keystore. according http://javarevisited.blogspot.com/2012/09/difference-between-truststore-vs-keystore-java-ssl.html . find hard come use cases general keystore bundled java environment. i understand default java truststore contains root certificates , other certs related trust. correct. however, keys stored in default java keystore? there isn't default java keystore. i find hard come use cases general keystore bundled java environment. there isn't such case, , there isn't such keystore either. there's nothing in non-no...

pascalscript - Conditional DisableProgramGroupPage in Inno Setup -

i'm trying create single installer both normal , portable installs. portable install disabling icons , uninstaller creation. the problem stuck @ how disable program group page when running portable install. misunderstanding here? [setup] ;this works expected uninstallable=not isportable() ;this not work, can't compile (disableprogramgrouppage=yes alone compiles fine) disableprogramgrouppage=yes isportable() compilation fails error value of [setup] section directive ... invalid. this isportable() function: function isportable(): boolean; begin if(standardradiobutton.checked = true) result := false else result := true; end; (elaborating on @tlama's comment) the disableprogramgrouppage not support "boolean expression": [setup]: disableprogramgrouppage valid values: auto , yes , or no contrary uninstallable : [setup]: uninstallable valid values: yes or no , or boolean expression you can use shouldskip...

c# - How to convert session data to SessionStateStoreData type in custom session state provider -

i using custom session provider in web application inheriting sessionstatestoreproviderbase , overriding methods. method used getting data session has return type of sessionstatestoredata . currently binary serialization being used serializing , deserializing data. want use json serialization instead of binary not sure how convert session data (of type string after json serialization) sessionstatestoredata type. constructor of sessionstatestoredata type uses sessionstateitemcollection type object can deserialize method of sessionstateitemcollection takes binary stream input. var ms = _serializedsessiondata == null ? new memorystream() : new memorystream(_serializedsessiondata); var sessionitems = new sessionstateitemcollection(); if (ms.length > 0) { var reader = new binaryreader(ms); sessionitems = sessionstateitemcollection.deserialize(reader); } return new sessionstatestoredata(sessionit...