Posts

Showing posts from July, 2015

c# - Amazon S3 Stream is too long -

when trying download large file, zip file size 2gb amazon s3, throws exception "stream long" . how reading file amazon stream var s3file = new s3fileinfo(client, bucketname, objectkey); var stream = s3file.openread(); is possible read file contents small chunks , merge them locally? -alan- public class buketobjectresult { public bool success { get; set; } public long size { get; set; } } public void getbucketobjectdata() { try { buketobjectresult res = checkfile(); //chunk divide in small chunks eg : 2gb file : 20mb chunks int chunksize = (int)(res.size / chunk); if (!res.success && (res.size == 0 || chunksize <= 0)) { res.success = false; return ; } string filename = "your file name"; long startpostion = 0; long endposition = 0

How to Organize Code in a Resource Management Phaser Typescript Project? -

i'm making type of resource-management type game , need sort of "collection manager" in between states , objects. i'm using typescript. let's example game raising cats. in 1 state, player can skip forward 1 year. when happens want go through collection of cats , select pairs become parents of new cats. in state player can feed 10 cats (changing hunger values). in 2 different states, need update collection of cats. i had code inside each state , collection of cats passed around through localstorage (or phaser cache). code has become quite messy. so want create abstraction layer between states , collection of objects. responsible updating cats, creating new ones, , returning subsets of cats based on passed criteria. static layer don't have pass between states. love able call functions like: catmanager.generatenewcats(10); catmanager.getcats({minage:2, maxage:5}); catmanager.incrementages(); how go organizing this? here 1 potential solution

iframe - Google Sites gadget disapears on Chrome when using BACK button -

the section in between horizontal navigation bar , "schedule" in this site built google gadget. when navigate through pages of site on chrome , use chrome's button come home page, gadget disappears of time. same thing happens forward button well. when inspect dom tree when issue active, see iframe element of gadget there dom object (html section) null. if reload iframe or refresh page, gadget appears. the gadget hosted in github here (abva.xml file). this site works fine on other browsers. have been fighting many days no avail. pretty new gadget development. appreciate if me resolve issue. thank you the issue resolved when htmlbox gadget div in inserted before gadget. made div empty , set width , height 0 wouldn't make visual impact. don't have logical explanation solution though.

angularjs - How to find an array object according to given information? -

i have array in angularjs controller this: $scope.persons = [{name:'joey', age:'27'},{name:'lucy', age:'22'}] i have got name 'lucy', how can age of name in controller (not in html)? i've created plunk here outlines single result, age, multiple results. this implemented within filter, documented on angular site here: https://docs.angularjs.org/api/ng/filter/filter https://plnkr.co/edit/ofrmzpqrzftonafyjp7z?p=info angular.module('plnk',[]).controller('plnkctrl', function($scope){ // note, added second joey here test multiple function. // output, check browser console. $scope.persons = [{name:'joey', age:'27'},{name:'joey', age:'28'},{name:'lucy', age:'22'}] console.log('single -> ', getagesingle('lucy')); console.log('multiple ->',getagemultiple('joey')); function getagemultiple(personlookup) { var r

c# - UWP WIndows-10 Loading images in app -

i have c# app targeting windows uwp platform. app displays images in list view. based on query made, these images can come either app's container( /assets/ folder) online source local source when image's source either in app's container or online source can bind image source valid uri in xaml fetch image. when image's source local, url image proprietary & use our own imge_fetch api image our servers. my problem how specify xaml binding capable of taking either uri(when image app's container or online source) or bitmapimage(returned our image_fetch apis) have checked post regarding ivalueconverter i want know, if there better/easier way in uwp trying achieve. you may create view model item class source property of type object , can assign string , uri or imagesource : public class imageitem { public object imagesource { get; set; } } in xaml, can directly bind property , benefit built-in automatic type conversion: <listbo

javascript - On click event not working when it has child elements -

Image
sorry if title kinda confusing i'll try , explain through code. have created button show or hides cart of e-commerce site(i'm using woocommerce). here sample of code i'm working. html markup <div class="crate-status toggle-cart"> <img src="http://localhost/crate/wp-content/uploads/2016/05/mini-cart-icon.png" /><span class="crate-name">crate:</span> <span class="cart-contents"><?php echo sprintf (_n( '%d', '%d', wc()->cart->get_cart_contents_count() ), wc()->cart->get_cart_contents_count() ); ?></span> <?php woocommerce_header_add_to_cart_fragment( $fragments ) ?> </div> javascript $(document).ready(function() { $('.toggle-cart' ).on('click', function(event) { $('.crate-box').toggleclass('toggle'); $('.overlay-site').toggleclass('show-overlay'); }) $(&

php - .htacess rewrite url when using get values -

i'm trying turn http://www.starsqa.com/lala.php?fname=bob http://starsqa.com/lala/bob <form action="lala.php" method="get"> name: <input type="text" name="fname"> <input type="submit"> </form> welcome <?php echo $_get["fname"]; ?>.<br> i tried on .htaccess, nothing happened redirect 302 /lala.php?fname=bob http://www.starsqa.com/lala/bob.php is possible? if want send visitors http://www.starsqa.com/lala/bob http://www.starsqa.com/lala.php?fname=bob : rewritecond %{query_string} ^$ rewriterule ^/lala/bob$ /lala.php?fname=bob [l,qsa] rewritecond %{query_string} ^$ rewriterule ^/lala/bob/$ /lala.php?fname=bob [l] if want general pattern fname can name, try this: rewritecond %{query_string} ^$ rewriterule ^/lala/([a-za-z0-9:\@.\-\+]{1,100})$ /lala.php?fname=$1 [l,qsa] rewritecond %{query_string} ^$ rewriterule ^/lala/([a-za-z0-9:\@.\-\+

c++ - omniorb makefile server error -

im doing adition simple program on omniorb 4.2 makefile server gives me error. heres makeserver file code: cc = gcc cppflags = -g -c ldflags = -g omni_home = /opt/omniorb omni_includes = -i$(omni_home)/include omni_lib_dir = $(omni_home)/lib omniidl = $(omni_home)/bin/omniidl includes = $(omni_includes) libs = -lomniorb4 -lomnithread -lomnidynamic4 objects = data.o cservicea.o server.o server: $(objects) $(cc) $(ldflags) -o server -l$(omni_home)/lib $(objects) $(libpath) $(libs) data.o: datask.cc data.hh $(cc) $(cppflags) $(includes) datask.cc server.o: server.cpp data.hh $(cc) $(cppflags) $(includes) server.cpp cservicea.o: cservicea.cpp cservicea.h data.hh $(cc) $(cppflags) $(includes) cservicea.cpp datask.cc: data.idl $(omni_home)/bin/omniidl -bcxx data.idl clean clean_all: rm -fr *.o rm -fr core rm -fr *.hh rm -fr *sk.cc rm -fr server and error gives me: $ make -f ma

RecyclerViews listItem x,y coordinates android -

how x , y coordinates of recyclerview listitem . have tried below methods returning 0 .any appreciated @override public void onbindviewholder(viewholder holder, int position) { int x,y; int arr[] =new int[2]; holder.imageview.getlocationonscreen(arr); log.d(tag,"x axis:"+arr[0]+",arr[1]:"+arr[1]); float d = holder.imageview.getwidth(); log.d(tag,"diameter 3:"+holder.itemview.getheight()); log.d(tag,"right:"+holder.itemview.getmeasuredwidth()); }

ios - How to check if two NSDates are from the same day -

this question has answer here: comparing nsdates without time component 14 answers i working on ios development , find hard check if 2 nsdates same day. tried use this fetchdatelist() // check date let date = nsdate() // setup date formatter let dateformatter = nsdateformatter() // set current time zone dateformatter.locale = nslocale.currentlocale() let latestdate = datalist[datalist.count-1].valueforkey("representdate") as! nsdate //let newdate = dateformatter.stringfromdate(date) let diffdatecomponent = nscalendar.currentcalendar().components([nscalendarunit.year, nscalendarunit.month, nscalendarunit.day], fromdate: latestdate, todate: date, options: nscalendaroptions.init(rawvalue: 0)) print(diffdatecomponent.day) but checks if 2 nsdates has difference of 24 hours. think there way make work still, wish hav

hadoop - Why sometimes the mapreduce Average Reduce Time is a negative number? -

Image
i run mapreduce job on hadoop cluster. job's running time saw in browser @ master:8088 , master:19888 (job history server web ui) shown below: master:8088 master:19888 i have 2 questions: why elapsed times 2 pictures different? why average reduce time negative number? it looks average reduce time based on times previous tasks (shuffle/merge) took finish , not amount of time reduce took run. looking @ source code can see relevant calculations occurring around line 300. if (attempt.getstate() == taskattemptstate.succeeded) { numreduces++; avgshuffletime += (attempt.getshufflefinishtime() - attempt.getlaunchtime()); avgmergetime += attempt.getsortfinishtime() - attempt.getshufflefinishtime(); avgreducetime += (attempt.getfinishtime() - attempt.getsortfinishtime()); } followed by: if (numreduces > 0) { avgreducetime = avgreducetime / numreduces; avgshuffletime = avgshuffletime / numreduces; avgmergetime = avgmergetime / numreduces

php - Broken switch statement -

ive been searching , staring hours , i'm @ loss. have following code when august date passed through switch (as aug) statement keeps returning 0 value instead of 8. echo results below code block. ideas might going wrong? seemed work july , broke on august 1st. $when=date("y-m-d"); $created=date("ymd"); $date=explode('-',$emprow->hire_date); echo "<br>hire date ";print_r($date);echo "<br>"; switch ($date[1]) { case "jan": $date[1]=01; break; case "feb": $date[1]=02; break; case "mar": $date[1]=03; break; case "apr": $date[1]=04; break; case "may": $date[1]=05; break; case "jun": $date[1]=06; break; case "jul": $date[

hadoop - Using DBOutputFormat to write data to Mysql causes IOException -

recently, learning mapreduce , use write data mysql database. there 2 ways so, dboutputformat , sqoop . tried first 1 (refer here ), encountered problem, following error: ... 16/05/25 09:36:53 info mapred.localjobrunner: 3 / 3 copied. 16/05/25 09:36:53 info mapred.localjobrunner: reduce task executor complete. 16/05/25 09:36:53 warn output.fileoutputcommitter: output path null in cleanupjob() 16/05/25 09:36:53 warn mapred.localjobrunner: job_local1404930626_0001 java.lang.exception: java.io.ioexception @ org.apache.hadoop.mapred.localjobrunner$job.runtasks(localjobrunner.java:462) @ org.apache.hadoop.mapred.localjobrunner$job.run(localjobrunner.java:529) caused by: java.io.ioexception @ org.apache.hadoop.mapreduce.lib.db.dboutputformat.getrecordwriter(dboutputformat.java:185) @ org.apache.hadoop.mapred.reducetask$newtrackingrecordwriter.<init>(reducetask.java:540) @ org.apache.hadoop.mapred.reducetask.runnewreducer(reducetask.java:614) @ org.apache.

c++ - Using c++11 in MacOS X and compiled Boost libraries conundrum -

i trying compile c++ project uses c++11 standards extensively. going -std=c++11, until tried use unordered_map , macos doesn't have unordered_map header file anywhere in usr/include. i did research , found using -stdlib=libc++ fix (not sure how, seems magic me if include file in filesystem). did. compiled well, linker cannot link boost::program_options program uses extensively. without -stdlib=libc++, boost links perfectly, lose unordered_map. what should have latest c++11 features mac os clang++ compiler , still able link boost libraries (which built sources on mac) ps: works fine in arch linux box my makefile: libs = -lboost_program_options cxxflags = -stdlib=libc++ -std=c++11 -wall -g obj = fastq.o fastq_reader.o main.o degenerate.o interleave.o complement.o interval_utils.o interval.o interval_utils_test_tool.o foghorn: $(obj) $(link.cc) -o $@ $^ $(libs) the output using -stdlib=libc++ $ make c++ -stdlib=libc++ -std=c++11 -wall -g -c -o fast

html - Issue with extra line space on Font Squirrel generated font in Firefox only -

i’m redesigning husband’s website, , though i’ve created few basic websites years ago, i’m bit of novice , i’m figuring things out go along… i have font i’ve run through font squirrel, , i’m having issue how displays in firefox. safari , chrome seem working fine. first line of text adds space above it. display font , have used in many different areas of site, including navigation bar , many graphics , headings (not h1 or h2 tags per se, many divs)—the 1 paragraph have used (in sidebar on index page) puts space above first line. messing layout of site, , can’t find font works design. i’ve tried setting line-height 1.2, , i’ve tried reset.css found on site, these don’t seem work. have css reset included on page recommended in css manual i’m using. also, css index page still internal, if view source can see it. (i haven’t cleaned yet, might tad disorganized.) the link test site here: http://www.californiaclassix.com/test/cc-indextest.html here css: @font-face { font-f

How are html id attributes passed as an argument to a separate JavaScript file? -

i'm still new programming. i've followed tutorial javascript calculator online, , in tutorial html id attributes passed along separate javascript file. file passed such: <script src="logic.js"></script> here example: var box = document.getelementbyid('display'); function addtoscreen(x){ box.value += x; if (x == 'c') { box.value = ' '; } } where box variable empty field in calculator integers , operations entered (the 'c' button clear calculator). function addtoscreen has parameter x, , x gets input such number 9, entered following input: <input type ="button" value="9" id="keys" onclick="addtoscreen('9')"> i'm trying understand how these passed more, i'm playing them. have made separate html , javascript file, , there 3 input fields user input numbers into, , button click average 3 numbers: <form> <input type="number" i

twilio - Getting a busy signal when calling a client device -

i've using basic phone example twilio, have set use auth.php example , have directed purchased phone number basic-call.php. when try call number, hear default prompt, busy signal , nothing happens in app. both auth.php , basic-call.php set use same client id (basic), , can't find documentation on twilio means if there's busy signal when directing client app. i don't have php errors in logs or errors showing in twilio console, if helps? turns out problem wasn't signing request account sid , auth token of subaccount number associated with. sure hope helps else!

java - Create a Synthetic Vision System -

i add feature android app: https://en.wikipedia.org/wiki/synthetic_vision_system in short believe terrain heightmap. need rendering terrain. rest of display can accomplish. after day of google appear no closer. research seems point using opengl, heightmaps , srtm. have no clue how tie together. none of java examples android specific. alternatively maybe using openstreetmaps , tile overlay cant establish if possible in 3d. the app moving map based on gps position of aircraft. aircraft moves on earth terrain ahead updated. can point me in right direction? i can recommend use vector format few layers. example, layer of depth, layer of landscape type , layer of objects. build 3d data need divide map in small tiles , load data in memory visible area only. 3d builder parse data. e.g. simple renderer (using opengl)... create mesh large tile size , enough count of vertexes. next, parse depth layer , move each vertex along z-axis need. after need set color specifi

html - Is it possible to vertically center multi-line labels? -

since i've been researching , working on hours no luck, assume answer no, love confirmation 1 way or another. i have multi-line label left of select field. assume label 3 wrapped lines. middle line of label match vertically select field. this: label line 1 label line 2 selectfield label line 3 basically, question similar 1 couple of years ago, not answered definitively: vertical center label text area , select , textbox . responded javascript required. i have fiddle efforts far. i've found interesting variations, nothing matches i'm looking for. can confirm whether or not possible? thanks!!! [edit: spelling] try html <div class= 'divclass'> <label class="labelleft" for='name'>name 1 long multi-line label:</label> <select class='selectclass'> <option value="yes">yes</option> <option value="no">no</option>

Creating a variable string from a multiselect listbox in MS Word -

i have created userform multiselect listbox "ok" command. when user makes selections listbox , clicks ok command, want create array (based on user's selections in listbox) can loop on each item in array open multiple files user has specified. for example, if user selects "client 1" , "client 3" in listbox , selects "ok" command, want create array values , call each value in array in "find , replace" sub replaces, e.g., "client 1" "client 1" (colored red), "client 3" "client 3" (colored red). (the red other find , replace macro can skip these items specifying different color find for, along text client 1, client 3, etc.) reading elsewhere on site, created function try generate array, don't know how , use in userform sub. after finding answer, below, deleted original code had pasted here, because wrong , won't anyone. additional information overall objective: have created ma

javascript - Hiding elements in table causes columns to shift -

in example http://jsfiddle.net/byak4/ why hiding cell cause whole column shift on , can avoid this? html <table> <tr> <td>john</td> <td>doe</td> </tr> <tr> <td>hello</td> <td><div class="hide">world</div></td> </tr> </table> css table { width:400px; } js $(document).ready(function() { $('.hide').slideup(); }); try with $(document).ready(function() { $('.hide').hide(); }); slideup may causes meshup , give width td like table tr td{ width:200px; } see demo see using slideup demo2

sas - How to change a date formatted number into number in SQL -

i meet confusing problem when code sql in sas. code is: proc sql noprint; select vdte :vdate test1; quit; proc sql; create table test3 select *, cdate>=&vdate. index test2; quit; i find index=1. there should index=0 , index=1 . when use number instead of macro variable vdate , eg. 17685(02jun2008) instead of &vdate. , works! i checked vdte. type numeric, format ddmmyy10.. vdte number stored in sas! when give &vdate., there problem!! could me understand situation? thanks, andrea if vdte has sas date format, need "clear" before storing value macro variable: proc sql; select vdte format=8. :vdate test1; quit; then comparison should work fine. note use date9. format creating macro variable , use cdate>="&vdate"d in second query.

android - Are separate intent services queued on the same thread? -

i have 2 intent services - intentservicea , intentserviceb they have following class definitions: public class firstservice extends intentservice { public firstservice() { super("first_service"); } @override protected void onhandleintent(intent intent) { log.d("chi6rag", "first starts"); (long = 0l; < 10000000l; i++) { if (i == 0l) log.d("chi6rag", "first started"); } log.d("chi6rag", "first ends"); } } and public class secondservice extends intentservice { public secondservice() { super("second_service"); } @override protected void onhandleintent(intent intent) { log.d("chi6rag", "second starts"); (long = 0l; < 10000000l; i++) { if (i == 0l) log.d("chi6rag", "second started"); } log.d("chi6rag", "second ends"); } } if execute

android - SherlockActionBar not showing on 4.2.2 -

my sherlock action bar work on samsung galaxy s2 4.0.3 , emulator 2.1 not on nexus 10 4.2.2, can't figure out why. here related code : in main activity : actionbar ab = getsupportactionbar(); ab.setdisplayshowtitleenabled(false); ab.setdisplayshowhomeenabled(false); ... @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { // stuff calendarcontract case r.id.action_settings: intent viewintent = new intent(this, settingsactivity.class); startactivityforresult(viewintent, 2); break; case r.id.add_alarm: loadtimer(); break; default: break; } return super.onoptionsitemselected(item); } ... @override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getsupportmenuinflater(); inflater.inflate(r.menu.mainmenu, menu); return true; } manifest : <?xml version="1.0" encoding="utf-8"

ios - trying to create Favorite Button for add items in favorite list -

i'm trying create favorite button on collectionviewcell saving items in favorite list. when tapped on favorite icon button add selected cell item in array of favorite list class, , shows in favorite list. when tapped on favorite button change image according values saved or not. when i'm trying save favorite list array in nsuserdefaults save , show values when retrieve it. when close app simulator , run again not shows values in favorite list array saved in nsuserdefaults , want set button image state according item add or not. output when tapped on favorite. , run again after closing app. can tell me how can fix that. or can please fix in project. thanks import uikit var url : [nsstring] = [ "https://www.youtube.com/watch?v=9h30bx4klxg", "https://www.youtube.com/watch?v=ij_0p_6qtss", "https://www.youtube.com/watch?v=ajtdxiazrmo", "https://www.youtube.com/watch?v=h202k7kfzl0", "https://www.youtube.com/

(Visual Studio 2015) Unable to create Win32 C++ app -

Image
i have visual studio 2015 community update 2. i've installed visual c++ windows , mobile platforms can see in picture: the problem when try create c++ win32 app , click on these 2 templates nothing happens , stuck @ screen. as cheers , hth alf said, had reinstall whole visual studio 2015 working again.

xml - Android style dosen't work -

i trying add specific style button, issue it's works in themes.xml when write : themes.xml <style name="apptheme" parent="theme.appcompat.noactionbar"> <item name="colorcontrolhighlight">@color/background</item> <item name="colorbuttonnormal">@color/white</item> </style> mylayout.xml <button android:id="@+id/play" android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignparentbottom="true" android:gravity="center" android:text="play" android:textcolor="@color/guillotine_background" android:textsize="25dp" android:textstyle="bold"/> but don't same result when use : styles.xml <style name="mycolorbutton" parent="apptheme"> <item name="colorcontrolhighlight">@color

jquery - How do i prevent jsTree from expanding table cell? -

Image
i creating jstree inside table cell. the tree without expanding looks this: but when click on root node . expands table cell. i want table cell should not expanded. my code follows: <table border="1" cellpadding="0"cellspacing="0" width="100%" style="margin-top:10px;"> <tr> <td style="padding-left:5px;">pca</td> <td id="population"></td> <td id="sex"></td> <td id="literacy"></td> </tr> </table> <script type="text/javascript"> $(function () { $("#population").jstree({ "html_data" : { "data" : "<?php echo $populationdata;?>" },

angularjs - Web development which is best Angular Js or Wordpress -

i developing 1 project little bit confused choose technology should use i go angularjs, why angularjs? i go wordpress, why wordpress? can suggest me best option? the answer not simple, because there many types of fields on selected technologies can used , @steur36 said before, depends on project requirements. basically, wordpress cms , prime functionality provide functionality run , display simple webpage (its mix of frontend , backend). wordpress used success small websites or blogs (where main feature provide and/or display basic content, like: text, images/media/gallery, files ect.) in other side, there angularjs , javascript frontend framework can focus on visual side of project , how content present audience. angularjs (or other javascript frontend framework, like: ember, backbone, ect.) can build appearance of webpage or web application, store content, may need restful backend server (to create queries server). as small summary , wordpress great smal

javascript - Resize canvas based on number of canvas wrt to parent div -

i have viewport of dimension. currently, showing single image drawn on html5 canvas. need show multiple canvas range 1-6. requirement resize canvases based on number of canvas fits parent div. for example : single canvas should take 100% of parent div, 2 canvas 50-50%. 6 canvas 2 rows 3 canvas each. also, user can toggle show/hide of canvas have rearrange. how can go doing this? using angularjs ,javascript , html5 css3. check out css flexbox can auto-size , auto-arrange multiple canvases inside container div. css-tricks has excellent overview of flexbox wes bos has done nice series of video tutorials of flexbox flexbox easy use after small learning curve. declare div flexbox container: #thediv{ display: flex; } and tell flexbox how want canvas-items displayed: #thediv{ flex-flow: row wrap; } you haven't detailed how want canvases grow / shrink when container div resized or when user hides / shows canvases, flexbox has grow / shrink settings can

facebook account kit - Web Login settings error -

the following error message being displayed "we're sorry, went wrong." while integrating account kit web (javascript) i not able update server urls field under web login setting section of facebook account kit product. when click on save changes button, shows message 'saved' doesn't save urls given in text field. is else getting issue? it working now. had select domain name popup box. detailed report here https://developers.facebook.com/bugs/1190154747695673/

angular - Know in parent what child RouteSegment is selected? -

i able find out in parent component, or app component, child route active. instance able style active route link. see [routelink] adds 'router-link-active' class, in example have 'home' route '/' has class no matter route use. there way see in parent of outlet route on? i've injected location @angular/common , able see full path guess looking @ when route changes: ngoninit() { this.router.changes.subscribe(changes => { console.log('location info:', this.location.platformstrategy.path()); }); } is there way @ routetree or active routesegment parent? or check router-outlet , see component loaded it? you can access current route like constructor(private router:router, private routeserializer:routerurlserializer, private location:location) { router.changes.first().subscribe(() => { console.log('router', this.router); let urltree = this.routeserializer.parse(location.path()); /

mysql - [My]SQL Query Syntax which requires foreach processing -

i have sql query task can ok in c# or linqpad prefer in sql standard reporting tools can it. end db bugzilla under mysql the problem need loop through bug_activity looking particular changes consider parent record "valid", how ? e.g. pseudo logic if bug_status went in backlog bug_status went assigned , happened 2016-03-01 206-03-31 consider valid record i unsure how web examples show declare , loops how loop fits "select, from, where" code. set @bugid = 64252; select bugs_activity.bug_id, -- profiles.realname, -- profiles.login_name, bugs_activity.bug_when, fielddefs.name, bugs_activity.added -- bugs_activity.removed bugs_activity, profiles, fielddefs -- real world 'where xx' have more logic , result in number of bugzilla records -- each bugzilla record has own 'bugs_activity' -- logic needs @ each buzilla records historyto filter results -- want end fil

java - The switch statent and return values - How to use a switch to determin JPanel drawn -

i have program has different jpanels written in different classes. print particular jpanel depending on button clicked user. when program launched, has 3 buttons: "animals jbutton", "plants jbutton" , "refresh jbutton" in jframe "frame"; no jpanel. if, example, user clicks on "animals jbutton", jpanel animals gets printed on jframe. the "animalsjpanel" , "plantsjpanel" written in different classes. class, "pagereturner", has method determines gets printed via switch. public class redirect { string pageanimals = "pageanimals"; string pageplants = "pageplants"; string value; public string pageredirect (string pageid) { switch (pageid) { case pageanimals: value = (animalsjpanel animalsjpanel = new animalsjpanel()); break; case pageplants: value = (plantsjpanel plantsjpanel = new plants

javascript - Syntax Error in IE 10 for AngularJS -

hi building angular js web application. in chrome , ff, running fine, in ie it's acting weird. i getting below error : syntaxerror<div class="ng-scope" id="maincontainer" data-ng-animate="1" ng-view=""> in console. ie version 10.

r - updateCheckBoxGroupInput in shiny based on selection of other checkboxes -

my shiny application has multiple tabs. in 1 of tabs have plot output want use create reports in tab. have included checkbox in first tab user select output reporting. in second tab trying update check box group input based on selection of first tab. getting first option selected. the reproducible code follows: based on ifelse condition: library(shiny) library(shinydashboard) ui <- dashboardpage( dashboardheader( title = "module",titlewidth = 225 ), dashboardsidebar( width = 225, sidebarmenu(id = "tabs", menuitem("toplines", tabname = "tplines", icon = shiny::icon("dashboard")), menuitem("my monthly reports", tabname = "myweeklyrep", icon = shiny::icon("compass")) )),

python - Getting a previous value Pandas -

i'm working on feature extraction machine learning model , every row need compare current price previous price. sort dataframe datetime column, iterate on rows , keep dictionary product id key , last price value. dataset big, around 5m 'sales' in training set , in test set. on small sample (about 250k products) taking long time , lot of memory. i've used vectorizing functions throughout other portions of code don't know how can make part more efficient. here's i'm doing right now: data = data.sort_values('date_time') previous_price = {} data_list = [] index, value in data.iterrows(): if value['prop_id'] in previous_price.keys(): data_list.append(value['price_usd']-previous_price[value['prop_id']]) else: data_list.append(0) previous_price[value['prop_id']] = value['price_usd'] data['previous_price_diff'] = data_list it looks want previous value subtract against

How to customize Zurb Foundation 6 close button -

the close button seems way displaying notice user can click away. usage remains rather elusive newb. i have placed 1 on page: <div> <div class="callout" data-closable="slide-out-left"> <button class="close-button" data-close>&times;</button> <p>whatever notice text</p> </div> but unaware of way of changing color zurb way, or find closing animation options other 1 use above. button colored e.g. zurb success, , fade out effect rather confusingly fast slide out effect. how go that? actually button tightly wrap around notice text, not take whole line width. doable in zurb-idiomatic way? thanks! to change color of close button or other style, can code css like .close-button{ color:red; } if using sass can customize variables. http://foundation.zurb.com/sites/docs/close-button.html#sass-reference the animations can use are: slide-in-down slide-in-left slide-

ruby - Rails: Set up favorite recipe for user but keep getting same error -

as user want able add recipe favorites. unfortunately when try add recipe favorites following error: recipe(#69883866963220) expected, got nilclass(#46922250887180) . i followed 'tutorial' guideline somehow not able add user's favorites. when use rails c , type in user.find(1).favorites , returns me empty array. who can me solve issue? thank in advance! my models: class favoriterecipe < activerecord::base belongs_to :recipe belongs_to :user end class user < activerecord::base has_many :recipes # favorite recipes of user has_many :favorite_recipes # 'relationships' has_many :favorites, through: :favorite_recipes, source: :recipe # actual recipes user favorites end class recipe < activerecord::base belongs_to :user # favorited users has_many :favorite_recipes # 'relationships' has_many :favorited_by, through: :favorite_recipes, source: :user # actual users favoriting recipe end my recipecontroller.rb: def

hibernate - JPA Deserilization Exception -

i having following domain while retrieving same jparepository giving me deserialization exception. tried making fields transient same issue. doing wrong here? @entity @table(name = "jhi_user") @cache(usage = cacheconcurrencystrategy.nonstrict_read_write) @document(indexname = "user") public class user extends abstractauditingentity implements serializable { private static final long serialversionuid = 123123212141221421l; @id @generatedvalue(strategy = generationtype.auto) private long id; @notnull @size(min = 1, max = 100) @column(name="login", length = 100, unique = true, nullable = false) private string login; @jsonignore @notnull @size(min = 60, max = 60) @column(name = "password_hash",length = 60) private string password; @size(max = 50) @column(name = "first_name", length = 50) private string firstname; @size(max = 50) @column(name = "last_