Posts

Showing posts from May, 2012

How to change Python shell editor to vim -

i have question how change python shell editor. simple example: $python python 2.7.3 (default, aug 1 2012, 05:14:39) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import datetime >>> help(datetime) the help() command opens unkonwn editor default. can change make open docs in vim instead? help() should open pager, not editor. sounds environment variables bit mixed up. pager controlled $pager , , if blank use more . should unset it. the default editor, (eg) ipython uses %edit command, can set via $editor variable.

asp.net - Model Popup extender not working -

i working on project , want popup panel on click of button not working reason behind ..as tried after updating ajax toolkit again not working. please give me solution that. here have tried: <form id="form1" runat="server"> <div> <asp:toolkitscriptmanager id="toolkitscriptmanager1" runat="server"></asp:toolkitscriptmanager> <asp:button id="btnshowpopupisbn" runat="server" style="display:none" /> <asp:modalpopupextender id="modalpopupextender1" runat="server" targetcontrolid="btnshowpopupisbn" popupcontrolid="pnl_isbn" cancelcontrolid="btncancel" backgroundcssclass="modalbackground" popupdraghandlecontrolid="pnlpopup"></asp:modalpopupextender> <asp:panel id="pnl_isbn" runat="server" visible="false" width="400px"cssclass="colo

vb.net - Decoding HTML and databinding into a ASP.NET repeater -

i have separate page use server.htmlencode feature encode html user has entered inside of htmleditorextender on textbox. i trying insert html repeater so: <asp:repeater id="articlelist" runat="server"> <itemtemplate> <div class="itemtemplate"> <h2><%#container.dataitem("title")%></h2> <h5>category:</h5> <%#container.dataitem("category")%><br /> <%#container.dataitem("decodedhtml")%> <%#container.dataitem("username")%> <%#container.dataitem("dateofpost")%> </div> </itemtemplate> <alternatingitemtemplate> <div class="altitemtemplate"> <h2><%#container.dataitem("title")%></h2> <h5>category:</h5> <%#container.dataitem("category")%><br /> <

sql - List of months between two dates, with years in oracle -

i'm storing months , years , hours in different columns, , want sum hours when have entered 2 dates. if have entered 2 dates suppose 03/01/2013 , 03/31/2015 should sum of hours between 03-2013 03-2015 , including months , years in between. select trunc( mod( (date1-date2)*24, 24 ) ) "hr" yourtable check out this article asktom.

ruby - Cannot start a new rails server - sqlite.3h is missing -

i trying run rails server on ruby on windows 7 operating system. made new rails application when try run server following error: d:\projects\rubyonrails>rails server => booting webrick => rails 3.2.13 application starting in development on http://0.0.0.0:3000 => call -d detach => ctrl-c shutdown server exiting d:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem': please install sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 not part of bundle. add gemfile.) trying install activerecord-sqlite3-adapter : d:\projects\rubyonrails>gem install activerecord-sqlite3-adapter error: not find valid gem 'activerecord-sqlite3-adapter' (>= 0) in repository error: possible alternatives: activerecord-jdbcsqlite3-adapter, activerecord-sqlserver-adapter, activerecord-bq-adapter, activerecord-simpledb-adapter, activerecord-mysql2-adapter after try install sqlite3 gem f

php - Yii how to use model update even if the record is new -

