Posts

Showing posts from January, 2011

image - Golang io.Reader issue with jpeg.Decode returning EOF -

i trying take multipart.file io.reader , decode jpeg covert thumbnail using github.com/disintegration/imaging's library. know in advance data going jpeg. when send multipart.file convertimagetothumbnail function , returns unexpected eof every time. doing wrong? package images import ( "github.com/disintegration/imaging" "image" "image/jpeg" "mime/multipart" ) func convertimagetothumbnail(pic multipart.file) (image.image, error) { pic.seek(0,0) // solution seek beginning of file img,err := jpeg.decode(pic) if err != nil { return nil, err } thumb := imaging.thumbnail(img, 100, 100, imaging.catmullrom) return thumb, nil } pic, header, err := r.formfile("avatar") // check error defer pic.close() pic.seek(0,0) before decode fixed issue.

node.js - 15 second delay on second request in node -

i have server need send multiple http requests. every request except first triggers ~15 second delay. if send requests linux console, postman or fiddler works great, without delay, cannot work node. i have tried https.get() , request , sockets , forking request in separate file. delay still there. server replies proper connection: close header. server nginx server. the time works node if put request in separate script , runs script. works because node exits , releases connection after request. i have tried agent: false , i'm sending connection: close server why take 15 seconds close, , why doesn't happen when using fiddler or postman? edit: added code. code works first time run it, if run twice or more delay appears. it's second function causes delay, first function works fine. async.waterfall([ function(cb) { console.log('making first connection'); var post_data = querystring.stringify({ 'login' : username, ...

android - Overflow menu item redirects to facebook, twitter, instagram applications etc -

i able redirect menu items particular website via mobile's browser. want users redirect these social networking website's application if have installed in device. these simple code facebook redirecting website in mobile's browser. please me reach application instead. case r.id.facebook: string url = "https://www.facebook.com/?_rdr=p"; startactivity(new intent(intent.action_view).setdata(uri.parse(url))); break; try this public void redirect(packagename, url) { uri uri = uri.parse(url); intent intent = new intent(intent.action_view, uri); try { intent inappintent = intent; inappintent.setpackage(packagename); startactivity(inappintent); } catch (activitynotfoundexception e) { startactivity(intent); } } call method like: for facebook: redirect("com.facebook.katana", url); for instagram: redirect("com.instagram.android", url); for twitter: redirect(...

r - creating a column with replaced values using mutate and dplyr -

this duplicate somewhere on stackoverflow , followup question dplyr mutate replace dynamic variable name . now trying use variable name new column. something like: library(ggplot2) data(mpg) mpg %>% mutate(hwy=replace(hwy, hwy>29,10)) the code below creates new column called varname want replace column hwy. varname = "hwy" mpg %>% mutate_(varname=interp(~replace(varname, varname>29, 10), varname=as.name(varname))) something like: mpg %>% mutate_(as.name(varname)=interp(~replace(varname, varname>29, 10), varname=as.name(varname))) but doesn't work. think dots notation in play not quite sure how wrap head around it. thank you. rather replace mpg 's existing hwy variable did following illustrate same thing , put context : from previous question: library(dplyr) library(ggplot2) library(lazyeval) data(mpg) # "normal" dplyr <- mpg %>% mutate(hwybin=replace(hwy>25,1,0)) # varying rhs varname <...

Rails loop with number_field params? -

i use 2 number_field numbers, , if minor_sum > minor , create minor_sum - minor +1 objects. <%= f.number_field :minor, :class => "form-control" ,placeholder: "(1~9999)" %> <%= number_field :minor_sum, nil, :class => "form-control" , placeholder: "(1~9999)" %> but when enter 2 number 111,112 , create, it's shows comparison of string array failed and mark line: if minor.present? && minor_sum.present? && minor < minor_sum the following controller: def create minor = params[:beacon][:minor] if params[:beacon][:minor].present? minor_sum = params[:minor_sum] if params[:minor_sum].present? if minor.present? && minor_sum.present? && minor < minor_sum.to_i while minor < minor_sum @beacon = beacon.new(beacon_params) ... minor += 1 end else ... end end does means got params number_field...

jquery - How to write the " <a href='javascript: function" and pass parameter at .ashx -

