Posts

Showing posts from February, 2012

tortoisesvn - Tortoise SVN: unable to revert -

simply put: right-click menus seem missing option revert previous revisions. i'm using version 1.7.5. according file, when rmb on revision, should see: compare working copy show changes unified diff compare previous revision compare , blame previous revision list item view revision in webviewer view revision path in webviewer browse repository create branch/tag revision update item revision... revert revision revert changes revision merge revision to... checkout... export... edit author edit log message shoe revision properties copy clipboard search log messages... instead, this: show changes unified diff compare previous revision save revision to... open open with... blame... browse repository create branch/tag revision edit author edit log message shoe revision properties copy clipboard search log messages... my repository in directory on own machine; i'm not connecting server. any ideas? the first menu shown when start log dialog working copy, i.e.

sql - Want to process a large appengine log file -

i run app on google app engine.....my log files huge due heavy traffic log file looks this 122.167.221.243 - - [06/mar/2012:01:11:29 -0800] "get /bengali/enable http/1.1" 404 0 "http://www.epicsearch.in/" - ---similar rows ---- below i want process them meaningful stats such no. of unique ip addresses or no. of hits on given page.... beginner not know how go it!!!!! assuming haven't done so, first thing you'll want download app engine logs using appcfg.py utility, example: appcfg.py --num_days=5 request_logs appname/ logs.txt after download it, have throw script or program parse logs whatever information you deem useful. this stack overflow question might place start -- decent scripting language should able adequately parse logs you.

objective c - RestKit RKObjectLoader objectLoader didLoadObjects failed on device -

i using restkit , stuck problem. i've tried quite lot of things solve this, return no success. :) - (void)objectloader:(rkobjectloader*)objectloader didloadobjects:(nsarray*)objects { nslog(@"objects count: %d.", [objects count]); nslog(@"editions count: %d.", [editions count]); [editions release]; editions = [objects retain]; nslog(@"objects count: %d.", [objects count]); nslog(@"editions count: %d.", [editions count]); edition *edition = [objects objectatindex:0]; nslog(@"edition title: %@.", [edition title]); } the console above code is: 2012-03-07 18:02:58.477 appname[2870:207] objects count: 1. 2012-03-07 18:02:58.478 appname[2870:207] editions count: 0. 2012-03-07 18:02:58.479 appname[2870:207] objects count: 1. 2012-03-07 18:02:58.479 appname[2870:207] editions count: 1. 2012-03-07 18:02:58.480 appname[2870:207] *** -[nscfarray title]: unrecognized selector sent instance 0x1ada60 2012

ruby - Japanese characters not supported by rmagick -

i'm tring build voucher template rmagick, (using utf8 encoding) below small code snippet text.annotate(template, 0, 0, 23, 155, offer_label) { self.pointsize = 16 self.font_weight = boldweight } when provide offer_label 安価な価格でホテルを予約 (japanese) in voucher created, offer_label dispayed ????????????. offer_label stored correctly in database template code snippet: <html lang="en"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title><%= @from_name %></title> <style type="text/css"> a:hover { color: #09f !important; text-decoration: underline !important; } </style> </head> i looked around suggested questions no luck.looking forward suggestions. update: label_name displayed correctly in browser web pages, issue comes in voucher created using rmagick 1) should install japanese font(s) runtime environment(s). you can check via magi

java - Convert embedded pictures in database -

i have 'small' problem. in database documents contain richtextfield. richtextfield contains profile picture of contact. problem content not saved mime , therefore can not calculate url of image. i'm using pojo retrieve data person profile , use in xpage control display contents. need build convert agent takes content of richtextitem , converts mime able calculate url like http://host/database.nsf/($users)/d40fe4181f2b86ccc12579ab0047bd22/photo/m2?openelement could me converting contents of richtextitem mime? when check embedded objects in rt field there none. when content of field stream , save new richtext field using following code. new field not created somehow. system.out.println("check if document contains field name "+fieldname); if(!doc.hasitem(fieldname)){ throw new pictureconvertexception("could not locate richtextitem name"+fieldname); } richtextitem picturefield = (richtextitem) doc.getfirstite

asp.net mvc - MVC not pulling through validation -

