Posts

Showing posts from February, 2010

Color cells by absolute value in a range in Excel 2010 -

Image
i'm looking color table of values in excel 2010 absolute value. basically, if have table: ...the cells colored cell's raw value. color cell's absolute value, cell coloring of table: ...but values of first table (the real values). ideas on how 1 might this? through gui or vba? i don't think there way 3 colors (red, yellow, green), can 2 colors (for example yellow , green). make color low value , color high value same. way, cells lower absolute value have middle color , cells higher absolute value have other color. select data conditional formatting color scale more rules select "3-point scale" under format style change colors maximum , minimum colors same

jquery - converting date string to utc time format javascript -

i'm trying convert date string format "2014-12-04 12:00am" utc time format of "2014-11-29 01:00:12". i'm using function function formatdate(d){ function addzero(n){ return n < 10 ? '0' + n : '' + n; } return d.getutcfullyear() +"-"+ addzero(d.getutcmonth()+1) + "-" +addzero(d.getutcdate()) + " " + addzero(d.getutchours()) + ":" + addzero(d.getutcminutes()) + ":" + addzero(d.getutcminutes()); } for reason when pick 12am it's set val 12pm , i'm not sure function working on possibilities try js : var d = new date("2014-12-04 12:00 am"); var n = d.toutcstring(); alert(n); // output: wed, 03 dec 2014 18:30:00 gmt you can see link : http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_toutcstring

ios - NSLayoutConstraint constant updates but doesn't animate like expected -

