Posts

Showing posts from May, 2015

java - How can I create Kinematic Objects in jBullet? -

i trying make game engine , want camera controlled player , effected other jbullet entities in java . got suggested use kinematic objects looked them. couldn't find documentation understand. can explain how set , use kinematic objects or @ least show me can start? the documentation kinematiccharactercontroller, found here isn't entirely helpful, source in characterdemo can be. 2 main properties defined in demo. public kinematiccharactercontroller character; public paircachingghostobject ghostobject; the ghost can used dynamic collision detection, not automatically react events. character can moved changing transform. //from source src\com\bulletphysics\demos\character\characterdemo.java transform starttransform = new transform(); starttransform.setidentity(); starttransform.origin.set(0.0f, 4.0f, 0.0f); vector3f worldmin = new vector3f(-1000f,-1000f,-1000f); vector3f worldmax = new vector3f(1000f,1000f,1000f); axisswee

css3 - Combined Box Shadow Transition and Border Transition not working. -

i have textarea , on focus animate both border shadow , border radius, problem if try combine 2 border radius animation not work "pops out" without animation. have created fiddle show problem. code looks this: textarea{ display: block; padding-left: 3px; padding-right: 3px; border: 1px solid #e7e7e7; box-shadow: 0 0 3px #e7e7e7; background: none; color: #6b6b6b; max-width: 100%; } textarea:focus { outline: none; box-shadow: 0 0 25px #9ecaed; -webkit-transition: box-shadow linear 1s; transition: box-shadow linear 1s; border-color: #9ecaed; transition : border 500ms ease-out; -webkit-transition : border 500ms ease-out; -moz-transition : border 500ms ease-out; -o-transition : border 500ms ease-out; } css doesn't work way you're expecting to. after setting transition: box-shadow linear 1s; overriding transition : border 500ms ease-out; . have set them both on same property. like ( fiddle ): textarea:focus { outline: none;

python - Connecting iOS app to Windows/Linux apps -

background: i start development on mobile , desktop app. both connected local wifi network (no internet connection) , need communicate 1 another. @ outset targeting ios , windows 2 platforms, intention of adding linux, osx, , android support in order. desktop app largely database server/notification center receiving updates ios apps , sending out data other ios apps. there may front end desktop app, incorporate ios app if needed. for moment want ios app automatically detect when on same network server , display data sent server (bonjour like). as far see there 2 paths take implement this create native app each platform (windows, linux, osx). pro: ideas of having native apps performance , ease of install. con: know absolutely nothing windows or linux development. create app built using web technologies (probably python) , create easy use installer create local server out of desktop machine mobile apps can communicate with. pro: of development cross-platform , installer sh

android - What conditions must be met for TestFlight to send activities to the server? -

i'm trying understand: on android, how testflight determine in beta-tester environment, , should upload activity testflight server? there have been similar questions asking testflight on ios, none related android. i've integrated testflight sdk company's android app because looked great solution beta-testing , remote logging (we use ios), i'm can't send session information testflight server. once install app through testflight app, see installed through testflight web console, , then... nada. no session data or remote logs, though should getting something. what have done far: quadruple-checked testflight api key verified testflight.takeoff() getting called verified testflight.isactive() reports true tried signing apk debug-only key tried signing apk our release key checked android log errors related testflight (none) contacted testflight support couple days ago (i've made contact, no progress yet) my current guess testflight lib thin

android - Bad Listview Performance on Nexus 4, good on Nexus 7 -

