Posts

Showing posts from July, 2012

mouseevent - Increase Javascript Mouse Events -

mouseevent - Increase Javascript Mouse Events - i know if there way increment sample rate of mousemove events of js. when cross window around 10-20 events, not plenty purpose of app, when can reach +100; thanks in advance, i think, maybe i'm wrong, mousemove events "sample rate" not determined javascript, sample rate of mouse. means whenever mouse sends event browser, event fired (if mouse has moved of @ to the lowest degree 1 pixel) , can respond it. mouse higher sample rates create more events (and more precise), mouse lower sample rate create fewer events. why when play quake 4 sample rate of mouse affects precision of aiming. so don't think it's problem of javascript, , should have app respond accordingly events generated mouse. same thing done in first person shooter auto aiming option. javascript mouseevent

java - Bizarre ArrayIndexOutOfBoundsException -

java - Bizarre ArrayIndexOutOfBoundsException - this question has reply here: how avoid java.lang.arrayindexoutofboundsexception? [duplicate] 2 answers i'm writing android application, , in there's array scan through in few places. reason, crashes in 1 of these places arrayindexoutofboundsexception. when debug it, indices @ times of crashes reasonable , within bounds of array (although different indices every time). more annoyingly, can't @ contents of array, because every time scroll through variables debugger disconnects right before array. set array array create in c function , homecoming (using android ndk et cetera) , best guess array messed up, works fine more not, , when crash doesn't crash on index 0 whatever i'm getting c code must in cases still work plenty read some. potentially relevant info if stop app when hasn't crashed debugger...

c# - OpenXML, IsolatedStorage, NETWORK SERVICE and Windows Server 2008 -

c# - OpenXML, IsolatedStorage, NETWORK SERVICE and Windows Server 2008 - i have big web application. 1 little piece of web application generates xlsx files using openxml library (written in c#). i've run problem described in post: isolatedstorage access denied however, instructions there windows server 2003, , user directory hierarchy in 2008 different. i've tried creating isolatedstorage directory in these locations (and giving network service permissions it): c:\users\default\appdata\local\isolatedstorage c:\users\default\appdata\roaming\isolatedstorage those did not work. i've tried find appropriate location isolatedstorage directory on windows server 2008 (generally using google , here) without success. can tell me should create directory (or alternatively, suggest other solution forcefulness openxml instruct archive library not utilize isolatedstorage create spreadsheet)? edit - july 14, 2011 - adding exception message , stack trace help others f...

passing blocks around in javascript without lengthy function syntax -

passing blocks around in javascript without lengthy function syntax - in testing code, i'm getting lot of things this: test.truth(function(){return mytest.isdef('')}); where bulk of line there function boilerplate. there way cut down that, can have syntax more like: test.truth { mytest.isdef('') } as 1 in scala? of course, ideally highly browser compatible. no, sorry. javascript has array literals - [] , object literals - {} , function literals possible using function() { } syntax javascript

javascript - Search for particular word using jQuery? -