i have following view code: @using (html.beginform("login", "press", formmethod.post)) { <fieldset> <legend>user registration</legend> <div> @html.textboxfor(model => model.fullname) @html.validationmessagefor(model => model.fullname) </div> <div> @html.textboxfor(model => model.company) @html.validationmessagefor(model => model.company) </div> <div> @html.textboxfor(model => model.emailaddress) @html.validationmessagefor(model => model.emailaddress) </div> <div> @html.checkboxfor(model => model.joinmailinglist) please check box recieve seasonal book pdf , monthly newsletter </div> <p> <input type="submit" value="proceed" /> </p> </fieldset> } and here model : public class userviewmodel { [required(errormessag

ruby - Rails 3. the "flash" doesn't work on some pages -

i'm using "web_app_theme" gem. problem flash error , warning messages don't work. for example, in sign in page work; in forgot password page doesn't work. tested displaying contents of flash <%= debug flash %> . this in sign in page... !ruby/object:actiondispatch::flash::flashhash used: !ruby/object:set hash: :alert: true closed: false flashes: :alert: invalid email or password. now: !ruby/object:actiondispatch::flash::flashnow but in forgot password page get... !ruby/object:actiondispatch::flash::flashhash used: !ruby/object:set hash: {} closed: false flashes: {} now: !ruby/object:actiondispatch::flash::flashnow i'm thinking might related not using haml. in sign in page i'm using haml in forgot password page i'm using erb. i'm confused because contents of 'flash' should same regardless of format, right? this ha

r - least cost path with multiple points -

Image
i trying connect bivariate location points form route. points refer fish locations, , need paths pass through water, , not surrounding land. basically, need multiple least cost path analyses , join them altogether. in r, have more experience there arcgis, python, modelbuilder, etc. i have used arcgis create cost surface, water coded 0 , land coded "nodata", , have imported r. i have tried using shortestpath gdistance pkg, r shuts down on me when try running between 2 points. example: costpath=shortestpath(costtrans,c29924[1,],c29924[2,],output="spatiallines") where cost surface "costtrans", , "c29924" spatialpointsdataframe lat/long locations. had planned run loop each row in data frame. however, not know why r not handling 1 iteration well. when converting cost surface transition object first arguements, receive following warning messages: warning messages: 1: in array(ans, c(len.a%/%d2, d.ans), if (!all(vapply(dn.ans, is.null, :

linux - Where can one find a dead server's MySQL version? -

i'd know if there's way find out version of mysql installed on server no longer running. it's possible browse through filesystem. $ strings /usr/bin/mysql |egrep "^[1-9]\." 5.1.49

c# - fastest way to compare 2 objects excluding a few properties? -

i have site users upload data , want update data properties have been changed. comparing 2 objects of same type changes , need exclude few properties such modifiedon date. here code far using reflection: private bool haschanges(object oldobject, object newobject) { var oldprops = (from p in oldobject.gettype().getproperties() select p).tolist(); var newprops = (from p in newobject.gettype().getproperties() select p).tolist(); bool ischanged = false; foreach (propertyinfo in oldprops) { if (checkcolumnnames(i.name)) { var newinfo = (from x in newprops x.name == i.name select x).single(); var oldval = i.getvalue(oldobject, null); var newval = newinfo.getvalue(newobject, null); if (newval == null || oldval == null) { if (newval == null && oldval !=

java - Post a UTF-8 string to a servlet using jquery -

i'm trying post utf-8 string servlet (hosted in tomcat) string read on server side not utf-8. i've verified via firebug ajax header's content-type has utf-8 encoding set. i'm posting "mÉxico" server i'm receiving "mÉxico". $.ajaxsetup({ scriptcharset: "utf-8" , contenttype: "application/x-www-form-urlencoded; charset=utf-8" }); $.ajax({ url: "setdata", type: 'post', data: 'mÉxico', success: function(){ console.log('data set'); } }); here's java code in servlet request.setcharacterencoding("utf-8"); bufferedreader reader = new bufferedreader( new inputstreamreader( request, "utf-8" ) ); char[] chr = new char[5]; reader.read( chr ); builder.append( chr ); update 1 i changed posting data in js encodeuricomponent('mÉxico') server still reads "mÉxico". but, if string value of encodeuricomponent('mÉx

html - css - inline elements ignoring line-height -

i'm having trouble figuring out why inline elements ignore line-height in browsers (chrome , firefox ignore it, ie9 not). here example: <small style="line-height: 1; font-size: 26px;">hello, world</small> the expected result element height 26px, however, it's being set 31px. if set element's display block, height correctly set 26px. everything read says it's supposed set line height, can't figure 1 out. here read on w3c: the height of each inline-level box in line box calculated. replaced elements, inline-block elements, , inline-table elements, height of margin box; for inline boxes, 'line-height' . source: http://www.w3.org/tr/css2/visudet.html#line-height what webkit inspector shows (and measured in photoshop) content area 's dimensions. see http://www.w3.org/tr/css2/visudet.html#inline-non-replaced the height of content area [of inline elements] should based on font, specification not specify

Django CSRF protection in Facebook Tab or Canvas App -

django's csrf protection sets cookie token on response , compares token posted form. appears in facebook tab app csrf cookie never being set in safari. know has safari's third party cookie policy. so how others writing facebook tab apps or canvas apps able set cookies on app if user has never visited domain (which safari allow setting of cookie)?

How to loop through an array of objects that have been decoded from JSON in PHP, and echo the values -

i'm new php , not sure how proceed. array decoding json is: (sorry if formatted weird) array(3) { [0]=> array(4) { ["name"]=> string(22) "brent's medical center" ["date"]=> string(26) "/date(1330449077600-0700)/" ["dealtype"]=> string(13) "capital lease" ["id"]=> string(11) "mo-n007175a" } [1]=> array(4) { ["name"]=> string(22) "brent's medical center" ["date"]=> string(26) "/date(1330448929213-0700)/" ["dealtype"]=> string(2) "na" ..... ["id"]=> string(11) "mo-n007172q" } [2]=> array(4) { ["name"]=> string(15) "moc" ["date"]=> string(28) "/date(-62135571600000-0700)/" ["dealtype"]=> string(2) "na" ["id"]=> string(9) "mc" } } i have used foreach loop, not

rebase - Git Workflows: Rebasing Published/Shared Branches -

our team @ work has enthusiastically adopted rebase workflow, might have gotten little carried away, point of question: judge. using pull --rebase no-brainer me now. however, have large feature branches multiple people work on. periodically, want bring in changes happening on master. conventional wisdom have merge since it's shared branch. however, in our rebase-obsession, we've decided rebase branches. of course requires everyone's cooperation. workflow goes this: 1) rebaser coordinates make sure they're checked-in , pushed on feature branch, asks them no more work on branch until clear. 2) rebaser rebases feature branch onto master, deletes remote feature branch (git push origin :feature), , pushes new, rebased feature branch (git push origin feature) 3) rebaser has fetch, updates feature branch, delete local feature branch (git branch -d feature), create new local feature branch tracks remote feature branch. gets all-clear. this workflow working,

java - How to extract portions of joda Date time effectively? -

i have joda date time object contains date , time fields , wish extract date , time portions 2 different sql date , time objects (java.sql.). thought converting datetime milliseconds , storing in respective sql objects trick produces calculation errors further upstream in app logic 1 === other. best way i've found far i've described in comment on question , convert sql time using: new java.sql.date(locdate.todatetime(localtime.midnight).getmillis())); new java.sql.time(loctime.todatetimetoday().getmillis()) ); couldn't find in datetime object api extract respective parts.

How to check dependencies of libraries against classes in java -

i have java project developed developer, in application there lot of unnecessary libraries. able delete of libraries. but, there lot of them want know whether there technique scan project , detect unrelated libraries project. i recommend tattletale jboss.

Android market not showing my published apps? What to change in my app manifest to help filtering? -

i published android app market , seemed fine. i tried download on particular phone (samsung epic 4g (sph-d700)) , not available. looks being filtered, along other samsung galaxy s phones. should change in manifest doesn't become filtered? im trying search on computer , doesnt show when that. mean didnt upload market? <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="send.text.fast" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="5" /> <uses-permission android:name="android.permission.send_sms"> </uses-permission> <uses-permission android:name="android.permission.read_contacts"> </uses-permission> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <supports-screens an

Rounding in Sql Server 2008 -

i want round decimal values in sql server if value 1.1 result should 2(next value) . how in sql server , inbuilt method there or want manually? edit: if value der in decimal place result should next integer value please help don't mean post simplistic answer, have looked @ ceiling / floor ? select ceiling(1.1); ---- 2 from msdn , ceiling "returns smallest integer greater than, or equal to, specified numeric expression."

database - Java:Change String content -

in application user give name of database file he/she want create database file , application create database @ location user provided name. of filechooser user give name of database , when he/she click on save button 1 database file created @ place. code: public class stringspilt1 { public static void main(string[] argv) throws classnotfoundexception, instantiationexception, illegalaccessexception, unsupportedlookandfeelexception { uimanager.setlookandfeel(uimanager.getsystemlookandfeelclassname()); jfilechooser filechooser = new jfilechooser(); filechooser.showsavedialog(null); system.out.println(filechooser.getselectedfile()); createdatabase((filechooser.getselectedfile()).tostring()); } private static void createdatabase(string string) { string databasename = string; // string databasename = "d:\\msaccessproject/griss.mdb"; database database = createdatabase(databasename); // rest of code } } now problem (filechoo

jquery - Multiple divs with same class name need individual operation -

i trying create effect involve panel expanding when appropriate link hovered. hover on link im using jquery change absolute position make slide have duplicates of same panel. how can code when each link highlighted activates slide own panel , not duplicates share same div classes. basicially need localise code run per each panel, each link activates slides $(function(){ $(".expandlink").hover(function(){ $(".hiddencontent").stop(true, false).animate({ top: "110px" }, 150); }, function() { $(".hiddencontent").stop(true, false).animate({ top: "185px" }, 150); }); }); you have select find this: $(function(){ var allcontent = $('.hiddentcontent'); var stopanimation = function() { allcontent.stop(true, false); }; $(".expandlink").hover(function(){ stopanimation(); $(this).find(".hiddencontent").anima

jQuery Tools: tooltips bug with position relative and overflow: auto on the parent container; jsfiddle example; how to fix it? -

i prepared jsfiddle example: http://jsfiddle.net/peh7t/11/ the problem have container position relative (which cannot changed). found tooltip setting relative: true , supposed solve problem (it uses jquery position instead of offset set tooltip position). work fine, if did not have overflow: auto (this cannot changed either). when scroll container , click on icon tooltip gets position relative container, not take scroll account. results in misplaced tooltips. does know how fix this? bonus question: when click on tooltip first time configured animation. when close tooltip , click icon again, tooltip pops without animation. how change behavior, gets nice animation when being shown? i don't know enough plugin / toolkit thing comment on how fix - instead i'd recommend code own. you code easily, using styled divs display:none next each of tooltip buttons. when button clicked, toggle tooltip div. way total control , don't have work around or shoehorn existi

objective c - #if for device detection in iPhone SDK -

i'm curious why code won't work: #if ui_user_interface_idiom//() == uiuserinterfaceidiompad @implementation uinavigationbar (custom height) - (cgsize)sizethatfits:(cgsize)size { cgsize newsize = cgsizemake(self.frame.size.width,44+breadcrumbbarheight-1); return newsize; } @end #endif any ideas? ui_user_interface_idiom() macro designed (and defined) runtime evaluation! using compile-time evaluation fail. it defined as: #define ui_user_interface_idiom() ([[uidevice currentdevice] respondstoselector:@selector(userinterfaceidiom)] ? [[uidevice currentdevice] userinterfaceidiom] : uiuserinterfaceidiomphone) the call [uidevice.. fail @ compile-time evaluation

How to add EditText on spinner popup in android? -

i need add edittext on top of spinner popup searching purpose. possible? how this? give me idea this. i have done custom class extends spinner class , override performclick() method. in performclick() method, i'm showing dialog. dialog have edittext , listview . added searching technique edittext.

c# - Wrapper a class(Native c++) using managed C++, how to do about the native struct? -

namespace mcwrapper { struct s1 { int n1; int n2; }; class c1 { public: void test(s1* ps1) { }; }; public ref class class1wrapper { public: class1wrapper() { _pc1 = new c1(); }; void test(s1* ps1) { _pc1->test(ps1); } private: c1* _pc1; };} build it, can .net dll . create c# client use dll: //c# public form1() { initializecomponent(); var c1 = new mcwrapper.class1wrapper(); //we can find test method , cannot type codes like: s1* c1.test()//????????????????????????????????? } i cannot run class1wrapper.test in c#. then have tried change test() test( int^ n), found c# explain test(int^n) test(valuetype n) have been confused, everybody. so, should set new managed struct like: public value struct css1{int n1;int n2} and change test(...) from class1wrapper::test(s1* ps1){_pc1->test(ps1);} to class1wrapper::test(css1*

java - Get history of a Deleted File from SVN using SVNKit -

i trying access revision history of file has been deleted using svnkit. following doing achieve that. svnclientmanager manager = svnclientmanager.newinstance(); svnlogclient logclient = manager.getlogclient(); logclient.dolog(svnurl, new string[] { filename }, svnrevision.create(deletedrevision), svnrevision.undefined, svnrevision.undefined, false, false, true, -1, null, new isvnlogentryhandler() { public void handlelogentry(svnlogentry logentry) throws svnexception { log.debug(" ==== " + logentry.getchangedpaths() + " === " + logentry.getrevision()); } }); here, deletedrevision => svn revision in file deleted. when code ex

GWT exception "Cannot Serialize" when using Hibernate -

i'm getting "com.google.gwt.user.client.rpc.serializationexception:", when employing gwt+hibernate. tried google, of error in context of list (i found similiar thread here gwt cannot serialize object hibernate ). i'm getting when i'm trying pass object of type userpreference through rpc. below classes reference. public class userpreference implements serializable { private static final long serialversionuid = 1l; private userinfo userinfo; // other attributes public userpreference() { super(); } // getters/setters } // userinfo class public class userinfo implements serializable{ private int id; private string name; private string cuid; private userrole role; private dbschema favdb; public userinfo() { super(); } } //dbschema class public class dbschema implements serializable{ private static final long serialversionuid = 1l; private int id; private string name; private int port; private string host; private string sidname; pr

HTML5 <video> can play .mkv files? -

so accidentally opened mkv video file chrome, , surprise played using native player: <video src="video.mkv"></video> it playing perfectly. html5 video supports matroska container? html5 doesn't support any video formats, or rather html5 doesn't specify formats browsers should support. it's browsers decide formats choose support. apparently chrome plays .mkv, wouldn't surprised if other browsers didn't play same file.

Extending a jquery plugin or building mixins on top of a base plugin? -

i have basic plugin written according jquery authoring guide . plugin implements basic features ul of elements ( activate , deactivate , search ). jquery.myplugin.core.js (function($) { var methods = { init : function(opts){ var options = $.extend({}, $.fn.list.defaults, opts); return this.each(function(i) { ... methods.search("my search query")); }); }, deactivate : function(){ ... }, activate : function(){ ... }, search : function(query){ ... }, }; $.fn.list = function(method){ if ( methods[method] ) { return methods[method].apply( this, array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'method ' + method + ' not exist on jquery.list' ); }

c# - Utility to convert an arbitrary string to a .NET string -

Image
is there utility out there convert arbitrary (or @ least html doc) string nicely formatted c# string. motivation doing lot of unit tests of html docs, , don't want load them files, rather keep inline strings. love paste html editor, , output reasonably looking c# string. instance: convert this: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" xmlns:fb="http://ogp.me/ns/fb#" itemscope itemtype="http://schema.org/"> into: @"<html xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en-us"" " + "lang=""en-us"" xmlns:fb=""http://ogp.me/ns/fb#"" itemscope " + "itemtype=""http://schema.org/"">" if not, thoughts on corner cases either html or .net strings might issue? sure not simple string.replace("\"", "\"\"") , busting lines

parsing JSON data in C# from Twitter Streaming API -

i'm trying parse tweets returning twitter's stream, seems instructs me use json.net, however, can't work .net 3.5 anybody have sample code without using .net 4.0? just find correct download .

python - Create a Procfile to declare the command to launch the web process: -

i have created procfile file, keep getting following. (venv)micheles-macbook-pro:bed4ted michele$ foreman start/usr/local/foreman/lib/foreman/procfile.rb:31:in `read': directory - procfile (errno::eisdir) /usr/local/foreman/lib/foreman/procfile.rb:31:in `parse_procfile' /usr/local/foreman/lib/foreman/procfile.rb:17:in `initialize' /usr/local/foreman/lib/foreman/engine.rb:24:in `new' /usr/local/foreman/lib/foreman/engine.rb:24:in `initialize' /usr/local/foreman/lib/foreman/cli.rb:81:in `new' /usr/local/foreman/lib/foreman/cli.rb:81:in `engine' /usr/local/foreman/lib/foreman/cli.rb:33:in `start' /usr/local/foreman/vendor/gems/thor-0.14.6/lib/thor/task.rb:22:in `send' /usr/local/foreman/vendor/gems/thor-0.14.6/lib/thor/task.rb:22:in `run' /usr/local/foreman/vendor/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task' /usr/local/foreman/vendor/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch' /usr/local/foreman/vendor/gems/thor-0.14

string - How to use single quotes within double quotes in PHP? -

creating link in php: echo "<a href=\"$currentfile?rowid=$row['id']\">click here</a>"; this throws error: parse error: parse error, expecting 't_string' or 't_variable' or 't_num_string' . how can this? also, mixing single , double quotes, , escaping double quotes reduces readability , generates errors. there better way create quotes syntax, %q() in ruby? working php 5.2.8. the problem array variable interpolation. syntax either "$row[id]" or "{$row['id']}" so: "<a href=\"$currentfile?rowid=$row[id]\">click here</a>" see http://php.net/manual/en/language.types.string.php#language.types.string.parsing .

r - how to display only the minimum and the maximum values in a legend while using image.plot function -

Image
i using image.plot function display color bar image. color bar, wish display legend @ boundary positions only. however, getting tics @ various places in middle. moreover, corresponding values not getting displayed. please see code segment below: color_plate=c('royalblue4','springgreen4','yellow2','darkred') layout(matrix(c(1,1), 1, 1)) par(mar=c(0,1,1,0)) #here image plotted image(image_variable, axes=false, xlab="", ylab="",col=color_plate) image.plot(zlim=c(min(ya),max(ya)),legend.only=true,col=color_plate, horizontal=true,legend.mar=0.4,legend.shrink=0.4,legend.width=0.4, axis.args = list(cex.axis = 1.5)) #here color bar added not able generate legend values @ both ends. #furthermore, wish eliminate tics , need values displayed. # tried 2 variations within image.plot function no result: #axis.args = list(cex.axis = 1.5,at=c(floor(min(ya)),ceiling(max(ya)))) #and #axis

Can I listen for any kind of event in splash screen using jquery or jquery mobile -

i want display splash screen in app. splash screen should disappear user event or after 5 second. i went through articles can listen events, should specify event name there. there way can listen kind of event? does work? http://jsfiddle.net/hjtaq/29/ js: function bindeventtouch(element) { element.bind('tap taphold swipe swiperight swipeleft', function(event, ui) { alert('event: '+event.type); }); } // list of events: http://api.jquery.com/category/events/ function bindevents(element) { element.bind('click change dblclick submit', function(event) { alert('element id: '+$(element).attr('id')+' event: '+event.type); }); } //bindeventtouch($('#display-event')); //bindevents($('#display-event')); $('.displayevent').each(function(){ bindevents($(this)); }); html <div data-role="page" id="home"> <div data-role="content

php - JSON foreach error to get name -

i´ve got following errormessage: parse error: syntax error, unexpected t_double_arrow, expecting t_paamayim_nekudotayim in /var/www/createrecipeing.php on line 60 don´t know how handle that, never had before. here´s code: $ings = array(); $ings = json_decode($incr_arr, true); print_r($ings); $reid = 5; foreach ($ings['data']['recipes']['recipe_' . $reid] key => $shing){ echo $shing['name']; } line 60 line foreach loop. know error must there because values of $ings correct. how can manage this? you need define element key other variable. you declared key when should $key . check php manual future reference. code fix foreach ($ings['data']['recipes']['recipe_' . $reid] $key => $shing){ echo $shing['name']; }

c++ - Boost variant get fail -

i have such code: boost::variant<b2distancejointdef, b2frictionjointdef, b2gearjointdef, b2mousejointdef, b2prismaticjointdef, b2pulleyjointdef, b2revolutejointdef, b2ropejointdef, b2weldjointdef, b2wheeljointdef> prmjointdef; b2distancejointdef &prmdistacejointdef = boost::get<b2distancejointdef>(prmjointdef); the error is: source\scene\components\jointcomponent.cpp:51:96: error: no matching function call 'get(boost::variant<b2distancejointdef, b2frictionjointdef, b2gearjointdef, b2mousejointdef, b2prismaticjointdef, b2pulleyjointdef, b2revolutejointdef, b2ropejointdef, b2weldjointdef, b2wheeljointdef>&)' \source\scene\components\jointcomponent.cpp:51:96: note: candidates are: boost/optional/optional.hpp:626:30: note: template<class t> typename boost::optional::reference_const_type boost::get(const boost::optional<t>&) boost/optional/optional.hpp:634:24: note: template<class t> typename boost::optional::r

wcf - How do I set the Priority on client side of MSMQ message sent to a WF Service activated via MQ -

i have wcf activated workflow service (xamlx) setup (hosted using workflowservicehost). this wcf webservice has 'netmsmqbinding' binding , net.msmq based endpoint used clients schedule operations. on client side, i've used visual studio generate proxy stub communicate wcf service. working fine , can see messages appearing in (journaled) mq on server , wcf picking messages queue activate configured workflow based on message. i need control priority of messages being sent mq wcf clients can prioritized processing of workflows. it seems netmsmqbinding doesn't support mq message prioritization. correct? if so, how can achieve/simulate this? can use mq triggers change priority of messages based on flags? posting solution, in case needs figure out netmsmqbinding not support setting message priority client side using wrong binding. more powerful msmqintegrationbinding right way go. client side: client side, 1 needs create system.messaging.message ob

C++: how to judge if the path of the file start with a given path -

i have path, example, named /my/path/test/mytestpath , , want judge if start given path, example /my/path std::string::find() returns index @ string found, index of 0 being start of string: std::string path("/my/path/test/mytestpath"); // check if 'path' begins "/my/path/". // if (0 == path.find("/my/path/")) { // 'path' starts "/my/path". }

perl - How can I update someone else's module on CPAN? -

i downloaded module cpan , added functionality. post newest module on cpan? if yes, how should this? possible @ all? should contact person wrote original module? procedure update specific module? you won't able upload , index module same name unless co-maintainer. uploading different name isn't productive community there 2 (or more) different versions. contact author submit patches rt queue module (or issue tracker specifies in docs) if it's on github, fork project, make change, , submit pull request if author unresponsive (which means no response, not negative response), have ways pass on maintainership of abandoned modules . take process because want give original author or current maintainer every chance respond. people might swamped @ work, on holiday, , on. however, situations turn out well. you can upload pause, if not sort of maintainer, pause won't index it. still show in cpan account , people can still download through cpan website

c# - TCP server is not reading fixed size messages correctly -

i'm sending sensor data android device tcp server in c#. android client sends data in fixed size chunks of 32 bytes. in server read data expecting come in full packs, since tcp stream protocol messages arrive @ server split in 2 parts. know because can watch software called socketsniff. the problem don't know how handle on server. all examples found use networkstream.read() , in method have pass array of bytes store data read, offset , number of bytes read. array of bytes must have know size, in case 32. i don't know real size of message arrived on server, 1 of following situations. if received data size 32 bytes, it's ok. if received data size if greater 32 bytes, think i'm loosing data. if received data size less 32 bytes, lets 20 bytes, these bytes stored in array , last 12 bytes of array remain value of zero. since may receiving zeros there's no way know size received, can't merge remaining data should come in next reading. my code ha

jsf 2 - primefaces3.0 X-scale value change -

i'm implementing line charts of primefaces(3.0) , i'm trying change value of x-scale the values i'm using minx="0" maxx="38" , since primefaces linecharts using jqplot , added script <script> $(function(){ widget_category.plot.axes.xaxis._tickinterval = 1; widget_category.plot.axes.xaxis.numberticks = 38; }); </script> but still coordinates coming in decimals. i mention y scale, values used miny="40" maxy="110" style="height:1005px;" , figured out scale value , can 10 if height defined 1005px i.e. 5 * 14 = 70 means y scale of 5 intervals , 14 values , line height 1005 5*14*14 = 980 + 25 (which top-margin added) 1005. though same not working out x-scale. any helpful. the arithmetic in y values multiplication operations on whole numbers, result in whole number. these whole numbers correlate pixels. your x range involves multiplication

javascript - setPanel() and getPanel() changing panel -

first, i'm sorry don't have link map cause it's on local , no way can give ip in here. ofcourse, can find freehost place there people see i'm makin actualy don't understand difference - show working map actual result or - explain problem exampl now want explain problem wondering how change in div setpanel() make it - show infowindows onmousemove not onclick - cross between steps without changing zoom tryed inside of getpanel() directionsdisplay.setpanel(plist); var p = directionsdisplay.getpanel() var = p.getelementsbyclassname('adp-substep') thats way array of steps. after thinking alot desided build own panel cause in end it's way make want. many , bie bie

c# - finding the value of the points in a chart -

Image
i have made chart on form. i want user see value , x_value , y_value of each part in balloon clicking on part. the ballon shoud disappear when user moves mouse. how can that? you this: tooltip tooltip = new tooltip(); point? clickposition = null; void chart1_mousemove(object sender, mouseeventargs e) { if (clickposition.hasvalue && e.location != clickposition) { tooltip.removeall(); clickposition = null; } } void chart1_mouseclick(object sender, mouseeventargs e) { var pos = e.location; clickposition = pos; var results = chart1.hittest(pos.x, pos.y, false, chartelementtype.plottingarea); foreach (var result in results) { if (result.chartelementtype == chartelementtype.plottingarea) { var xval = result.chartarea.axisx.pixelpositiontovalue(pos.x); va

java - Spotify: "Best Before" Error -

so i, many others, have tried solve problem. believe have code correct, , have tested many, many, many dates on this. however, when send .java file, .jar file, , .class file guys @ spotify, continually says we have tested solution, , while doing unfortunately discovered following error: run time error linkage error what have works fine on system. guys have ideas on how can stop getting run time , linkage errors? code below: package spotifychallenges; import java.text.parseexception; import java.text.simpledateformat; import java.util.date; import java.util.scanner; import java.util.vector; public class spotifychallenges { public static void main(string[] args) throws parseexception { vector approvedyears = new vector(); vector approvedmonths = new vector(); vector zeroesapplied = new vector(); vector approveddates = new vector(); vector earliestdate = new vector(); vector earliestdatecheck = new vector(); scanner scanner = new scann

d - how to decode ubyte[] to a specified encoding? -

the problem is : how parse file when encoding set @ runtime? encoding be: utf-8 , utf-16 , latin1 or other the goal convert ubyte[] string selected encoding. because when use std.stdio.file.bychunk or std.mmfile.mmfile have ubyte[] data. are trying convert text file utf-8? if answer 'yes', phobos have function specialy this: @trusted string toutf8(in char[] s) . see http://dlang.org/phobos/std_utf.html details. sorry if not need.

php - mysql_fetch_array's div onmouseover only works for first result -

i new on website , hope you'll answer soon. i want remove icon show when users hover on selected friend, appears on mysql_fetch_array's first result. doesn't work others. can help? i've heard it's being done foreach function don't know how use it, because i'm new @ php. here codes. php: $q = mysql_query("select * `users`"); while ($row = mysql_fetch_array($q)) { echo '<div id="friends" onmouseover="showremove();" onmouseout="hideremove();">'; echo '<div id="fillexit"></div>'; echo '<div id="showexit"></div>'; echo '</div>'; } javascript: function showremove() { var l=document.getelementbyid("showexit"); var s=document.getelementbyid("fillexit"); l.style.display = 'block'; s.style.display = 'none'; } function hideremove() { var p=document.getelementbyid("showexit");

map - Silverlight Object Loads Then Disappears -

i using windows 7 ult., ie9, chrome. have installed silverlight 5 , trying develop app using devexpress dxmap control , silverlight. however, having issues silverlight seems. when go site (http://www.silverlight.net/learn/overview/what's-new-in-silverlight-5/introduction-to-silverlight-5-3d) watch video on silverlight 3d feature, video player believe silverlight control loads, disappears. when run app dxmap control, page loads blank area zoom control, navigation pad, , scale visible. have tried finding solution problem, have not been successful. suggestions? okay, found out issue. thought not checking "host silverlight application in new web site" option (since never had website yet) let application load on own, had enable "host silverlight application in new web site" option associated test page.

r - CFA nice path plots -

Image
when efa package psych can generate nice path plots correlations , loadings , such this: using fa.diagram function following code: library(psych) covariances <- ability.cov$cov correlations <- cov2cor(covariances) fa.promax <- fa(correlations, nfactors=2, rotate="promax", fm="pa") fa.diagram(fa.promax, simple=false) i tend use cfa more efa , able plot model correlations in same way. use sem package. have tried pathdiagram function produces code can paste gvedit graphviz. , correlations , between factor correlations aren't there. additionally don't cutting , pasting program (though file sem pathdiagram reads: " to obtain graphics output directly, dot program must on system search path. "; don't know put in path make happen , if have correlations anyway?) i'd able make path diagram similar fa.diagram psych efa. i'd able in r , not cut , paste. don't care package use think people agree simpler better , i

deployment - Prevent program appearing in Add/Remove section of Control Panel -

i'm bootstrapping clickonce setup file can add custom actions pre , post install. problem i'm facing clickonce installation writes add/remove programs section of control panel . mean user end 2 uninstallers (clickonce , bootstrapper). program available offline, rules out setting clickonce deployment online-only , suppressing add/remove entry way. there other way prevent clickonce deploy adding entry add/remove section? or there way retrospectively remove entry safely? its stored in registry under hkey_local_machine\software\microsoft\windows\currentversion\uninstall just delete corresponding key , sound little malicious http://support.microsoft.com/kb/314481

Build error while building android source code on ubuntu 12.04 -

i building android source code on ubuntu 12.04, update latest version of ubuntu , android (repo sync). after tried build android source code(clean build).i got following build error > host sharedlib: libopenglrender > (out/host/linux-x86/obj/lib/libopenglrender.so) host prebuilt: > eventanalyzer > (out/host/linux-x86/obj/executables/eventanalyzer_intermediates/eventanalyzer) > install: out/host/linux-x86/bin/exc_dump install: > out/host/linux-x86/bin/fastboot install: > out/host/linux-x86/bin/fs_config install: > out/host/linux-x86/bin/fs_get_stats install: > out/host/linux-x86/bin/genext2fs install: > out/host/linux-x86/bin/gpttool host prebuilt: hierarchyviewer > (out/host/linux-x86/obj/executables/hierarchyviewer_intermediates/hierarchyviewer) > /usr/bin/ld: cannot find -lx11 collect2: ld returned 1 exit status > make: *** [out/host/linux-x86/obj/lib/libopenglrender.so] error 1 > make: *** waiting unfinished jobs.... i did find solut