i developing android application @ moment. application has deal large lists alot (thousands of entries, it's playlist). to add possibility reorder entries, use drag-sort-listview library. additionally, each row has progressbar in it. bar visible on current item (so 1 whole list). however, running huge performance problems on nexus 4 (cm 10.1.2 final), while performance @ nexus 7 (2012, stock). tracked cpu usage while scrolling list fast can (without using fastscroll mechanism. on nexus 7, cpu usage stayed below 30%, on nexus 4 hit 80% , list extremely laggy. logcat output had line i/choreographer(639): skipped xx frames! application may doing work on main thread. a few times , ui felt render 1fps. the problem can't imagine reason this. using viewholder pattern in adapter. because of custom fonts, using font cache. the getview() method of adapter: @override public view getview(int position, view convertview, viewgroup arg2) { playlistitem playlistitem = items

ios - viewWillLayoutSubviews getting called after applicationDidEnterBackground notification -

i'm having issue app crashing on sleep, , on home. i'm getting bad_access error in thread called gpus_returnnotpermittedkillclient , tells me app making ui changes in background, understanding no-go. therefore, i'm stepping through code see happens on home / sleep, , find breakpoint in vc's -viewwilllayoutsubviews method getting hit after breakpoints in -applicationwillresignactive , -appplicationdidenterbackground notifications (in i'm attempting stop updates asynchronous callback function). that doesn't seem make sense. application's perspective, if it's not cool ui updates in background, why call viewwilllayoutsubviews after you're in background? edit: appears when app doesn't crash. lldb getting things out of order? i think need tolerant of this. per tech note , can't gles rendering in background. recommendation app set flag when applicationwillresignactive called, , before doing rendering work check flag , don'

Auto-submit HTML Form using VB in Access 2007 -

i'm @ wit's end on one. part of project i'm working on requires interaction html form bring correct page on external web-based tool. i've managed make form accept entered variables , generated on fly using document.write, haven't been able reliably trigger 'submit' action in way not throw off error 91. so far, i've been using simple getelementbyid.click call... here's list of few things i've tried trigger: testloop: pause (1) browsercontrol.document.getelementbyid("submit").click on error goto testloop *(the 'error loop' tactic didn't work @ all.) pause (3) browsercontrol.document.getelementbyid("submit").click (this works best, because different pcs might have different hardware specs , open applications might slow down, works me hasn't been working tester. if make long, end adding additional delay form i'm worried being slow.) <script type="text/javascript"&

vb.net - Sorting List(Of MaskedTextBox) -

the list private msklistclass1 new list(of maskedtextbox) contains following maskedtextbox controls after executing following code each ctrl control in me.pnlclass11.controls if typeof ctrl maskedtextbox msklistclass1.add(ctrl) end if next seat112 seat212 seat312 seat412 seat512 seat612 seat122 seat222 seat322 seat422 seat522 seat622 but aren't in order have shown above suppose. when try assign values these controls in sequential manner don't assigned in order. i tried following code for = 0 11 step 1 msklistclass1(i).text = rno312(i) next the assignment expect seat112 1138m0321 seat212 1138m0322 seat312 1138m0323 seat412 1138m0324 seat512 1138m0325 seat612 1138m0326 but aren't getting assigned in order there possibility sort list msklistclass1 this line gives me following output msklistclass1.sort(function(x, y) x.name.compareto(y.name)) seat111 1138m0321 seat121 1138m0321 seat211 1138m0323 seat221 1138m0324 seat

c# - WCF Callback failing due to object not being initialized (Duplex) -

so have object raises events , wcf service hosted within windows service. the raised events in class within windows service , wcf service subscribes events , when events fire meant callback client let client know happened on part of windows service. the issues @ times callbacks work , @ times not. have checks see if there clients call if not don't bother. not sure best way implement because @ times the: call = operationcontext.current.getcallbackchannel<iriskeodwcfevents>(); gets callback @ other times exceptions out or set null because event coming wcf service coming part of windows service (a class) rather operationcontext. in short how can setup wcf service alert clients when events occurred in part of windows service? (more code) before publishing out events check (only care publish when have clients): private void publish(eodevent eodlistevent, eoditem item) { if ( _eodeventsubscribers == null || _eodeventsubscribers.count

My app uses Audio Unit to play mp3 files in IOS, but when the screen off, the sound stopped -

my app uses audiounit play mp3 files, totally used remoteio, newtimepitch, auconverter , multichannelmixer 4 audiounits. my app play when screen locked, can not play while screen off! even more strangely, issue happens in iphone4s(v6.1.3), works fine in iphone5(v6.1.4)! here audio-unit setting code: // connect audio unit: converter -> timepitch -> output osexcute( augraphconnectnodeinput(processinggraph, converternode, 0, timepitchnode, 0) ); osexcute( augraphconnectnodeinput(processinggraph, timepitchnode, 0, mixernode, 0) ); osexcute( augraphconnectnodeinput(processinggraph, mixernode, 0, eqnode, 0) ); osexcute( augraphconnectnodeinput(processinggraph, eqnode, 0, outputnode, 0) ); // try fix no sound issue, not work uint32 maximumframesperslice = 4096; osexcute( audiounitsetproperty(mixerunit, kaudiounitproperty_maximumframesperslice, kaudiounitscope_global, 0, &maximumframesperslice, sizeof (maximumframesperslice))); i have fixed issue. solution i

Does it matter what I name a C file? -

in java, required compiler name files <classname>.java . in c, matter file name is? no, source files can in principle called anything. however, name should reflect contents of file readability. header files don't have called same corresponding source files; should .

c# - XAML ObjectDataProvider, ObjectType Error -

i'm trying instantiate object (that created in c#) in xaml using objectdataprovider. unfortunately, i'm receiving following error: "the type reference cannot find public type named 'typename'". have .cs file of same name the typename. here's xaml: <window x:class="projectname.projectfile" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:local="clr-namespace:projectname" title="projectfile" height="500" width="500"> <window.resources> <resourcedictionary> <!-- line 9 1 right below one. --> <objectdataprovider x:key="name1" objecttype="{x:type typename}"/> <objectdataprovider x:key="name2"

android - How to open file:/// in Phonegap window.open system browser -

i want open file saved in local system example: file:/// in device broswer whe click on anchor link. i've tried this: <a href="#" id="examplelink" data-href="file:///mnt/sdcard/documents/third/index.html" class="load-swf">load swf1</a> so: $( '#examplelink' ).on('tap', function() { var url = $( ).data( 'href' ); navigator.app.loadurl( encodeuri( url ), { openexternal:true }); }); but doesn't work... if try url http://www.google.com.co/ works perfectly.... using file:/// not going well...

JavaScript: Dynamically create array -

i'm trying dynamically create array 1 in javascript. have string mathematical literal expression '2a + 3b + 4a + 5c': want split array literal part of number (ex. 'a,b,a,c'). i've tried use following code : var expression = '2a + 3b + 4a + 5c'; var numbersarray = expression.split(' + '); /* numbersarray = 2a,3b,4a,5c */ alert('so far it's working!'); var lettersarray = new array(); (var = 0; < numbersarray.length; i++) { eval('var lettersarray[' + + '] = numbersarray[' + + '].replace(/[0-9]/g,"");'); alert(eval('lettersarray[' + + ']')); } but doesn't work! how can fix it? lots of errors here, tried comment of fixes: var expression = '2a + 3b + 4a + 5c'; var numbersarray = expression.split(' + '); /* numbersarray = 2a,3b,4a,5c */ //using single quotes inside single quotes doesn't work without escaping, try double quotes instead a

css - Why is the logo hiding in IE7? -

i finishing small website , noticed in ie7 logo hiding behind image on home page: http://reapvalue.com/ here html: <div id="wrap"> <div id="header"> <ul id="main-nav"> <li><a href="/about/">about</a></li> <li><a href="/what-we-do/">what do</a></li> <li class="last"><a href="/contact/">contact</a></li> </ul> <h1><a href="/"><img id="logo" src="/photos/logo.png" alt="reap - renewable energy , preservation, april montgomery, llc." ></a></h1> <h1><a href="/"><img id="logo-small" src="/photos/logo-small.png" alt="reap - renewable energy , preservation, april montgomery, llc." ></a></h1> </div><!-- end #header --> <div id="tagline">

animation - Pull Down Map Android - Facebook Effect -

i working on prototype have 2 fragments in linearlayout. here xml looks like: <linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <framelayout android:id="@+id/map_holder" android:layout_width="match_parent" android:layout_height="0dp" android:layout_above="@id/footer" android:layout_weight=".30" > </framelayout> <framelayout android:id="@+id/list_holder" android:layout_width="match_parent" android:layout_height="0dp" android:layout_above="@id/footer" android:layout_weight=".70" > </framelayout> </linearlayout> the top fragment map fragment , bottom fragment list of items. trying expand map when user clic

Android LWP, How to refresh RenderScript objects after Setting Preferences Changes? -

i have developed android lwp using renderscript. want add setting page , use preferences save option values. eg. initial objects quantity 10. user can change objects quantity 20. i cannot update/refresh/reset/recall renderscript regenerate new setting. how it? i have managed onsharedpreferencechanged, how call in order regenerate lwp new setting after user click? public void onsharedpreferencechanged(sharedpreferences sharedpreferences, string key) { //how force renderscript update here } in fact, need know "how refresh/clear drawn object on renderscript?" because when setting has been changed, need redraw objects again.... the best things have managed go far set quantity of objects on listener this private class splistener implements sharedpreferences.onsharedpreferencechangelistener { @override public void onsharedpreferencechanged( sharedpreferences sharedpreferences, string key) { // todo auto-generated method stub obj_count = inte

vsx - How can I programmatically access Visual Studio 2013's Return Values that appear in the Autos Window? -

visual studio 2013 has capability of showing return values of every method in statement that's been stepped over . appear in autos window. question is, how can programmatically obtain them, using vs-sdk (as idebugproperty2's) or envdte.expression's? there api this? i know can evaluate "$returnvalue" last return value, i'd obtain return values of method stepped over, including names.

android - Keep tts speaking even if get call -

i made android application uses texttospeech , works fine. problem when receive call, texttospeech stops. i use apps mine , continue speaking during received call. how can that? maybe using link async? thanks! what happens when receive call, app's activity onpause. so should start background service activity , handle texttospeech there(the service). so if activity paused, texttospeech continues doing work. here: http://developer.android.com/reference/android/app/service.html and useful tutorial on services: http://www.vogella.com/articles/androidservices/article.html

textbox - How can I move (displace) TextBoxes created during runtime, referring to them by name? VBA -

so have created user form take input user create tool in evaluation of financial investments job. user form takes account possible revenues , expenses generated investment, number of years investment useful. added 3 buttons, 1 creates new revenue row, creates new expenses row , last new years column, giving me 2 matrices of rev x years , expenses x years. if need more details let me know! the small "+" buttons seen add rows of revenues or expenses or columns of years. problem when add row of revenues have displace expenses down, created in run-time. approach has been use controls collection , name of text box (which have made matrix: e1y1, e2y2, e1y2, e2y2,... , forth) using each statements , couple of loops. program runs , compiles properly, things shifting down labels , frames, outside each , loops code. i'm attaching relevant code if there's else need let me know, suuuper appreciated!! private sub movecontrols() dim ctl control dim cell textbox

Iterate over Ruby Array in increments of 4 -

i have following array: csv_array = [1,2,3,4,5,6,7,8,9,10] i need write each item in array separate csv row, in groups of 4. if this csv.open("content_file.csv", "wb") |csv| csv << csv_array end i csv file of entire array laid out across 1 row. i need csv file this: 1,2,3,4 5,6,7,8 9,10 how can write ruby script csv << csv_array[0..3] csv << csv_array[4..7] and on, regardless of how many items in array? using ruby 1.9.3. csv_array = [1,2,3,4,5,6,7,8,9,10] csv_array.each_slice(4) |chunk| p chunk end # >> [1, 2, 3, 4] # >> [5, 6, 7, 8] # >> [9, 10]

java - How do I extract the username and password out of a URL in a filter? -

i've created basicauthfilter , has signature: @override public void dofilter(servletrequest request, servletresponse response, filterchain chain) throws ioexception, servletexception this working if calls filter authorization header set right way. but, if on chrome or firefox visits url this: http://username:password@localhost:8888 the browsers not populating authorization header information (which surprised me). looked @ information sent chrome , username , password in request url else. i can't figure out how extract information url. i've tried lot of getters on httpservletrequest , haven't found gives me username , password. note: yes, know insecure, it's convenient use when you're trying test system. my coworker found this thread implies isn't possible in modern browsers. refuse send username:password part of url on wire security reasons.

ieee 754 - Is it 52 or 53 bits of floating point precision? -

i keep on seeing nonsense 53 bits of precision in 64-bit ieee floating point representation. please explain me how in world bit stuck 1 in contributes numeric precision? if had floating point unit bit0 stuck-on 1, of course know produces 1 less bit of precision normally. sensibilities on this? further, exponent, scaling factor without mantissa, specifies leading bit of number is, no leading bit ever used. 53th bit real 19th hole. merely (useful) crutch aid human mind , logic accessing such values in binary. claim otherwise double counting. either books , articles claiming 53rd bit nonsense wrong, or idiot. stuck bit stuck bit. let's hear arguments contrary. the mathematical significand 1 of ieee-754 64-bit binary floating-point object has 53 bits. encoded combination of 52-bit field exclusively significand , information exponent field indicates whether 53 rd bit 0 or 1. since main significand field 52 bits, people refer significand 52 bits, sloppy termi

gem - Find the location of the SASS executable. (using rbenv) -

i have working sass installation. can run these commands in terminal , output: sass -v sass 3.2.9 (media mark) rbenv versions system * 1.9.3-p392 (set /users/eric/.rbenv/version) 2.0.0-p0 i need locate exectuable can provide webstorm ide file watcher. http://blog.jetbrains.com/webide/2013/03/file-watchers-in-webstormphpstorm-6-a-k-a-background-tasks/ . have set in other environments (windows, osx without rbenv) before, can't figure out how here. if run whereis sass , no output. how find executable , specify webstorm? digging rbenv, see here: /users/eric/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sass-3.2.9/bin/sass specifying path webstorm work. appropriate/stable reference location directly, or there better way doesn't depend on version numbers? this working answer me: /users/eric/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/sass-3.2.9/bin/sass it's not best because have update location when upgrade sass, it's functional

c# - make GlobalKeyboardHook class read string comes from 2D barcode scanner -

i using globalkeyboardhook class make application listen keyboard keydown event , works fine when barcode scanner scan image, return string "dos-720" encodeing "ÃÍãÏ", globalkeyboardhook class return thing "¤aii¤", how make globalkeyboardhook class return original string?? the globalkeyboardhook class public class globalkeyboardhook { [dllimport("user32.dll")] private static extern int callnexthookex(intptr hhk, int code, int wparam, ref keyboardhookstruct lparam); [dllimport("user32.dll")] private static extern intptr setwindowshookex(int idhook, llkeyboardhook callback, intptr hinstance, uint theardid); [dllimport("user32.dll")] private static extern bool unhookwindowshookex(intptr hinstance); [dllimport("kernel32.dll")] private static extern intptr loadlibrary(string lpfilename); public delegate int llkeyboardhook

What types of asp.net web controls could I set a background image to? -

i need set background image code asp:image control. there control use in it's place in order background image work? the code in master file looks this: <div style="width:21px;" class="icon-img"><asp:image id="img" runat="server" imageurl="/images/icon.png" height="11" visible="false"/></div> your master page.aspx <div id="mydiv" runat="server" style="width:21px;" class="icon-img"></div> your code behind: protected sub page_load(sender object, e eventargs) handles me.load mydiv.style("background-image") = "url('mybackground.png')" end sub make sure aspx page has given id div , attribute runat="server" (which needed access code behind). or: <div id="mydiv" runat="server" style="width:21px;" class="icon-img"><asp:image id="

MySql--Order by is "breaking" my query? -

Image
so, have query want execute, , once it's done want results sorted time desc. however when spits out single result... here's i'm seeing: first query no sorting: second query order added in: can me understand what's going on , how fix it? thanks, your queries different. variables evaluated after order by clause. result, different set of rows satisfy having clause. to fix problem, put query -- without order -- subquery. selection want , order by in outer query. edit: i'm not going retype query pasted images. structure of query is: select * (<your query here>) s order time desc limit 5

Using a template callback function in C++ -

i want have function checks conditions based on given callback function. considers code: class foo{ template <class paramtype> struct isgood { typedef bool (*check)(typename const paramtype*, int other); }; template< typename paramtype > void dosmth(isgood<paramtype>::check isgood, const paramtype* param){ //... if(isgood(param, some_int_calculated_here)) dosmthelse(); } what want call with: bool checkequalint(int* i, int j){return *i==j;} bool checkequalfloat(float* i, float j){return *i==j;} dosmth(checkequalint, &i); dosmth(checkequalfloat, &i_float); (all constructed examples show problem) the compiler won't , throws me error c2664 "converting param 1 bool(int*,int) in bool(paramtype,int) not possible" i there solution without using template< typename paramtype, check > void dosmth(check isgood, const paramtype param) which ommits necessary declaration of check function? best solution isgood() header i

node.js - running a task in parallel in nodejs -

this seems work: function callloop (n) { function caller () { console.log("hello " + n); settimeout(function () { caller(); }, 10000); } caller(); } (var = 0; < 5; i++) { callloop(i); } settimeout, in example, instead long-running network call. "correct" way parallelize these network calls? check out async.parallel : var async = require( 'async' ); function callloop (n) { function caller () { console.log("hello " + n); settimeout(function () { caller(); }, 10000); } caller(); } var functions = []; (var = 0; < 5; i++) { functions.push(callloop.bind(null, i)); } async.parallel(functions);

beautifulsoup - Beautiful Soup - issue with brackets in strings? -

beautiful soup seems have problem strings contain brackets, following code fail if ethernet lan (rj-45 ) entered keyword succeed if enter ethernet lan does know of reason why is, there special can add code make work brackets need perfect match? code pattern = re.compile(r'\s*%s\s*' % 'ethernet lan (rj-45) ports quantity') rj45_ports = soup.find(text=pattern).findnext('div',{'class':'ds_data'}).text print rj45_ports html <div class="tablerow"> <div class="ds_label"> <span class=""> ethernet lan (rj-45) ports quantity</span> <span class="red line"> </div> <div class="ds_data"> 1 </div> </div> in regex () s special characters. need escape them. pattern = re.compile(r'\s*%s\s*' % 'ethernet lan \(rj-45\) ports quantity') it may worthwhile write function handles sanitizing strings. def sanitize(s): out

sql server - How to know the value of the INT sequential I just INSERTed in SQL 2008 R2 -

i have these tables (simplified clarity): table changes changeid bigint memberid varchar(10) changedon smalldatetime table fieldchanges changeid bigint fieldname varchar(30) oldvalue varchar(100) newvalue varchar(100) in order keep track of changes made member ( memberid ). what want insert record in changes , sql generating sequential value (by using isidentity ) changeid column , insert record in fieldchanges value , other details. now, insert , select latest record memberid , wondering if there efficient way this, sql returning value of changeid column when doing insert . to identity value of inserted identity column, use select scope_identity() the scope specific stored proc, script batch, function or trigger.

llvm c++ api - Print x86 assembly instead of getting machine code from ExecutionEngine -

i've seen several conflicting descriptions of how around google results, , haven't been able of them work. my problem this: call executionengine::getpointertofunction (with llvm::function*), i'd instead pretty-printed x86 assembly produced function. anybody? [eta: i'm using llvm 3.3. descriptions i've found seem earlier versions of llvm.] it turns out can add event listener jit executionengine executionengine::registerjiteventlistener. if provide instance of class, can have callback invoked when machine code generated you, , you'll given pointer machine code , length. this, can call llvm::sys::disassemblebuffer description of machine code buffer. however, llvm::sys::disassemblebuffer function defers udis library if llvm compiled support. since build of llvm didn't have flag set , can't rebuild it, i'll using udis library directly: https://github.com/vmt/udis86

objective c - Displaying an object hierarchy within NSOutlineView - cannot get it to work correctly, any tips? -

so, want use nsoutlineview in application display specific, lack of better name, hierarchy. explain, here's how looks in code: have protocol declares few methods used objects i'd display: @protocol outlineviewitem <nsobject> @required -(bool)haschildren; //tells whether object has children @required -(nsinteger)numberofchildren; //returns 0 if none or number of children @required -(id)getchildren; //return nsmutablearray containing children @required -(nsstring*)getdisplayablename; //returns string displayed in nsoutlineview @end as can guessed, these methods should make task little bit easier. then, i've got following hierarchy of objects (all of them implement protocol) -> main application contains 1 instance of project class, contains nsmutablearray of subproject class instances, contains nsmutablearray of subprojectitem class instances. an example of how i'm using these protocol methods in project class (subprojects aforementioned nsmutabl

Chat system in php with long pool, how to send and get msg together without so much delay time -

i m developing chat aplication in php client using long polling. when user send msgs woud .abort() getmsg() function , restart in on sendmsg() sucess (ajax call), if user send repeatedly msgs, getmsg() fired multiple times same parameters, , if other user sending msgs too, got repeatedly same msgs. got way around it, without .abort() getmsg() in sendmsg() works (ajax take care of both calls). when user send repeatedly msgs, need wait in sleep() loop (getmsg()) msgs, if there word in each. there way make abort() fire 1 time on consecutive msgs, or how make sleep() go lower (less seconds) when finds message? wouldt take of server check everytime? thank s in advance, sorry long text. here`s functions: php getmsg() (a php file, function) $aa = mysql_num_rows($chatresult); $togetmsg = 2; while($aa == 0 && $tried_times < 6) { sleep($togetmsg); $chatresult = mysql_query("query"); $aa = mysql_num_rows($chatresult); $tried_times++; } while($crow = mysql_fe

ruby on rails - `heroku open` fails - table doesn't exist error in logs -

edit: while trying working, commented out offending factory_girl entirely - , it's still giving same error - cannot load such file -- factory_girl_rails /app/lib/tasks/sample_data.rake:1:in require' is there need make heroku work with/see updated files? op: heroku open returns we're sorry, went wrong. in browser , following heroku logs : 2013-08-23t21:18:48.870042+00:00 app[web.1]: started "/" 86.59.188.18 @ 2013-08-23 21:18:48 +0000 2013-08-23t21:18:49.388611+00:00 app[web.1]: 2013-08-23t21:18:49.388611+00:00 app[web.1]: activerecord::statementinvalid (mysql2::error: table 'heroku_9e0ff302f567892.users' doesn't exist: show full fields `users`): 2013-08-23t21:18:49.388611+00:00 app[web.1]: app/models/user.rb:52:in `authenticate_with_salt' 2013-08-23t21:18:49.388611+00:00 app[web.1]: app/helpers/sessions_helper.rb:62:in `user_from_remember_token' 2013-08-23t21:18:49.388611+00:00 app[web.1]: app/helpers/sessions_helper.

mercurial - IPython, Sage, Dependencies, Anaconda, and Package Integration? -

i've started using ipython interactive development , exploratory research, i've found exciting cool features , possibilities. using anaconda package manager manage dependencies, includes ipython. from i've read, 1 goal of ipython team integrate sage math (cas) ipython, cell magic. know if still under development? or rather, if wanted use sage now, writing extension way [1]? [1] https://github.com/ipython/ipython/wiki/extensions-index also, if install additional packages scientific development, not included in anaconda distribution, easy pip or have go through anaconda package build handle dependencies , such? if using ipython, understand doing easy_install or pip recommended in docs, believe overwrites existing dependencies within anaconda. if use pip, how affect anaconda dependencies if not install in anaconda environment, take equivalent virtualenv.py, , way set revision control (i.e. mercurial)? to clarify, not want run ipython within sage, want run sage

python - BlackJack Class Difficulties -

i'm trying simulate dealer of game of blackjack, , i'm confused. basically, i'm using deck of cards consists of j, q, k, a, , 2-10 simplify stuff, rather using ordinary card deck setup. i realize of pretty messy, i've been working classes of 3 hours. class deck: '''simulates deck of cards.''' def __init__(self): '''deck() -> deck creates deck of cards''' self.deck = ['j', 'j', 'j', 'j', 'q', 'q', 'q', 'q', 'k', 'k', 'k', 'k', 'a', 'a', 'a', 'a', '2', '2', '2', '2', '3', '3', '3', '3', '4', '4', '4', '4', '5', '5', '5', '5', '6', '6', '6', '6', '7', '7', '7', '7',

android - How to convert a photo to pdf every time you click -

i'm working on app access , create folder after clicking access camera , after bit of photo shots, saving in latest in pdf. not know how turn jpg pdf. read itext not know how implement it public class cameraview extends activity implements surfaceholder.callback{ protected static final string tag = null; /* variabili private */ private surfaceview msurfaceview; private surfaceholder msurfaceholder; private camera mcamera; private boolean mpreviewrunning; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); getwindow().setformat(pixelformat.transparent); //aggiungo il traslucido requestwindowfeature(window.feature_no_title); //no barra titolo getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); //full screen setcontentview(r.layout.main); imageb

android fragments - How do I hide tabs or TabsAdapter using ActionBarSherlock -

how hide tabs dynamically? i'm using actionbarshelock make swipe tabs , searchview. when show search results in listview want hide whole row of tabs. know if possible? if want hide tabs, can call: getsupportactionbar().setnavigationmode(actionbar.navigation_mode_standard); when you're done can go tabs mode: getsupportactionbar().setnavigationmode(actionbar.navigation_mode_tabs);

javascript - How can I use 'ended' event in .on() in jQuery? -

im trying use ended video tag in dynamically generated content on isn't working , idk why, code. $(document).ready(function() { $('.container').on('click','.videobox',function(){ var $this = $(this); var video = $this.next('video')[0]; if (video.paused) { $this.css({ opacity: 0 }); video.play(); } else { video.pause(); $this.css({ opacity: 0.5 }); } }).on("ended",".test",function () { alert('asd'); $(this).prev('.videobox').css({ opacity: 0.5 }); }); }); this html <div class="videobox" style="position: absolute; z-index: 500; background-color: #000; opacity: 0.5; width: 473px; height: 474px;"><img src="/image/camera.png" style="position: relative; top: 45%; margin-left: 160px;"></div> <video class="test" width="473" h

actionscript 3 - Leapmotionas3 interaction finger as a mouse -

i'm testing leapmotionas3 library logotype: https://github.com/logotype/leapmotionas3 i can make gestures work, have 2 apps working gestures, can't finger act "mouse" , interact buttons on screen. does know how this? advice, tip, tutorials? to connect device use: package { import flash.display.sprite; import com.leapmotion.leap.controller; import com.leapmotion.leap.events.leapevent; import com.leapmotion.leap.frame; import com.leapmotion.leap.hand; import com.leapmotion.leap.finger; import com.leapmotion.leap.vector3; import com.leapmotion.leap.util.leaputil; import com.leapmotion.leap.gesture; import com.leapmotion.leap.swipegesture; import com.leapmotion.leap.screentapgesture; import com.leapmotion.leap.keytapgesture; import com.leapmotion.leap.screen; import flash.events.event; import com.greensock.tweenlite; import com.greensock.easing.expo; import com.greensock.plugins.*; import com.greensock.easing.back; import flash.display.shape; import flash