javascript - Search for particular word using jQuery? - i have script, let's users submit e message. want restrict users posting particular world, , 1 time word used, form cannot submitted (return false;) , alert outputted. so how word check in jquery? example: 1) desired world blocked: pizza 2) user puts word in textarea 3) user hits submit, used word beside other words form doesn't submit if jquery cannot this, javascript can, i'd welcome javascript solution. conceptually, when submit button pressed, contents of textarea. you'd search word pizza (one simple regular expression) , if found it, set cookie prohibits them submitting period of time (you decide how long time). then, on submit button, you'd check see if cookie exists , if does, you'd prohibit submit function. can either jquery or pure javascript/browser - that's personal preference. here's little piece of code: var o = document.getelementbyid("mytextarea...

algorithm - Tools for Designing & Modeling Complex Systems -

algorithm - Tools for Designing & Modeling Complex Systems - what tools designing & modeling complex systems? i'll leave question open interpretation, allow variety of answers. complex system: complex scheme system composed of interconnected parts whole exhibit 1 or more properties (behavior among possible properties) not obvious properties of individual parts. - [wikipedia - complex systems] unless fluent in writing discrete-event simulation code, or have particular subject-matter area there exists domain-specific simulation libraries, suggest netlogo. netlogo platform agent-based simulation; term describes dsl used in platform. aside documentation supplied in netlogo itself, seth tisue , uri wilensky have written first-class introduction netlogo. netlogo used among community of agent-based modelers--for instance, featured in 2010 conference proceedings paper titled software tools analysis , modelling in complex systems. (the link paper here--careful...

Codeigniter LIKE search always returns the whole table -

Codeigniter LIKE search always returns the whole table - when search function, no matter entries in searched db table. this controller: function search() { $this->form_validation->set_rules('company', 'company field', 'required'); $search_text = $this->input->post('name'); $is_ajax = $this->input->post('ajax'); $data['found_companies'] = $this->company->get_companies_by_name($search_text); $data['page_title'] = 'search'; $this->load->view('head', $data); $this->load->view('pages/search', $data); $this->load->view('footer'); } this model function get_companies_by_name search: function get_companies_by_name($name) { $this->db->select('id,name,logo,phone,email,adress,url,contact,contact_phone,biz_id,join_date,user,password'); $this->db->like('name', $name, 'after'); $returned ...

regex - Regular Expressions- Match Anything -

regex - Regular Expressions- Match Anything - how create look match absolutely (including whitespaces)? example: regex: bought _ sheep. matches: bought sheep. bought sheep. bought 5 sheep. i tried using (.*) doesn't seem working. update: got work, apparently problem wasn't regular expressions, it's (.) characters beingness escaped. anyways people. normally dot matches character except newlines. so if .* isn't working, set "dot matches newlines, too" alternative (or utilize (?s).* ). if you're using javascript, doesn't have "dotall" option, seek [\s\s]* . means "match number of characters either whitespace or non-whitespace" - "match string". another alternative works javascript (and not recognized other regex flavor) [^]* matches string. [\s\s]* seems more used, perhaps because it's more portable. regex

java - How to detect web browser name and version? -

java - How to detect web browser name and version? - looking java library converts user-agent header browser name , version. i need info in order understand whether can send xml+xsl browser, or should transformation xhtml on server. i need info in order understand whether can send xml+xsl browser, or should transformation xhtml on server. it seems best approach content negotiation. when run restaurant (server), don't inquire diner (ua) name is, inquire them what want eat (content type)! java user-agent

google map usage -

google map usage - does have nay info on usage of google map in busines/commerceial use? there limit on how many times individual can utilize google map view daily info, when used commercially. or restriction set on business or ip? i planning display info on google map , other userd can view such info using google maps. thanks in advance from terms of service: 10.1.2 restrictions against commercial use. (a) no fees. must not charge users or other 3rd party fee utilize of maps api implementation, service, or content, except permitted under section 9.1.2 (exceptions). (b) no direct marketing. must not print more 5,000 copies of sales collateral materials containing screenshot of content purposes of commercial sales lead generation ("direct marketing") or incorporate content core part of printed matter (such printed maps or guide books) redistribute fee. must contact google maps api premier sales team obtain direct license...

ios4 - iPhone xml parsing/editing a better solution? -

ios4 - iPhone xml parsing/editing a better solution? - i utilize gdataxml parsing xml received webservice, parse part need , want "edit" xml , send webservice. i checked gdataxml examples saving xml model objects , creating xml model objects again. because speed of import want without saving or converting xml model objects want edit/delete nodes on , send possible. actually can converting string , string manipulation. dont think editing xml string safe way. how can better? thanks i tend utilize xml nsdictionary object found on google saves lot of time parsing , configuring xml. seek out. iphone ios4

php - Loading tab by default in jQuery tab script -

php - Loading tab by default in jQuery tab script - i have jquery tab script gets content php file defined link , parses div element. when user selects tab, turns bold. however, when script loaded up, tab not selected default. question how can load tab , it's contents default , show tab selected current code? this current jquery code: function load(url){ $.ajax({ url:url, success:function(message){ $("#content").html(message); } }); } $(document).ready(function(){ $("[id]").click(function(){ type=$(this).attr("id"); url=""+type+".php"; $("[id]").removeclass("selected"); $("#"+type).addclass("selected"); load(url); homecoming false; }); }); this html code: <ul> <li><a id="tab1" href="javascript:void(null);">tab1</a></li> <li...

asp.net - ASP .NET PageMethods - File Upload -

asp.net - ASP .NET PageMethods - File Upload - i trying create ajaxy file upload. here asp code: <input type="file" id="supportingdocs" runat="server"/> <input type="button" id="uploadbtn" onclick="upload();" value="upload"/> here javascript: function upload() { pagemethods.uploadfile($get('supportingdocs').value, onsucceed, onfail); } here relevant c# code: [webmethod] [scriptmethod] public static string uploadfile(string files) { httprequest request = httpcontext.current.request ........ } what trying httpfilescollection request empty. know pagemethods not follow normal asp .net lifecycle. looking @ httprequest object while stepping through code in debugging see else in request there "files" property empty. i'm missing here , method of uploading files might not possible. you utilize 1 provided ajaxcontroltoolkit, i.e. asyncfileupload ...

java - How to change the port in an embedded HornetQ programmatically -

java - How to change the port in an embedded HornetQ programmatically - i want alter default port in embedded hornetq. works when done in hornetq-configuration.xml file: <acceptors> <acceptor name="netty-acceptor"> <factory-class>org.hornetq.integration.transports.netty.nettyacceptorfactory</factory-class> <param key="port" value="6446"/> </acceptor> </acceptors> but changing programmatically not. load configuration file, , seek override, without success - here try: // load configuration fileconfiguration configuration = new fileconfiguration(); configuration.setconfigurationurl("hornetq-configuration.xml"); // prepare configuration objects string netty = nettyacceptorfactory.class.getname(); map<string, object> transportparams = new hashmap<string, object>(); transportparams.put(transportconstants.host_prop_name, "localhost"); transportparams.put(transpo...

php - Query and Display Results Every 'X' amount of Minutes from Oracle Database -

php - Query and Display Results Every 'X' amount of Minutes from Oracle Database - is there way can query oracle 10g database, , display results in dynamically refreshed html file every 3 minutes, example? here predicament: have several queries love display results of whole organization on basic html web page css. problem not want user able refresh page in his/her browser, , severely bog downwards database. have no problem writing queries, or writing html , css needed display tables. it's if query, export results xml every 3 minutes, , have html or php file pointing dynamically updated xml file. open other options well... i have basic user access oracle db...nothing admin like. have access server, though, , have experience php, pl/sql, , html. perhaps have lower level programming language python? kind of stuck here. kind of help appreciated! you can execute ajax request every 3 minutes using settimeout() function. using jquery framework $(docu...

How can I get 'more posts' or 'other posts' using Facebook C# GRAPH API? -

How can I get 'more posts' or 'other posts' using Facebook C# GRAPH API? - i have question. i think facebook c# graph api supports method posts or messages. example) jsonobject me = fbapi.get("/me/feed?access_token=" + this.app_access_token); is there additional parameter previous posts or messages? if it's not possible, other api ( php, javascript ... ) supporting this? -jack- i'm not exclusively familiar c# sdk, if follows convention of other graph api compatible sdks should able this: jsonobject me = fbapi.get("/me/feed?limit=25&since=1311007970&access_token=" + this.app_access_token) the limit parameter restrict number of posts retrieved @ 1 time , since parameter unix timestamp allow query posts farther in time. check out paging section on page more information: https://developers.facebook.com/docs/reference/api/#reading facebook-graph-api facebook-c#-sdk

how to set image layout param in Gallery in android -

how to set image layout param in Gallery in android - i want utilize gallery in android in adapter class have set @override public view getview(int arg0, view arg1, viewgroup arg2) { imageview iview = new imageview(ctx); iview.setimageresource(pics[arg0]); iview.setscaletype(imageview.scaletype.fit_xy); //iview.setlayoutparams(new gallery.layoutparams(150, 150)); iview.setlayoutparams(new gallery.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content)); homecoming iview; } so overlap image, not show 1 one. but if set iview.setlayoutparams(new gallery.layoutparams(150,150)); then not overlap image image size increase.. have if want wrap content of image height width thanks look @ gallery doc: http://developer.android.com/reference/android/widget/gallery.html can utilize "setspacing" method on gallery object forcefulness images not overlap. android gallery

Multidimensional Arrays in PHP -

Multidimensional Arrays in PHP - i'm having problem multidimensional arrays in php. i'm assuming should simple but, i'm having difficulty wrapping mind around multi-dimensions. the array have looks this: array ( [0] => array ( [projects_users] => array ( [project_id] => 1 ) ) [1] => array ( [projects_users] => array ( [project_id] => 2 ) ) ) i somehow alter array this, see array of project_id: array ( [0] => 1 [1] => 2 ) sorry such simple question. hints or clues great! $arr = ... $new_arr = array(); foreach ( $arr $el ) { $new_arr[] = $el['projects_users']['project_id']; } or, php version >= 5.3: $new_arr = array_map(function ($e) { homecoming $e['projects_users']['project_id']; }, $arr); a 3rd fun way, reset : $arr = ... $new_arr = array(); foreach ( $...

plugins - where to add eclipse extension -

plugins - where to add eclipse extension - i trying override default rename functionality of eclipse in application. created class extends renameparticipant. added extension point in plugin.xml but doesn't work. in application there more 30 projects(or plugins??)(eg: core, debug, editor, parser, ui etc). want know is, should set rename extension. ie, in projects' plugin.xml need add together extension rename? please help me figure out this. new plugin development. in advance, ann you should utilize extension point org.eclipse.ltk.core.refactoring.renameparticipants in plugin.xml file of plug-in contains participant class because extension point has refer participant class. for example, see next utilize of org.eclipse.ltk.core.refactoring.renameparticipants extension point in org.eclipse.jdt.ui/plugin.xml . <extension point="org.eclipse.ltk.core.refactoring.renameparticipants"> <renameparticipant class="org.eclipse.jdt.inte...

Azure Workerrole lifecycle -

Azure Workerrole lifecycle - is windows azure operating scheme restarting or reseting running worker role automatically time time? or can rely on fact worker role running infinitely if have loop in run() method? role instances (whether worker or web) recycled @ to the lowest degree 1 time monthly, invitee os updated on monthly basis. host os refreshed on quarterly basis, potentially resulting in additional role recycles (assuming host , invitee updates performed separately). having said that: can take not auto-updated latest invitee os, specifying invitee os version use. cannot opt out of host os updates. in general, should not rely on role instance running infinitely. need assume there reboots in future. aside host os updates, there hardware failures can , occur. see here more info invitee os updates, , here host os updates. azure azure-worker-roles

c# - Casting between inherited classed -

c# - Casting between inherited classed - the next cast doent work. think should, can explain me why not? both webserviceerrormessage , btmacresponse inherit webservicemessage class datalayer.webservicemessage msg = new service.webserviceerrormessage(ex) ; datalayer.btmacresponse macrsp = (datalayer.btmacresponse)msg; unless webserviceerrormessage inherits btmacresponse , don't see why should work. you're trying cast value btmacresponse when object isn't btmacresponse . to set way, expect able cast filestream memorystream because both inherit stream ? would expect able cast button string because both inherit object ? c# casting

ios - How to add UIImages like animation using NSTimer? -

ios - How to add UIImages like animation using NSTimer? - i want add together array of uiimages uiimageview using nstimer. such animation. how in ios? in advance. there simple way it. // create view execute our animation uiimageview* campfireview = [[uiimageview alloc] initwithframe:self.view.frame]; // load frames of our animation campfireview.animationimages = [nsarray arraywithobjects: [uiimage imagenamed:@"campfire01.gif"], [uiimage imagenamed:@"campfire02.gif"], [uiimage imagenamed:@"campfire03.gif"], [uiimage imagenamed:@"campfire04.gif"], [uiimage imagenamed:@"campfire05.gif"], [uiimage imagenamed:@"campfire06.gif"], [uiimage imagenamed:@"campfire07.gif"], [...

android - Take photo automatically -

android - Take photo automatically - in app want take photo automatically every several seconds, tried startactivity using google image_capture intent , inject key events. cant find way intent keyevent activity not written me. can suggest other method? or else have write own photo taking activity(it cause lot of time...) anyone can suggest other method? use camera class , take image yourself. or else have write own photo taking activity(it cause lot of time...) not developers. android

Problem parsing String to DOM in Java -

Problem parsing String to DOM in Java - consider have standard domparser, written along lines of: documentbuilderfactory mill = documentbuilderfactory.newinstance(); documentbuilder builder = factory.newdocumentbuilder(); factory.newdocumentbuilder().newdocument(); this.document = builder.parse(new inputsource(new stringreader(xmlstring))); then when feed this, works: <?xml version="1.0" encoding="utf-8" standalone="no"?><rsp stat="ok"> <photos page="1" pages="385628" perpage="10" total="3856272"> <photo farm="7" id="5943736412" isfamily="0" isfriend="0" ispublic="1" owner="35783591@n08" secret="7c3ee3a0ee" server="6144" title="sooc"/> <photo farm="7" id="5943736298" isfamily="0" isfriend="0" ispublic="1" own...

unix - Crontab append remotely -

unix - Crontab append remotely - i append entries crontab on remote server. this. for host in $hosts ssh $host echo "5,10,15,20 05,35 8-20 * * * /myhome/myscript" crontab_file done problem not know name of crontab file line needs appended with you should not edit crontab file directly, utilize crontab -e (why? read this). create simple text file script , cut&paste crontab. unix

objective c - How to set initial location for image (iphone) -

objective c - How to set initial location for image (iphone) - i have uiimageview along uiscrollview. both setup correctly , working fine. however, when view loaded, puts pixel location (0,0) starting point (i.e. view top left of image).. how set such on viewdidload starts @ pixel location (1000,1000) of image? not care happens after user scrolls or zooms in/out much obliged. [uiscrollview setcontentoffset:cgpointmake(1000.0, 1000.0)]; iphone objective-c uiscrollview uiimageview uiimage

python - How to configure TASK_SERIALIZER with django-celery -

python - How to configure TASK_SERIALIZER with django-celery - i'm using django-celery , i'd set task_serializer json instead of pickle. i can on per-method basis changing task decorators from @task to @task(serializer="json") but i'd globally. setting task_serializer="json" in settings.py doesn't work. trying run import celery celery.conf.task_serializer="json" (as implied here) results in attributeerror: 'module' object has no attribute 'conf' any thought how configure setting when running celery through django? figured out. in settings.py need set celery_task_serializer = "json" docs confusing, @ to the lowest degree me. python django celery django-celery

emacs - Jruby gem error win32-service for rsense -

emacs - Jruby gem error win32-service for rsense - i trying install rsense, next directions here rsense docs rsense_home set cannot install jruby win32-service finish steps have rsense service started @ boot. this total error, ran error suggested specifying jruby version. ideas on completing install? c:\users\renshawfamily>echo %rsense_home% c:\rsense c:\users\renshawfamily>jruby -s gem install win32-service fetching: win32-api-1.4.8.gem (100%) building native extensions. take while... error: error installing win32-service: error: failed build gem native extension. c:/jruby-1.6.3/bin/jruby.exe extconf.rb warning: jruby not back upwards native extensions or `mkmf' library wel l. check http://kenai.com/projects/jruby/pages/home alternatives. checking strncpy_s()... ioerror: cannot run programme "cc" (in directory "c:\j ruby-1.6.3\lib\ruby\gems\1.8\gems\win32-api-1.4.8\ext"): createprocess error=2, scheme cannot find file specif...

gridview - Image Binding in ASP.NET -

gridview - Image Binding in ASP.NET - i have next piece of code imageurl='<%# bind("imageurl") %>' i've got gridview want show images on itemtemplate have database i'm saving on name of images e.g --> img1.jpg i want append total path of image @ before name can viewed on itemtemplate on gridview . i tried utilize concat, or + operator doesn't seem work can any1 tell me 2 ??? use inline eval imageurl='<%# "path/to/image" + bind("imageurl") %>' no need utilize bind . used two-way, read/write databinding. asp.net gridview

php - Search engine for website -

php - Search engine for website - i thinking of having search engine website. however, came know using php browse through number of indexes saved in our database. right method or other algorithm doing same thing available.. please tell me other possible way of implementing search engine own website. for information, website informative 1 html contents. in advance :) :) you seek mysql total text search or more no of records suggest sphinx. you utilize sphinx kind of search (and certainly fast), kind of fields want search on improve served straight within database - making assumptions you're providing indexes on tables. the real strength of sphinx lies in full-text search, don't indicate you'll need. click here more details http://sphinxsearch.com/downloads . php search-engine

How to get start with Appcelerator Titanium -

How to get start with Appcelerator Titanium - i new appcelerator titanium. followed instructions , able install software , android sdk(only android time being). site suggested when tried import , run kitchensink, can see nil on emulator. not running. issue? or there other simple project ? please help me regards kitchensink heavy application. so start emulator , run project titanium studio, wait time. if not running after this, check android sdksetting (window->preferences->titanium studio->titanium) also check java environment variable setting. when application setting done, application execute. appcelerator-mobile

objective c - How do I disable NSLog? -

objective c - How do I disable NSLog? - i'd next in xcode: find nslog commands without comments, , replace //nslog... in other words, want comment nslog calls. possible? there easy way this? there little hack do. search nslog , replace them //nslog , search ////nslog , replace them //nslog . objective-c xcode

Delete a dictionary from another dictionary python -

Delete a dictionary from another dictionary python - if , b 2 dictionaries, using python, there way of removing elements dictionary in dictionary b? for example, parent_dict = {"a" : "aaa", "b" : "bbb", "c" : "ccc", "d" : "ddd", "e": "eee"} derived_dict = {"a" : "aaa", "d" : "ddd", "e" : "eee"} now need write function dict_reduce(dicta, dictb) deletes elements of dictb dicta. (i.e.,) dict_reduce(parent_dict, derived_dict) should give {"b" : "bbb", "c" : "ccc"} my work around loop is: def dict_reduce(parent_dict, child_dict): key in child_dict.keys(): del parent_dict[key] homecoming parent_dict reduced_dict = dict_reduce(parent_dict, child_dict) note: it great if solution 1 liner or not takes loop. also need not check whether parent dictionary has...

javascript - detection of height doesn't work -

javascript - detection of height doesn't work - i have simple script: var o = document.getelementbyid("content"); if (o.clientheight == "372") { o.style.height = "328px"; o.style.marginbottom = "44px"; } else { o.style.height = "214px"; o.style.marginbottom = "32px"; } but somehow else executes, if initial height of div 372px... can help me? clientheight takes padding account. may want utilize scrollheight , offsetheight , or style.height , depending on needs. note style.height not homecoming integer others. http://help.dottoro.com/ljcadejj.php javascript

c++ - Over-the-Air / Over-the-Wire automated Software Update (hot-code-loading) strategy -

c++ - Over-the-Air / Over-the-Wire automated Software Update (hot-code-loading) strategy - have linux scheme (as part of project), might have hot-code-loading, i.e. update parts of software, over-the-air (s.a. downloading software on wifi) or over-the-wire (over lan). there 2 parts of software, 1 part written in c++ , in erlang. c++ part talks external entities on tcp/ip (a set of 6-7 odd proprietary protocols). part need hot-loading of, c++ part talks external entities. c++ part talks erlang on ports (under development currently), alter nifs (sometime in future). can suggest strategies hot-code-loading of c++ functionality. aware of erlang's ability do, understanding functionality doesn't extend on part written in c++. also, need ensure c++ module containing proprietary protocol implementation, "valid source". might right strategy ? i guess, requirements not uncommon, if such modules, frameworks, libraries exist, happy pointed those. don't kno...

php - Changing from Php4 to Php5 -

php - Changing from Php4 to Php5 - i submitted php script prestashop , asked me convert php4 php5. conversion tools out there? i submitted php script prestashop , asked me convert php4 php5. conversion tools out there? thanks. none know of. install php 5 (a bit late though!) , run script(s) see if there errors. might want read the php documentation on migrating 4 5 though, there few things broke backward compatibility. php prestashop

windows - C# Video Tutorials -

windows - C# Video Tutorials - i experienced php developer , planning larn c# developing desktop apps. beingness unfamiliar c# , desktop languages couldnt find video tutorial, , visual c# different c#? can please link me video series learning c# there c# tutorials here msdn. also microsoft has videos here : http://msdn.microsoft.com/en-us/vcsharp/bb798022 note: if know java chance, might wasting time on video tutorials, c# similar java , can pick experience during project working on. msdn library helpful , similar java api. c# windows desktop-application

java - How can a primitive float value be -0.0? What does that mean? -

java - How can a primitive float value be -0.0? What does that mean? - how come primitive float value can -0.0? mean? can cancel feature? when have: float fl; then fl == -0.0 returns true , fl == 0 . when print it, prints -0.0 . because java uses ieee standard floating-point arithmetic (ieee 754) defines -0.0 , when should used. you can around problem adding 0.0 e.g. double.tostring(value + 0.0); see: java floating-point number intricacies operations involving negative zero ... (-0.0) + 0.0 -> 0.0 java floating-point

visual studio 2010 - Qt add-in for VS2010 -

visual studio 2010 - Qt add-in for VS2010 - i've installed qt add-in vs2010 , when seek "show" path qt installed i'm getting error ver of qt has been built mingw. it, i've found similar question when tried type in console 'configure' i'm getting error configure isn't recognized. how shall overcome problem? thats because way qt built mingw , vs different , has different files. you have download qt source code. click start , search visual studio 2008 command prompt or 2010 command prompt. go visual studio command prompt , navigate qt source code folder. type configure -platform win32-msvc2008 --> if have vs 2008 or utilize configure -platform win32-msvc2010 vs 2010 and after done, type nmake wait until built (4 hrs) , should prepare it. visual-studio-2010 qt

python - difference b/w [ab] and (a|b) in regex match? -

python - difference b/w [ab] and (a|b) in regex match? - i knew [] denotes set of allowable characters - >>> p = r'^[ab]$' >>> >>> re.search(p, '') >>> re.search(p, 'a') <_sre.sre_match object @ 0x1004823d8> >>> re.search(p, 'b') <_sre.sre_match object @ 0x100482370> >>> re.search(p, 'ab') >>> re.search(p, 'ba') but ... today came across look vertical bars within parenthesis define mutually exclusive patterns - >>> q = r'^(a|b)$' >>> >>> re.search(q, '') >>> re.search(q, 'a') <_sre.sre_match object @ 0x100498dc8> >>> re.search(q, 'b') <_sre.sre_match object @ 0x100498e40> >>> re.search(q, 'ab') >>> re.search(q, 'ba') this seems mimic same functionality above, or missing something? ps: in python parenthesis used define lo...

javascript - Problem with getImageData function -

javascript - Problem with getImageData function - so, i'm using function getimagedata on "context" variable i've made within of <script> part, , when such draw rectangle ctx.getimagedata.data[0] show reddish value of rectangle drew on canvas. but, when import image , draw onto canvas, , seek utilize getimagedata.data[0] 0, makes no sense, i'm not sure why not reading image correctly. i've tried tutorials on they're vague , have segments written together. so, when draw rectangle, color value comes out fine, again, when draw image, without drawing rectangle on canvas, never value of particular pixel on image. can help me? here's currrent code: <html> <head> <title> color test :) </title> </head> <body> <canvas id = "colortest" width = "500" height = "500"> please don't utilize shitty browsers :) </canvas> <script> //netscape.security.privi...

c# - How can I convert this to return multiple items? -

c# - How can I convert this to return multiple items? - i have list of games, need select randomly, day of week, next code works 1 game. var gameoftheday = games.allactive[(int)(datetime.today.gethashcode()) % games.allactive.count()]; what need homecoming more 1 game, randomized, based on x ( x in case above day of week, alter specific string ) i need create semi-random generation of items. semi - since want feed keyword, , same results per keyword random - since need create game list random for example, every time come in page title "hello", see same games, selected specificly keyword games list based on keyword "hello". in same way gameoftheday works. you can utilize linq this: int limit = 10; string keyword = "foo"; random rng = new random(keyword.gethashcode()); var gamesoftheday = games.orderby(x => rng.next()).take(limit); however, have overhead sort. if have lot of games compared amount you're se...

php - Zen Cart template issues -

php - Zen Cart template issues - i have been working on new template commerce site running zen cart. first experience making one, , going pretty smooth until now. basically, zen cart's default wording still in place , cannot seem figure out why. example, on breadcrumbs, instead of displaying proper page, get: header_title_catalog :: login , title of page is: <title>loginprimary_sectiontitletertiary_sectionsite_tagline</title> this happening throughout site. have placed necessary header files, , tpl body page same default. hoping there specific solution this. can imagine page php definitions happening not beingness included. point me in right direction? thanks. found issue. missing languages folder outside of template folder. names game same name template , copied files default template. php templates zen-cart

python - How to make an application not portable? -

python - How to make an application not portable? - i trying create application should not portable between computers or between users of same computer. best way this? edit: not portable meant, application should not usable without installing it. ie) moving installed folder different computer or different user login of same computer. how can id unique user login in computer?. please excuse poor english. let installation script re-create modules of programme user application directory. in programme add together path sys.path, import find modules. python cross-platform portability

.net - Wix !(bind.AssemblyFullName.fileId) only works on GACed assemblies? -

.net - Wix !(bind.AssemblyFullName.fileId) only works on GACed assemblies? - woe, woe , thrice woe. why wix create installing .net assemblies soooooo difficult! i'm installing com inprocess server implemented in .net, in wix install need create registry entries it. don't want this, i'd rather wix had equivalent of regasm, create me manually. got tired of getting flamed suggesting tad arcane, gave , tried declarative way, boy. so, here's registry stuff looks now: <file id="fildriverassembly" source="$(var.tigra.astronomy.awrdrivesystem.targetpath)" keypath="yes" vital="yes" assembly=".net"> <!--<class context="inprocserver32" description="$(var.installname)" id ="$(var.driverguid)" threadingmodel ="both" > <progid description="$(var.installname)" id ="$(var.driverid)" /> </class>--> </file> <registrykey r...

java - Use of JPEGImageDecoder on Android platform -

java - Use of JPEGImageDecoder on Android platform - i'm trying utilize jpegimagedecoder interface on android application, application stops unexpectedly. next code snippet: import com.sun.image.codec.jpeg.jpegcodec; import com.sun.image.codec.jpeg.jpegimagedecoder; inputstream in = new fileinputstream(filename); jpegimagedecoder decoder = jpegcodec.createjpegdecoder(in); why application stops unexpectedly or can utilize these packages on android? don't think can utilize packages on android. android uses bitmapfactory (android.graphics.bitmapfactory) handle image decoding. stack trace show? java android jpeg sun

c# - loaderlock MDA - later in the application execution -

c# - loaderlock MDA - later in the application execution - here's problem have when running app, , isn't in startup routing, much later on: managed debugging assistant 'loaderlock' has detected problem in 'c:\projects\videophill\playerrac\recorder\videphill recorder test\bin\x86\debug\videophillrecorder.vshost.exe'. additional information: dll 'c:\windows\assembly\gac\microsoft.directx.directsound\1.0.2902.0__31bf3856ad364e35\microsoft.directx.directsound.dll' attempting managed execution within os loader lock. not effort run managed code within dllmain or image initialization function since doing can cause application hang. why? look? causes me problem while debuging, not in runtime. that mda has knack giving false warnings. clr loaded , initialized time directx wrappers getting loaded, programme doesn't hang. debug + exceptions, expand managed debugging assistants node , untick "loaderlock" stops nagging you....

forms - customized email system -

forms - customized email system - i have need add together personalized email form on each registered user's page. ordinarily utilize webforms because email form needs dynamically alter destination email address email address of registered user page visitor on. from research, webforms can't dynamically alter destination address. can offer me alternative solution(s). thanks incase interested in solution problem - reply webforms. the 6.x.3-1.1 version offers ability set static email address or component field recipient address. component field 1 of configure input field webform. if create email component field can set recipient. forms email drupal dynamic

visual studio - vcxproj to cmake -

visual studio - vcxproj to cmake - i'm developing cross-platform c++ project. original thought work msvc2010 , later compile other systems help of cmake , hudson. doesn't seem convenient manually alter cmake files after changes in studio settings. so, what’s easiest way: write parser vcxproj , vcxproj.filters, or there solution? it might useful, time time, type of conversion, porting. on travels i've found following, in no particular order: specifically vs cmake/gyp: vcproj2cmake vcxproj2cmake (not typo!) gypify.py .sln/solution-reading gyp file generator. gyp cmake alternative, beingness used chromium project (base google's chrome browser). gyp output makefile, visual studio or xcode build files (see gyp's '-f [make|scons|msvc|xcode]' switch). python script quite promising, i'm hoping modify correctly specify header-containing folders gcc's '-i' include parameter. other cmake/make-related conversion tools: make so co...

iphone - what are a few main reasons that apple applications crash? -

iphone - what are a few main reasons that apple applications crash? - what faults in xcode cause app crash? nslogs have it? i know vague question, dont know have cause crash. i'm beginner, , im not experienced @ programming, how application manage freeze fricking often? there warnings in few places: local declaration of 'webview' hides instance variable in nsurlrequest *currentrequest = [webview request]; 'dyang_s_game' may not respond 'generatewordsarray' in [self generatewordsarray]; bad memory usage, , coding errors, (that not show errors) , warnings can usualy turn out crash iphone xcode

java - LibGdx (OpenGl ES/Android) - Calling Texture.createGLHandle multiple times returns textureid of newly created texture overwriting it -

java - LibGdx (OpenGl ES/Android) - Calling Texture.createGLHandle multiple times returns textureid of newly created texture overwriting it - android 2.1 - eclipse what steps reproduce problem? 1. create new texture(managed) using new texture(filehandle, format, bool); - glgentextures called - glhandle created (logcat: 100271) "bg_plainred.png" - uploadimagedata calls glbindtexture(100271) create new texture(managed) using new texture(filehandle, format, bool); - glgentextures called - glhandle created (logcat: 315638026) "body2.png" - uploadimagedata calls glbindtexture(315638026) at point, textured sprites render correctly.. 2. call texture.dispose(); "bg_plainred.png" - gldeletetextures(glhandle) (logcat: glhandle = 100271) 3. create new texture(managed) using new texture(filehandle, format, bool); - glgentextures called - glhandle created (logcat: 100271) "bg_wallpaper.png" - uploadimagedata calls glbindte...

javascript image gallery with adjusted navigation for mobile platforms -

javascript image gallery with adjusted navigation for mobile platforms - i want create javascript image gallery (with 6 thumbnails in row , many rows fit page. clicking thumbnails bring popup box images , video) @ bottom of page there numbered pagination. however, create on mobile platform (android/iphone) user can paginate swiping pages go forwards or backward. how adjust pagination mobile platform? should utilize specific crossplatform tool sencha create gallery? have thought using jquery mobile ? http://jquerymobile.com/ mobile navigation image-gallery

Java database compatibility -

Java database compatibility - will code communicates ms access 2007 database work ms access 2003 database well? , vice versa. how compatible jdbc stuff different versions? thanks. there odbc-jdbc bridge, java can connect can setup odbc driver to. of course, drivers "pass" sql database, if code used querys specific of database work on database won't on else. java database ms-access

php - File manager with auto-renaming of files and strict validation -

php - File manager with auto-renaming of files and strict validation - i'm looking develop file manager has unusual requirements. thought authenticated user can upload new files, re-order existing ones (through drag , drop), , delete - nil new here know. however, files beingness used part of media presentation , have strict ordering , naming convention, i'd thought i'd allow them upload files name, renaming on fly, @ point can determine name should be, in line exists in folder. basically, every alter made has potential knock on effect file names within folder. added this, want set versioning scheme alternative roll previous states. i'm leaning towards php , jquery solution, building on top of out there. there out there work me adding validation , processing on top of standard file manager processes? doesn't have php, intranet site running on handful of machines same spec. perchance there solution via java or language... hope isn't vague, hoping ...

html - How to add a woothemes like notification bar? -

html - How to add a woothemes like notification bar? - i add together fixed notification bar (like yellowish 1 here) on website: http://balloonup.com. tried set followings after body: <div id="notification-wrapper" style="border-bottom: 1px solid #c69a00; background-color: #fef28f;top:0; position: fixed;z-index: 99999;width: 100%;"> <em>hello world!</em> </div> unfortunately, yellowish bar overlaps header. any idea? in woothemes illustration they've pushed downwards first content box (#top) through margin-top height of "notification bar" @rockinthesixstring wrote. html css notifications wordpress-theming

CSS - Drop Line Menu Problem -

CSS - Drop Line Menu Problem - i cant seem css positioning right new line drops links when user hovers on category sub categories. i wondering how can accomplish this? i have many sub sub categories 6 levels deep allow know. here css. #nav-container { border-top: 2px solid #000000; float: left; font-weight: bold; margin: 0; padding: 5px 0px; width: 100%; background: #0098ff; list-style-type: none; } #nav-container ol { list-style-type: none; margin: 0 auto; padding: 0px; text-align: left; width: 1024px; } #nav-container li { float: left; margin: 0px; padding: 0px; width: auto; } #nav-container ol h2 { font-size: .9em; margin: 0px; width: 236px; float: left; } ul.cat-container li { display: none; } ul.cat-container > li { display: list-item; } ul.cat-container li:hover > ol > li { display: list-item; } ul.cat-container ol { list-style-type: none; ma...

Modifying Django UserCreationForm -

Modifying Django UserCreationForm - i wanted add together more fields standard django usercreationform went ahead , subclassed within of app's forms.py file , ended this: class customusercreationform(usercreationform): email = forms.emailfield(label = "email") first_name = forms.charfield(label = "first name") last_name = forms.charfield(label = "last name") class meta: model = user fields = ("first_name", "last_name", "username",) def save(self, commit=true): user = super(customusercreationform, self).save(commit=false) user.first_name = first_name user.last_name = last_name user.email = self.cleaned_data["email"] if commit: user.save() homecoming user i went ahead , created custom modeladmin users, looks this: class customuseradmin(useradmin): add_form = customusercreationform inlines = [pr...

javascript - Programmatic interface to Rhino compiler? -

javascript - Programmatic interface to Rhino compiler? - i've found rhino js compiler documentation, says how compile js -> jvm, documented interface i've found command-line tool. also, seems built "script (list of commands)" -> "runnable main() method" utilize case, , not (for example) subclassing specific java class. is there easy way utilize rhino code generator generate .class file class define? specifically, i'm trying implement interface utilize java library turn around , utilize inspection on it, normal interpreter mechanism of implementing interface in rhino won't work here. i not familiar these specifics of rhino, java documentation on javax.script has straightforward section titled implementing java interfaces. perhaps helpful. javascript jvm bytecode rhino

How do I query UUIDs stored as binary in a database (JPA/Hibernate/MySQL) -

How do I query UUIDs stored as binary in a database (JPA/Hibernate/MySQL) - i have java/jpa/hibernate/mysql based app. want utilize uuids object identity, want ensure database performance not suffer. i found great blog posting jpa , uuid primary keys gets me of way there. notice how storage of uuid optimized storing in binary form (versus string representation. it solves part of problem, because can insert objects efficiently database. however, have issue when want query database using entitymanager.createquery. possible/desirable query against binary data? or, should store string uuid along-side binary version facilitate querying? tested hibernate 4.1.2 , mysql-connector-j 5.1.18, can define uuid field: @entity class entitytype { @column( columndefinition = "binary(16)", length = 16 ) private uuid id; } ...and query uuid instance: uuid id = ....; entitytype result = em.createquery( “select x entitytype x x.id = ?1″, entitytype.class ) ...

How do I print a List of anything in Scala? -

How do I print a List of anything in Scala? - at moment have method prints ints def printlist(args: list[int]): unit = { args.foreach(println) } how modify flexible plenty print list of anything? since println works on anything: def printlist(args: list[_]): unit = { args.foreach(println) } or better, aren't limited list s: def printlist(args: traversableonce[_]): unit = { args.foreach(println) } scala

javascript - How to write a regex for string matches which starts with @ or end with ,? -

javascript - How to write a regex for string matches which starts with @ or end with ,? - how write regex string matches starts @ or end , . looking code in javascript. regex solution be: class="snippet-code-js lang-js prettyprint-override"> var rx = /(^@|,$)/; console.log(rx.test("")); // false console.log(rx.test("aaa")); // false console.log(rx.test("@aa")); // true console.log(rx.test("aa,")); // true console.log(rx.test("@a,")); // true but why not utilize string functions first and/or lastly characters: class="snippet-code-js lang-js prettyprint-override"> var strings = [ "", "aaa", "@aa", "aa,", "@a," ]; (var = 0; < strings.length; i++) { var string = strings[i], result = string.length > 0 && (string.charat(0) == "@" || string.slice(-1) == ","); c...

How to get Enum Value from index in Java? -

How to get Enum Value from index in Java? - i have enum in java: public enum months { jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec } i want access enum values index, e.g. months(1) = jan; months(2) = feb; ... how shall that? try this months.values()[index] java enums

Excel VBA store countifs output for further operation -

Excel VBA store countifs output for further operation - i writing application in vba excel. using conditions , counting number of records next functions working fine. cnt = appexcel.application.countifs(r1, audittype, r2, "fail", userrange1, username & "*") here r1,r2 , userrange1 range types describing individual cells. if print r1.address '$e:$e r2.address ' $m:$m on. i getting number of rows nowadays criteria in "cnt" variable. i need farther manipulation searching custom cells above range of cells. need store addresses in "range" object. please guide me how can store filtered records in range. don't want re-create area also. you add together new range worksheet declaring name object in vba , setting it's refersto value address. illustration adds needed declarations , code this. assumes interested in cells in r1 range contain constants: dim rngfiltered excel.range dim nmnew excel....

php - Can't use method return value in write context -

php - Can't use method return value in write context - the next if status causing error: if( !empty ($this -> session -> userdata( 'user_id') ) ) { $user_id = $this -> session -> userdata( 'user_id' ); } else { $error = "id doesn't exist"; } i next error: fatal error: can't utilize method homecoming value in write context in (line number) how can prepare it? replace first if statement if( ! $this->session->userdata('user_id') ) . the empty function check if variable empty userdata function. additionally, information, according codeigniter documentation, userdata function returns false if item doesn't exist, means if user_id doesn't exist in session, code in else executed. php codeigniter

ruby - Rails STI models with the same name but inheriting from another model -

ruby - Rails STI models with the same name but inheriting from another model - my rails application uses sti have 2 different types of customers. 1 person client , other company customer. so in people controller want instantiate customer. (so type attribute of person customer). my client model inherits person model. model filename called customer.rb in companies controller want instantiate customer, 1 time again uses customer.rb, won't work because inherits person still. how can utilize same model, each model needs inherit model? #models/customer.rb class client < person end #models/customer.rb class client < company end i tried moving customer.rb different directories, e.g. person/, company/ i'm not sure if correct. maybe should utilize modules? that not work. cannot have 2 distinct classes same name, , class cannot inherit 2 classes. maybe can utilize polymorphic association between client , person/company. class person has_ma...

jQuery Mobile: Closing a dialog navigates back to the wrong page -

jQuery Mobile: Closing a dialog navigates back to the wrong page - i have form when posted redirects page. page presents series of links, each 1 opening dialog box. my issue when close dialog box jquery mobile navigates wrong url - not 1 dialog called, 1 before. here's code: the page served through form redirect manually specifies url product of redirect. <div data-role="page" data-url="/call/stockquestions"> when on page url looks follows: http://localhost:60887/#/call/stockquestions the link dialog looks follows: <a href="/call/editstocksummary/529" data-rel="dialog" class="ui-link">set stock detail</a> clicking opens form up. when click cancel jquery mobile navigates to: http://localhost:60887/#/call anyone have ideas doing wrong here? thanks try updating recent version of jquery mobile. had similar issues , update sorted it. jquery jquery-mobile

visual studio 2010 - strange problem with referenced log4net assembly -

visual studio 2010 - strange problem with referenced log4net assembly - i'm not sure if problem connected log4net or problem vs. everytime i'm trying, have same result. let's start beginning. i'm creating console application (.net 4) , using nuget install log4net library. now, when want add together code it, intellisense works ok: but when seek compile it, have error this 1 assembly found moment, have problem with. have absolutly no thought (and why) going on. have checked 2 other solutions , problem same. have not checked manually downloaded version yet. most there underlying dependency missing. 1 mutual reason project using client profile instead of total .net 4.0. (not sure log4net, run lot when including 3rd party libraries, esp. ties web). if correct, going properties , changing framework version total .net 4.0 solve issue. visual-studio-2010 reference

android - Setting the file and Video permission... so, as to use the content only by the application -

android - Setting the file and Video permission... so, as to use the content only by the application - how can accomplished task avoid re-create paste , read content store in sdcard or phone memory, application can utilize it. give thanks concern. to create files private application in internal storage internal storage you encrypt info of course of study encrypt info on sdcard. android

Sending continuous Ajax .post var using jquery to server -

Sending continuous Ajax .post var using jquery to server - i want continuously maintain sending update server using jquery. interval nil. best way this? updating cursor position of 1 time person on others screen. practical implementation in prototype of html5 whiteboard. what options available. which best way , implications. function send_position(){ //code post } setinterval( "send_position()", 10 ); will method ok? either using window.settimeout() described robert or, if utilize html5, utilize websockets: http://code.google.com/p/jquery-websocket/ jquery ajax setinterval continuous

c# - How to include a link in AddModelError message? -

c# - How to include a link in AddModelError message? - i want add together modelstate error, so: modelstate.addmodelerror("", "some message, <a href="/controller/action">click here</a>) however, link doesn't encoded, , displayed text. tried using <%= html.validationsummary(true, "some message") instead of <%: html.validationsummary(true, "some message") but no luck. anyone have thought how working? cheers the validationsummary helper automatically html encodes messages. 1 possible workaround write custom validation summary helper doesn't html encode messages: public static class htmlextensions { public static mvchtmlstring myvalidationsummary(this htmlhelper htmlhelper, bool excludepropertyerrors, string message) { var formcontext = htmlhelper.viewcontext.clientvalidationenabled ? htmlhelper.viewcontext.formcontext : null; if (formcontext == null &...

c# - OOP - two tables into the same object -

c# - OOP - two tables into the same object - i have 2 tables in database used same thing, tables don't have same structure. lets have 1 table manual requests , table automatic requests. have load both tables same gridview , i'm using custom business objects. to illustrate question i'll phone call tmanualreqtable , tautomaticreqtable. tmanualreqtable - id - field1 - field2 - field3 - field4 and tautomaticreqtable - id - field1 - field3 in code, i'm using same object these 2 tables. have interface properties of both tables , i'm checking if field exists when i'm loading info object. but i'm thinking should created 2 objects , 1 superclass abstracts methods. what sentiment it? i create interface irequest describes fields & methods mutual both, , interfaces & classes manualrequest , automaticrequest implement irequest , add together methods/fields unique each of them. you can utilize irequest type incorpora...