Image
just prewarning - i’m pretty sure issue doesn’t have omission of self.view.layoutifneeded() in animation. i’m expecting constraint ‘animatingsideconstraint’ animate value set in viewwillappear: new value set (and animated) in viewdidappear: , allows search bar appear grow extent of navigation bar. the properties set, aren’t animated to. here’s code: @iboutlet var animatingsideconstraint: nslayoutconstraint! override func viewdidload() { super.viewdidload() // search bar // searchbar.delegate = self if let searchbarcontainerbounds = navigationcontroller?.navigationbar.bounds { searchbarcontainerview.bounds = searchbarcontainerbounds } } override func viewwillappear(animated: bool) { super.viewwillappear(animated) // search bar // // set initial properties // animatingsideconstraint.constant = cgrectgetwidth(searchbarcontainerview.bounds) * 0.5 // initialise use // searchbar.becomefirs

ios - Animate UILabel text color in Swift -

how can animate color change of uilabel using swift? have seen people mention using calayer cannot figure out swift syntax. this example of objective-c calayer *layer = myview.layer; catextlayer *textlayer = [catextlayer layer]; [textlayer setstring:@"my string"]; [textlayer setforegroundcolor:initialcolor; [textlayer setframe:self.bounds]; [[self.view layer] addsublayer:textlayer]; [uiview animatewithduration:0.5 animations:^{ textlayer.foregroundcolor = finalcolor; }]; it easier working calayer let mylabel: uilabel! uiview.animatewithduration(2, animations: { () -> void in mylabel.backgroundcolor = uicolor.redcolor(); }) thats it... edit ok, sorry didn't knew color want change... have converted example swift code... first import quartzcore than if let layer: calayer = self.view.layer calayer? { if let textlayer = catextlayer() catextlayer? { textlayer.string = "my string" textlayer.foregrou

xcode - Do I have to have LaunchScreen.xib for iOS 8 launch images? -

Image
i'm using xcode 6.1. in launch image sources = launchimage , in launch screen file = main_iphone. in images.xcassets under launch image name = launchimage. i have retina hd 5.5 , retina hd4.7 launch image in appropriate sizes ios 8. yet ios 8 devices whether on iphone 4s, iphone5's, or iphone 6's, ios 8 doesn't load launch image. don't use xib, storyboards. however, have create xib file called launchscreen.xib , put ios 8 launch images in file ios 8 launch images? so i'd put 2 ios 8 images in there , xib has no problem me using storyboards build game? way launch image work ios 8 in xcode 6.1? edit: made launchscreen.xib file. in file put retina hd 4.7 inch launch image 4.7 inch screen. in launch screen file put launchscreen.xib still same result. ios 7 launch images load ios 8 launch images don't load. i had same problem had marked xib launch screen, needed select launch xib in build settings, general tab.

java - Generating JavaFX project with Maven -

i'm trying create new javafx maven project in intellij idea using following pom.xml: <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>pl.edu.pg.eti.pcej</groupid> <artifactid>pl.edu.pg.eti.pcej.wi.clustermap</artifactid> <version>1.0-snapshot</version> </project> i cannot generate project, because i've got following warnings , errors: [warning] property organizationname missing. add -dorganizationname=somevalue ... [error] failed execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: archetype com.zenjava:javafx-bas

How do I declare a controller method for a named route in Laravel 4? -

i attempting declare method/function in controller responds numerically named route. when load page in site receive error stating controller method not found, meaning laravel won't load application incorrect formatting. searched answer no luck. here route i'm attempting access via math controller: students/academics/math/7-12 here method declaration route: public function get712() which gives me following error no matter page i'm loading: call undefined method illuminate\routing\router::get712() i'm not sure how name function/method in controller purely numeric routes since hyphen not allowed , there no upper/lowercase numbers. why not pass 7-12 variable method? route: students/academics/math/{number} controller: public function getmath($number) { // code here }

c# - WPF Datagrid single click row to open new Page -

my first post here! , new coding!... i have wpf datagrid in frame on page. click (preferably single click) on row , use id value stored in 1 of columns navigate (open) new page. using mousedoubleclick can double click row open page. throwing: "an unhandled exception of type 'system.nullreferenceexception' occurred in program.exe additional information: object reference not set instance of object." on line (see code behind below complete method): string id = ((datarowview)persondatagrid.selecteditem).row["personid"].tostring(); xaml: <datagrid x:name="persondatagrid" autogeneratecolumns="false" selectionmode="single" selectionunit ="fullrow" mousedoubleclick="persondatagrid_cellclicked" > <datagrid.columns> <datagridtextcolumn binding="{binding path=personid}" clipboardcontentbinding="{x:null}" header="id" />

ios - UIButton center position doesn't update with rotation -

i have program dynamically generates uibuttons in center of screen push of button. buttons not updating x-coordinates when rotate device. here code creating buttons: - (ibaction)createbutton:(uibutton *)sender { uibutton *button = [uibutton buttonwithtype:uibuttontypecustom]; [button setbackgroundcolor:[uicolor redcolor]]; [button addtarget:self action:@selector(dosomething:) forcontrolevents:uicontroleventtouchupinside]; button.frame = cgrectmake(self.xcoord,self.yoffset,100.0,120.0); [self.view addsubview:button]; _yoffset = _yoffset+130; } the xcoord , self.yoffset set in viewdidload: - (void)viewdidload { [super viewdidload]; self.yoffset = 109; self.xcoord = self.view.bounds.size.width/2-50; } the coordinates of button in code fixed once they've been added view. if want update frame of buttons when screen rotates, you'll need trigger repositioning of buttons when screen rotates. autolayout in storyboa

go - Interact with external application from within code (Golang) -

i need able run external application , interact though manually running command-line. examples find deal running program , capturing output. below simple example hope illustrates trying accomplish. package main import ( "fmt" "log" "os/exec" ) func main() { cmd := exec.command("rm", "-i", "somefile.txt") out, err := cmd.combinedoutput() if err != nil { log.fatal(err) } if string(out) == "remove file 'somefile.txt'?" { // send response 'y' rm process } // program completes normally... } i've tried tweak various examples i've found accomplish 0 success. seems though 'rm' waiting response, go closes process. any examples, articles, or advice can provide appreciated. many in advance. you have 2 possibilities. first use readline() works if application output full lines, , can wait \n. not case rm, have develop custom splitfunction

Listening for netlink broadcasts in a kernel module -

the selinux module sends out netlink broadcast listening sockets. i'm wondering if it's possible listen netlink broadcast within kernel module? from selinux netlink code: netlink_broadcast(selnl, skb, 0, selnlgrp_avc, gfp_user); i found can listen netlink data through use of regular sockets. and, yes, it's possible in kernel-space. you need create , bind socket: struct sock *sock = null; struct sockaddr_nl addr = { 0 }; /* create netlink socket selinux traffic */ int rc = sock_create_kern(af_netlink, sock_raw, netlink_selinux, &ctx.sock); if (rc) return rc; addr.nl_family = af_netlink; addr.nl_pid = 0; addr.nl_groups = selnlgrp_avc; rc = kernel_bind(ctx.sock, (struct sockaddr *) &addr, sizeof(addr)); if (rc) return rc; /* setup socket callback */ sock = ctx.sock->sk; sock->sk_data_ready = netlink_data_ready; sock->sk_allocation = gfp_kernel; to receive data: static void netlink_data_ready(struct sock

Synchronization paragraph from java documentation -

everyone! i reading java doc this: https://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html could anyone,please, tell more about the java programming language neither prevents nor requires detection of deadlock conditions. programs threads hold (directly or indirectly) locks on multiple objects should use conventional techniques deadlock avoidance, creating higher-level locking primitives not deadlock, if necessary. thanks. it means "do not expect java handle or avoid deadlocks you. if not write code there no way java tell in advance. so, responsibility make sure code not cause deadlocks".

osx - Custom NSControl classes in OS X 10.10 -

i need develop new custom nscontrol. of guides , examples can find (including apple's subclassing nscontrol article) built around nscell. of 10.10, of cell-related messages on nscontrol have been deprecated. i tried creating subclass , adding project via custom view in ib, can't control accept first responder despite being enabled, setting refusesfirstresponder no, , return yes acceptsfirstresponder. , i'm sure i'm missing lot of functionality (value change notifications, etc.) supposed there. is there newer reference around shows how controls supposed developed? google-fu letting me down if there is. thanks!

wordpress - .htaccess: RewriteRule: bad flag delimiters -

pulling hair out on one. have following .htaccess file custom redirects in addition wordpress's default settings. when tested on local wamp server worked fine after moving production i'm not getting rewriterule: bad flag delimiters error in server log , after while site goes down internal server error any appreciated. in advance! <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^rockford_weddings___welcome\.html$ /wedding/ [r=301,l] rewriterule ^blog/?$ /journal/ [r=301,l] rewriterule ^blog/(.*)$ /$1 [r=301,l] rewriterule ^portraitinvestment/?$ /portraitinvestment\.pdf [r=301,l] rewriterule ^weddinginvestment/?$ /weddinginvestment\.pdf [r=301,l] rewriterule ^holidaycards2014/?$ /holidaycards2014\.pdf [r=301,l] </ifmodule> # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </

io - What is the ^s symbol in C? -

i trying write set of double values file. specifying file "name".dat extension. write values want, symbol have never seen before, nor can find online, written. here writing: fprintf(filepath,"%lg,%lg,%lg\n",struct[i].x,struct[i].y,struct[i].z); here example of lines in file when viewed through text editor: double,double,^sdouble double,double,^sdouble double,double,^sdouble and on ..... the same ^s symbol appears before third set of data on every line. can explain symbol means? viewing file through emacs. may parsing issues having. thank consideration , help. you viewing file editor shows control characters: # echo -ne "\x13" | cat -e ^s how got there no 1 going able tell without seeing code.

python - TypeError: %d format: a number is required, not getset_descriptor -

i trying code script finds out current date , time , creates folder name based on this. error when try run code: typeerror: %d format: number required, not getset_descriptor this code: import os import time #import rpi.gpio gpio import logging import sys datetime import datetime d = datetime inityear = "%04d" % (d.year) initmonth = "%02d" % (d.month) initdate = "%02d" % (d.day) inithour = "%02d" % (d.hour) initmins = "%02d" % (d.minute)ion wish save files. set home default. # if run local web server on apache set /var/www/ make them # accessible via web browser. foldertosave = "/home/timelapse/timelapse_" + str(inityear) + str(initmonth) + str(initdate) + str(inithour) + str(initmins) #os.mkdir(foldertosave) # set initial serial saved images 1 fileserial = 1 = 'timefile' # run while loop of infinity while true: if os.path.isfile(a) == false: # set fileserialnumber 000x using 4 digits

python - Picking n_neighbors for KNeighborsClassifier -

simple question couldn't find answer anywhere online. based on data, how pick number use n_neighbors? or best use default of 5? data set working uses 13 values predict target. you should try different parameters , evaluate them via cross validation. sklearn has class that: gridsearchcv : g = gridsearchcv(kneighborsclassifier(), { "n_neighbors" : [5, 7, 11, 13, 17] }) g.fit(x, y) it's easy customize scoring function , (most importantly) run evaluations in parallel.

Picasso Library Not Loading Images in Android 5.0 -

i have listview extending arrayadapter. using view holder patter getview , here part of getview method loads images using picasso. following code expected load images image view inside every list item. picasso.with(mcontext).load(imageurl).fit().into(holder.myimageview, new callback(){ @override public void onerror() { holder.myimageview.setvisibility(view.invisible);} @override public void onsuccess() {}}); so here problem: works fine os < android 5.0, in case of android 5.0 (lollipop), looks picasso fetching these images when app installed , run first time, when launch app again, images don't load. not @ sure problem is. not loading huge images, can assume images loading of size of small icon/thumbnail (around 120x120). using picasso 2.4.0 application , phone using testing nexus 4. open issue of edit: https://github.com/square/picasso/issues/633 alternative: struggled find answe

Google forms scripts to send email -

i have created script go along camp signup form. when student signs up, need email sent both parent , leader. have general script format correct each 1 works when (the script bound spreadsheet, not form). if have both functions in code.gs file or in separate file, neither of them work. how supposed run more 1 function attached form submission? here code 2 emails sent: here code 2 emails sent (if add both these, doesn't work): function emailresponsetoparent(e) { var studentname = e.values[1]; var parentemail = e.values[3]; var tripname = e.values[6] var subject = "your young life " + tripname + " registration has been submitted." var message = "we have received " + studentname + "'s signup registration " + tripname + ". more words here...."; mailapp.sendemail(parentemail, subject, message); } function emailresponsetoleader(e) { var studentname = e.values[1]; var leaderemail = "meg@me.com"; var tripname

vb.net - Get value from DataSet column starting with DataGridView's row and column indexes -

i have row , column indexes of value in datagridview , need find corresponding column value in dgv's dataset, matching on id field of table. so dgv cell value being accessed with: dgvemployees.rows(e.rowindex).cells(e.columnindex).value().tostring() the id column dataset employeeid, found in dgv dgvemployees.rows(e.rowindex).cells(1).value().tostring() i know can specific dataset's row directcast(row, employeesdataset.employeesrow).employeesid and i've been iterating through dataset's row's original , current values employeesdataset.employees(r)(c, datarowversion.original).tostring() and employeesdataset.employees(r)(c, datarowversion.current).tostring() respectively. so, given of information, how can compare matching column in dataset known column in datagridview? know answer lies somewhere in code i've offered here, i'm not sure how put need!

imagemagick - convert: non-conforming drawing primitive definition `text' -

imagemagick provides following command example of how draw text on image: convert -size 250x50 xc:none -box white -pointsize 20 -gravity center \ -draw 'text 0,0 " '\'' \" $ \\ " ' \ -trim +repage text_special_sd.gif when run code, error: convert: non-conforming drawing primitive definition `text' @ error/draw.c/drawimage/3192. the command want run following, gives same error: convert /tmp/tmpgrazky -fill none -stroke chartreuse -strokewidth 2 \ -draw "rectangle 221,155,256,191" -pointsize 17 -fill chartreuse \ -draw "text 20%,20% 'score:0.84'" /users/rose/home/video-object-detection/data/imagenet/n07840804/annotated/lbzhyvh74w8_10000/10000_99.jpg the suggestions in so post did not fix problem. i'm on mac. answers find on web recommend trying different combination of single , double quotes around statement after -draw, think i've tried 'em all. here's output of c

java - Getting error code, but don't know why -

i need write code fraction calculator can add, subtract, multiply, , divide 2 fractions. have code , getting error message exception in thread "main" java.lang.stringindexoutofboundsexception: string index out of range: -1 @ java.lang.string.substring(unknown source) @ calculator.run(calculator.java:24) @ calculator.main(calculator.java:13) i know error message gives me spot need fix cannot figure out have done wrong. still pretty new java easy fix. thank in advance. import java.util.*; public class calculator { public static void main(string[] args) { system.out.println("please enter 2 fractions add, subtract, multiply, or divide\nor\ntype 'quit' exit program."); boolean on = true; scanner console = new scanner(system.in); while (on) { string input = console.nextline(); if (input.equalsignorecase("quit")) { on = false; } else

google compute engine - how to create a mirror of an instance? -

using google compute engine, how can create mirror of instance? instance created, need create identical mirror backup. ideally, if goes wrong in original instance, backup should automatically take over. take @ snapshots . can take snapshot of instance , use c reate new disk spin instance.

php - Replace a letter with another in an entire Wordpress page -

i'm making wordpress website danish shipping agency in based germany, , want homepage automatically transform letter "ø/Ø" letter "ö/Ö". i have made php function/program replace ø/Ø ö/Ö, $string. but how can make check letters in wordpress page? <?php $string = "Öýra bibendum trisö tique agergöet dellentesque Öibendum Öristique gmet reölentesqueö."; $newsmall = "ö"; $oldsmall = "ø"; $onlyconsonants = str_replace($oldsmall, $newsmall, $string); $newlarge = "Ö"; $oldlarge = "Ø"; $onlyconsonants = str_replace($oldlarge, $newlarge, $onlyconsonants); echo $onlyconsonants; ?> there 2 ways this: 1. use plugin (probably best way): take @ this one can work you. it's described as: lets find , replace text in pages, posts, custom post types , trashed items gui. optional: postmeta , low_priority updates 2. replace content on database this query should trick: update wp_post

javascript - In an Ionic app, Google Maps only loads when page is refreshed, but not when coming from another page, -

i trying show google maps street view in ionic app having troublegetting work. when go page page, doesn't load. refresh current page, street view works. idea on how fix this? controllers.js .controller('streetviewctrl', function($scope, $ionicloading, $state, $stateparams){ console.log('street view page loaded'); parse.initialize("xyz", "xyz"); //load goog map $scope.initialise = function() { console.log('initialize function'); var mylatlng = new google.maps.latlng(40.758774, -73.98504); var mapoptions = { center: mylatlng, zoom: 1, maptypeid: google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("street"), mapoptions); var panoramaoptions = { position: mylatlng, addresscontrol: false, pov: { heading: 34, pitch: 10

msbuild - How to pass ItemGroup with metadata between targets? -

from understanding, using dependsontargets necessary pass itemgroup between targets. not sure if there other ways pass targets without dependsontargets . i have tested itemgroup cannot pass calltarget or msbuild task. workaround solution convert itemgroup property (flatten it) , use properties pass over. i define itemgroup of file . file has value metadata. execute target , remove 1 file item each recursive loop. here script: <target name="mygroup"> <itemgroup> <file include="5"> <value>5a</value> </file> <file include="4"> <value>4a</value> </file> <file include="3"> <value>3a</value> </file> <file include="2"> <value>2a</value> </file> <file include="1"> <value>1a</value> </file> </itemgroup> &

java - Oracle BPM Human Task Comments Callback Errors When Instantiating AppModule in Called Class -

oracle bpm version 11.1.1.7. in humantask.task, events tab, content change callbacks section, have entered qualified class name of class implements notesstore , addnote , getnotes methods. the class uses public methods in appmodule write , read comments using our custom table , these methods tested during development using the bc tester , temporary main in callback class. the project compiled jar , placed in bpm project's sca-inf/lib folder, sca , related adf human task forms deployed. when comment made in out of box human task comments section during process instance, class called, exception occurs in getnotes method @ line appmodule created: java.lang.classcastexception: oracle.jbo.common.ampool.poolmgr in class, appmodule created so: auditmodule service = (auditmodule)configuration.createrootapplicationmodule("com.co.modules.auditmodule", "auditmodulelocal"); i've tried adding web.xml config file sca bpm project filter discussed in p

java.util.scanner - Need to subtract one from user input. How? Java -

basically need know how subtract 1 user input. trying x , y coordinate user place 2d array can 20x20, if user puts in 20, need program read 19 not out of bounds. x = keyboard.nextint() is have now. // solution 1 x = math.min(19, math.max(0, keyboard.nextint() - 1)); // solution 2 x = keybord.nextint() - 1; if(x < 0) { // error?! x = 0; } else if(x > 19) { // error?! x = 19 }

unity3d - Scrolling Scene Background - Unity -

my title might have been bit misworded, honest i'm not sure how word it, i'm making game on unity , have main scene , making main menu want have a, guess, camera panning around main scene background of main menu. not sure if worded right or wording type google research i'm hoping guys might able point me in right direction. cheers guys, jason as stromdotcom mentioned can attach script camera. it's hard tell you're trying if want circle camera around point... try making empty game object in middle of scene , point camera @ it. make object parent of camera (using object , cameras transform properties). from here should able set game object rotate using script, should make camera spin child of object. i have not tried in unity have used technique in other programs i'm assuming work. sorry if doesn't.

Template type member variables in c++ -

i'm trying change type of membervariable, based on whats written within template. for example a<64, 64> should make member int_128 sadly, have no idea how work template types, , every tutorial find helps template functions. my class looks like template<int x, int y> class a{ private: typetobegeneric m_variable } is there way in constructor like if( x+y <= 64){ typetobegeneric = int_64 } else{typetobegeneric = int_128} i don't want add specific type within template<>. structure a<64, 64> should untouched. constexpr bool lessthan64(int a,int b) { return (a+b) < 64; } template<int x, int y> class a{ using type = typename std::conditional<lessthan64(x,y),int_64,int_128>::type; private: type m_variable; } using constexpr functions compile time metaprogramming can evaluate values @ compile time , use std::conditional chose between 2 types. edit: more 2 types can use variadic template

angular dart >> Best way to create a table:column renderer -

i'm hopping awesome community can steer me on right direction. came flash/flex/js world, , how simple define item renderer in flex. here i'm trying accomplish: i have angular component consist of form , html table. have columns, headers, rows, etc. populating correctly using ng-repeat. want able define column "renderers", if passes me column property "renderas: 'button'" or "renderas: 'progress'" should able render entire column button, or progress bar, etc. here i've tried far: ng-bind-html="getcolrenderer(column.renderas, column.value)" returns html based on 'renderas'. know, work basic html stuff, cannot append 'ng-click', or 'href' due angular's security. so, opted else. i semi-have solution embedding "ng-switch" inside ng-repeat. had ng-if several types of potential "renderers" opted switch. somehow seems future problems while trying display many columns

visual studio 2013 - Source File Tabs on Startup -

Image
every time start visual studio 2013 solution automatically opens source files tabs. these tabs had opened @ 1 point no longer relevant working on. can't figure out how rid of these tabs (or change ones open default) on start up. right right clicking , selecting "close documents" works fine rather not every time come coding. know how change this? note: using git extensions , productivity power tools 2013 if makes difference. is when open every solution or when launch ide? if latter, can check startup options , make sure at startup option not set load last loaded solution ?

Tying to use php variable in sql select statement -

i'm new php , i'm combining 2 pieces of code has been written others. page displays records mysql database , variable i'm trying use being displayed using following code: <span class="headleft"><?php echo cleandata($this->recipe->name); ?>:</span> the sql select statement trying use name field it's lookup. select name , round(sum(i.calories)/1500*100,2) calories , round(sum(protein)/525*100,2) protein , round(sum(fat)/300*100,2) fat , round(sum(carbohydrate)/675*100,2) carbohydrate , round(sum(fiber)/30*100,2) fiber , round(sum(sugar)/375*100,2) sugar , round(sum(saturated_fat)/150*100,2) saturated_fat , round(sum(monounsaturated_fat)/150*2,2) monsaturated_fat , round(sum(polyunsaturated_fat)/150*2,2) polyunsaturated_fat , round(sum(cholesterol)/200*100,2) cholesterol , round(sum(sodium)/1300*100,2) sodium `mr_recipes` r left join ingredients on r.id = i.recipeid name = ($this->recipe->n

php - Unable to upload images on laravel app to hostgator hosting -

i've been searching around net try fix problem. changed code in controllersfolder multiple times , still no solution. changed permissions of img folder , products folder 777 , still no success. this structure of folders on ftp cyberduck: -->app_base/ ( has base laravel folder except /public/ folder) -->[some other folders...] -->public_html/ -->daveswebapp.us/ (name of website. has content of base public/folder) -->img -->products [empty folder] this error receive each time try upload new product images in admin panel: intervention \ image \ exception \ notwritableexception can't write image data path (/home2/ecuanaso/app_base/bootstrap/img/products/1417822656.jpg) products controller code: <?php class productscontroller extends basecontroller { public function __construct() { parent::__construct(); $this->beforefilter('csrf', array('on'=>'post')); $this-&

javascript - Get destination from URL shortener via AJAX call -

$( document ).ready(function() { $.ajax({ type: 'head', url:'http://bit.ly/1vtp41q', complete: function(request, textstatus){ alert(request.getresponseheader('location')); } }); }); i'm making ajax call header info bit.ly link. can see final destination under location header (checking via console in firebug on firefox 33), getresponseheader function returning null. is possible url , possibly page's title tweaking code?

opengl es - mat3 attribute in WebGL -

i'm attempting use angle_instanced_arrays extension in webgl render multiple instances of object different mat3 transformation matrices. code related buffer matrices: //setup this.shaderprogram.transformattribute = gl.getattriblocation(this.shaderprogram, "transform"); ext.vertexattribdivisorangle(this.shaderprogram.transformattribute, 1); this.transformbuffer = gl.createbuffer(); //each render gl.enablevertexattribarray(this.shaderprogram.transformattribute); gl.bindbuffer(gl.array_buffer, this.transformbuffer); gl.bufferdata(gl.array_buffer, new float32array([/*9 floats per instance*/]), gl.stream_draw); gl.vertexattribpointer(this.shaderprogram.transformattribute, 9, gl.float, false, 0, 0); and in vertex shader, have 'attribute mat3 transform;' instead of 'uniform mat3 transform'. when execute code above, error on vertexattribpointer: "vertexattribpointer: bad size or stride". this error persists if set stride 36 (9 * 4-byte float

osx - How to install the CPLEX Python API so that it is accessible in PyCharm 4.0 -

i struggling install package in python can used in pycharm 4.0 (running mac os x 10.10) the package has installed using setup.py file ( instructions here ). can specify directory need install package. i'm able run package if run python command line, , add installation directory pythonpath each time open terminal. said, not know how access package within pycharm. is there default directory python packages should go pycharm can see package (if so, on mac os x 10.10?). otherwise, should modify pythonpath variable?

Batch - Countup Timer -

i'm trying make countup timer in batch , far, have this :timer set time=0 :time set /a time=%time%+1 ping localhost -n 2 >nul goto time the problem is, want run @ same time event happening in same batch file. how can this? are wanting time how long takes execute batch script? if have powershell installed can use measure-command cmdlet. save timeit.bat : @echo off >~timeit-%~n1.bat echo(%* powershell "measure-command {start-process ~timeit-%~n1.bat -wait}" del ~timeit-%~n1.bat then when want time execution of something, say, systeminfo , timeit systeminfo . if prefer non-powershell solution (as powershell takes several annoying seconds prime in first run per windows session), here's faster batch / jscript hybrid solution ( more info ). executes command in same window, whereas powershell solution spawns new window command. save timer.bat : @if (@a==@b) @end /* begin multiline jscript comment :: timer.bat command args :: measure

JNWSpringAnimation Framework for iOS (Compile Errors) -

Image
i followed instructions came framework @ github repository. got error when tried compile stemming nsvalue+jnwadditions files. example project comes code meant run in mac os x , not ios. missing here when trying use framework ios app? giggles removed aforementioned files , able compile got runtime error, guess not surprising. i'm new stuff , want play animation , springs :( github repository: https://github.com/jwilling/jnwspringanimation help! ah. got it. fellow newbs out there: had import uikit header file of nsvalue+jnwadditions.h. got rid of "expected type" errors! makes sense me , have no idea why took me long figure out. womp womp

generics - Java 8 type inference involving Booleans -

consider following code: class predicate { public boolean eval(evaluationcontext ec) { /* logic here */ } } // later ... list<predicate> preds = new list<>( /* predicates here */ ); // let's use stream<> implement , logical connective: // version a: boolean resulta = preds.stream() .map(p -> p.eval(context)) .reduce(boolean.true, (a,b) -> boolean.logicaland(a,b)); // oops: code above doesn't compile ... // error: incompatible types: java.lang.object cannot converted boolean // version b: (add intermediate variable explicit type) stream<boolean> v = _children.stream().map(p -> p.eval(context)); boolean resultb = v.reduce(boolean.true, (a,b) -> boolean.logicaland(a, b) ); // compiles fine... so, question is: what wrong structure of version prevents java compiler correctly inferring type of result of map()? limitation of type-inference algorithm in java? if so, there better way

vba - Pass Range in Function, Sum Adjacent Cells, and Return Sum -

Image
i have following excel table: i want pass first column string, determine address of cells called 'lna' , 'lcamp', , sum adjacent cells 'between' 2 addresses. failed code: function lnatolcamp(componentlist) single dim integer dim lboundaddress variant, uboundaddress variant = lbound(componentlist) ubound(componentlist) if componentlist(i, 1).value = "lna" lboundaddress = componentlist(i, 1).address.offset(0, 1) end if if componentlist(i, 1).value = "lcamp" uboundaddress = componentlist(i, 1).address.offset(0, 1) end if next lnatolcamp = application.worksheetfunction.sum(lboundaddress, ":", uboundaddress) end function maybe there's better way? try this: function lnatolcamp() single dim lna range, lcamp range sheets("sheet1") set lna = .range("b:b").find("lna").offset(0, 1) set lcamp = .range("b:b").find("lca

java - Incorrectly Reading Serial Using RXTX in Ubuntu -

i reading accelerometer signals connected arduino board through serial interface. using rxtx library , following code. private void initializeserial() { commportidentifier portid = null; enumeration portenum = commportidentifier.getportidentifiers(); while (portenum.hasmoreelements()) { commportidentifier currentportidentifier = (commportidentifier) portenum.nextelement(); (string portname : port_names) { if (currentportidentifier.getname().equals(portname)) { portid = currentportidentifier; break; } } } if (portid == null) { system.out.println("port not found"); return; } try { serialport = (serialport) portid.open(this.getclass().getname(), 2000); serialport .setserialportparams(115200, serialport.databits_8, serialport.stopbits_1, serialport.parity_none); input = new bufferedreader(new inputstreamread

ruby - How to force all homebrew formulas to install keg-only? -

is there way force homebrew install of formulas keg-only, i.e. without system-wide side effects? similar accomplished running brew unlink <name> after every formula? the reason i'm asking i'd have secondary installation of homebrew acts sort of installer dependencies of hard-to-build scientific program, compiling , installing dependencies degree of isolation rest of system. you can create separate homebrew installation somewhere other /usr/local . don't need install keg-only that.

c++ - Finding the number of palindromic sequences from a given set of numbers -

suppose given set of numbers 20 40 20 60 80 60 can broken 2 palindromic sequences: 20 40 20 , , 60 80 60 . can broken 6 palindromic sequences each containing single number. how find smallest number of palindromic sequences possible given set of numbers in c++? ps- not homework. genuine question. a straightforward approach begins looking @ each of o(n 3 ) subsequences , checking see if it's palindrome. once know subsequences palindromic, can dynamic programming in o(n 2 ) time find minimal number of consecutive subsequences cover whole sequence. for input 20 40 20 60 80 60 , c++ implementation below prints [20 40 20] [60 80 60] . #include <cstdio> #include <vector> using namespace std; int main() { // read data standard input. vector<int> data; int x; while (scanf("%d", &x) != eof) { data.push_back(x); } int n = data.size(); // @ every subsequence , determine if it's palindrome. vector<vector<bool&g

Haskell, Simple Continuation -

i having hard time convert simple cps function this cps style square function -- : http://en.wikibooks.org/wiki/haskell/continuation_passing_style square :: int -> int square x = x * x square_cps :: int -> ((int -> r) -> r) square_cps = \cont -> cont (square x) -- square_cps 3 print write '9' out in console now, change function arguments in reverse order square_cps' :: ((int -> r) -> r) -> int square_cps' = ? is impossible? first minor correction definition of square_cps : square_cps :: int -> ((int -> r) -> r) square_cps x = \cont -> cont (square x) ^^^ alternatively can write: square_cps x cont = cont (square x) note works though type signature makes square_cps function of 1 argument. now, type signature square_cps' can't work. way written means int out of (int -> r) -> r function returns r . to flip arguments square_cps , first write equivalent type signature: squar

Create a marquee on a circular path in html and css? -

i need marquee on circular path fieldset. want image "g" move in circular path. <html> <style type="text/css"> #circle { width:600px ; height:600px ; border-radius:50%; text-align:centre; margin-left:25%; margin-right:25%; } #circle > legend { margin:0px auto; } #appimg1 { width:100px ; height:100px ; border-radius:50%; } </style> <fieldset id="circle"> <marquee behaviour="scroll" id="circle1"> <legend id="circle2"><img src="games.png" id="appimg1"></legend> </marquee> </fieldset> i think marquee tag ancient , never official, although browsers may still support it. don't think can want. maybe can have @ css transitions: /* show , size container, can see what's going on. */ .container { position: absolute; top: 200px; left: 200px; border: 1px dashed #999; display: inline-b