i want write table edit , delete event call javascript function @ .ashx. , use jasn pass table html .aspx. don't know how pass parameter javascript function @ .ashx <td rowspan='2'><a href='#' class='toggle'><img title='details' src='/images/detail24.png'/></a>&nbsp;<a href='javascript:editrow('' + i_dtdata.rows[nrow][1].tostring() + ''); return false;' class='toggle'><img title='edit' src='/images/edit24.png'/></a>&nbsp;<a href='javascript:deleterow('" + i_dtdata.rows[nrow][1].tostring() + "'); return false;' class='toggle'><img title='delete' src='/images/delete24.png'/></a>" http://i.stack.imgur.com/ck5ca.png

jquery - MVC partial load in document.ready not getting fired -

i have <div id="reports"> <img src="~/content/img/wait.gif" />loading reports... </div> ... @section scripts { <script type="text/javascript"> $(document).ready(function () { alert('test'); $("#reports").load('/report'); $("#reporttype").change(checkreportselection); checkreportselection.apply($("#reporttype")); }); </script> } on machine, #reports loaded data report controller page loaded. tried on different machine, targeting machine , worked fine. host machine windows 10. when deployed machine server 2012 r2, "loading reports..." stays , report controller not invoked (checked using debugger). tried using chrome , ie , doesn't work. i alert know document.ready fired. what issue? thanks turns out issue path. charlietfl. using url.content(...) ...

matlab - How to convert data from [-1,1] to [0,255]? -

i have arrays of data in range [-1,1] , need convert them range [0,255] in matlab. either formula or code! (i checked matlab functions not find function related conversion!) see small piece of exmaple code. n = 10; = 2*rand(1,n) - 1; % random data in [-1,1] b = 255/2*(a+1); % linear projection [0,255]

python - Google App Engine - Multiple child/parent -

i want make friend system have db model this: class users(ndb.model): username = ndb.stringproperty(required = true) bio = ndb.stringproperty() class friend_list(ndb.model): list = ndb.stringproperty(repeated=true) class friend_pending(ndb.model): list = ndb.stringproperty(repeated=true) friend_pending model friend not yet accepted. while friend_list model friend accepted. i want make both friend_list , friend_pending child of users entity. possible? here's second approach if not possible: class users(ndb.model): username = ndb.stringproperty(required = true) bio = ndb.stringproperty() class friend_list(ndb.model): user_username = ndb.stringproperty(required = true) list = ndb.stringproperty(repeated=true) class friend_pending(ndb.model): user_username = ndb.stringproperty(required = true) list = ndb.stringproperty(repeated=true) if both possible, better cost , performance? i...

ios - Using UIScrollView to show different views flipping -

i'm trying use uiscrollview in addition uipagecontrol show paging image of sorts. mock version of record sleeve, im not sure how make views page. have table on first section, , works correctly, don't know how add second. don't want in code, want in nib. i'm using mono touch , xamarin know things different. need best practice add subview uiscrollview , , make compatible iphone models.

java - Interface object not working when called from another fragment -

