Posts

Showing posts from May, 2011

android - NullPointerException while trying to startActivityForResult -

android - NullPointerException while trying to startActivityForResult - edit: reply not phone call startactivityforresult on called activity object, instead invoke caller's context. this code, exception on lastly line: 107 intent intent = new intent(callingactivity.this, calledactivity.class); 108 calledactivity calledactivity = new calledactivity(); 109 calledactivity.startactivityforresult(intent, called_activity_code); inside callingactivity: @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); log.i(sr.tag,"req=" + requestcode + " res=" + resultcode); //never getting here } manifest file snippet: <activity android:name=".ui.callingactivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main" /> <category and...

php - Statement match there condition -

php - Statement match there condition - i have question regarding condition. question : combined length of 2 sides of triangle must greater length of 3rd side segments form triangle. example, 8, 6 , 12 can form triangle because sum of 2 of 3 segments greater 3rd segment. however, 24, 5, , 15 cannot form triangle because sum of segments 5 , 15 not greater length of segment 24. so, coding : $aa = $_get['a']; $bb = $_get['b']; $cc = $_get['c']; if(($aa + $bb > $cc) || ($bb + $cc > $aa) || ($aa + $cc > $bb)){ echo"triangle"; } else{ echo"not triangle"; } it can run, but, test number : 8, 6 , 12 , display triangle. number :24, 5, , 15 display triangle reply not triangle. can tell me why? tq because all of these 3 conditions must met, not single one. replace if(($aa + $bb > $cc) || ($bb + $cc > $aa) || ($aa + $cc > $bb)){ with if(($aa + $bb > $cc) && ($bb + $cc > $aa) ...

java - printStackTrace() on appengine -

java - printStackTrace() on appengine - i'm noob here. on appengine servlet gives me 500 error caused this: try{ classifiedtweet = sentanalysis.classifytext("en", "i happy"); }catch(mashapeclientexception mce){ mce.printstacktrace(); } when comment out works, want see why not working. help please update 1 i found similar here just solution doesn't work me you should see stacktrace on console itself. if uploading app appspot.com can go appengine.google.com application go logs. there find stacktrace under tag error. java google-app-engine

scala - Beginner: How do I say "any superclass of generic A" -

scala - Beginner: How do I say "any superclass of generic A" - i'm playing quicksort illustration @ start of scala example , trying adapt generic type a , rather int s. what i've got working far is def sort[a <: ordered[a]](xs: array[a]) which allows sort run on types reflexively ordered, like richboolean . but i'd allow types a extend ordered[b] b superclass of (so, instance, extends ordered[any] ). how can this? what got work, agilesteel's answer: case class x( : int ) extends ordered[x] { def compare( x : x ) = x.i - } class y( : int, j : int ) extends x(i) case class z( : int ) extends ordered[any] { def compare( : ) : int = { if (! a.isinstanceof[z] ) sys.error("whoops") val z = a.asinstanceof[z] z.i - } } object quicksort { def main( args : array[string] ) { val xs = array( 3, 1, 2, 4 ) map x sort( xs ); val ys = array( 3, 1, 2, 4 ) map { => new y(i, -i) } sort[x...

php - Only submit this.val on form when submitted? -

php - Only submit this.val on form when submitted? - i'm making form displays dynamic value , have forms action in jquery function , want take value out of $(this).closest('tr') <input type="text" class="line_order_id" value="'.$order_id.'" size="5" readonly> want take value .line_order_id , send php page process. jquery $(document).ready(function(e) { $('.viewthis').live({ click: function() { var $tr = $(this).closest('tr'); var order_id = $('.line_order_id', $tr).val(); $('form#orderslist').attr({ action: "phpdump.php", target: "_blank", }).submit(); homecoming false; } }); }); any ideas?? given existing code seems value input in question , set in order_id variable, question how set value form , submit it? if so, think 2 obvious ways set in hidden input fiel...

asp.net 4.0 - Microsoft ReportViewer over 65536 rows? -

asp.net 4.0 - Microsoft ReportViewer over 65536 rows? - i have reportviewer version 10 in webforms project. when export info excel (and theres more 65536 rows) error. guess has old/new excel file format (biff or ever). guess if export xslx solve it. here error msg: "excel rendering extension: number of rows exceeds maximum possible rows per sheet in format; rows requested: 287005, max rows: 65536" does know if theres way prepare this, can export excel file on 65536 rows/records? this sounds more excel issue but... when had similar problem, decided rather trying create study viewer work take chance process properly. i suggest not using reportviewer exporting , either write process dump info out csv or utilize 3rd party library. went csv route. there plenty of samples of using c#/vb , asp.net output csv file sql server. if want excel formatting, best utilize 3rd party dll (don't utilize office stuff requires server have office installed)...

iphone - UIKeyboardBoundsUserInfoKey Deprecated -

iphone - UIKeyboardBoundsUserInfoKey Deprecated - i trying utilize code below xcode tells me uikeyboardboundsuserinfokey deprecated , wondering newer code instead: nsvalue* avalue = [info objectforkey:uikeyboardboundsuserinfokey]; and below code in context: -(void) keyboarddidhide: (nsnotification *)notif { nsdictionary* info = [notif userinfo]; nsvalue* avalue = [info objectforkey:uikeyboardboundsuserinfokey]; cgsize keyboardsize = [avalue cgrectvalue].size; cgrect viewframe = self.view.frame; viewframe.size.height += keyboardsize.height; scrollview.frame = viewframe; if (!keyboardvisible) { //nslog(@"keyboard hidden. ignoring notification."); return; } keyboardvisible = no; } you can utilize uikeyboardframebeginuserinfokey or uikeyboardframeenduserinfokey key instead of uikeyboardboundsuserinfokey. iphone cocoa-touch

android - devicePolicyManager.lockNow() is not working for Motorola Tablets -

android - devicePolicyManager.lockNow() is not working for Motorola Tablets - public final static void lockdevice() { seek { if (devicepolicymanager.isadminactive(admincomponent)) { devicepolicymanager.locknow(); } } grab (final exception ex) { ... } } the above code not throw exception nor locks screen motorola xoom tablets only. (both homeycomb , icecream sandwitch) same code works on other homeycomb , ics tablets. i googled, did not solution. ideas.....? possible reasons problem 1) think there problem receiver's meta-data in androidmanifest.xml 2) haven't added right class(extended deviceadminreceiver) either admincomponent or android:name property of receiver. after spending lot of time on have created code. code main activity public class lockertest extends activity { protected static final int request_enable = 0; d...

c++ - Any hierarchical, tree-like editor for general use? -

c++ - Any hierarchical, tree-like editor for general use? - i using c++ editor write downwards general notes, i.e. utilize code blocks { } , multi-line comments /**/ organize text in hierarchical way. editors allow collapse/uncollapse such blocks, allowing view parts of text interested in. e.g.: { /// title { /// contents // 1. introduction // 2. basic concepts // 3. strategies // 4. key words } { /// 1. introduction /* 1 time upon time... */ /* paragraph... */ } other chapters... } this approach works quite well. readable text editor, , offers tree construction find great. however not rich in terms of features, compared classic word processor. do know of tool allows organize text file in hierarchical way, without polluting text much, remains readable when examined directly? useful features be, e.g., links other parts of text , other documents; links web; ... thank you! ...

ios public static const equiv -

ios public static const equiv - i'm trying accomplish c style version of public static const what tried doing already: classa.h extern const int features; classa.m #define the_const 123 classb.b #import classa.h initwithframe features xcode not through runtime error, rather build error of undefined symbols architecture i386: "_the_const", referenced from: ... how can share extern const class utilize well? classa.h extern const int features; classa.m const int features = <your const value here>; ios static constants public extern

perl - How can I quickly filter a hash given an array of keys? -

perl - How can I quickly filter a hash given an array of keys? - this over-engineered solution think can done better. takes array of keys create filter string, checked against every key in hash see if key has index in filter string... exclude flag flips logic include or exclude based on result of _filter. not best way. improve ways? sub _filter{ ($filter,$key,$joiner) = @_; $joiner = $joiner ? $joiner : '+'; $i = index($filter,$key); if($i >= 0){ $c; $c = substr($filter, $i-1, 1); print stderr "\nc => $c [$key][$i]"; if($i==0){ homecoming 1; } return($c eq $joiner); } homecoming 0; } sub hashfilter{ my($hash,$filter_keys,$exclude) = @_; homecoming 0 unless ishash($hash) && $filter_keys; $exclude = $exclude ? $exclude : 0; $filter = isarray($filter_keys)? join('+',@$filter_keys) : $filter_keys; print stderr "filter > $filter"; $p...

iphone - iOS How to get the content offset of a view inside a scrollview -

iphone - iOS How to get the content offset of a view inside a scrollview - lets add together 10 views scrollview. give them rect within of scrollview. there way figure out each item's offset in scrollview? i'm guessing isn't applicable here. need in essence is, "if item @ content offset in scrollview (meaning visible user in area of scrollview), this". each view's frame expressed in superview coordinate scheme (bounds). is, in case each view content offset cgrectgetminy(view.frame) . iphone objective-c

uitableview - Has the scrollviewTexturedBackgroundColor changed in iOS 5? -

uitableview - Has the scrollviewTexturedBackgroundColor changed in iOS 5? - i trying create table have twitter-like background color. please see: http://cocoacontrols.com/posts/how-to-build-the-twitter-ipad-user-experience all they utilize scrollview texture background , increment alpha 0.8 or so. darkens default apple shade. in code, next line of code works fine in ios 4.3 , gives me darker texture indeed. moving ios 5, however, it's no longer darker, or reason it's not possible me darken texture quite dark. known problem? thanks! conversationtable.backgroundcolor = [[uicolor scrollviewtexturedbackgroundcolor] colorwithalphacomponent:0.5]; try alter background color of underlaying view (perhaps window) black. default window background color (now?) white , code opposite. self.window.backgroundcolor = [uicolor blackcolor]; ios uitableview colors scrollview textures

regex - Regular expression for LaTeX with escaped } (curly brace) needed -

regex - Regular expression for LaTeX with escaped } (curly brace) needed - i started write c programme converting latex html code. best way in sentiment utilize regular expressions, yet cannot create simple thought work pcre: replace \term{abc} [pre]abc[/pre] ( \term latex command of own). right here's catch: how handle escaped curly braces ( \} ) in \term ? how handle pairs {} ? how create regular look greedy consumes first of many \term commands, not of them? well, many questions figure out. hope can help? ps: i'm sorry if, in case, have overlooked reply similar question... see perlfaq6(1) "can utilize perl regular expressions match balanced text?". said, since latex's complexity seems similar (if not worse) (x)html, might want heed words of regex match open tags except xhtml self-contained tags . regex latex pcre

Altering Notepad++ Block/Stream comment functionality -

Altering Notepad++ Block/Stream comment functionality - is there way alter way comment/uncomment menu commands work in notepad++ per language. want php comment function able <?php /* */ ?> instead of /* */ you can create user defined comment block. on image menu there dialogue window lightning bolt hover on it says user defined dialogue click it. click comment , number tab header , edit stream and/or block comment. notepad++ comments

python - Multidimentional array inside checkboxes -

python - Multidimentional array inside checkboxes - is there way can set html checkbox bidimentional array, this: <input type=checkbox name=message[group1][1] value=1> if yes, 1) how should accomplish in case illustration wrote wrong? 2) how access elements request handler in django? yes, can utilize such checkboxes names, it's string. elements on server side generate checkboxes names , values. this: def multi(request): arr = [] x in range(1, 6): cur_row = [] arr.append(cur_row) y in range(1, 6): curr_cell = bool(request.post.get('message[group%d][%d]' % (x, y))) row.append(curr_cell) homecoming httpresponse('ok') but server needs know ranges come process checkboxes. set 1..5 range example. ps. value attribute valid checkboxes? checked attribute? python django

Rails, how to get rid of html tags in my page? -

Rails, how to get rid of html tags in my page? - this .rb code under app/db/migrate folder #--- # excerpted "agile web development rails, 3rd ed.", # published pragmatic bookshelf. # copyrights apply code. may not used create training material, # courses, books, articles, , like. contact if in doubt. # create no guarantees code fit purpose. # visit http://www.pragmaticprogrammer.com/titles/rails3 more book information. #--- class addtestdata < activerecord::migration def self.up product.delete_all product.create(:title => 'pragmatic project automation', :description => %{<p> <em>pragmatic project automation</em> shows how improve consistency , repeatability of project's procedures using automation cut down risk , errors. </p> <p> put, we're going set thing called computer work doing mundane (but important) project stuff. means ...

Cleaning up cookies whenever Internet Explorer test starts with selenium 2 php webdriver -

Cleaning up cookies whenever Internet Explorer test starts with selenium 2 php webdriver - i have set of selenium 2 tests (using chibimagic's php bindings) running (phpunit) on firefox , other browsers create new profile each time test run. with net explorer doesn't happen, browsers keeps cookies whenever new test run. can of course of study undo whatever done in session in tests (logout etc) increment running time of tests (not desirable). what happen net explorer clean cookies every time new test run. tried $this->delete_all_cookies() , $this->driver->delete_all_cookies before each test doesn't seem anything. i know can set desiredcapabilities supposedly start clean session doesn't seem work. tried $this->driver = webdriver_driver::initathost("somehost.com" ,"4444", "internet explorer",array('ensuring_clean_session' => true)); and if logged in in previous set of tests, still logged in in new se...

linux - What is -lnuma and what program uses it for compilation? -

linux - What is -lnuma and what program uses it for compilation? - i compiling message passing programme using openmpi mpicxx on linux desktop. makefile following: mpicxx -c readinp.cpp mpicxx -o exp_fit driver.cpp readinp.o at point next error: /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lnuma my questions are: what -lnuma? using it? how should go linking it? the build script can't find numa library - numa (non uniform memory access). -l alternative tells linker link library, scheme ether doesn't have right 1 installed or search path linker incomplete/wrong. try querying package-manager (apt or rpm) bundle libnuma. linux compilation linker mpi

actionscript 3 - Add child on dynamic component name -

actionscript 3 - Add child on dynamic component name - as must add together image on several grouping on same form, i'd customize procédure that. indeed, actualy, have that, if(value=="17"){ gv17.addelement(imac); v17.setstyle("backgroundcolor",'#ffffff'); } my goal that: if(value=="18"){ gv18.addelement(imac); v18.setstyle("backgroundcolor",'#ffffff'); } if(value=="17"){ gv17.addelement(imac); v17.setstyle("backgroundcolor",'#ffffff'); } if(value=="16"){ gv16.addelement(imac); v16.setstyle("backgroundcolor",'#ffffff'); } do have solution solve that. indeed, think it's stupid write x times (3 in example) that. can refer object name name string...

mysql order by the same as a list that i have in a variable -

mysql order by the same as a list that i have in a variable - i pulling info has cities attached , info in order shows current city first, cities in order distance city searched. have cities in order want them shown in array called $nearby_city_array. there way pull data, in order, according shows in array? $query = "select username, city, state ... city = '" . $city . "' state = '" . $state . "' order " . $nearby_city_array . "; $result = mysql_query($query, $db) or die(mysql_error($db)); any ideas great thanks. while have found improve solution, i.e. 1 using info stored in database, else visiting question might search solution original question. this idea: create temporary table tmp_order (cntup integer auto_increment, city varchar(100)) insert tmp_order (city) values ('a'), ('b'), ... -- order select...

java - Importing netbeans to eclipse -

java - Importing netbeans to eclipse - yesterday had application netbeans imported eclipse i've got error connection database. import com.sun.crypto.provider.rsacipher; it says: access restriction: type rsacipher not accessible due restriction on required library this import working in netbeans before cant solve on eclipse, can help me? you missing jar (sunjce_provider.jar) in classpath. certainly comes netbeans eclipse has no thought hehe http://www.jarfinder.com/index.php/java/info/com.sun.crypto.provider.sunjce java eclipse netbeans

visual studio 2010 - Can't access tfs server using vs2010, 404 error returns -

visual studio 2010 - Can't access tfs server using vs2010, 404 error returns - i using vs2010 , tfs2010 work. can't access server while colleagues can. when tried access server http://mytfs:8080/, responses: balbla , 3 possible reasons , "the remote server returned error: (404) not found." i checked client settings , compare colleagues, nil different. no tfs proxy, default ie proxy setting. no path is set. no stored credentials in scheme business relationship management (windows xp), same dns/host setting. besides, can telnet server port 8080 using command window. can browse http://mytfs:8090/ using domain business relationship in web browser. moreover, admin tells me due tfs server's log, has received post request , responsed 200 ok. tried alter mytfs ip address still got 404 response. i googled problem , found much this , patch cannot installed(is says update not appply or blocked condition). can help? lot. i find problem. because tfs uti...

ruby on rails 3.1 - git push heroku stopped working? -

ruby on rails 3.1 - git push heroku stopped working? - this working till hr ago - has had happen them or can suggest solution? simply, when type git force heroku cursor sits there, blinking, not doing anything. (the force github works fine). thanks! you need monitor heroku status page for instance, right now, says: elevated error rates issue: investigating elevated error rates git push, , api operations. running apps may affected errors dyno unidling. jan 10, 2012 – 18:53 utc – 31 minutes ago git ruby-on-rails-3.1 heroku

osx - Pumping Cocoa message loop from background thread -

osx - Pumping Cocoa message loop from background thread - i have cocoa-based command line application programmatically creates nswindow + nsview. uses nexteventmatchingmask loop manually pump event loop , dispatch events. loop called upper level code periodically poll input. if run on main thread works fine in view receives input events correctly. if instead move window creation , message loop separate thread nexteventmatchingmask no longer returns events , view doesn't receive input. i'm aware "main" thread in cocoa app supposed handle events. secondary thread thread needs talk cocoa, utilize "main" thread far cocoa concerned. possible? phone call nsapplicationload thread, , far know first cocoa function called in process. if can't specify main cocoa thread then, there other way able create nswindow on background thread , receive events it? can't phone call nsapplication run because not in command of application's main loop. nee...

Implementing Chat On Facebook Web App -

Implementing Chat On Facebook Web App - this not technical question - sorry in advance . i have social web app on facebook , want give app's users ability chat between (exactly way facebook chat looks). see here options : 1 : regarding facebook chat api http://developers.facebook.com/docs/chat/ not clear me whether works user's facebook friends or have ability allow non friends chat (it of import since 99% of users aren't supposed facebook friends). read few times , seems service facebook user , facebook friends , maybe wrong ? 2 : if right , facebook chat api friends , easy , safe way implement simple chat between 2 users myself? (i not expecting millions of users on app it's not out of question app implement chat). per send message non-friend facebook user?, cannot send chat messages via api between facebook users not connected. facebook facebook-graph-api chat facebook-chat

php - curl 403 forbidden -

php - curl 403 forbidden - i getting 'you don't have permission access /rest/02/put.php on server.' message while using following. this put-service-consumer.php <?php $url = 'http://127.0.0.1/rest/02/put.php'; $fh = fopen('data.txt', 'r'); $data = file_get_contents('data.txt'); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_infile, $fh); curl_setopt($ch, curlopt_infilesize, strlen($data)); curl_setopt($ch, curlopt_put, true); curl_exec($ch); curl_close($ch); ?> this put-service.php <?php $putdata = fopen("php://input", "r"); echo $putdata."here"; $fp = fopen("put_data_file.txt", "a"); while ($data = fread($putdata, 1024)) fwrite($fp, $data); fclose($fp); fclose($putdata); ?> this illustration restful php webservice book. while examples , post works, examples delete , set isn't working. help in advance. this may ai...

Defining WebSphere MQ administrative subscriptions -

Defining WebSphere MQ administrative subscriptions - we using ibm's websphere mq, , having issues creating administrative subscriptions via scripts. 1 of params expects existing model queue reason missing our environment. maybe that's issue altogether wondering there way bypass model queue , create subscription anyways? the link i'm looking @ messages & codes manual section containing amq8464. please scroll downwards see amq8464. guess we're missing insert_3 there way around not having it. total text of error follows: if command entered alter or display, subscription specified not exist. if command entered copy, source subscription not exist. if command entered create, scheme default mq subscription not exist. thanks ideas. this error can thrown when attempting re-create or delete subscription , expected existing subscription isn't found. since attempting define subscription can assume lastly case described in error manual 1...

xml - Android Layout Weight Views Being Cut Off -

xml - Android Layout Weight Views Being Cut Off - ok have fragment want display 2 textviews , listview first textview takes little bit @ top of layout , rest of space devided evenly between textview , listview. current layout listview cutting off other 2 textviews little space. think might have layout_weight attibute. fragment_layout.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:weightsum="100"> <textview android:id="@+id/text_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="10" android:text="loading ..." android:gravity="center"/...

python - How to parse sentences, words and visemes with pyTTS -

python - How to parse sentences, words and visemes with pyTTS - i'm trying utilize pytts hear phrases. i need stuff in every sentence, word , viseme of each phrase. although can hear scheme reading text, nil happens when seek create callback functions these elements. here code: import pytts class enginetts(object): def __init__(self): phrases = ['this first utterance!', 'now speak else', 'finally conclude phrase'] self.tts = pytts.create() self.tts.subscribeword(self.onwordsentence) self.tts.speak(phrases) def onwordsentence(self, event): # never calls this... print 'this function has been called' x = enginetts() the same sentences , visemes. doing wrong? because you're not calling function since has not () @ end. should replace: self.tts.subscribeword(self.onwordsentence) with: self.tts.subscribeword(self.on...

hudson - Why are some fingerprinted files in Jenkins defined as "outside Jenkins" -

hudson - Why are some fingerprinted files in Jenkins defined as "outside Jenkins" - i have several series of jenkins jobs bound along fingerprinted files. when file fingerprinted, jenkins indicate job originated fingerprint, , used basis bindings, namely promotions. but i've got 1 job builds fingerprintable file (nothing different other jobs) , flags file fingerprinted. when jenkins shows fingerprints job, file listed orign of "outside jenkins". the file first fingerprinted in jenkins. job/build did first fingerprinting has not been deleted. , job pretty much identical in function, plugin usage, , scripts other jobs work fine. does know why happens? hudson jenkins fingerprint

php - Issue with $_SERVER['HTTP_REFERER'] , trying to redirect to last page? -

php - Issue with $_SERVER['HTTP_REFERER'] , trying to redirect to last page? - ** update script ** here sample of script i'm trying run. $lastpage = $_server['http_referer']; echo '<script>alert("'.$lastpage.'")</script>'; // gives me url need. $_session['lastpage'] = $lastpage; after content updated, i'm using window.location redirect previous page, so: echo '<script>window.location="'.$_session['lastpage'].'"</script>' the problem is, window.location directing me proper url, except it's missing colon in "http://". when alert http_referer shown in code above, gives me total url, colon , all. when seek utilize in window.location, strips out colon. any ideas? thanks! why don't redirect php? header("location: ".$_session['lastpage']); php redirect server-side

cakephp - use different layout not working -

cakephp - use different layout not working - for download action want utilize layout created pdf.ctp here action in controller function download($id = null) { $this->layout = 'pdf'; // include component app::import('component', 'pdf'); // create instance $pdf = new pdfcomponent(); // invoice name (output name) $pdf->filename = 'contract'; // without .pdf // can utilize download or browser here $pdf->output = 'download'; $pdf->init(); // render view $pdf->process(router::url('/', true) . 'pv/pdf_contract/'); $this->render(false); } but still using default layout. not sure why thanks i figured out. needed $this->layout=false in referencing method , not in actual download method. thanks cakephp cakephp-2.0

bash - Shell scripting - which word is first alphabetically? -

bash - Shell scripting - which word is first alphabetically? - how can check words first alphabetically between 2 words? illustration in code #!/bin/bash var1="apple" var2="bye" if [ $var1 \> $var2 ] echo $var1 else echo $var2 fi i want print apple, since apple comes before bye alphabetically, isnt working intended. doing wrong? the bash builtin [ allow string comparisons (it's 1 of primaries listed under conditional expressions in bash manpage) have escape them they're not treated output redirection commands. this leads rather ugly looking code. lines you'd expect work: var1=apple var2=bye if [ $var1 > $var2 ] would evaluate to: if [ 'apple' ] (which true) while creating file called bye in current directory. in fact, since you'd have reverse sense right, you're more see message: ./pax.sh: line 7: bye: no such file or directory simply reversing sense of statement working correctly, since...

Im trying to figure out how to access an image from the android default gallery and email it -

Im trying to figure out how to access an image from the android default gallery and email it - i've figured out how access default gallery, , i've figured out how utilize email function text wanna email images in gallery, how do this? going seek , utilize code bellow error keeps poping "gettempuri", overlooking, appreciate help on this. thanks public void onclick(view v) { intent photosendbutton = new intent(intent.action_send); photosendbutton.setflags(intent.flag_activity_new_task); photosendbutton.putextra(intent.extra_email, new string[]{"johnnywalker@hotmail.com"}); photosendbutton.settype("image/*"); uri parse = gettempuri("/mnt/sdcard/yourfolder"); photosendbutton.putextra(mediastore.extra_output, parse); startactivity(intent.createchooser(photosendbutton, "send mail...")); this because you're trying access method within onclicklistener. method gettempuri defined outs...

javascript - jQuery .each() does not update -

javascript - jQuery .each() does not update - i trying check if set of radio buttons has been selected. however, seems not update if radio selected after fact. the code: $('button#submit').click(function() { var addr_chkd = 0; $('input:radio[name="address"]').each(function() { if (!$(this).attr('checked')) addr_chkd++ }); }); if (addr_chkd) // when button clicked , nil selected, code works great. however, when radio button selected , button clicked, addr_chkd still returns value greater zero. [update] the issue i'm checking addr_chkd greater zero. should checking if addr_chkd equal length of radio buttons. made slight modification @ppvg's reply , did trick. $('button#submit').click(function() { var radios = $('input:radio[name="address"]'); var num_unchecked = radios.filter(':not(:checked)').length; if (num_unchecked === radios.length) {...

java - On services and @Transactional -

java - On services and @Transactional - if have service class calls 3 other service classes in row, , each of sub-services has deal dao object @ point, how can create wrapper service wraps them single transaction? simple annotating wrapper @transactional? if dao marked @transactional? if annotate outer service @transactional , daos @transactional , called service default bring together outer transaction you're hoping. java hibernate spring transactions dao

hibernate - Grails Mapping error when adding a new domain object -

hibernate - Grails Mapping error when adding a new domain object - i have created new domain object in existing grails 1.3.7 project. package com.xfitlog class implement { string name string description string abbreviation static belongsto = [exercise : exercise] static constraints = { name( nullable: false, unique: true ) description( nullable: false, maxsize: 2000 ) abbreviation( nullable: true ) } string tostring() { "${name}" } } this class links 'implement' class. class exercise{ string name string description boolean isapproved implement implement static constraints = { name ( nullable: false ) description ( nullable: false, maxsize: 5000 ) isapproved ( nullable: true ) implement ( nullable: true ) } string tostring() { "${name}" } } ...

c++ - How to properly use VAOs? -

c++ - How to properly use VAOs? - i'm getting started opengl, , i'm trying utilize 3.x , above features. 1 thing not understand vaos. i understand vao encapsulates rendering state, can phone call setup functions prior render loop , bind vao state changes made in setup. not clear on how should lay out data. should have each model in scene it's own vao, or should utilize few vaos , bind vbos of multiple models (which have read more efficient)? vao encapsulates bound buffed , vertex attributes in it. if need bind different buffer , set different attributes draw call, should assign different vao that. c++ opengl graphics

rally - Querying attributes where value is not yet set -

rally - Querying attributes where value is not yet set - any of guys know how query rally set of things string attribute value not yet set? can’t query value equal empty string. doesn’t parse. , can’t utilize “null” either. or rather, can seek “null” , parses fine doesn’t result in finding anything. query = @rally_api.find(:defect, :fetch =>true, :project_scope_up => false, :project_scope_down => false, :workspace => @workspace, :project => @project) { equals :integration_i_d, "" } this followed telling me substitute "" nil didn't work. null tried no success well. i've tried "null" , null , "". none of them work. i'm not familiar our ruby rest toolkit straight hitting our wsapi, (<field> = null) . notice there no quotes around "null". also, i'm wondering if utilize of contains in illustration above want...

c++ - String size undesirable output -

c++ - String size undesirable output - i not able find bug in little piece of code. wrong it? string f,s; f[0] = 'd'; s.append(f); cout<<f.length()<<" "<<f<<" "<<f[0]<<endl; cout<<s.length()<<" "<<s<<" "<<s[0]<<endl; output : 0 d 0 d even if alter s.length s.size , result same. why s[0] = 'd' , s.size() = 0; ? both strings empty when create them, contain no characters. f[0] out of bounds, , accessing element of empty container undefined behaviour, can legally happen. you need do string f(1, 'd'), s; // creates f 1 repetition of 'd' s.append(f); ... or string f, s; f += 'd'; // or f.push_back('d'), or f.append('d'), or... s.append(f); ... c++ string

Obtain first line of a string in PHP -

Obtain first line of a string in PHP - in php 5.3 there nice function seems want: strstr(input,"\n",true) unfortunately, server runs php 5.2.17 , optional 3rd parameter of strstr not available. there way accomplish in previous versions in 1 line? here go $str = strtok($input, "\n"); php string newline strstr

mysql - Programmatically identify django many-to-many links -

mysql - Programmatically identify django many-to-many links - i'd automatically generate list of objects many-to-many links. let's have 5 models: model 1 has m2m link model 2 model 2 has m2m link models 3 , 4 model 4 has m2m link model 5 if user adds object model 1, want give them alternative add together model 1 or add together model 2 if user adds object model 2, want give them alternative add together model 2, or add together model 1, 3, or 4. if user adds object model 4, want give them alternative add together model 4 or model 5/2. etc. is there way observe these relationships (forward , backward) automatically? you can access m2m relation fields via model1()._meta.many_to_many homecoming m2m relations, including genericrelations . mysql django many-to-many

java - What is arithmetic left shift of 01001001? -

java - What is arithmetic left shift of 01001001? - i think 00010010 i.e. tries maintain sign bit is on other hand, logical left shift 1 pos 10010010 is correct? for left shift, arithmetic , logical shift same. the difference right shift only, arithmetic right shift re-create old msb new msb after having shifted, keeping negative number beingness converted positive when shifting. wikipedia has more detailed explanation. java bit-manipulation

wordpress - After changing the common settings of permalinks to "post name", Now my navigation menu is not working -

wordpress - After changing the common settings of permalinks to "post name", Now my navigation menu is not working - i have installed wordpress , create pages default permalinks settings. these pages displaying in navigation menu. when changed permalinks mutual settings "post name" instead of default, links on site working pages in navigation menu not working. redirects me page not found error message. what can problem? your navigation menu might hardcoded in theme's header.php file, when changed permalink structure, old links pointing nonexistent pages. wordpress permalinks

orm - How to use @Formula (in Hibernate) to refer to the same (current) object -

orm - How to use @Formula (in Hibernate) to refer to the same (current) object - i have class @entity @table(name = "db.appl_session") @attributeoverrides({@attributeoverride(name = "id", column = @column(name = "appl_session_id"))}) @sequencegenerator(name = "tablesequence", sequencename = "db.appl_session_sq") public class aisession{ @formula("(select sum(nvl(budg.amt_ov,budg.amt)) db.budget budg budg.appl_session_id = appl_session_id)") private localdate realsessionstartdate; in above formula working db.budget object , current object id ( appl_session_id). wanted work next fellow member variable (startdate) in aidapplicantyearsession class @basic @temporal(temporaltype.date) @column(name = "start_ov_dt") private date overridestartdate; how should write formula looks above on uses object's fellow member variable ? came with @formula("(select start_ov_dt db.appl_session)") i...

objective c - prepareForSegue is not called after performSegue:withIdentifier: with popover style -

objective c - prepareForSegue is not called after performSegue:withIdentifier: with popover style - i have universal app, sharing same controller ipad , iphone storyboard. have set uilongpressgesturerecognizer on uitableview, when cell pressed on iphone calls action perform segue: -(ibaction)showdetail:(id)sender { uilongpressgesturerecognizer *gesture = (uilongpressgesturerecognizer*)sender; if (gesture.state == uigesturerecognizerstatebegan) { cgpoint p = [gesture locationinview:self.thetableview]; nsindexpath *indexpath = [self.thetableview indexpathforrowatpoint:p]; if (indexpath != nil) { [self performseguewithidentifier:segue_detail sender:indexpath]; } } } the segue detail view performed 'push'. first thing should notice sender nsindexpath, way found passing selected cell. maybe there's improve solution. works fine, in sense segue performed, , before prepareforsegue called too. however happens on...

Moving jQuery code into a function? -

Moving jQuery code into a function? - i have next code apply when document ready: $(document).ready(function () { $('#updatedialog').dialog({ autoopen: false, width: 400, resizable: false, modal: true, buttons: { "update": function () { $("#update-message").html(''); //make sure there nil on message before go on $("#updatereferenceform").submit(); }, "cancel": function () { $(this).dialog("close"); } } }); }); is there way can take actions of code , move function. have 1 line phone call function within $(document).ready(function () { yes it's simple: function foo() { $('#updatedialog').dialog({ autoopen: false, width: 400, resizable: false, moda...

java - How to determine if 48 hours has passed from a specific time? -

java - How to determine if 48 hours has passed from a specific time? - i looking check , see if 48 hours has pasted specific time? using date time format (yyyy/mm/dd hh:mm:ss) there java function this? sure. advice pick joda datetime. but grab milliseconds 2 dates , subtract them. pass them hours , check if more 48 have passed. // pseudo-code datetime = new datetime("old time"); datetime b = new datetime(" "); // hours double hours = (a.getmillis() - b.getmillis()) / 1000 / 60 / 60; if(hours>48) ... java time

jquery - Animating the background color of a page automatically when a page loads -

jquery - Animating the background color of a page automatically when a page loads - possible duplicate: jquery animate backgroundcolor is possible animate/transition background-color of element automatically when page loads? i have page info this: <ul> <li> stuff</li> <li> other stuff</li> <li class="unread"> more stuff</li> </ul> for elements .unread class want background image start off lite yellowish color , have fade regular page background-color (which white in case) think of new pm or notification on facebook, effect trying achieve. you utilize css property transition ; html <div class="transition"></div> css div.transition { height: 100px; width: 100px; background-color: #ffffff; transition: background-color 1s linear; -moz-transition: background-color 1s linear; -o-transition: background-color 1s linear; -webkit-...

Error in pointer arithmetic (OpenCL) -

Error in pointer arithmetic (OpenCL) - can explain me why code doesn't work? __kernel void foo(__global const void* a) { __global const uchar* currentposition = (__global uchar*) a; // update position currentposition += 4; } when seek read value of currentposition after increment same result when don't arithmetic. why happening? thank you. it's 'const' keyword declare currentposition. c++ not allow modify values. set currentposition when declare it. opencl

dynamics nav - Automatic generate a sales order line for every sales order -

dynamics nav - Automatic generate a sales order line for every sales order - im experimenting dynamics nav 2009. there way automatically insert sales line every time create new sales order? want postage stamp included everytime im making new sales order. this alter require modification nav partner. the modification add together c/al code automatically insert new sales line every time new sales header record created. oninsert() salesline.init; salesline."document type" := "document type"; salesline."document no." := "no."; salesline."line no." := 0; // additional code salesline.insert(true); sales dynamics-nav

css - @font-face not displaying on Internet Explorer -

css - @font-face not displaying on Internet Explorer - i using bulletproof syntax , converted fonts font-squirrel fonts on www.runningwithpurpose.org.nz (fonts inline css in html - working) www.runningwithpurpose.org.nz/broken (fonts in css file - not working) . both methods display fontes fine on browsers other ie display or fonts , other times not @ (but not @ all). have tried playing around htaccess file, using 'smiley' syntax neither worked. did manage prepare putting font css inline in html file. ok wondering why seem unable working many other people have @font-face declarations in css file much cleaner , used work fine me doesn't. any suggestions on how working great, considering no other existing help has worked. one of @font-face declarations used @font-face { font-family: 'aller-regular'; src: url('assets/fonts/aller-regular.eot'); src: url('assets/fonts/aller-regular.eot?#iefix') format('embedded-opentype...

How to trigger the events fom android code and handle them in html page? -

How to trigger the events fom android code and handle them in html page? - i want embed youtube player in android. , want command player of own triggering events android code. best way this. , how handle events. naive , can handle html event using java script .. in android phone call websppas . u can larn more form here and can find illustration how work form here android html youtube

python - client connection id passed from nginx to uwsgi -

python - client connection id passed from nginx to uwsgi - i using next setup: client -> nginx -> uwsgi -> python app the connection between client , nginx persistent. aware there no back upwards persistent connection between nginx , uwsgi. is there way pass nginx connection id uwsgi can differentiate between clients? trying differentiate between clients next limitation: client not back upwards cookies , cannot modify client code. client posts json same url modifying urls not apply here. two solutions come mind: link client ip address and/or other headers client sending; upon first connection create session id , alter links on page /link/to/page?sid=%(sessionid)s . it's not pretty works. python http nginx wsgi uwsgi

cout - How to get window to stay open after C++ code runs? -

cout - How to get window to stay open after C++ code runs? - possible duplicate: how stop c++ console application exiting immediately? i trying see results, do code can see if did correct? #include <iostream> using namespace std; int main() { cout << "c++" << endl; cout << "the sum of 11 + 12 = " << 30/2 << endl; homecoming 0; } i think mean dos terminal closes programme ends. a mutual solution have phone call cin , scanf or getch @ end of program, before return 0 . forces programme wait user input before exiting. a improve way compile programme , run within dos prompt yourself. start dos prompt, cd directory programme in , run there. c++ cout dev-c++

PHP error reporting off -

PHP error reporting off - this question has reply here: how prepare “headers sent” error in php 11 answers i getting error: warning: session_start() [function.session-start]: cannot send session cache limiter - headers sent how completly turn off error reporting server, php. ini file has: error_reporting = off display_errors = off but still shows error. check php load right php.ini file. utilize phpinfo() see loaded one. grep code find if there code ini_set('display_errors', true) override php.ini settings. besides of doing above 2, should prepare error. php

Cut out text in CSS. Possible? -

Cut out text in CSS. Possible? - this question has reply here: how apply inverse text mask css 3 answers say, have: <div class="outer"> <div class="inner"> <span class="text">hello!</span> </div> </div> the 'outer' div has linear gradient background. 'inner' div has bluish background. possible create text color same color of 'outer' div. sort of text mask effect: you can false using text transparency kp mentioned. first, apply same gradient span have on outer div. then, apply bluish background inner div , text it's been knocked out. have sample fiddle here. here's article details technique. remember, first technique not work in ie. if want accomplish similar effect in ie can utilize technique shown here. technique requires png, , mark...

java - Can we override the spring beans declared in one xml config in another config? -

java - Can we override the spring beans declared in one xml config in another config? - i newbie spring question might have easy reply please bear me if i'm asking silly. i have global spring config file want utilize in many applications , override properties of few beans differently in different applications. can suggest best way this? for example, i've in global.xml . <bean id="testinstance" class="testclass"> <property name="mem1" ref="val1"/> <property name="mem2" ref="val2"/> </bean> now, want refer testinstance different spring config , utilize after overriding mem1 . possible in spring? need utilize custom tags that? you can override bean defined in xml in xml config. if want leverage @configuration same out of luck. spring not allow that. https://jira.springsource.org/browse/spr-9567 java spring

wpf - Different template on different ListBoxItem value without DataTemplateSelector? -

wpf - Different template on different ListBoxItem value without DataTemplateSelector? - as title, possible? i have seen in treeview can defines different hierarchicaldatatemplate different datatype using datatype attribute, doens't need datatemplateselector. so wonder if possible take template according binded value without using datatemplateselector? in condition, simple, if info object's property = 1, display template1, 2 template2. is possible without datatemplateselector? yes, can utilize datatrigger <style targettype="{x:type listboxitem}"> <setter property="template" value="{staticresource defaulttemplate}" /> <style.triggers> <datatrigger binding="{binding someproperty}" value="2"> <setter property="template" value="{staticresource template2}" /> </datatrigger> </style.triggers> </style> ...

java - Adding children to GridLayout dynamically -

java - Adding children to GridLayout dynamically - i have app display grid of same image, based on dimensions chosen user. i'm using gridlayout build grid, far, have been unable figure out way set children (multiples of image) in java code size of grid , number of children alter settings. suggestions? i found should work me. in blog post announcing gridlayout, posted this code pretty shows how add together grid. java android dynamic dimensions grid-layout

jsf - Pass values between Managed Beans of different pages -

jsf - Pass values between Managed Beans of different pages - i can't pass values between 2 managed beans of different pages. implementing search box jsf component in home page. request values , when user hits search goes search result page. search result page has jsf component search resukts needs access selection in managed bean correspond search box home page. i have tried using injection seams managed bean box reintialized, showing default value. pick involvement search box, i.e. cinema, click search takes me search result, hope see cinema see sport defualt value. please find code below. search result managed bean import javax.el.elcontext; import javax.faces.bean.applicationscoped; import javax.faces.bean.managedbean; import javax.faces.bean.managedproperty; import javax.faces.bean.requestscoped; import javax.faces.context.facescontext; @managedbean @applicationscoped public class expsearchresultsmb { /** creates new instance of expsearchresultsmb */ p...

winforms - How to change listview header's forecolor? C# windows form application -

winforms - How to change listview header's forecolor? C# windows form application - i know can alter ownerdraw property true , handle drawcolumnheader event if this, have take care of in drawing header. is there anyway alter foreground color , else drawn defaults? how this: create new winform project, drag listview command onto form, set ownerdraw = true, view = details in properties pane, handle drawcolumnheader event. namespace windowsformsapplication1 { public partial class form1 : form { public form1() { initializecomponent(); this.setlastcolumnwidth(); this.thelistview.layout += delegate { this.setlastcolumnwidth(); }; } private void setlastcolumnwidth() { // forcefulness lastly listview column width occupy // available space. this.thelistview.columns[ this.thelistview.columns.count - 1 ]....

ios - password with percentage symbol always wrong iPhone -

ios - password with percentage symbol always wrong iPhone - i'm developing iphone application in xcode login function , i'm having problem next code: nsstring *post = [nsstring stringwithformat:@"username=%@&password=%@",[nsstring stringwithformat:@"%@",username],password]; nslog(post); nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:[nsurl urlwithstring:url]]; nsdata *postdata = [post datausingencoding:nsasciistringencoding]; [request sethttpmethod:@"post"]; [request addvalue:[nsstring stringwithformat:@"%@",username] forhttpheaderfield:@"username"]; [request addvalue:password forhttpheaderfield:@"password"]; [request sethttpbody:postdata]; action = @"token"; nsurlconnection *connection; connection = [[nsurlconnection alloc] initwithrequest:request delegate:self]; now there fellow member password %32dzs3* , app gives error password incorrect. when nslog password it's...

compiler construction - Is this C++ code portable? -

compiler construction - Is this C++ code portable? - struct { int a; virtual void print() {} }; struct b : { int b; virtual void print() {} }; int main(void) { *a = new b; a[0].print(); // g++, vs2010, clang phone call b::print. } all 3 g++, vs2010, clang phone call b::print. doubting c++ 101. under impression using dot object not result in dynamic dispatch. -> pointer , dot reference result in dynamic dispatch. so question whether code portable? a[0] same *a , , look reference a , , virtual dispatch happens through references through pointers. a->print() , (*a).print() exclusively identical. c++ compiler-construction virtual portability

GIS application with django and google maps using mongodb -

GIS application with django and google maps using mongodb - i developing gis application using google maps api. using postgis db. i considering switching mongodb , have next questions this, is mongodb viable selection storing gis data. ( other nosql engine viable?) does django-nonrel has modified django.contrib.gis module mongodb support? , how work? thanks in advance :) as stated sergio tulentsev, mongodb has spatial indexes. but, not geometry types can stored. far know, points can stored. can, however, query using polygon. since mongodb flexible, store geometry text, json object. example, store coordinate like: { lon: 52.1234, lat: 14.1245 }. can interpret on own application like. the downside there no native index. if never have query based on location/spatial relation, fine. if have query based on location/spatial relation, have write own index. can hard thing do... there couchdb has geospatial addition. don't know how works/what supports though. ...

ruby on rails - Master slave replication with replica latency in mind -

ruby on rails - Master slave replication with replica latency in mind - i working on ruby on rails application in production. this application needs master/slave database replication. i using octopus gem that. the problem have staging env working past week or so, in staging env have setup alerts on amazon rds. i see replica latency 10 seconds (it's 100 seconds sometimes). how handle in application, thinking have several instances running, under load balancer, , have background jobs running (using resque)? if looking simple master/slave replication of data, have considered doing @ database rather application level. i run several master/slave , master/master setups using mysql replication, tends maintain replication latency low on reasonably fast wan connection . it's not synchronous, sounds that's not requirement in case. ruby-on-rails ruby ruby-on-rails-3 master-slave

c# - url which references an object -

c# - url which references an object - i'm trying implement silverlight timeline application. problem if want fill timeline need refer xml file via url: <timeline:timelinetray.urls> <timeline:uriinfo url="http://localhost:4444/monet.xml" /> </timeline:timelinetray.urls> but elements shown on timeline aren't static. there several pages we're gonna utilize timeline. on runtime generate new, edit , delete items. had generate dynamic xml "document" via xdocument class (silverlight). worked fine saw have reference xml document via url: urls ';' delimited list of info xmls events show. need specify parameter or timeline appear blank. so well, how can solve problem? way bind xdocument viewmodel timeline won't work. don't want save generated xdocument able reference it. there way? edit: found solution. it's through codebehind, though: var doc = new xdocument( // stuff you'd ); ti...

python - Should I include the function that I am testing inside the unittest file, or should I just import it in the unittest file? -

python - Should I include the function that I am testing inside the unittest file, or should I just import it in the unittest file? - i want inquire if should include function testing within unittest file (such have 1 file, unittest.py), or should import in unittest file (i have 2 files, unittest.py , function.py). seeing both methods when read in web, find first testing described redundant. two separate files of course. thought unit test should non-intrusive , should sit down in own file, set under test directory and/or named test_*. have never seen people set in same file unless trivial demo. python unit-testing function

javascript - feed button for facebook not working -

javascript - feed button for facebook not working - $i got next in js consol error error occurred sharebutton. please seek later api error code: 191 api error description: specified url not owned application error message: redirect_uri not owned application. while putting configuration follow app display name: app namespace: contact email: app domain: www.somthing.com ------------------------------------js <script> window.fbasyncinit= function() { fb.init({ appid : '204143816348127', // app id status : true, // check login status cookie : true, // enable cookies allow server access session xfbml : true // parse xfbml }); // additional initialization code here }; // load sdk asynchronously (function(d){ var js, id = 'facebook-jssdk'; if (d.getelementbyid(id)) {return;} js = d.createelement('script'); js.id = id; js.async = true; js.src = "//connect...

qt creator - Linking with libpng in Qt -

qt creator - Linking with libpng in Qt - i'm trying compile project uses both qt framework , libpng. having errors previous version of libpng downloaded newer code-base , next errors when seek build project: running build steps project mytool-win-cli... configuration unchanged, skipping qmake step. starting: "c:\qtsdk\mingw\bin\mingw32-make.exe" c:/qtsdk/mingw/bin/mingw32-make -f makefile.debug mingw32-make[1]: entering directory `c:/_src/mytool-win-cli-build-desktop-qt_4_7_4_for_desktop_-_mingw_4_4__qt_sdk__debug' g++ -mthreads -wl,-subsystem,windows -o debug\mytool-win-cli.exe debug/main.o -l"c:\qtsdk\desktop\qt\4.7.4\mingw\lib" -lmingw32 -lqtmaind -lpng -lqtguid4 -lqtcored4 -lc:\openssl-win32_full\lib c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libpng.a(libpng14_la-pngread.o): in function `png_create_read_struct_2': /usr/src/packages/libpng/14/libpng-1.4.8-1/src/libpng-1.4.8/pngread.c:90: undefined reference `setjmp' c:/qtsdk...

c++ - How to compile a program in wxSmith ( Codeblocks ) with all the libraries? -

c++ - How to compile a program in wxSmith ( Codeblocks ) with all the libraries? - i have created programme in codeblocks (wxwidgets application) have compiled , runs when executed codeblocks interface ....however when go release folder , run executable gives me *.dll file errors :/ how create programme ? there's chance code:blocks has default setting executable path includes path libraries. windows finds dlls using path environment variable ensure application works within codeblocks. however in order run outside codeblocks you'd need either re-create dependencies directory holds application or you'll have set path variable include directories hold dependencies. c++ visual-c++ wxpython wxwidgets codeblocks

oauth - Facebook access Token with longer expiration -

oauth - Facebook access Token with longer expiration - i trying follow this tutorial on getting token longer expiration time . facebook connect done on client side (js sdk). steps take are: enabled 'deprecate offline_access' on app settings page retreive access_token normal curl "https://graph.facebook.com/oauth/access_token? client_id=app_id& client_secret=app_secret& grant_type=fb_exchange_token& fb_exchange_token=access_token" this returns same exact same access token expiration of 2 hours, shouldn't homecoming token (same or not access_token) valid 60 days ? thanks as of right now, in experience, seems 60 day tokens returned new users add together app after 'deprecate offline_access' setting enabled. older users, prior setting 'deprecate offline_access' setting seem stuck @ 2 hr lifetime. i have tests seem indicate setting 'enhanced auth dialog' setting in add-on 'deprecate off...

time series - R: grouping/splitting a dataset by categories in combination with apply.weekly() -

time series - R: grouping/splitting a dataset by categories in combination with apply.weekly() - intro i not r expert yet please excuse question should embarassed of ask. in another question asked on stackoverflow got helpful comments on how aggregate unregularly daily info of xts object weekly values apply.weekly() function. unfortunately didn't find function tapply() , ddply() , by() or aggregate() allows split categories works apply.weekly() function. my data this illustration dataset. posted in other question. illustration purposes taking liberty post here: example <- as.data.frame(structure(c(" 1", " 2", " 1", " 2", " 1", " 1", " 2", " 1", " 2", " 1", " 2", " 3", " 1", " 1", " 2", " 2", " 3", " 1", " 2", " 2", " 1", " 2", " 1...