Posts

Showing posts from 2015

c# - How to copy form fields with PdfWriter not PdfCopy in iTextSharp -

i merge 2 pdf files (only selected pages) , add custom headers , footers them. therefore not use pdfcopy copies page without altering it. use pdfwriter . the problem not know how copy acrofields, acroforms, annotations , else except content pdfwriter . do know how this? you want use getimportedpage method of pdfwriter class. copies pdfimportedpage can use. pdfreader pdfreader = new pdfreader(originalfile); pdfimportedpage importedpage = pdfwriter.getimportedpage(pdfreader, pagenumber); as example, can place previous code in onopendocument event of pdfpageeventhelper , in onendpage event can use directcontentunder object of pdfwriter place entire page underneath current page. pdfwriter.directcontentunder.addtemplate(importedpage, 0, 0);

xmlhttprequest - Make my jQuery Ajax script use CORS -

i built application reads data via ajax external website. works fine found out in question if want package blackberry 7, webworks or phonegap, may need use called cors . how can convert following script same thing except using 'cors'? <script type="text/javascript"> $("#page_all").live('pagebeforecreate', function() { $.get('http://mysite.com/mobile/data/data_all.php',function(data){ $('.content').empty(); $(data).find('market').each(function(){ var $market = $(this); var html = '<div class="data">'; html += '<div data-role="collapsible" data-collapsed="true" data-theme="b"><h3>' + $market.attr('date') + '</h3>'; html += '</div>'; $('#result').append(ht...

python - Paramiko change IP of remote machine -

i have change ip of remote machine running gentoo. use code looks like try: guest.connect("10.22.254.200", username='root',password='root') except sshexception detail: session.flash = detail.message else: sftp = guest.open_sftp() sftp.put('./scripts/change-ip', '/root/change-ip') sftp.close() guest.exec_command('chmod +x /root/change-ip') time.sleep(5) try: stdin,stdout,stderr = guest.exec_command('/root/change-ip 10.22.254.200 &') my change-ip script looks like set -x cp /etc/conf.d/net /etc/conf.d/net.bak sed "s/10.22.254.200/$1/g" /etc/conf.d/net.bak > /etc/conf.d/net /etc/init.d/net.eth0 restart i able ssh directly , execute script changing ip, reason cant in code. any appreciated restarting network on network dangerous thing. happens here after stopping network interface in command /etc/init.d/net.eth0 re...

iphone - When an iOS device rotates, how do I change the orientation only one element? -

i able handle orientation changes in current iphone application. problem don't want view of controller rotate or resize. when device orientation changes, want 1 ui element rotate 90 degrees on screen. apple's camera application perfect example of - when device orientation changes, of buttons rotate, view not rotate. i suppose resize view, move of elements around, , animate buttons, feel there must easier way it. thanks in advance. 1) can create 2 view hierarchies , change on screen in willrotatetointerfaceorientation: see question 2) or can handle rotations see question

jquery mobile - ajax json output parsing in jquerymobile -

public function actionajaxsearch() { $data_fetched=person::model()->findbyattributes (array('code'=>'cust0001')); echo cjson::encode($data_fetched); } $('#searchresult').live('pageshow', function(e,info) { $.post('?r=mobile/ajaxsearch',$('form').serialize(), function(res) { arrayvalue =res; $.each(arrayvalue, function(i, profile) { alert(i); alert(profile); }); } }); i getting output json encode one. in traversing alert getting value each character not key or value. help? adding datatype , contenttype solved problem. added complete code other's ref. public function actionajaxsearch() { $data_fetched=person::model()->findbyattributes (array('code'=>'cust0001')); echo cjson::encode($data_fetched); } $('#searchresult').live('pageshow', function(e,info) ...

javascript - Exporting HTML PHP webpage to image -

there google map in site , need export google map image , need store. can in script php or html or javascript how can it? as @sirko , @brendan have pointed out, should provide kind of code have work on. if looking starting point extend on @jbrtrnd's suggestion of using html5 canvas wrap google maps div in , write script convert image. luckily there js library created accomplishes task, have @ js library , find answer: http://www.nihilogic.dk/labs/canvas2image/

c# - Disabling Anonymous authentication for web application causes error -

i trying enable windows authentication , disable anonymous authentication intranet application. have enabled windows authentication , disabled anonymous in iis7, , set web.config use windows authentication. <system.web> <authentication mode="windows" /> <compilation debug="true" targetframework="4.0" /> </system.web> when deploy , run application, page header load. when navigate service.svc file in chrome or ie, following error: security settings service require 'anonymous' authentication not enabled iis application hosts service. system.notsupportedexception: security settings service require 'anonymous' authentication not enabled iis application hosts service. i assume problem web.config or service.svc.cs, cannot identify it. happens 1 service. enabling anonymous authentication in iis7 resolve issue, need disabled. in servicerefernces.clientconfig, have: <configuration> ...

optimization - Improving the speed of a Python solution to the Lead Game exercise -

here solution the lead game problem on codechef . runs fine, took 2.63 sec , 3.8m memory, while saw many c programs had completed in 0.08 seconds , 1.6m memory. how can make faster? import sys cnt = int(sys.stdin.readline()) match = [[int(x) x in sys.stdin.readline().split()] in range(cnt)] diff=[] in range(cnt): if i!=0: match[i]=[sum(vals) vals in zip(match[i-1],match[i])] diff.append([1 if max(match[i])==match[i][0] else 2,abs(match[i][0]-match[i][1])]) maxval = max(diff,key=lambda x:x[1]) sys.stdout.write(str(maxval[0]) + ' ' + str(maxval[1])) i wouldn't worry memory footprint (python data structures take little more space, , it's normal) , it's hard expect python script beat c program in terms of speed. edit : no need keep leads history my o(n) algorithm ran in 1.18 seconds: import sys rounds = int(sys.stdin.readline()) score = [0,0] leads = [0,0] while rounds > 0: results = map(int, sys.stdin.readline()....

javascript - how to get content change event of ul in jquery -

hi have ul , ul populated through ajax request. want trigger functiont whenever content placed or changed in ul . ul this <ul class="prodlisting" id="prodlisting"></ul> i have tried .bind() function contentchange this $(".prodlisting").bind('contentchange', function() { alert("called"); show_socialshare(); }); and tried $(".prodlisting").change(function(){ alert("called"); show_socialshare(); }); but both not working. can body tell me how can fire function on event you use: $(document).bind('ajaxcomplete', function(){ alert("called"); show_socialshare(); }); this watch document ajax calls , run once it's complete.

android - Basis approach for Login and then listview -

i'm working on android app display listview items loaded web. listview must displayed after logging in app. what i've done far: i created main activity tabs on top. in 1 of tabs (activity's) have log in. then use asynctask authenticating in background. now that's i've done far. need make following: when username , password meet requirements, app should start new activity, show listview remote items web. need done in proper fashion, use asynctask this. problem is... i don't know how approach this. because when verify username load... , load again when it's loading list items.. there way working nicely , within tabs interface is? i'm not sure if understand asking for. as far can tell though, want add listview tab after authenticating. use tabhost.newtabspec() make new tab once async task returns login successful. sorry if misunderstood. hope helps.

Would implementing a CDN involve moving images and changing path names? -

i'm learning cdns, please forgive if dumb question. implementing cdn involve moving images , changing paths? yes cdn (content delivery network) @ basis nothing more set of webservers. if want host files on cdn must copy files cdn servers , use full cdn address points files on servers on own webpage.

actionscript 3 - Access children of embedded aswf -

i embedding swf file has children on timeline. this: [embed(source="assets/skyscraper200x600.swf")] private var skyscraper :class; all children in swf have instance name, double checked when creating swf in flash cs5. trying access children name this: _bg = movieclip(new skyscraper()); _pig = movieclip(_bg.getchildbyname("chara_pig")); _arrow = movieclip(_bg.getchildbyname("arrow_banner")); however, both _pig , _arrow end being null. what's stranger when @ skyscraper object in debugger, shows rather strange class name , loader child (which in turn has no children). what's this? . i can access them above if not embed swf, load loader. cannot in case. need embed swf. so, how can access children of embedded swfs? i not talking accessing classes in library of embedded swf, instances on timeline. here solution. can see steps helped me find solution (describetype friend) : public class demo extends sprite { [embed...

spotify - libspotify API: is there any way to store session after login? -

is there way retrieve session id other programs share login? or allowed share session id among multiple programs single user? thanks. no, isn't allowed. you're allowed have user separately log each app, can't share login details between processes that. also, there's no "session id" libspotify expose — isn't oauth app!

ios5 - UIScrollView and UINavigationController not working with iOS 4 -

i have problem uiscrollview , uinavigationcontroller(s) , ios 4. following code works fine ios 5: //////////////////////////////////////////////////////////////////////////////////// /* scroll view */ //////////////////////////////////////////////////////////////////////////////////// mscrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 88, 1024, 668)]; mscrollview.contentsize = cgsizemake(1850, 668); //////////////////////////////////////////////////////////////////////////////////// // first view //////////////////////////////////////////////////////////////////////////////////// uiimageview *imgview = [[uiimageview alloc] initwithimage:[uiimage imagenamed: @"view_bg.png"]]; imgview.frame= cgrectmake(10, 50, 350, 510); [mscrollview addsubview:imgview]; [imgview release]; mfirstview = [[[firstview alloc] init] autorelease]; uinavigationcontroller *navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller...

javascript - jQuery - building dynamic if statements based on object passed as the function argument -

i'm trying build several dynamic if statements based on definition in argument of function. should able run them if particular keys , vales provided. can read keys , values, not sure how build code upon them. object passed function argument: param = { 'fields': { 'email' : { 'match' : 'email' }, 'countadults': { 'match' : 'number', 'range' : '1, 10' } } }; //and bit trying parse object $.each(param.fields, function(key, value){ // reading definitions parameter if(name == "'+key+'") $('[name="'+key+'"]').mandatory(); // define begining of if $.each(param.fields[key], function(subk, subv){ += '.'+subk+'("'+subv+'")'; // adding more if statement }); }); return (all if statement); } after returning o...

css3 - Why do browsers use prefixes? -

possible duplicate: why browsers create vendor prefixes css properties? what advantage browsers use prefixes implement technology? e.g. google chrome needs -webkit- prefix render css3-tags, animation (it needs "-webkit-animation:" work). what advantage compared implementing technique directly chrome? browsers use prefixes can implement new features before gets standardized.

maven 3 - How to skip building of the pom in multi-module project -

i'm trying optimize build process (in development) in term of time build whole tree of maven multi-module project. of pom aggregation of sources/libraries rarelly (and typically) never change. specific sub-questions are is possible somehow configure maven not build pom if there no changes in sources specified in pom:project/build/sourcedirectory attribute? or possible (at least) conditionally disable maven-bundle-plugin? - takes of time. google not find relevant q#1. typical solution not work #2 - when try specify 'executions' maven-bundle-plugin (like this) <plugin> <groupid>org.apache.felix</groupid> <artifactid>maven-bundle-plugin</artifactid> <version>${maven-bundle-plugin.version}</version> <extensions>true</extensions> <executions> <execution> <id>osgi-bundle</id> <phase>bundle</phase> <goals> ...

javascript - Mysterious garbage character - IE 8 only -

i building table, content pulled other elements in page (page scraping). i using innertext or textcontent pull text, regular expression trim it: string.replace(/^\s+|\s+$/g,""); this works fine in ie 9 , chrome, in ie 8 getting garbage character cannot identify. able reproduce behavior alerts in jsfiddle: http://jsfiddle.net/te4fq/ what character, , how can rid of it? update: helpful replies! seems character in question u200e (left right mark). second part of question remains, how can rid of such characters regular expressions, , keep regular text? both "at risk" , "complete" <th> tags in jsfiddle snippet have u+200e (left-to-right mark, aka lrm) code point @ end of content. not whitespace character, cannot matched \s . one way rid of character use xregexp library , can replace matches of \p{c} empty string (i.e., delete them). \p{c} matches code point in unicode's "other" category, includes control, format...

c - getting started with ARMCI -

i want use armci, try read documentation, understand armci not used developers library. means there can different implementation of armci mpi do. can 1 please suggest me of implemeations. in general, unable started armci (speaking of coding), any appreciated. you use armci directly, low-level interface. global arrays (ga) popular library based on armci. ga used nwchem, among others. there multiple implementations of armci. 1 pacific northwest can downloaded part of ga package . there implementation of armci in new versions of mpich2 works on mpi one-sided operations.

javascript - should two FireFox browsers on same computer share same cookies? -

i observing 2 firefoxes running on same windows-7 computer sharing same cookies, using javascript. how 2 instances of chrome, ie, etc behave? can browser forced allocate own, private cookie memory? yes. firefox uses user profiles. long instances using same profile, cookies shared. same goes chrome. not sure ie profiles, though (and whether has them). learn more firefox , chrome profiles.

c# - Binding empty dictionary to a listbox -

when try bind dictionary listbox argumentexception. cannot bind new value member. i use following code. can 1 tell me wrong. because when enter row in dictionary working fine... this.contactpersonenlistbox = new dictionary<int, string>(); lscontactpersonen.datasource = new bindingsource(this.contactpersonenlistbox, null); lscontactpersonen.displaymember = "value"; lscontactpersonen.valuemember = "key"; it doesn't make ton of sense bind empty dictionary since dictionary object doesn't report changes, adding item dictionary after setting data source won't show in listbox. but rid of error, try setting this: bindingsource b = new bindingsource(); b.datasource = this.contactpersonenlistbox; lscontactpersonen.displaymember = "value"; lscontactpersonen.valuemember = "key"; lscontactpersonen.datasource = b;

codeigniter check if uri segment exist in database -

i trying create dynamic pages without creating new files , getting data database... so table like: pages ------ id | page_name | text 1 | | page goes here 2 | contact | contact page goes here now question how can manage make $this->uri->segement(1) automatically check if given page name exist in database? do have create new controller handle or? if have several pages want check, recommend having pages controller managers pages. this class pages extends ci_controller { public function view($page_name) { $this->load->pages_model(); if($this->pages_model->does_exist($page_name)) { // exist. things. } else { show_404(); } } } in routes.php , route about , contact pages (and whatever others may have) pages controller. $route['about'] = "pages/view/about"; $route['contact'] = "pages/view/contact"; your pages_model ...

c# - System.ArgumentException Requested value was not found -

i have c# aplication use c++ .dll. when call method dll, an: system.argumentexception. requested value 'c:\test\test.csv' not found . the file dies exist @ path , have c++ application uses .dll , work well. testdata.convert.toprodfile("c:\\test\\test.csv"); the role of method convert , write file. does have idea exception? are sure right exception ? mean there may problem message thrown instead, of course if file not exist. have dll source code ?

Load a DOM and Execute javascript, server side, with .Net -

i load dom using document (in string form) or url, , execute javascript functions (including jquery selectors) against it. totally server side, in process, no client/browser. basically need load dom , use jquery selectors , text() & type val() functions extract strings it. don't need manipulate dom. i have looked @ .net javascript engines such jurassic , jint, neither support loading dom, , therefore can't need. i willing consider non .net solutions (node.js, ruby, etc) if exist, prefer .net. edit below answer, i'm trying different route, i'm attempting port envjs jurassic. if can working think want, stay tuned.... the answer depends on trying do. if goal complete web browser simulation, or "headless browser," there number of solutions, none of them (that know of) exist cleanly in .net. mimic browser, need javascript engine , dom. you've identified few engines; i've found jurassic both robust , fastest. google chrome v8 eng...

network programming - Checking open UDP Port in C++ -

how can check if remote udp port open using native c++? since udp connection-less, calling connect() not helpful. cannot try binding since not local. nmap cannot indicate. (however netstat can find out, think looks internal information open ports/files). there anyway detect it? if go layer down on network level, possible send icmp message c++ check port-unreachable status? mean, give enough information on port status? platform linux. i assume trying determine whether or not udp port on remote machine being passed through firewall and/or has application running on it. you cannot reliably determine this. closest can come try sending series of small datagrams address , port, spaced 1 second apart 10 seconds. if there no firewalls blocking port , no application running, remote system might send icmp_unreach_port (port unreachable). if there no blocking firewalls , remote system down, router might send icmp_unreach_host or icmp_unreach_net . if firewall blocking y...

swing - java Gap between jframe and ImagePanel -

Image
i have jlayeredpane adds 3 objects, problem backgroundimage when app runs there gap between jframe , background image top set (0,0) no matter change gap still there (i want rid of gap). if copy backgroundimage class , put in file/class gap not there. can help? public class navigationmenu extends jpanel { private arraylist<string> menu = new arraylist(); private int menusize; private int menuchannel = 0; private font realfont; private static dimension screensize = new dimension(new screendimensions().getscreenwidth(), new screendimensions().getscreenheight()); private static final int menu_height = (int)(new screendimensions().getscreenheight()*0.1); private static final int menu_width = new screendimensions().getscreenwidth(); private static final int menu_center = (new screendimensions().getscreenheight() / 2) - (menu_height / 2); public navigationmenu() { //add menu channels setpreferredsize(screensize); setbounds(0,0,menu_width,screensize.height); th...

html - Vertical alignment in table-cell together with floating div -

i have following (sample) html code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head> <title>th-alignment</title> <style type="text/css"> th { border: 1px solid #333; vertical-align: middle; } div.sb { float: right; width: 4px; height: 26px; background-color: #999; } </style> </head> <body> <table cellspacing="0" cellpadding="0"> <colgroup> <col width="120" /> <col width="120" /> </colgroup> <thead> <tr> <th> <div class="sb"></div> <div>heading 1</div> ...

Which javascript object creation is more efficient? -

i understand recommended manner version 2 (below), using prototype. however, difference between 2 versions because not version 1 beat version 2 in memory consumption, routinely completes in half third of time (according tests using chrome). version 1: var c = function() { console.log("new c"); } c.f = function(foo) { console.log("function"); } var = []; (var = 0; < 100000; i++) { a.push(new c()); } version 2: var c = function() { console.log("new c"); } c.prototype.f = function(foo) { console.log("function"); } var = []; (var = 0; < 100000; i++) { a.push(new c()); } version 1 give function object only, while version 2 provide function object function holding prototype. and i'm pretty curious see if of new c(); instanciations in version 1 has access c.f method...

c# - .Net BlockingCollection.Take(2) : Safely removing two items at a time -

after doing research, i'm resorting feedback regarding how remove 2 items off concurrent collection. situation involves incoming messages on udp being placed blockingcollection. once there 2 users in collection, need safely take 2 users , process them. i've seen several different techniques including ideas listed below. current implementation below i'm thinking there's cleaner way while ensuring users processed in groups of two. that's restriction in scenario. current implementation: private int userqueuecount = 0; public blockingcollection<user> userqueue = new blockingcollection<user>(); public void joinqueue(user u) { userqueue.add(u); interlocked.increment(ref userqueuecount); if (userqueuecount > 1) { ienumerable<user> users = userqueue.take(2); if(users.count==2) { interlocked.decrement(ref userqueuecount); ...

sql server - Stored Procedure with output parameters connected to method in C# -

do see blatantly wrong line: commasepstring1 = com.parameters["@commasepstring"].value.tostring(); it shows error like: object reference not set instance of object. for short, c# method looks like: public static datatable getfilmdetails(string filmid, out string commasepstring1) it takes following stored procedure (that executes correctly on own): com.commandtext = "cataloggetfilmdetails2"; and since @commasepstring output parameter in stored procedure , in c# have this: param = com.createparameter(); param.parametername = "@commasepstring"; param.direction = parameterdirection.output; param.dbtype = dbtype.string; com.parameters.add(param); commasepstring1 = com.parameters["@commasepstring"].value.tostring(); if curious stored procedure, starts this: create procedure cataloggetfilmdetails2 (@filmid int, @commasepstring varchar(50) output) the sp inserts rows table variable based on joins, puts values column x t...

c# - Method which does nothing or throw Exception -

i have big method, part of checks state of object , throws exception if state invalid. should extract method? new method 'checkstate' nothing or throw exception. if understand correctly, mean part of method checks state of object , throws exception if invalid. you further asking whether should move own method(one checks state of object , throws exception of invalid). the answer is; neither. exception should thrown in "exceptional" circumstances. if enter method , expect object in valid state, use if were. if occurs unexpected, catch exception , throw "invalidstateexception". (if programmed shouldn't necessary either.) if enter method , not sure object in valid state, being in invalid 1 not "unexpected" behavior, , should handled differently. this check method come place. shouldn't throw exception should return boolean, determine next. invalid object in case reasonable, use code handle case check method returns valid...

ember.js - Can I define a default value for ember-data model attributes? -

when define attribute model in ember-data, can specify default value? the ember-data model definition suggests attributes defined this: attributename: ds.attr('number') ...with optional second argument options hash. i've looked @ the code code-reading skills aren't figuring out attributes can put in options hash. possible this? attributename: ds.attr('number', { default: 0 }) or attributename: ds.attr('boolean', { default: false }) ? you close, it's defaultvalue , see attributes.js#l63-65 .

How to open a link in the current window by pressing a button in Google App Script UIApp? -

i'm writing script allows user log in site. have done can't seem find way open new link after user has been authenticated pressing log in button. steps: user enter username , password the user authenticated if user exists in spreadsheet link opened user's profile (this link can't seem working). thank in advance help. here working example : type 1 of names, if 3 letters correct link appears function showdialog() { var app = uiapp.createapplication(); app.settitle("anchortest"); var panel = app.createverticalpanel(); var txtbox = app.createtextbox().setname("tbox"); var subm = app.createanchor('ok', 'href').setid('subm').setvisible(false); var fake = app.createbutton('enter lastname').setid('fake'); panel.add(txtbox).add(subm).add(fake); var keyhandler = app.createserverhandler("textkey"); txtbox.addkeyuphandler(keyhandler); keyhandler.addcallbackelement(pan...

Java garbage collection confusion -

if have long-lasting object , lots of temporary objects b, c, d, etc. contain reference a, temporary objects ever collected long referenced something? class {} // (sits in web app session) class b { private a; } class c { private a; } where b , c exist request only, contain references a. they will, if there no way reach b , c (but reach other objects) collected usual.

caching - mongodb: force in-memory -

after using myisam years 3 indexes + around 500 columns mio of rows, wonder how "force" mongodb store indexes in memory fast-read performance. in general, structured table , queries index1=.. or index2=... or index3=.. (myisam) , pretty simple in mongodb well. it's nice if mongodb managing index , ram on own. however, not sure if , way mongodb can speed these queries on indexs-only best. thanks it's nice if mongodb managing index , ram on own. mongodb not manage ram @ all. uses memory-mapped files , "pretends" ram of time. instead, operating system responsible managing objects kept in ram. typically on lru basis. you may want check sizes of indexes. if cannot keep of indexes in ram, mongodb perform poorly. however, not sure if , way mongodb can speed these queries on indexs-only best. mongodb can use covered indexes retrieve directly db. however, have very specific fields returned. if include fields not part of index, not...

wcf binding - How to create a wsdl file for a WCF service library? -

i have wcf service library project. trying generate wsdl file launching wcf test client running in visual studio (pushed f5). launched wcf test client says "failed add service. service metadata may not accessible. make sure service running , exposing metadata.". gives me below error message. c:\users\xxx\appdata\local\temp\test client projects\10.0\354421b1-b65e-45fc-8d98-ac87254a5903\client.cs(911,26) : error cs0644: 'system.componentmodel.propertychangedeventhandler' cannot derive special class 'system.multicastdelegate' i added servive behavior expose metadata follows. not sure else missing here able generate wsdl file. help! <services> <service name="cu.customer" behaviorconfiguration="metadata"> <endpoint address="" binding="wshttpbinding" contract="cu.icustomer"> <identity> <dns value="localhost"/> </identity> </endpo...

c# - Is there a way to try to guess the date from a filename and, if unable, to gracefully fail? -

i want try (programmatically) guess date file created. it named blabla.2012-06-04.xlw , can guess created june 4th, 2012. however, if file named else, sitona.potatopanotis.pal , want able give (without attempted conversion datetime causing exception) , present user datetimepicker. doable? i've got code: string substr = selectedfilename.substring(date_begin_pos, date_length); return datetime.parse(substr); i'm thinking make sense: try { string substr = selectedfilename.substring(date_begin_pos, date_length); return datetime.parse(substr); } catch (conversionexception ce) { //show form datetimepicker } update it seems should work: datetime dt; if (!(datetime.tryparse(substr, out dt))) { . . . either can ask directly creation time using file.getcreationtime or if trying guess via file name can use tryparse date , if doesn't work (method return false) show dialog.

graph - How can I display/visualize this type of data in a chart? -

i have data related movement of players in game. each player reports distance, speed, current coords , timestamp. this game may have 1/2k players playing @ given moment in time, plotting on may blurry... wondering useful (if any) data can extracted , visualized data? attempted create line graph of average speed , running total of movement (two different graphs), these don't seem user wants. user isn't sure want, "know" line graph wrong way go! any information give me on data might useful extract or how best data visualized appreciated! there ton of options think. not data-visualization expert sounds players shown separately, @ once, totaled, averaged, etc. , actual stats (distance, velocity, duration, time, location) can shown individually or in relation/proportion each other (totaled, averaged, know). produce large number of possible perspectives right there? , have options how visually present these perspectives. plain text, icons/colors, graphs/...

plsql - Oracle BLOB - Undo tablespace and efficient writing to file -

please see pl/sql code block @ end of post i writing pl/sql code extract files zip. i'm using "as_zip" package found @ http://technology.amis.nl/wp-content/uploads/2010/06/as_zip7.txt file names found in zip ( as_zip.get_file_list ) , extract ones blob ( as_zip.get_file ) written file using utl_file . first question far i've seen in monitoring, undo tablespace doesn't seem written during process wanted confirm others true...if i'm extracting contents of particular files blob written out file, undo tablespace impacted? every megabyte business uses on database they're charged need ways reduce our tablespaces if @ possible... second question in terms of writing blob out file, there more efficient ways how i've done it? first file (which happens largest @ 3.03gb) writes out file system nice , quick each subsequent file seems write out slower , slower. need free resources or allocate them differently or.... set serveroutput on declare...

html - How to display scrollbar in IE8 when in full screen mode? -

whenever press f11 turn browser full screen mode, vertical scroll bar disappears on right hand side cant scroll down page. there anyway can show scroll bar in full screen mode? body overflow:visible. overflow: auto; overflow-y: auto;

arff - Range of values for a Nominal Attribute in Weka -

i have nominal attribute used numeric prediction using weka. nominal attribute happen have 957 possible values(1-957) . there way specify in arff input file . 1 obvious way write script generate 1-957 comma separated entries. but wondering if there workaround provided weka? this not possible far know. use following shell command generate values. seq -s, 1 957

Google App Engine Eclipse plugin - all the console output in red -

i've tried first google app engine java tutorial using eclipse indigo google plugin on windows. seems work i'm wondering javaw.exe console output shown in red, info's included (can't post images): 2012-06-04 23:50:42 com.google.appengine.tools.development.devappserverimpl start info: server running @ http://localhost:8888/ 2012-06-04 23:50:42 com.google.appengine.tools.development.devappserverimpl start info: admin console running @ http://localhost:8888/_ah/admin is supposed work way? because javaw.exe spits of these out on stderr , there's no filtering on eclipse side? yes, red output in console google plugin eclipse normal. i'm not sure if there technical reason being red, or if conscious style choice, it's on every installation of eclipse + gpe i've ever used.

C++: Two-dimensional array, how to find the row with largest difference in their columns? -

i have 2 dimensional array variable number of rows , 2 columns, supposed find row has biggest difference in columns. make more clear: given lowest , highest temperature n days , supposed find day difference between temperatures largest (and if 2 days have same difference, supposed give first one). however, have never used multidimensional arrays, not sure whether can this: a[i][1]-a[i][0]? (a[i] index of day, , a[1] highest temperature day, a[0] lowest) this part of code looks this: int difference (int n, float a[maxn][2]) { float difference=a[0][1]-a[0][0]; int index=0; (int i=0; i<n; i++) { if (a[i][1]-a[i][0]>difference) { index=i; a[i][1]-a[i][0]=difference; //here error message: lvalue required left operand of assignment } } return index+1; //to day largest difference if don't assignment, make value equal difference ==, says "statement has no effect", thinking maybe not allowed trying do. ...

Compiling external .java files from within Java -

i making tool write .java files, (hopefully) compile files .class files. in 1 process, user selects file directory multiple .java files written. want program compile these java files. javacompiler friend. check documentation here and here example on how use compiler api javacompiler compiler = toolprovider.getsystemjavacompiler(); diagnosticcollector<javafileobject> diagnostics = new diagnosticcollector<>(); standardjavafilemanager filemanager = compiler.getstandardfilemanager(diagnostics, null, null); iterable<? extends javafileobject> compilationunits = filemanager.getjavafileobjectsfromstrings(arrays.aslist("youfiletocompile.java")); javacompiler.compilationtask task = compiler.gettask(null, filemanager, diagnostics, null, null, compilationunits); boolean success = task.call(); filemanager.close();

mysql: mysterious sideways single quote and IS NOT NULL -

i have 2 queries can run , 2 totally different results, solely because use "sideways single quote" versus single quote. see below: select * items 'natural' not null will return every record regardless if "natural" column set null select * items `natural` not null will correctly return records there values set column "natural" that ain't right. your first example 'natural' not null tests see if string literal 'natural' not null. since string literals not null, condition true. the second example tests value of column name natural . want. related string literals a string sequence of bytes or characters, enclosed within either single quote ( ' ) or double quote ( " ) characters. schema object names the identifier quote character backtick ( ` )

javascript - How to inherit from a "constructor returns another object" object -

the node-binary binary parser builds object following pattern: exports.parse = function parse (buffer) { var self = {...} self.tap = function (cb) {...}; self.into = function (key, cb) {...}; ... return self; }; how inherit own, enlightened parser this? pattern designed intentionally make inheritance awkward? my successful attempt far @ inheriting methods of binary.parse(<something>) use _.extend as: var clever_parser = function(buffer) { if (this instanceof clever_parser) { this.parser = binary.parse(buffer); // guess super.constructor(...) _.extend(this.parser, this); // really? return this.parser; } else { return new clever_parser(buffer); } } this has failed smell test, , of others. there makes in tangerous? how about: var clever_parser = function ( buffer ) { var parser = binary.parse( buffer ); _.extend( parser, clever_parser.methods ); return parser; } clever_...

c++ - Fast insertion of values into a map with an increasing integer as the key? -

efficiency of map::insert(iterator position, const value& k) can dramatically improved providing appropriate value in parameter position. if use integer numbers key, , every insertion done number larger inserted keys, can speed ::insert operation when giving ::end() iterator of map? something like: mymap.insert( mymap.end() , make_pair( next_number , myvalue ) ); where mymap of type map<uint64_t,mytype> , next_number every incrementing large integer. edit: the answer question might differ depending on whether data stored in map dense or not (see discussion below). so, lets ask question in both ways: once it's dense once it's not. still curious. perhaps measuring answer it. to directly answer question asked, c++ specs that: in c++03, insertion map a.insert(p,t) must amortized constant complexity (rather logarithmic) if t inserted right after p . in c++11, insertion map a.insert(p,t) must amortized constant complexity if t insert...

c# - Justify text with DrawString right -and- left -

let's have 200 pixels of space , want draw 2 strings it: - first string should left justified - right second string should right justified - not overlap if not both fit (then whatever string.trimming options say) am going have measure each , draw manually, or drawstring have way support i'm trying without me reinventing wheel? imagine \l , \r escapes did this, say graphics.drawstring("\lfirst\rsecond", ...); and i'd wind like "first second" at least that's i'd have happen (i know \l , \r not exist). there way? i've ignored flags , instead i'm showing (roughly) how can align text. it's easy enough pick out text, split , draw 2 separate strings! string text2 = "use textformatflags , rectangle objects to" + " align text in rectangle."; using (font font2 = new font("arial", 12, fontstyle.bold, graphicsunit.point)) { rectangle rect2 = new rectangle(150, 10,...

c - Is this enough to detect race conditions? -

say have multithreaded application , run same inputs . enough instrument every load , stores detect write-write , write-read data races? mean logged load , store addresses, if can see thread did load , thread did store, can detect write-read , write-write data race noticing overlapped addresses. or missing something? or missing something? you are missing lot. pubby said, if see read, write in t1, , later read, write in t2, can't anything absence of races. need know locks involved. you may want use tool, such google's threadsanitizer instead. update: but approach cover races or @ least of races? your comments here , on other answers appear show don't understand race is. your approach may expose some of races, yes. guaranteed not cover of them (which make exercise futile).

SVN Exclude files from current commit -

i have handful of files wish not commit svn duration of 1 commit while having rest commit repository. there svn command can in sense ignore specified files commit want make? well link pointed out in comments helpful point, ended having commit files/folders specifically, working around ones didn't want commit through svn ci -m 'message' folder/file might not have been elegant method, worked, , has taught me valuable lesson in making sure commit per moving piece/section before moving on next.

javascript - Showing a message to the user in chrome extension -

my problem not coding general design question. wrote chrome extension connects user through socks5 proxy (via ssh) vpn network. if proxy process killed or connection interupted socks proxy reconnect , on successful connection (failed) tabs reloaded. while connecting network browseraction icon animated. works fine far. what want decent visible hint, there going on in background , user has wait few seconds until clicks link or opens tab. thought alerts, hates them , of course right. thought animated message twitter or growl, injecting page content script not seem work on error pages. showing messages @ browseraction text or showing popup doesn't seem possible. my question is: of know extension solved nicely or have idea how solve this. should visible @ first sight without being anoying. ideas welcome! you can animate browser action or page action icon. see example: http://code.google.com/chrome/extensions/samples.html#9a6e4ec46997fb92b324974afa08a3d007e2537f

focus - Firefox cursor invisible, becomes visible when clicking anything else -

i have absolutely strangest bug i've ever encountered, , i'm near wit's end on one. ideas on how debug (or clever workarounds) awesome. the problem: i'm making simple wysiwyg editor in firefox using contenteditable. problem appears when load text edit via ajax. before load, cursor appears fine (for split second), , once text loads disappears. can still enter text, , cursor still "there" (a status box shows current line/col fine), cursor not visible , selection overlay not appear. here's makes strange: clicking anywhere, on other dom element, on firebug, on window -- makes cursor return , behave normal. in fact, time cursor has problems @ beginning, when loading page or on refresh. clicking anywhere inside contentedtiable div not fix -- have click outside refresh. right now, need workaround. i've tried 500 flavors of $(someelement).click or $(somelement).focus, don't replicate "actual" click user. has seen before? ...

shallow matrix construction in octave C++ api -

is there way construct matrix in octave's c++ api pointer data + size (ie, not using deep copy)? possibly undocumented unsafe way, caller has manage corresponding memory, or way assign pointer data? thing find method in dmatrix.h, private: matrix (double *d, octave_idx_type r, octave_idx_type c); same array.h, pointer data seems private.

sql - Exporting Large MySql Table -

i have table in mysql manage using phpmyadmin. it's sitting @ around 960,000 rows. i have boss likes @ data in excel, means weekly, have export data excel. i looking more efficient way this. since can't entire table @ once, because times out. have been stuck 'chunking' table smaller queries , exporting that. i have tried connecting excel (and access) directly database, same problem; times out. there way extend connection limit? honestly size of data, suggest doing mysqldump importing table copy of mysql installed somewhere else, maybe on virtual machine dedicated task. there, can set timeouts , such high want , not worry resource limitations blowing production database. using nice on unix-based oses or process priorities on windows-based system, should able without impact production system. alternatively, can set replica of production database , pull data there. having so-called "reporting database" replicates various tables...

java - GWT client side error (TypeError): b is null -

i have simple gwt 2.4.0 requestfactory application, fails client side exception when fire method calls. context.checkpassword(tblogin.gettext(), ptbpasswd.gettext()) .fire(new receiver<employeeproxy>() { @override public void onsuccess(employeeproxy response) { window.alert(response == null ? "login faild!" : response.getdisplayname() + " login success!"); } @override public void onfailure(serverfailure error) { window.alert("somthing wrong"); } }); firebug , chrome developer tools shows nothing. recive alert message: (typeerror): b null filename: http://localhost:8084/app/bdb5ac36bc159624d4b51b3846c167df.cache.html stack: oz(null,"{\"f\":\"ru.itskills.daxx.acme.client.employeerequestfactory\",\"i\":[{\...

c++ - word wrapping block of text with variable font/formatting using winapi -

i need draw arbitrary string directly on screen (not inside rich text control) using mfc and/or windows api. characters within string can vary in font face or color, , can bold, italic, underlined, or combination of two. additionally, users can choose wrap text within bounds of choosing, option force fit adjusting font size. i'm thinking of doing along lines of: parsing vector of substrings , formats using getcharabcwidthsfloat calculate widths of substrings manually calculating line breaks need fall repeating above iteratively smaller fonts if necessary make text fit drawing each of substrings individually drawtextw, determining locations using widths of preceding substrings , line break points is there better approach? if not, there gotchas or tricks should aware of when implementing this? (i'm aware of dt_calcrect | dt_wordbreak flags drawtext, don't think that'll work me because a) assumes consistent font/formatting across whole string , b) saw message b...

android - How to interact with ActionBar from NativeActivity with Java-side window content (Xperia Play)? -

for xperia play prior ics, way input touchpad through nativeactivity (not plain old activity). unfortunately, drawing in nativeactivity, name suggests, done on native-side, not java-side. in order input on native-side graphics on java-side, following must added nativeactivity's oncreate method: getwindow().takesurface( null ); getwindow().setcontentview( r.layout.main ); and set couple methods through jni receiving touchpad , touchscreen input native-side. can happily draw through android's java api, while still getting touchpad input. works quite xperia play's running pre-ics. adding menus via oncreateoptionsmenu doesn't cause problem. the problem comes when xperia play running ics. menu has moved action bar. unfortunately, isn't possible interact action bar (pressing 3 dots ignored, , acts i'm pressing surface behind action bar.) in case makes difference, creating action bar menu options through oncreateoptionsmenu. using window.fea...