ok, have android app login node.js server. file structure consist of: mainactivity.java, firstfragment.java, middleman.java, , mysocket.java. mainactivity.java package ""; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.widget.edittext; import java.net.urisyntaxexception; public class mainactivity extends activity implements middleman { string server_address = ""; mysocket my_socket; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item cl...

c - X11: how to properly support a 16-bit per pixel display -

i'm doing xlib programming , have support 16-bit display. far know operating truecolor display. there rule of thumb on how allocate colors , free them? on 24 bits displays use raw rgb values colors. a truecolor visual has fixed colormap can convert rgb pixel value using xalloccolor() usual. xgetvisualinfo() return bitmasks need shift , mask rgb values if prefer.

c++ - Stream Iterators - stream of bytes -

reading files array of bytes can accomplished using istream_iterator. for example: std::ifstream afile(somefile); noskipws(afile); ... std::vector<uint_8> vofbytes = { std::istream_iterator<uint8_t>(afile), std::istream_iterator<uint8_t>() }; i have need able same vectors , strings. problem these in size. for example: std::string astring = "abc"; std::wstring awstring = l"abc"; std::vector avector<uint32_t> = { 0, 1, 2, 3 }; // std::distance(asv.begin(), asv.end()) == 3 std::vector<uint8_t> asv = { /* astring std::vector<uint8_t> */ }; // std::distance(awsv.begin(), awsv.end()) == 6 std::vector<uint8_t> awsv = { /* awstring std::vector<uint8_t> */ }; // std::distance(uiv.begin(),uiv.end()) == 16 std::vector<uint8_t> uiv = { /* avectorto std::vector<uint8_t>*/}; i have been looking through cpp reference bit , have not come across way treat above stream of ...

mysql pdo update record using LEFT JOIN -

"update tablename1 t1 left join tablename2 t2 on t1.pin = t2.pin , t1.status = t2.status left join tablename3 t3 on t1.pin = t3.pin , t1.status = t3.status left join tablename4 t4 on t1.pin = t4.pin , t1.status = t4.status left join tablename5 t5 on t1.pin = t6.pin , t1.status = t6.status left join tablename6 t6 on t1.pin = t6.pin , t1.status = t6.status left join set t1.status = : status, t2.status = : status, t3.status = : status, t4.status = : status, t5.status = : status, t6.status = : status t1.pin = : pin , t1.status = : active " this query updating multiple tables @ same time. of tables might empty used left join update table values. got error near 'set t1.status = 'notactive' , t2.status = 'n' @ line 7' did change , and still error , when search error uncaught exception 'pdoexception' message 'sqlstate[42000] of things found appears when there reserved word . far concern there no reserve word in code....

How to start Snipping Tool from PowerShell? -

i trying use snipping tool command line. can run run box, despite how try , different ways cannot open snipping tool on windows 7 powershell. sick of having use mouse open snipping tool. start process: [system.diagnostics.process]::start("c:\windows\system32\snippingtool.exe") call operator: & "c:\windows\system32\snippingtool.exe" dot-sourcing: . c:\windows\system32\snippingtool.exe using inovke-item : ii "c:\windows\system32\snippingtool.exe" change directory: ps c:\windows\system32> ./snippingtool.exe try using start-process "c:\windows\sysnative\snippingtool.exe" -edit add, if run x86 (32-bit) powershell console, you'll have use sysnative because on 64-bit system, c:\windows\system32 64-bit processes. open x64 powershell console, , c:\windows\system32 work expected. additionally, c:\windows\syswow64 contains 32 bit binaries. safe , use c:\windows\sysnative , won't have think type of thing...

how do not load un-used repository service in spring data couchbase? -

i writing library uses spring data couchbase interacting couchbase. there several buckets being accessed using spring data couchbase. don't want load of them. load specific repository based on input parameter passed during initialization of library. how do that?

java - How to ignore a specific field while parsing a JSON into map -

Image
i want parse below json pojo. using jackson parse json. { "totalsize": 4, "done": true, "records": [ { "attributes": { "type": "oppor", "url": "/service/oppor/456" }, "accountid": "123", "id": "456", "proposalid": "103" } ] } in above json, fields "totalsize", "done", "records" , "attributes" known fields. whereas, "accountid", "id" , "proposalid" unknown fields. , in above json, don't need "attributes" part of bean object. and here equivalent bean class json public class result { private int totalsize; private boolean done; private list<map<string, string>> records; public int gettotalsize() { return totalsize; } public void settotalsize(int total...

c# - Herocard not displaying more than 3 buttons in skype Microsoft bot framework -

i've added 6 buttons in hero card , tried display them. works fine in teams , emulator doesn't work on skype. displays 3 buttons. private list<cardaction> getcardbutton(list<string> opts) { list<cardaction> cardbuttons = new list<cardaction>(); int = 1; foreach(string opt in opts) { cardaction plbutton = new cardaction() { title = opt, type = "postback", text = i.tostring(), value = i.tostring() }; cardbuttons.add(plbutton); i++; } return cardbuttons; } //passing list of strings. list<cardaction> cardbuttons = getcardbutton(cardopts); herocard plcard = new herocard() { title = "try here", text = "with:", buttons = cardbuttons }; plattachment = plcard.toattachment...

django join to model with same User -

i want connect post model userimage can jointly represent post , corresponding related user image must displayed. please tell me how generate query. views instance = postmodel.objects.order_by('-updated') model userimage: class userimage(models.model): user = models.foreignkey(user,on_delete=models.cascade) profileimage = models.imagefield(upload_to="userprofile/") model contain post detail: class postmodel(models.model): title = models.charfield(max_length=100) author = models.foreignkey(user,default=none) body=models.textfield() slug = models.slugfield(unique=true) subject=models.textfield() timestamp = models.datetimefield(auto_now_add=true,auto_now=false) updated = models.datetimefield(auto_now=true,auto_now_add=false) ideally every user should have 1 profile. so, userprofile model should connected user model using onetoonefield class userimage(models.model): user = models.models.onetoone...

javascript - three.js JsonLoader is not showing JSON object converted from .obj -

Image
i have code: var camera, scene, controls, renderer; init(); animate(); function init() { scene = new three.scene(); camera = new three.perspectivecamera(75, window.innerwidth / window.innerheight, 0.1, 100); camera.position.z = 10; //lights var light = new three.directionallight(0xffffff, 1); light.position.set(10, 10, 10); scene.add(light); controls = new three.orbitcontrols(camera); controls.addeventlistener('change', render); renderer = new three.webglrenderer({alpha: true}); renderer.setclearcolor(0x000000, 0); // default renderer.setsize(window.innerwidth, window.innerheight); document.body.appendchild(renderer.domelement); var jsonloader = new three.jsonloader(); var mesh; ...

database - how to format date in "YYYY-mm-dd" format using hql? -

when use ms sql database, convert date in timestamp "yyyy-mm-dd" format. convert(date, "timestamp") i need same function using hql. which function remove time indices , give date in "yyyy-mm-dd" format? you use following converts date string specified format to_char(mydate,'yyyy-mm-dd')

javascript - close an object tag in html5 -

i loading html page in tag , getting loaded in overlay <div id="overlay-inabox4" class="overlay"> <div class="wrapper"> <object id="sendmessageoverlay" data="http://localhost:8000/messages/write/?recipients={{ context_user.username }}" style="height:25rem; width:50rem;" /> </div> </div> after doing operation in overlay want close it. how can this? i tried doing changing css of $('.overlay') display:none, wont work because $('.overlay') not accessible within object tag contents.

Powershell Invoke-Command -Computername without FQDN -

i’m using tool uses invoke-commands. test-connection , other commands works without qualified domain name when type in computer name. when want use invoke commands have use fqdn of computer. notice that? or workaround? help! i think might provide answer question along why that. pretty positive commands share enought similarities experience same problem. powershell remoting ip-address target

automated tests - How to execute RFT scripts on a remote machine -

i have rational functional tester installed on local machine, , have written scripts. need run these scripts on remote machine. research shows should be: using rational test manager but rational test manager obsolete, since 2010. i tried putting scripts on rqm , run through web on remote machine, scripts run rqm need adapter resides on local machine. how run rft scripts on remote machine without installing rft there? execute rft test script using agent controller? "post rft 8.2.0.1 , able execute script on remote machine rft must installed on machine. *****edit*** rft's installation complete package installation ,meaning when install rft installs complete product capable of recording /playback scripts on supported domains. so it's not possible on machine x install recorder , on machine y install playback engine. approach perhaps have kind of tool on server machine here script , go , execute on machine z , not have rft installed .. script ma...

javascript - Nested setTimeouts with the same name , any repercussions doing this ? -

i going through source code of typed.js , main function in plugin uses design pattern of multiple settimeout's nested inside 1 another, have @ code: self.timeout = settimeout(function() { // check escape character before pause value // format: \^\d+ .. eg: ^1000 .. should able print ^ using ^^ // single ^ removed string var charpause = 0; var substr = curstring.substr(curstrpos); if (substr.charat(0) === '^') { var skip = 1; // skip atleast 1 if (/^\^\d+/.test(substr)) { substr = /\d+/.exec(substr)[0]; skip += substr.length; charpause = parseint(substr); } // strip out escape character , pause value they're not printed curstring = curstring.substring(0, curstrpos); } if (self.contenttype === 'html') { // skip on html tags while typing var curchar = curstring.substr(curstrpos).charat(0); if (curchar === '<' || curc...

php - posting array of checkboxes in a dragable UI: not getting posted -

i using array of checkboxes in draggable ui, can change row order drag , drop. when drag bottom entries top not getting checked checkboxes on post. you can try moving row in inspect element. <form type="post" name="chekfrm" action="index.php"> <table> <tr><td><input type="checkbox" name="dconf_check[]" value="18" checked="checked" id="dconf_18" title="name"></td></tr> <tr><td><input type="checkbox" name="dconf_check[]" value="13" checked="checked" id="dconf_13" title="name"></td></tr> <tr><td><input type="checkbox" name="dconf_check[]" value="19" checked="checked" id="dconf_19" title="name"></td></tr> </table> <input type="submit" name=...

How to read a PDF file in android application without Intent -

this question has answer here: render pdf file using java on android 8 answers i going read pdf file sdcard , load android application without starting pdf reader installed on android device! is possible? how? thanks! or if have access internet, upload google drive , view online. need browser in case.

org.apache.spark.shuffle.FetchFailedException -

i running query on data size of 4 billion rows , getting org.apache.spark.shuffle.fetchfailedexception error. select adid,position,userid,price ( select adid,position,userid,price, dense_rank() on (partition adlocationid order price desc) rank traininfo) tmp rank <= 2 i have attached error logs spark-sql terminal.please suggest reason these kind of errors , how can resolve them. error logs the problem lost executor: 15/08/25 10:08:13 warn heartbeatreceiver: removing executor 1 no recent heartbeats: 165758 ms exceeds timeout 120000 ms 15/08/25 10:08:13 error taskschedulerimpl: lost executor 1 on 192.168.1.223: executor heartbeat timed out after 165758 ms the exception occurs when trying read shuffle data node. node may doing long gc (maybe try using smaller heap size executors), or network failure, or pure crash. spark should recover lost nodes one, , indeed starts resubmitting first stage node. depending how big cluster, may succeed or not.

python - Change logging colors in PyDev windows -

Image
i'm using pydev , i'm trying change default colors of logging messages (for example - make info green...). i've tried use colorlog , colorama colors in console (both standard , interactive) remain same. below code i've used: import logging import colorlog colorlog import coloredformatter import colorama colorama import init init() formatter = coloredformatter("%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s", datefmt=none, reset=true, log_colors={ 'debug': 'cyan', 'info': 'green', 'warning': 'yellow', 'error': 'red', 'critical': 'red', } ) logger = logging.getlogger('example') handler = logging.streamhandler() handler.setformatter(formatter) logger.addhandler(handler) logger.setlevel(logging.debug) return logger def main(): """create , use logger.""" logge...

Android WebView - CSS not working -

using android 5.0.2... the following not showing properly. unable see styling. <!doctype html> <html> <head> <style> .bodybg{ background: linear-gradient(#88ddff, #55aaff); width:100%; height:100%; background-position: 0, 0; background-size: 100%, 100%; position: absolute; } </style> </head> <body> <div class="bodybg"> ... </div> </body> </html> the webview loaded html that. webview webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); inputstream inputstream = context.getresources().openrawresource(r.raw.html_page); byte[] bytes = new byte[inputstream.available()]; inputstream.read(bytes); final string html = new string(bytes); webview.loaddata(html, "text/html", null...

php - Handling send email error on Laravel 5 -

i trying send email confirmation user on local got error. swift_transportexception in abstractsmtptransport.php line 383: expected response code 250 got code "521", message "521 5.2.1 must complete image puzzle before sending. please goto http://challenge.aol.com/spam.html how can catch error messenger , return client. please give sugestion. thank

php - How to execute heavy task? -

i need parse big excel file , convert json format, however, got error when tried so: maximum execution time of 60 seconds exceeded what right way handle this? upload excel file, user see waiting animation, until parsing done. also, if user refreshed page, see waiting animation if parsing not done yet @ server side. how break task sub tasks, , manage them till executed? what's right way in laravel 5? the right way handle long running jobs in laravel use queues . when user uploads excel file, can push new job processing file queue , gets executed in background.

Processing a json parsing in separate java file in android -

i have main_activity class extends activity class. need perform json parsing in java file called json_parsing.java .i planning declare method in json parsing class , create object in main_activity class. doubt is 1) should add json parsing class in android manifest ? if so, how can it? if jsonparsing class doesn't extend activity or isn't service don't need declare in manifest. by way want underline things: create model in class use capitalized letters start class names

c# - stringbuilder.tostring() assigned to datatable.select() not always working, any ideas why? -

datarow[] dr = datatable.select(stringbuilder.tostring()); this code selects looks like. if parameter of string type, it's fine.but if happens above, doesn't seem work time. fine until yesterday , code broken today. any ideas cause this? went stringbuilder since constructing select statement concatenating strings the construction of select statements happen through switch, example compare equality (we're applying filters) below: select.appendline(filter.column); select.appendline(" "); select.appendline(comparisonoperatorsenum.equal); select.appendline(" '"); select.appendline(filter.value.tostring()); select.appendline("' "); i suggest changing appendline append . open sql injection attack. suggest select.append(filter.value.tostring().replace("'", "\"");

Why does the Maven site for my plugin not show the parameters from the base class? -

i'm writing maven plugin, parameters common mojos. that's why wrote abstract base class containing them. works build, when create maven site plugin, plugin documentation individual goals doesn't show parameters. what doing wrong? or bug of maven site plugin? edit: i need give more details: manage our data configuration , i18n texts in xml files. @ runtime, data resides in database. purpose of plugin check xml (two goals), compare database (two goals) , copy database (two goals). since parameters required in goals, have abstract base classes contain maven parameters. here's hierarchy comparison goals: abstractmojo +-- basereferencedatamojo +-- basereferencedatabasemojo +-- basecomparisonmojo +-- configurationcomparisonmojo +-- i18ncomparisonmojo so, instance in basereferencedatamanagermojo , have following maven parameters: public abstract class basereferencedatamanagermojo extends abstractmojo { ... /** * maven p...

Progress Bar in Python Console on Windows -

i have gone through below 2 links in addition others , have tried examples , suggestions provided, in output progress bar not getting updated, rather new 1 shows, either end of same line or alternately on new line. missing here, can please guide me. python progress bar text progress bar in console for ease, reproducing of codes (from examples of above threads) have tried , outputs. did understand incorrect update same line or missing. appreciate help. using python 3.4 on windows 7 , getting output on console (no gui). example 1: import progressbar import time, sys progress = progressbar.progressbar() in progress(range(80)): time.sleep(0.01) output 1: >>> 0% | | 1% | | 2% |# | 3% |## ...

ios - Disabling Horizontal Scrolling from UIScrollView Swift -

scroll view i have uiscrollview, constraints left: 0, top: 0, right: 0, bottom: 0 inside scroll view at top of uiscrollview uiimageview constraints left: 0, top: 0, right: 0, height: 200 underneath have uitextview constraints left: 0, top: 0, right: 0, bottom: 0 this means uitextview resize respect content, , set scrollingenabled false uitextview . so, when run, almost works perfectly. the 1 problem uiimageview takes 10% more actual screen width. hence, horizontal scrolling enabled. i have tried adding lines imageview.frame = cgrect(0, 0, screensize.width, 200) scrlview.contentsize.width = screensize.width but makes no difference. can still scroll horizontally , image view still takes around 10% more actual screen width. note, have not set imageview screen width in storyboard, programatically. any ideas? like this, func scrollviewdidscroll(scrollview: uiscrollview) { if scrollview.contentoffset.x>0 { scrollview.contentoffset...

opengl - GLUT animation with glutPostRedisplay -

is there difference between calling glutpostredisplay() @ end of display function , using idle function callback nothing call display function? have seen both ways used in examples , cannot tell difference observation. a main loop looks this: process , handle events calling stuff glutkeyboardfunc / glutmousefunc . advance/update 3d state (physics/animation etc) typically in glutidlefunc re-draw scene if needed use glutdisplayfunc glutpostredisplay sets flag, tells glut call display callback on next loop iteration. doesn't call display [1] [2] . if have game, updates every frame might not useful. maybe if you're alt-tabbed or dragging window don't need calling display. or might frame limiting dropping frames (although i'd suggest this ). void idle() { ... animatedthing.value += deltatime glutpostredisplay(); //scene changing. call display } having "dirty" flag becomes more useful when don't need re-render cont...