i have system important close realtime possible. reason when i'm fetching data external source want use $model->update instead of executing 2 queries : $model->find() if(new) $model->save else $model->update this time consuming...can use $model->update , if record new create it? i looked @ code update, i'm not sure how override it. public function update($attributes=null) { if($this->getisnewrecord()) throw new cdbexception(yii::t('yii','the active record cannot updated because new.')); if($this->beforesave()) { yii::trace(get_class($this).'.update()','system.db.ar.cactiverecord'); if($this->_pk===null) $this->_pk=$this->getprimarykey(); $this->updatebypk($this->getoldprimarykey(),$this->getattributes($attributes)); $this->_pk=$this->getprimarykey(); $this->aftersave(); return true; } else

java - Getting 1 second sample using Xuggler -

i have issues regarding xuggler api, i want create little class, once mp3 file opened, gets raw bytes it, but, how many? have 1 second sample original file. this current code: public byte[] getsamples(int ibytesqtty){ byte[] rawbytes = null; /** go correct packet */ while (this._inputcontainer.readnextpacket(this._packet) >= 0){ system.out.println(this._packet.getduration()); /** once have packet, let's see if belongs audio stream */ if (this._packet.getstreamindex() == this._iaudiostreamid){ iaudiosamples samples = iaudiosamples.make(ibytesqtty, this._audiocoder.getchannels()); //system.out.println(">> " + samples.tostring()); /** because packet can contain multiple set of samples (frames of samples). may need call * decode audio multiple times @ different offsets in packet's data */ int icurrentoffset = 0; while(icurrentoffset < th

javascript - Select previous "this" element -

i have piece of javascript code trying previous element declared. have 2 onclick functions within eachother. $('#formingredient').on("click", '.newingredient', function() { value = $(this).attr('data-name'); $(this).attr('data-isactive', 'true'); $('#newingredientinput').val(value); $('#newingredient').modal('show') $('#createnewingredient').click(function() { inputname = $('#newingredientinput').val(); inputcategory = $('#newingredientcategory').val(); var newingredient = $.ajax({ type: "get", url: '/content/includes/ajax/createnewingredient.php', data: {name: inputname, id_category: inputcategory} }); newingredient.done(function(result) { //pai.showpage(pai['page']); $(this).parent().replacewith('hello'); $('#n

Getting resource not found exception in android app -

i trying build app in aosp, development kit has hdpi density, have double verified following code snippet: switch (getresources().getdisplaymetrics().densitydpi) { case displaymetrics.density_low: log.d(tag, "\n\n\n\n ldpi \n\n\n\n"); break; case displaymetrics.density_medium: log.d(tag, "\n\n\n\n mdpi \n\n\n\n"); break; case displaymetrics.density_high: log.d(tag, "\n\n\n\n hdpi \n\n\n\n"); // ... break; case displaymetrics.density_xhigh: log.d(tag, "\n\n\n\n xdpi \n\n\n\n"); // ... break; } when build application in android file system,and if run it, getting following error: e/androidruntime( 825): java.lang.runtimeexception: unable start activity componentinfo{com.example/com.example.mainactivity}: android.view.inflateexception: binary xml file line #11: error inflating class android.widget.button e/androidruntime( 825): @ android.app.activitythread.performlaunchactivity(activitythread

html - Extra Space on Right Side CSS -

i seem getting space on right side of page. i'm using zurb's foundation/wordpress this. you can check website here: http://tinyurl.com/dypgvgp any ideas? first of don't see space on right in firefox. here's general pointers. if remove limit on x-overflow, can see stuff going on on right. example, page goes on quite bit on right side. might want limit width of main container. here's how disable: html, body { font-size: 100%; /* overflow-x: hidden; */ } this drawing border: *, *:before, *:after { -moz-box-sizing: border-box; } this giving each row margin left , right: .row .row { margin: 0 -0.9375em; max-width: none; width: auto; } hope helps some.

c# - Use view as Crystal Report datasource in Visual Studio 2010 -

i want use crystal reports in website , want display 2 different tables in report. underrstand, should use view, don't know how should use it, or code should write in code behind crystal report viewer? can tell me should here? you need add crystalreportviewer control page want show crystal report on: <cr:crystalreportviewer id="crystalreportviewer1" runat="server" autodatabind="true" /> then in code: reportdocument myreportdocument = new reportdocument(); myreportdocument.load("thenameofyourcrystalreportfile.rpt"); myreportdocument.setdatasource(yourdataset); crystalreportviewer1.reportsource = myreportdocument; once set reportsource, should prompt parameters. look @ here references crystalreportviewer , reportdocument . for loading xsd file dataset: dataset yourdataset = new dataset(); dataset.readxmlschema("dataset1.xsd");

html - Limit number of checkboxes to be selected, jQuery -

a simpler version of question has been posted, i'm having difficulty. say have 5 checkboxes: none apple banana orange pear the user allowed select 2 checkboxes, if "none" chosen, can select one. is possible @ all? try play example: var checked = [], $check = $('.check').change(function() { if (this.value == -1 && this.checked) { $check.not(this).prop('disabled', true).prop('checked', false); checked = []; } else { $check.prop('disabled', false); checked.push(this); checked = $(checked) checked.prop('checked', false).slice(-2).prop('checked', true); } }); http://jsfiddle.net/q7dve/

debugging - IntelliJ IDEA debug jumps inside instead of going over -

i use last stable sbt scala 2.10 , last scala plugin in intellij idea 12.x. , have simple test scala project. i have specs2 test want start debug from. having several breakpoints, i'm expecting going on lines, (from 1 break point - in test , in code), instead: debbuger going somewhere inside library classes, stops there, showing me strange sources. that's reproducible time, , have click 2, 3, 5 times on next-arrow-button (on debug panel) reach next break point (in test or in code). i run test sbt 'test-compile' action, intellij pop-up suggests. aldo found this debug settings scala ("do not step specific scala classes"). have check-box selected. i've post issue in intellij idea site. intellij 15 has support adding breakpoints inside lambdas. see this blog post details.

vb.net - DataGridView ComboBox Cell Causes Program to Crash -

i have datagridview contains 6 columns , 50 rows, 1 of columns datagridview combobox. in collection property of datagridview in designer have entered of items in combobox. when clicking on cell first thing within datagrid works fine , collection populated within combobox. the problem: problem occurs when enter information different cell (text) , leave cell , move on combobox. causes program crash, no exceptions or anything. program crashes in debugger. question has seen crash before, , if how did work around or fix it. debugger crash information: problem signature: problem event name: appcrash application name: client.exe application version: 1.0.1.0 application timestamp: 51825708 fault module name: stackhash_69d8 fault module version: 6.1.7601.17725 fault module timestamp: 4ec49b60 exception code: c0000374 exception offset: 000c380b os version: 6.1.7601.2.1.0.256.1 locale id:

r - Change dots of a ggplot to text labels -

Image
recently asked question getting multiple graphs within 1 picture. got pretty answers 1 question still remains. how change dots scatter plot labels? plot looks now want black dots changed rownames of data. code use plotting follows: plotall<-function(data){ combs <- expand.grid(names(data), names(data)) out <- do.call(rbind, apply(combs, 1, function(x) { tt <- data[, x]; names(tt) <- c("v1", "v2") tt <- cbind(tt, id1 = x[1], id2 = x[2]) })) library(plyr) df.text=ddply(out[out$id1==out$id2,],.(id1,id2),summarise, pos=max(v1)-(max(v1)-min(v1))/2) out[out$id1==out$id2,c("v1","v2")]<-na ggplot(data = out, aes(x = v2, y = v1)) + geom_point(alpha = 0.5) + facet_grid(id1 ~ id2,scales="fixed")+ geom_text(data=df.text,aes(pos,pos,label=id1)) + geom_abline( slope=1 ) + ggtitle("corralation between measured & calculated affinities") + ylab("&q

c# - Using Roslyn to parse/transform/generate code: am I aiming too high, or too low? -

(what i'm trying work around application.settings/mvvm problem generating interface , wrapper class vs-generated settings file.) what i'd is: parse class declaration file generate interface declaration based on (non static) properties of class generate wrapper class implements interface, takes instance of original class in constructor, , 'pipes' properties through instance. generate class implements interface directly. my question two-fold: am barking wrong tree? better off using code-dom, t4, regex(!) this, or part of this? (i don't mind bit of work, learning experience.) if roslyn way go, bit of should looking at? kind of naively hoping there way of walking tree , spitting out bits want, i'm having trouble getting head round whether/how use syntaxrewriter it, or whether use fluent-style construction, querying source multiple times bits need. if want comment on mvvm aspect can, that's not main thrust of question :) if require

sql - How to do natural join when the common column have different names? -

i need natural join on 2 tables named customers , addresses (relationship 1:1), common column in tables key- id (according column natural join operate) . however- column in table customer called "id_customer", , in table addresses it's called- "id". because of that, natural join doesn't work correctly, because program doesn't identify it's same column (by significance). i can not change columns names same (because of many reasons..) there way make work- program understand same columns? so don't use natural join . explicit join instead: from customer c join address on a.id = c.id_customer also, wouldn't surprised if actual join condition were: on a.id_customer = c.id (when using id primary key of tables, practice include table name in foregn reference.) as general rule, natural joins bad choice in long term. might store such queries in stored procedures, triggers, or applications. modifies table s

Why does IBM WebSphere Commerce use Dojo instead of some more popular javascript frameworks? -

one of popular frameworks jquery, there others have lot of community behind them. of dojo books i've found 4+ years old , there seems lot less open source community behind it. sure there lot more ibm's reasons going dojo? ibm uses dojo everywhere (websphere portal, websphere commerce, worklight, bpm, ...). jquery might more popular, doesn't mean it's better. jquery might more open community, has disadvantages. if isn't included in jquery plugins. plugins of jquery never know how long they're going work or how long they're supported. dojo divides dojox library different stages tell how long/well plugin supported. besides better plugin management, dojo has lot more offer makes more complete framework jquery. in opinion, makes dojo toolkit more stable , trustworthy jquery. think dojo more faced towards enterprise community while jquery isn't. ibm delivers lot of software packets/middleware products pointed towards enterprise community t

profiling - Gathering JavaScript memory profile data from users -

i'm writing client-heavy site. since own testing me far, i'd gather statistics on how it's performing in wild. i'm imagining adding sort of profiling code app run percentage of time (so doesn't slow down) , sending info home. adding timing benchmarks should easy, becomes problem long-running pages lots of js memory usage. there way instrument memory used app normal, unprivileged js code in of major browsers? there other profiling metrics available? in chrome: for (var key in performance.memory) { alert(key+': '+performance.memory[key]); } demo: http://jsfiddle.net/usuxv/1/ sample output: jsheapsizelimit: 1620000000 usedjsheapsize: 10000000 totaljsheapsize: 16100000 you can use console.memory . seems return same results.

.net - How to ignore a particular field from an Entity model upon insert? -

we have field in our sql server database table autogenerated sql server, field called createdtime . we have mapped whole database table our datamodel in entity framework, field createdtime . when insert new row in database, via entity framework, not provide value createdtime . this causes insert fail error: sqldatetime overflow. must between 1/1/1753 12:00:00 , 12/31/9999 11:59:59 pm so question is: there way to exclude particular field in entity datamodel in entity framework insert statement? not above error? we keep field createdtime in entity model, because might want access later. i found simple solution problem on thread: http://social.msdn.microsoft.com/forums/en-us/adodotnetentityframework/thread/7db14342-b259-4973-ac09-93e183ae48bb there fernando soto writes: "if go edm designer click on field in table auto-generated database, right click on , select properties , @ properties windows click on storegeneratedpattern , set value computed,

Include Third Party Jars in Hadoop -

i new hadoop. have added gson api mapreducing program. when running program getting; error: java.lang.classnotfoundexception: com.google.gson.gson can suggest me how add third party libraries hadoop? be sure add dependencies both hadoop_classpath , -libjars upon submitting job in following examples: use following add jar dependencies current , lib directories: export hadoop_classpath=$hadoop_classpath:`echo *.jar`:`echo lib/*.jar | sed 's/ /:/g'` bear in mind when starting job through hadoop jar you'll need pass jars of dependencies through use of -libjars . use: hadoop jar <jar> <class> -libjars `echo ./lib/*.jar | sed 's/ /,/g'` [args...] note: sed commands require different delimiter character; hadoop_classpath : separated , -libjars need , separated.

c++ - pass the pointer of image buffer to OpenCV and change the saturation? -

i want pass pointer of image buffer, change saturation , see result immediately. change not applying in buffer , not changing. void changesaturation(void* buffer,int width, int height) { mat matobject(width, height, cv_8uc4, buffer); m_matsource = matobject; mat newmat = m_matsource.clone(); // bgr hsv cvtcolor(matsource, matsource, cv_bgr2hsv); for(int = 0; < newmat.rows; ++i) { for(int j = 0; j < newmat.cols; ++j) { newmat.at<cv::vec3b>(i, j)[1] = 255; //saturationvalue; } } // hsv bgr cvtcolor(newmat, m_matsource, cv_hsv2bgr); // here m_matsource->data change } how can apply change on buffer? i refactored code when trying reproduce problem , in process fixed it. cloned source newmat changed color space of original image , proceed ignore new modified image. try out: void changesaturation(mat& image) { mat result(image.rows, image.cols, image.type()); // bgr hsv cvtcolor(image, result, cv_

java - how to get value from ajax response in different textfields if there is more than one value in response? -

i create program in response coming ajax have 2 values testcode , testname, have 3 text fields in jsp page , 1 testid, when run program , enter testid value in first text field , press tab ajax response coming in testcode , testname present. problem in 2nd , 3rd text field both values(testname,testcode) coming together, want particular testname go particular field ,not both values in same field. code is: index1.jsp(jsp file) <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <script type="text/javascript" language="javascript" src="a.js"

django-ajax-uploader how to send csrf_token with fine-uploader 3.5.0 -

i implementing django-ajax-uploader in project, want use latest version of fineuploader under 3.5.0, supposedly, documentation says thing should send csrf_token putting inside customheaders dictionary: if want use latest version of fine uploader, valum's file-uploader called, instead of 1 bundled django-ajax-uploader, can replacing params arguments in above template following customheaders: customheaders: { 'x-csrftoken': '{{ csrf_token }}', }, here full code: ... <h1>qq-file-uploader</h1> <div id="upload-button" class="btn btn-primary"><i class="icon icon-cloud-upload icon-white"></i> selecciona un archivo</div> <div id="file-upload"></div> </form> {% endblock %} {% block styles %} <link rel="stylesheet" type="text/css" href="{{ static_url }}js/libs/

Is there a analog of complete.cases for variables in R? -

here example illustration: x = data.frame(x1=1:3, x2=2:4, x3=3:5) x # x1 x2 x3 # 1 1 2 3 # 2 2 3 4 # 3 3 4 5 x[2, 1] = na x[3, 2] = na complete.cases(x) # [1] true false false x[complete.cases(x), , drop=false] # x1 x2 x3 # 1 1 2 3 what if instead complete cases, want filter complete variables (columns)? in example above should like: x[,3,drop=false] # x3 # 1 3 # 2 4 # 3 5 or this: x[, complete.cases(t(x)), drop=false] # tks simon

silverlight - Adding new tabs to TabControl -

what want in example make first tab of tabcontrol disappear , add 2 new tabs dynamically. new tabs appear 'header' not showing: itemcollection ic = this.tabcontrol1.items; tabitem firsttab = (tabitem)ic[0]; firsttab.visibility = visibility.collapsed; tabitem newtab = new tabitem(); newtab.headertemplate = firsttab.headertemplate; newtab.header = newtab.name = "test1"; ic.add(new tabitem()); newtab = new tabitem(); newtab.headertemplate = firsttab.headertemplate; newtab.template = firsttab.template; newtab.contenttemplate = firsttab.contenttemplate; newtab.header = newtab.name = "test2"; ic.add(new tabitem()); replace both ic.add(new tabitem()); ic.add(newtab) like this: tabitem newtab = new tabitem(); newtab.headertemplate = firsttab.headertemplate; newtab.header = newtab.name = &quo

winforms - Deleting some content from the text file in c# -

i have text file called load.txt contains approximately 200 lines. have checkbox, if checked want create new file had first 100 lines load.txt. , using c# program. real requirement have delete line 110 201.and code below , because of reason deleting line 1 92. dnt know whats happening. string line = null; string tempfile = path.gettempfilename(); string filepath = savefiledialog1.filename; int line_number = 110; int lines_to_delete = 201; using (streamreader reader = new streamreader(sqlconnectionstring)) { using (streamwriter writer = new streamwriter(savefiledialog1.filename)) { while ((line = reader.readline()) != null) { line_number++; if (line_number <= lines_to_delete) continue; writer.writeline(line);

jquery - Scroll to element returning offset null -

i'm trying element id select box, , scroll element with: // jump services $(function () { $("select.jump").change(function() { var selected = $(this).find("option:selected").val(); console.log(selected); $('html, body').animate({ scrolltop: $("#" + selected).offset().top }, 2000); }); }); console.log(selected) returns id correctly, offset null. it appears bracket , slash issue in id seletors. you mentioned have brackets , slashes in ids. whether or not square brackets or ordinary brackets, brackets have special meaning in jquery selectors . , including slashes, should avoid them altogether in html ids. it's illegal ids if refer w3c spec. square brackets in jquery selectors attribute-related . ordinary brackets in jquery selectors filter-related . see jquery selectors: http://api.jquery.com/category/selectors/ and typical selectors same css selectors , , should

android - Screen orientation change not calling activity methods -

so there lots of posts on topic neither working in case. orientation not calling method of activity. i tried possible ways mentioned like: putting android:configchanges="orientation|keyboardhidden|screensize" in calling activity. then putting onconfigurationchanged method as: @override public void onconfigurationchanged(configuration conf) { super.onconfigurationchanged(conf); system.out.println("on onconfigurationchanged called.............."); } but not getting called. oncreate() , onresume() , onrestoreinstancestate() methods not getting called when change screen orientation. further, changed sdk versions , target versions without success. update: my part of activity manifest activity is: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.wassap.main" android:versioncode="1" android:versionname="1.0" > <uses-sdk a

java ee - Error creating bean with name .. Injection of autowired dependencies failed -

im implementing java spring client access webservice, im having problem bean creation , autowire. im not sure because im new these. im not using maven, pure eclipse javaee (if matters, cause example followed @ here uses maven). sorry long piece of codes, im stuck.. i have clientcontroller.java in package com.helloworld.controller package com.helloworld.controller; import org.springframework.beans.factory.annotation.autowired; import org.springframework.stereotype.controller; import org.springframework.ui.model; import org.springframework.web.bind.annotation.modelattribute; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; import org.springframework.ws.client.core.webservicetemplate; import com.helloworld.domain.*; @controller @requestmapping("/") public class clientcontroller { @autowired private webservicetemplate webservicetemplate; /** * default handler. when applicat

JPA - select with join - how to make two related tables -

i have 2 tables relacionship id_employee. --------------------------- --------------------------- table employee table timesheet --------------------------- --------------------------- id_employee id_time name_employee date_entry --------------------------- quant_hour id_employee --------------------------- i need select returns records table employe , hours in existing related table timesheet. employees not have hours recorded in timesheet table should appear in list because registered in employee table. what jpql query ? class employee @entity public class employee { @id @generatedvalue private long id_employee; private string name_employee ; //gets , sets } class timesheet @entity public class timesheet { @id @generatedvalue private long id_time; private double quant_hour; private date date_entry; @many

java - Zooming and loading very large TIFF file -

i have large hi-res map want use in application (imagesize around 80 mb). i know following: how can load image best way possible? know take seconds load image (which ok) notify user of progress. use determined mode , show in sort of jprogressbar user. should reflect number of bytes have been loaded or that. there image loading method can provide functionality (like imageio.read() )? because map of high resolution offer user scroll zoom in , out. how can best way? know fact rescaling bufferedimage standard way take long time such big file. there efficient way of doing this? thank input! kind regards, héctor van den boorn p.s. image drawn on canvas of jpanel. hi andrew, thank help; worked out , loading quick. without expertise , explanation have still been working on you've earned bounty fair , square. what did following; using imagemagick created multiple images of different resolution , @ start of execution load smallest res. image. rest loaded in seperate

jquery - Tablesorter Custom Filter to show only available -

i'm working tablesorter , have been able use amazing things, 1 thing can not figure in filters. i'd have method or custom filter make dropdown boxes list availabe rows (cells without filtered class) example: i have 2 rows 1 names other courses if in first row select name, drop down in second row should show courses available user. items form teh second row show if filtered. so question is 1) there class i'm missing turn time of functionality on 'filter-select only-not-filtered' or 'filter-select-available' or something? 2) if 1 doesn't exist possible custom filters , if like, have been on wiki 2 days , there no example of custom filter , can't find list of classes , in filters. thanks , first post here got things right. just wrote change , submitted tablesorter since has done in widget plugin. https://github.com/mottie/tablesorter/issues/292

actionscript 3 - What is Dart equivalent to AS3 arguments object? -

i translating as3 code dart. have partially translated following stuck on how handle as3 arguments object. guidance? void setlabeltextcolors([int upcolor = 0, int overcolor = 0, int downcolor = 0]) { _lcup = arguments.length > 0 ? upcolor : -1; ... } you can use question mark operator see if argument has been given or not. void setlabeltextcolors([int upcolor = 0, int overcolor = 0, int downcolor = 0]) { _lcup = ?upcolor ? upcolor : -1; ... }

c - Priority queue - time queue -

i'm trying build timer queue in c save jobs need processed based on time, priority queue best thing here or there else need at? the following have, job 1, start_time, time_to_exec, execute after 5 minutes job 2, start_time, time_to_exec, execute after 5 minutes new job came in job 3, start_time, time_to_exec, execute after 1 minutes ... , on and i'll checking first element every few microseconds. start_time time before entering queue. time_to_exec time used insert job queue

scanf - Easiest/clearest way to read formatted data in C++ -

i'm reading in file of space/newline delimited numbers. after trying stringstreams , ifstreams, appears c++ hasn't improved on fopen , fscanf simple task in terms of simplicity, readability, or efficiency. what robustness? since check fscanf returned number of items expect, doesn't seem issue. benefit can think of stringstream's giving more options handle failure. here quick example using fscanf: file * pfile; pfile = fopen ("my_file.txt","r"); if( pfile == null ) return -1; double x,y,z; int items_read; while( true ) { items_read = fscanf( pfile, "%lf %lf %lf", x, y, z ); if( items_read < 3 ) break; // checks eof (which -1) or reading 1-2 numbers std::cout << x << " " << y << " " << z << "\n"; } note : security, replace fopen/fscanf fopen_s/fscanf_s in visual studio. in experience neither c nor c++ offer "robust input tolerates id