Posts

Showing posts from February, 2012

objective c - Handling Pointer-to-Pointer Ownership Issues in ARC -

objective c - Handling Pointer-to-Pointer Ownership Issues in ARC - suppose object a has property: @property (nonatomic, strong) foo * bar; synthesized in implementation as: @synthesize bar = _bar; object b manipulates foo ** , in illustration phone call object a: foo * temp = self.bar; [objb dosomething:&temp]; self.bar = temp; can this, or similar, done legitimately? what right declaration dosomething: method? furthermore, suppose object b may deallocated before have chance set bar property (and take on ownership of instance pointed temp ) - how tell arc hand off owning reference? in other words, if wanted next illustration snippet work, how need handle arc issues? foo * temp = self.bar; // give reference current value [objb dosomething:&temp]; // allow modify reference self.bar = nil; // release whatever have _bar = temp; // since we're getting owning reference, bypass setter what aren't thinking of? ...

reporting services - In SSRS, is it possible to make a context sensitive report containing multiple subreports for dynamics CRM 2011 -

reporting services - In SSRS, is it possible to make a context sensitive report containing multiple subreports for dynamics CRM 2011 - i have designed ssrs study having multiple sub-reports. study working fine displaying info records. need create context sensitive. below query main report. select filterednew_franchisee.new_franchiseeid, filterednew_franchisee.new_name, filterednew_monthlypayment.new_insurance filterednew_franchisee inner bring together filterednew_monthlypayment on filterednew_franchisee.new_franchiseeid = filterednew_monthlypayment.new_franchiseeid (filterednew_monthlypayment.new_yearmonth = @reportyear + @reportmonth) , (filterednew_franchisee.new_franchiseeid in (select new_franchiseeid filterednew_franchisee crmaf_filterednew_franchisee)) sub-reports using fields above query parameter. am missing ? there other approach needs followed? possible design context sensitive study having multiple sub-reports? please help. ...

Rails - How to validate a field only if a another field has a certain value? -

Rails - How to validate a field only if a another field has a certain value? - i'm pretty new rails , came across problem wasn't able solve friend google :) in form have select 3 values: apple, banana , cherry. if take apple select hide select- , text-field javascript, because when apple chosen, there no need fill in these other 2 fields anymore. so have problem validating form when it's submitted. i've found similar problems illustration in case of "only validate field if blank." this problem solved this: validates_presence_of :mobile_number, :unless => :home_phone? so i've tried first thing popped mind: validates_presence_of :state, :granted_at, :if => :type != 1 but when run it, error: undefined method `validate' true:trueclass so didn't find out how can access values object created... give thanks in advance help , hope question isn't obvious sounds :-) because executable code need wrap in lambda...

Simple handlng and logging of Exceptions i ASP.NET MVC? -

Simple handlng and logging of Exceptions i ASP.NET MVC? - hi, i looking simple way log exceptions database in asp.net mvc application. have looked @ "exception management application block" can´t find simple , clear articels how handle in asp.net mvc? maby should grab exception far possible , log database im not sure how in asp.net mvc. in windowsforms there diffrent events(like unexpectedexception) hear can log, there in asp.net mvc? bestregards edit1: found tool called elmah http://code.google.com/p/elmah/ im not sure if solution , if works asp.net mvc. then found article http://www.davidjuth.com/asp-net-mvc-error-handler.aspx looks easy , clear not know if right way go? use elmah, available on nuget. log unhandled exceptions in web app , provide interface view them. can log variety of storage mechanisms including xml , sql databases, can email errors. the solution logging exceptions in asp.net applications (both webforms , mvc). if using elmah ...

java - How to get Apache CLI to handle double-dash? -

