Posts

osx - Why is /usr/bin/arch not installed? -

my application has been depending on presence of /usr/bin/arch , , understanding part of standard mac os x installation. it's there if install snow leopard dvd, without installing developer tools. however, i've encountered 2 users 10.6.7 missing file. there normal way of getting mac os x omits arch ? or these users' installations happen broken? /usr/bin/arch part of com.apple.pkg.basesystem package, should present in every stock mac os x installation. running: $ pkgutil --file-info /usr/bin/arch will tell package installed /usr/bin/arch , , running: $ pkgutil --files com.apple.pkg.basesystem will tell contents of package. it might worth run latter in machines of users haven’t got arch .

linux - bash - automatically capture output of last executed command into a variable -

i'd able use result of last executed command in subsequent command. example, $ find . -name foo.txt ./home/user/some/directory/foo.txt now let's want able open file in editor, or delete it, or else it, e.g. mv <some-variable-that-contains-the-result> /some/new/location how can it? maybe using bash variable? update: to clarify, don't want assign things manually. i'm after built-in bash variables, e.g. ls /tmp cd $_ $_ holds last argument of previous command. want similar, output of last command. final update: seth's answer has worked quite well. couple of things bear in mind: don't forget touch /tmp/x when trying solution first time the result stored if last command's exit code successful this hacky solution, seems work of time. during testing, noted didn't work when getting ^c on command line, though did tweak bit behave bit better. this hack interactive mode hack only, , pretty confident not recommend a...

c# - How do I obtain the client coordinates where a Panel (Canvas, stackpanel, etc) is located in a WPF app? -

i need programatically obtain client coordinates panel (stackpanel instance) located. when using windows api, button has topleft , bottomright coordinate determines location within window in resides. how obtain coordinates stackpanel in wpf window ? thank help, john. you can call transformtovisual() gets generaltransform relative other element can use container (frame/ window) generaltransform gt = stackpanel1.transformtovisual(parentwindow); point p = gt.transform(new point(0, 0));

jQuery Datepicker beforeShowDay works only after 1st click -

i'm having problem beforeshowday . when page loads, days i've told highlight not highlighted until click day in calendar. if click next-month button , come original month, 'selected' days highlighted expected. so, on initial draw of calendar dates not highlight have programmed them do. click in calendar fixes itself. am missing init option? please see code example below. test url in protected directory user/pass of test/test. @ mini-cal in right column bottom. switch next month , see problem. note highlighted days im may. also, note 'year' dropdown missing until click happens. http://www.urbanbands.com/dev/cgi-bin/links/eventmgr.cgi?do=list the code: <script> $(document).ready(function(){ // current date var today = new date(); var m = today.getmonth(), d = today.getdate(), y = today.getfullyear(); // need list of event dates month database. // declare 'dates' var before adding "beforeshowday" optio...

eclipse - Flash Builder Export Release Build Fails -

i'm having issue when trying export release build of air application in flash builder 4.5. after choosing key sign package , clicking finish complete export, errors saying "error occurred while saving project settings: "default" build target cannot found selected project." i've included error message output log in .metadata folder. great baffling me. !entry com.adobe.flexbuilder.project 4 43 2011-05-10 15:56:11.432 !message failed build target settings: default !stack 0 java.lang.exception @ com.adobe.flexbuilder.project.internal.flexprojectcore.createerrorsta tus(flexprojectcore.java:1009) @ com.adobe.flexbuilder.util.logging.globallogimpl.log(globallogimpl.ja va:66) @ com.adobe.flexbuilder.util.logging.globallog.log(globallog.java:52) @ com.adobe.flexbuilder.project.ui.utils.projectbuildpackagingui.doappl ysettings(projectbuildpackagingui.java:754) @ com.adobe.flexbuilder.project.ui.utils.projectbuildpackagingui.applys ettings(projectbuildpackagin...

Java: Can I use two different names in an enum to count as the same thing? -

i have enum class cardinal directions(north, east, south, west): public enum direction { north, east, south, west; } is there way able use multiple names same thing? example this: public enum direction { north or n, east or e, south or s, west or w; } in practice want able , sign variable either n or north , have 2 operations same. example: direction direction1=new direction.north; direction direction2=new direction.n; //direction1==direction2 public enum direction { north, east, south, west, ; // convenience names. public static final direction n = north; public static final direction e = east; public static final direction s = south; public static final direction w = west; } is legal, "n" not work auto-generated valueof method. i.e. direction.valueof("n") throw illegalargumentexception instead of returning direction.north . you cannot write case n: . have use full names in swit...

json - Google Geocoding Result into MVC Controller -

i utilizing javascript api v3. geocoding address follows: geocoder.geocode({ 'address': address }, function (results, status) { //get results array here } this working successfully. need pass json mvc controller. have seen numerous ways this, cannot working geocode result. from haack : (i have collection on objects duplicate structure of result. @ outermost object being result[] (see below)). geocoder.geocode({ 'address': address }, function (results, status) { var jsont = json.stringify(results); $.ajax({ url: '/ctrl/action', type: "post", datatype: 'json', data: jsont, contenttype: "application/json; charset=utf-8", success: function (result) { alert(result.result); } }); } the controller method fires, value null . [httppost] public actionresult action(googlegeocoderesponse georesponse) { //georesponse ...