java - How to get Apache CLI to handle double-dash? - i've looked @ docs can't see how apache commons cli handle double-hyphen "option" terminates alternative processing. consider next command-line has "-opt" alternative can take optional argument not specified: myprogram -opt -- param1 param2 i want alternative end no arguments in case, apache returns "--" argument. if alternative allowed more 1 argument, or of parameters returned arguments. here sample code illustrating issue: package com.lifetouch.commons.cli; import java.util.arrays; import org.apache.commons.cli.*; public class doublehyphen { private static options options = new options(); public static void main(string args[]) { // 1 required alternative optional argument: @suppresswarnings("static-access") optionbuilder builder = optionbuilder.isrequired(true). withdescription("one optional arg"). witharg...

python - How to check whether virtualenv was created with '--no-site-packages'? -

python - How to check whether virtualenv was created with '--no-site-packages'? - sometimes errors suspect result of django app using globally installed python modules/django apps instead of within virtualenv. is there way check whether app's virtualenv created '--no-site-packages' without having delete it, re-create follows? deactivate rmvirtualenv my_env mkvirtualenv my_env --no-site-packages workon my_env pip install -r requirements.txt surely there must improve way! thanks. there's file in <env>/lib/pythonx.x/ called no-global-site-packages.txt when create virtual environment --no-site-packages . just tried virtualenv 1.7: % virtualenv --no-site-packages env.without % virtualenv --system-site-packages env.with % find env.without | sed 's/env.without//' > files.without % find env.with | sed 's/env.with//' > files.with % diff files.with* 230a231 > /lib/python3.2/no-global-site-packages.txt py...

How to make pycassa silent (make it stop printing to console when i create or change key or column validators) -

How to make pycassa silent (make it stop printing to console when i create or change key or column validators) - the next prints "doubletype(reversed=false)" console; how tell pycassa stop doing that? happens when alter_column too. python 2.7.2+ (default, nov 30 2011, 19:22:03) [gcc 4.6.2] on linux2 type "help", "copyright", "credits" or "license" more information. >>> pycassa.types import compositetype, utf8type, longtype, doubletype, booleantype >>> pycassa.system_manager import systemmanager >>> systemmanager().create_keyspace('test', strategy_options={"replication_factor": "1"}) >>> systemmanager().create_column_family('test', 'testcf', key_validation_class=doubletype()) doubletype(reversed=false) thanks it harmless bug fixed here: https://github.com/pycassa/pycassa/issues/98 the next release won't have issue. pycassa

Snapshot from the map in android -

Snapshot from the map in android - i want create snapshot of particular location map calling intent or mapview.can help me.i not getting snapshot. try this post, believe should help. involves enabling drawing cache , forcing utilize cache. works on views. should work on mapview aswell code link private bitmap getmapimage() { /* position map output */ mapcontroller mc = mapview.getcontroller(); mc.setcenter(some_point); mc.setzoom(16); /* capture drawing cache bitmap */ mapview.setdrawingcacheenabled(true); bitmap bmp = bitmap.createbitmap(mapview.getdrawingcache()); mapview.setdrawingcacheenabled(false); homecoming bmp; } private void savemapimage() { string filename = "foo.png"; file f = new file(getexternalfilesdir(null), filename); fileoutputstream out = new fileoutputstream(f); bitmap bmp = getmapimage(); ...

php - CakePHP 1.3: Alaxos ACL Plugin not recognizing Pages Plugin -

php - CakePHP 1.3: Alaxos ACL Plugin not recognizing Pages Plugin - i have been developing cakephp , alaxos acl plugin has helped in tremendously. however, facing 1 issue not sure how prepare it? i added plugin named 'pages', cannot acl see added list of allowed/denied actions. if access plugin thru domain.com/pages/pages next error dbacl::check() - failed aro/aco node lookup in permissions check. when check thru acl plugin display, there no reference pages controller , if run acl build function, says there nil add. is because controller named pages , there pages controller within cake? if how prepare it? option, @ time, adding manually db? should go thru plugin , rename pages else? or there else should doing? thanks, i see 2 things here. first suspect, having 2 classes in application share same name bad idea. give problems in 1 way or another, wrong class beingness instantiated or whatever. far cake not utilize namespaces, not recommended. ...

android - Unable to get Facebook permissions: birthday_date, about_me always null -

android - Unable to get Facebook permissions: birthday_date, about_me always null - i have asked facebook birthday_date,about_me , location permissions of user , friends, when query these fields, these null. have 150 friends in json have these fields equal null, indicating facebook has not authenticated permisson. query: string query = "select name,about_me,birthday_date, current_location, uid, pic_square,sex user uid in (select uid2 friend uid1=me()) order name"; bundle params = new bundle(); params.putstring("method", "fql.query"); params.putstring("query", query); response = utility.mfacebook.request(null, params, "get"); json response contains next fields null. "birthday_date": null, "current_location": null, "about_me": null, i using next code login , permissions facebook. utility.mfacebook = new facebook(constants.my_app_id); utilit...

apache - Is there a way to keep a php object in memory to avoid disk reads and wirtes? -

apache - Is there a way to keep a php object in memory to avoid disk reads and wirtes? - so have object reads file disk gnugpg appears create gnugpg key ring in home directory. i want avoid having load object every time php script called apache. is there away have php object remain in memory? if it's little object doesn't take much memory , serializable store in session: function getsessionobject($objectname, $params){ $sessionobjectserialized = getsessionvariable($objectname, false); if($sessionobjectserialized == false){ $sessionobjectserialized = constructsessionobject($objectname, $params); setsessionvariable($objectname, $sessionobjectserialized); } $sessionobject = unserialize($sessionobjectserialized); homecoming $sessionobject; } function constructsessionobject($objectname, $params = array()){ switch($objectname){ case('gnugpg_key_ring'):{ $gnugpgkeyring = getgnupgkey...

java - Can I write multiple byte arrays to an HttpClient without client-side buffering? -

java - Can I write multiple byte arrays to an HttpClient without client-side buffering? - the problem i upload big files (up 5 or 6 gb) web server using httpclient class (4.1.2) apache. before sending these files, break them smaller chunks (100 mb, example). unfortunately, of examples see doing multi-part post using httpclient appear buffer file contents before sending them (typically, little file size assumed). here such example: httpclient httpclient = new defaulthttpclient(); httppost post = new httppost("http://www.example.com/upload.php"); multipartentity mpe = new multipartentity(); // here plain-text fields part of our multi-part upload mpe.addpart("chunkindex", new stringbody(integer.tostring(chunkindex))); mpe.addpart("filename", new stringbody(somefile.getname())); // file include; looks we're including whole thing! filebody bin = new filebody(new file("/path/to/myfile.bin")); mpe.addpart("myfile", bin); p...

Maven and Eclipse global enviroment variable -

Maven and Eclipse global enviroment variable - i have got path external programme in pom.xml, annoying because if multiple people work pom through svn has changed , recommitted... can somehow set global eclipse variable (where?) , reference through pom (how?)? you define scheme property my_prog_path , reference in pom.xml ${env.my_prog_path} this should work within , outside eclipse. eclipse variables maven environment workspace

Loop through URL GET variables with javascript -

Loop through URL GET variables with javascript - i know can obtain url variable calling geturlvars()["id"] , there way (an unknown number of) variables in url? few reasons allowed on client side. try this: function geturlvars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexof('?') + 1).split('&'); for(var = 0; < hashes.length; i++) { hash = hashes[i].split('='); vars[hash[0]] = hash[1]; } homecoming vars; } var url_vars = geturlvars(); for(var in url_vars) { alert(i + " == " + url_vars[i]); } javascript url get

osx - Core Audio and the Phantom Device ID -

osx - Core Audio and the Phantom Device ID - so here's going on. i attempting work core audio, input devices. want mute, alter volume, etc, etc. i've encountered absolutely bizarre cannot figure out. far, google has been of no help. when query scheme , inquire list of sound devices, returned array of device ids. in case, 261, 259, 263, 257. using kaudiodevicepropertydevicename, following: 261: built-in microphone 259: built-in input 263: built-in output 257: iphonesimulatoraudiodevice this , good. // method returns nsarray of sound devices on system, both input , // on system, returns 261, 259, 263, 257 - (nsarray*)getaudiodevices { audioobjectpropertyaddress propertyaddress = { kaudiohardwarepropertydevices, kaudioobjectpropertyscopeglobal, kaudioobjectpropertyelementmaster }; uint32 datasize = 0; osstatus status = audioobjectgetpropertydatasize(kaudioobjectsystemobject, &propertyaddress, 0, null, &datasize); if(kaudio...

javascript - jquery slider - animating timeline -

javascript - jquery slider - animating timeline - i'm using jquery slider function timeline $("#content-slider").slider({ min: 0, max: 300, step: 1, change: handlesliderchange, //start: getimagewidth, slide: handlesliderslide }); function handlesliderslide(event, ui) { $("#content-scroll").prop({scrollleft: ui.value * (maxscroll / 300) }); if (ui.value >= 7 && ui.value <= 13) { $('#marker_10').animate({opacity: 'hide'}, 100, function () { $(this).parent('div').animate({margintop: '100px'}, {duration:1000, queue:false }).addclass('up').find('p').animate({opacity: 'show'} ) }) } if (ui.value > 13 || ui.value < 7 && ($('div#container_10').hasclass('up'))) { $('div.up').stop(true) $('#container_10').removeclass('up').find('p').fadeout('fast').end().animate({margintop:'...

c# - What is best way of filter datatable? -

c# - What is best way of filter datatable? - in 1 of c# requirement have datatable in having next data category topics resourceworked tp1 hemant tp2 kevin b tp3 haris b tp4 hemant b tp5 hemant c tp6 kevin in output want 2 set of data output-1: each unique category how many resorces worked category noofresorces 2 b 2 c 1 output-2: how many times resorces worked unquie category like category resource nooftime hemant 1 kevin 1 b haris 1 b hemant 2 c kevin 1 what best way accomplish output i.e. either datatable filter or linq? addition: can linq expert tell me online website or book learning linq? here first requirement: var uniquecat = d in tbldata.asenumerable() grouping d (string)d["category"] grouping select group; var catres = grp in uniquecat ...

Flash Class Giving Me and Import Error -

Flash Class Giving Me and Import Error - here code wrote. flash class based upon generic object. package{ import flash.events import flash.ui import flash.sprite; import flash.sound; public class songplayer extends object { private var _song : sound; private var _soundtrans : soundtransform; addeventlistener(event.enter_frame , onenter); public function songplayer (_sound:sound) : void { _song = _sound; var chan : soundchannel = new soundchannel(); chan = _song.play(); }; } } in fact, code total of errors: all (!) of import statements invalid. check api documentation each class find out right bundle or qualified class name import (such flash.display.sprite , flash.events.event ). you add together event listener outside of function block you did not declare onenter function handle event there no need write extends object , since custom classes in flash extend object definition. fo...

mod rewrite - Having trouble using .htaccess for hiding the .php extension -

mod rewrite - Having trouble using .htaccess for hiding the .php extension - i'm having problem using .htaccess. content of .htaccess file rewriteengine on rewritecond %{request_filename}!-d rewritecond %{request_filename}!-f rewriterule ^([^.]+)\.php$ $1 [l] i opened text file, pasted these lines , saved .htaccess showing .htaccess before right clicked .htaccess file , changed "open notepad". guess shouldn't create difference showing blank name. the main problem when open localhost on browser through wamp, folder i've kept .htaccess file, isn't visible or if access shows internal server error.now, if remove .htaccess file there, shows in localhost directory , doesn't show error when seek open it. if you're getting 500 internal server error, .htaccess file beingness read. see, may missing spaces before ! : rewriteengine on rewritecond %{request_filename} !-d #-----------------------------^^ rewritecond %{request_file...

php - why not use arrays instead of many parameters -

php - why not use arrays instead of many parameters - i may sound stupid want know if there benefit of passing arguments function array,rather passing each arguments or downsides? sure might nicer if pass array method, mean? arrays signify have collection of same thing, whilst method parameters different things. if want pass list of things method , same action on of them, makes perfect sense utilize type of array/collection object. if want create tidier , avoid passing around lots of objects together, consider refactoring code utilize kind of wrapper object can pass around more easily. also if have many arguments consider using array hold them, it's sure sign need refactor code ;-) php function

validation - JSF2 disabled attribute for validator evaluated only for first cycle? -

validation - JSF2 disabled attribute for validator evaluated only for first cycle? - i found disabled attribute validator utilize in jsf2 evaluated in first cycle if managed bean viewscoped. but create utilize of disabled attribute validators based on info 4th update phase. expect reevaluated in cycles performed on same view. example xhtml page: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head></h:head> <h:body> <h:form> <h:panelgrid id="pnlgrid"> <h:inputtext id="somevalueid" value="#{testpagebean.somevalue}"> <f:validatelength minimum="2" maximum="4...

ruby - Rails 3. how to make a nested attribute query? -

ruby - Rails 3. how to make a nested attribute query? - i have shipment has 1 invoice; invoice belongs shipment. shipments table 1 contains customer_id. i need find invoices... for particular client and that have customer_account_balance of 0 i have tried many different approaches none seem work, lastly 1 got me error private method select or that... reports_controller.rb = invoice.where("customer_open_balance != 0") s = shipment.find_by_customer_id(@customer.id) shipment_ids_from_invoices = i.map{|x| x.shipment_id} @shipments = s.select{|z| shipment_ids_from_invoices.include? z.id} does work? @shipments = shipment.joins(:invoice).where(:customer_id => @customer.id).where("customer_account_balance <> 0") it sounds schema looks this: shipment: (customer_id, ...) invoice: (customer_open_balance, shipment_id, ...) did set has_one :invoice in shipment.rb , belongs_to :shipment in invoice.rb? ruby-on-rails ruby acti...

ubuntu - regular user can't read /proc/net/dev -

ubuntu - regular user can't read /proc/net/dev - i'm pretty sure i'm missing here, i'm not sure what: this root can see: root@opteron16:/# ls -l | grep proc dr-xr-xr-x 290 root root 0 2012-01-14 02:03 proc root@opteron16:/# ls -l proc | grep net lrwxrwxrwx 1 root root 8 2012-01-21 03:29 net -> self/net root@opteron16:/# ls -l proc/net/ | grep dev -r--r--r-- 1 root root 0 2012-01-14 02:05 dev this ganglia user: root@opteron16:/# cat /etc/passwd | grep ganglia ganglia:x:111:119:ganglia monitor:/var/lib/ganglia:/bin/false when seek access /proc/net/dev user: root@opteron16:/# su -s /bin/bash ganglia ganglia@opteron16:/$ ls -l /proc | grep net lrwxrwxrwx 1 root root 8 2012-01-21 19:49 net -> self/net ganglia@opteron16:/$ ls -l /proc/net/ ls: reading directory /proc/net/: invalid argument total 0 ganglia@opteron16:/$ cat /proc/net/dev cat: /proc/net/dev: no such file or directory would great not sense stupid : ). ...

How to debug PHP in eclipse in an external browser rather than internal? -

How to debug PHP in eclipse in an external browser rather than internal? - how can create eclipse launch , debug site on default browser instead of interal browser? i'm using macosx, eclipse pdt 3.0.2 zend debugger. eclipse > preferences > general > web browser. select alternative 'use external web browser', , leave 'default scheme web browser' box ticked. php eclipse zend-debugger

Reduce paragraph line break height on iTextSharp -

Reduce paragraph line break height on iTextSharp - how can cut down height of line break occurs when paragraph length long width of columntext? i've tried following, i've seen other questions answered this: p.leading = 0 but has made no affect. i've tried increasing leading 100 see if larger line break added, neither work. spacingbefore/spacingafter doesn't help either: p.spacingbefore = 0 p.spacingafter = 0 how can cut down this? when using table, need set leading on cell itself. however, you'll see leading property read-only instead you'll need utilize setleading() method takes 2 values, first fixed leading , sec multiplied leading. according to post here: multiplied means, larger font, larger leading. fixed means same leading font size. to shrink leading 80% you'd use: dim p1 new paragraph("it best of times, worst of times") dim c1 new pdfpcell(p1) c1.setleading(0, 0.8) edit sorry, saw ...

html - Cross-Browser Solution: Have links clickable when under image -

html - Cross-Browser Solution: Have links clickable when under image - i have header in html page contains curve. my problem: curve image & sits @ highest z-index. meant cutting off text below has highest z-index. result, none of links below image(curve) can clicked because image sits on top of them. heres simple jsfiddle: http://jsfiddle.net/he7d5/2/ how can links below image clickable? the easiest way know create image have css: pointer-events: none; but doesn't work in ie & looking cross-browser friendly solution. <div id="headercontainer" style="position: relative; width: 100%; text-align: center; background-color: yellow;"> <div id="header" style="width: 1100px; height: 400px; padding-left: 30px; padding-right: 30px;"> <ul id="navbar" style="background-color: red; width: 800px; height: 40px; float: left;"></ul> <a id="logo" href=...

iphone - CommonCrypto alternative to PBKDF2 -

iphone - CommonCrypto alternative to PBKDF2 - since apple has deprecated utilize of openssl in ios need alternative pbkdf2 in 1 of ios security frameworks. tried search commoncrypto no luck. is there fair alternative pbkdf2 recommanded apple? i.e. key derivation function (password based) in ios (implemented apple)? p.s. i'm aware of pbkdf2 using commoncrypto on ios , don't want utilize openssl since not recommanded apple, see why apple depricating openssl in macos 10.7 (lion) pbkdf2 standard algorithm , recommended pbkdf algorithm. not "openssl" , not deprecated (it encouraged). should using cckeyderivationpbkdf() commoncrypto purpose in ios 5+ , os x 10.7+. if want backport version of commoncrypto older platforms, see how compile , utilize commoncrypto ios 4?. iphone ios security pbkdf2 commoncrypto

vba - Print macro using xlDialogPrinterSetup fails to use driver-specific settings -

vba - Print macro using xlDialogPrinterSetup fails to use driver-specific settings - i have piece of vba code prints set of sheets if criteria on sheet containing code , command button met. sub printer() dim rnsheets range dim rnsheetname range dim mycell range dim snameadress string dim fname string dim ws worksheet snameadress = "i10" set rnsheets = me.range("c12:c39") application.screenupdating = false on error resume next 'denna rad ger ett fel om skrivaren inte finns, därav inneslutning av felhanterare. 'kanske felet bör hanteras? application.activeprinter = "gotatunneln-04 på ne02:" on error goto 0 'tar upp skrivardialog. application.dialogs(xldialogprintersetup).show 'application.dialogs(xldialogprint).show each mycell in rnsheets if mycell <> "" set rnsheetname = mycell.offset(0, -2) on error resume ne...

Why Haskell ghc does not work, but runghc works well? -

Why Haskell ghc does not work, but runghc works well? - one code work runghc, can not compile same 1 ghc command. why? below minimal code , environment: https://gist.github.com/1588756 works well: $ runghc cat.hs can not compile: $ ghc cat.hs -o cat macbook air, max os x snow leopard the .cs extension shown in paste wrong;1 rename file cat.hs , it'll work fine. this error message: ld: warning: ignoring file cat.cs, file built unsupported file format not architecture beingness linked (i386) occurs when pass file ghc doesn't know how handle; passes on straight linker, ignores it doesn't know, either. :) 1 @ to the lowest degree until ghc gets c# support... haskell ghc

Wordpress replacing bloginfo with home_url? -

Wordpress replacing bloginfo with home_url? - in header file, i'm using wordpress function bloginfo next 3 times: <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> but theme check plugin gives me next warning: bloginfo(url) found in file header.php. utilize echo home_url() instead. can tell me how can replace that? couldn't find info in function references on wordpress website. it may not in header.php . find on all active theme files reference to: bloginfo('url'); and replace with: echo home_url(); wordpress

PSGI logging (Perl) -

PSGI logging (Perl) - despite rather scant , unclear documentation , effective how-to beginners, have grown psgi , using in 1 of applications. know how manage logging across multi-node application? considered "best practice" regarding logging in psgi? i recommend using plack::middleware::accesslog logging accessing , plack::middleware::logdispatch custom logging. both in turn utilize popular log::dispatch module. the logdispatch middleware docs not show how utilize logging object 1 time set up. here's example: my $app = sub { $env = shift; $env->{'psgix.logger'}->({ level => "debug", message => "this debug" }); homecoming [ 200, [], [] ]; }; to address multi-node concern, utilize log::dispatch::syslog send logging rsyslog in turn pass log info on rsyslog server. in way, nodes can log single central logging server. with flexibility of log::dispatch, have alternative log both locally , remotel...

google chrome cannot identify jquery-ajax function data result -

google chrome cannot identify jquery-ajax function data result - i'm trying action based on jquery-ajax function result here illustration code: function test(){ $.ajax({ type: 'post', url: 'testing.php', success: function(data) { if($.trim(data) == 'ok' ) alert('success , ok'); else alert(data) } }) } it works fine in firefox , "success ok" alert, in chrome "ok" alert. why doesn't $.trim(data) == 'ok' work in chrome when info equal "ok" ? jquery ajax google-chrome

facebook - What is the deal with offline_access? Is it still in use? -

facebook - What is the deal with offline_access? Is it still in use? - i can request access_token upon supplying offline_access scope parameter oauth. can execute opengraph commands require access_token fine when logged out of facebook, , when log in, don't need create new one. according this blog post, offline_access (getting?) deprecated. confusions: why doesn't authentication dialog display requesting offline access when authenticating user? is safe rely on persistent access_tokens? clarification appreciated! the facebook api shouldn't accessed when user isn't online. can update access token anyways, , should enough. facebook api facebook-graph-api offline access-token

jquery - All content is displayed in one row rather than in the rows they should be in -

jquery - All content is displayed in one row rather than in the rows they should be in - i have table scrollable fixed table headers, problem table rows displayed under first column (question no). why happening. can't show looks on page because server downwards can show jsfiddle of code here how can of content displayed in right rows , not content displayed in 1 row first row? it sounds want 1 table cell span width of many columns, in case you'd utilize colspan="#" # number of columns cell should span. jquery html css

linux - Bash script sort files and then dump into files -

linux - Bash script sort files and then dump into files - i need sort many files , dump many files in order of 1.csv, 2.csv, 3.csv , on each file of equal size. the next pipe sorts , dump single huge file cat input_files | sort > one_huge_file how dump multiple files? take @ useful tool: $ man split linux shell sorting

Accessing a django-piston REST API via a django view within the same project -

Accessing a django-piston REST API via a django view within the same project - i'm building little web service. showcase service can going build lite-weight interface. i'm having hard time figuring out how rest api , regular django views can play nicely together. here's setup: using django-piston build simple crud rest web service. using django views httplib2 get/post to/from web service. both beingness run same django project (and same web server). right have simple read rest service working in browser. when seek utilize httplib2 django view request hangs. my questions: -am thinking right way? -is there improve way accomplish this? -should rest web service different project (and web server) rest interface? any help appreciated! generally, i'd demonstrate api working via unit tests, rather live views, can see how might not need. so (in line akonsu's comment above) if you're experiencing problem local dev, it's single threaded dev...

c++ - How would I get a project to run in Terminal through Xcode? -

c++ - How would I get a project to run in Terminal through Xcode? - is possible me nail run in xcode , have project compiled g++ compiler open terminal window , run it? so pretty much want xcode run these commands when nail run: g++ [source] ./a.out and @ point terminal window open programme running. how (if it's possible)? i had settle running programme in terminal window kept open while coding in xcode. had xcode compile programme 'a.out' file whenever built programme in xcode. did running 'run script'. here's how did it: go screen can edit build settings. under 'targets' in side menu, click on project go 'build phases' tab , click 'add build phase' button from list drops downwards select 'add run script' then input xcode when building programme in box under shell command box. commands this: cd [path program] g++ [program] (i can't block code formatting work here). now have ma...

Removing external lua files and sprite Sheets from memory in Corona -

Removing external lua files and sprite Sheets from memory in Corona - my application has lot of sprite sheets , respective lua files.i have used director class switch between different screens , have used spritesheet:dispose() statement during screen transition. though application crashing in ipad. have cancelled timers , transitions, removed run time listeners, used collectgarbage() @ enterframe event of run time. yet application crashing. because of external files or other problem? suggestion helpful. you need provide more information: it crashing in simulator or on ipad ? if crashing in simulator, lua error in console ? did close other apps on ipad, if have many there not plenty memory app did add together listener low memory, tell whether problem memory or not: local function handlelowmemory( event ) native.showalert( "low memory!", "please consider closing other applications.." , { "ok" } ); end runtime:addeventlistener( ...

html - Space above header in ddsmoothmenu -

html - Space above header in ddsmoothmenu - i'm coding website friends i'm using ddsmoothmenu dropdowns.. there's weird spacing between header , top of body, , appears on pages.. weird, , when checking out through chromes developer options, simple cannot find reason spacing. btw, i'm using 960 gs. header gradient body background image. edit i know problem is. in head tag gets moved body, on pages weird spacing. have no thought why or how. no weird spacing, should be. http://i.imgur.com/5cl7w.jpg weird spacing! http://i.imgur.com/7gldl.png here rendered source of 1 of pages without error: <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="icon" type="image/png" href="img/favicon.ico" /> <title>armilla - forside</title> ...

html - Dynamically Sort nodes and put delimiters where it comes using XSLT -

html - Dynamically Sort nodes and put delimiters where it comes using XSLT - i have html file , want convert xml document using xslt.. i want: all nodes retained. and elements sorted. and code should in dynamically. i have comma(,)between elements need handle delimiter <dl>,</dl> comes..(not comma speces want retained) i have huge file want simple code process html nodes.here explained codeing xslt if u understand plz help me.. my html file is.. <span id="2102" class="one_biblio"> <span id="2103" class="one_section-title"><b>title</b></span> <span id="2204" class="one_authors"> <span id="2205" class="one_author">, <!--here comma arraives--> <!-- here id value misplaced --> <span id="2207" class="one_surname">surname</span>,<!--here comma arraives--> <span...

Facebook Enhanced Auth Dialog -

Facebook Enhanced Auth Dialog - the new enhanced auth dialog shows of friends using app. there way hide this? there apps more politically right not know else using it. you seek disabling social discovery in apps settings. seek setting default activity privacy "only me". facebook

php - Using Disqus for a 'Single Sign-On' on a site -

php - Using Disqus for a 'Single Sign-On' on a site - so i'd able utilize disqus allow people register site , @ same time disqus. giving letting them not have sign twice having 1 profile on site. i thinking when post disqus sign sent hook , set these details database. problem people won't know doing this. i aware disqus offer service. for $299 p/m isn't viable option. the solution write own comments scheme integrates own user system. there free single sign-on solutions don't have write code authorize facebook, twitter etc goes through 1 api. i utilize http://www.janrain.com/products/engage php javascript single-sign-on disqus

Google Earth TimeStamp animation sequence issue -

Google Earth TimeStamp animation sequence issue - i have been trying create illustration of animation in google earth (ge) plotting points on map @ different times. can't seem work. using google's kml , have looked @ documentation. the next illustration of plotting 3 points @ different timestamps. using "timestamp" tag "begin" , "end" tags inside. how show working on google documentation page, not seem work becuase time line on ge not show when open file (the timeline supposed show in ge when there "timestamp" tags in kml file). however, when alter "begin" , "end" tags "when" tag, seems sort of work not in way wanted to. know if using "begin" , "end" tags wrong? doc google gives http://code.google.com/apis/kml/documentation/kmlreference.html#timespan here illustration talking about. can open in ge saving kml file. see 3 dots show no animation. wanted happen have 1 dot ...

svn - Delete "Deleted" files from local repository -

svn - Delete "Deleted" files from local repository - how delete files have been deleted repo have not been deleted locally yet? essentially, i'm writing build script in powershell needs up-to-date changes repo , checkout, there might files deleted repo haven't yet been deleted local checkout. mean, 1 solution delete , clean checkout, that's rather expensive , take long time. svn status , "d" , delete them locally, that's rather tedious. i'd overwrite conflicts , --force checkout files need merged. is there simple command revert or checkout switch i'm missing? **edit: there 2 different cases need handle: part a) in 1 section, need leave modified in working re-create lone , checkout changes aren't conflicts or merged. need never abort, meaning want throw away has problem , maintain working/local copy. i thinking of using: svn update --accept mine-full --force (note: on root directory , not individual files) part b) in...

c# - Make correct URI for WP Game Library -

c# - Make correct URI for WP Game Library - i trying create library sounds in it, cant uris work, if utilize online uri like new uri("http://www.archive.org/download/brahmsviolinconcerto-heifetz/03iii.allegrogiocosomanontroppovivace.mp3") it works fine, issue linking correctly folders in project my in wp game librarys folder have \sounds\letters , in folder sound named a.wma my method loading public void playletter(string letter) { seek { initialize(); frameworkdispatcher.update(); var uri = new uri(@"/sounds/letters/" + letter + ".wma", urikind.relative); var song = song.fromuri("sound", uri); mediaplayer.play(song); } catch(exception e) { console.writeline(e.tostring()); } } and of course of study give string "a" parameter when fails i have included sound file in project like i ...