Posts

Showing posts from March, 2011

documentviewer - Protected Tiff File Viewer Suggestions -

in web app building in asp .net, there requirement allow users view tiff image files not have ability print, save or copy these documents. understand users may able print screen, , no solution 100% foolproof. can suggest tiff file viewers can allow prevent users saving, copying or printing these document , integrate asp .net application? thanks million! - cian i think have 3 options: embed tiff images in silverlight application embed tiff images in flash/flex/air application break each tiff image pieces , show them using html/css last option not practical one, though. if decide use silverlight showing tiff images, may want @ libtiff.net (free, open-source, commercial-friendly license). libtiff.net supports silverlight , it's source code package contains silverlight test application displays tiff images. disclaimer: 1 of maintainers of library.

batch file - Unable to concatenate strings separated by comma -

i'm being driven crazy stupidly simple problem eating time. want append strings separated comma, comma doesn't appended. below batch file snippet: set missingparams= set switchurl= set truststore= if 0%switchurl%==0 (set missingparams=switchurl) if 0%truststore%==0 ( if not 0%missingparams%==0 ( set missingparams=%missingparams%, ) set missingparams=%missingparams%truststore ) after runnin script when echo %misingparams% , expected value switchurl,truststore prints switchurltruststore . d:\deleteme>echo %missingparams% switchurltruststore for debugging, when introduced echo statements in batch file, results more bizzare: set missingparams= if 0%switchurl%==0 (set missingparams=switchurl) if 0%truststore%==0 ( if not 0%missingparams%==0 ( echo missingparams=%missingparams% set missingparams=%missingparams%, echo missingparams=%missingparams% ) set missingparams=%missingparams%truststore ...

JOptionPane in Java -

does know why tab (\t) not work joptionpane.showmessagedialog? my code follows: string addtext = "name\t\taddress\t\ttel.no\temail\n"; (int = 0; < addressbooksize; i++) { addtext = addtext+entry[i].viewallinfo(); } system.out.print(addtext); joptionpane.showmessagedialog(null, addtext); are there other ways align text in joptionpane? put tabbed text jtextarea string addtext = "name\t\taddress\t\ttel.no\temail\n"; (int = 0; < addressbooksize; i++) { addtext = addtext+entry[i].viewallinfo(); } system.out.print(addtext); joptionpane.showmessagedialog(null, new jtextarea(addtext));

asp.net - CSS linked to aspx page is Not loading in Firefox -

i creating aspx page using visual studio 2008. , linking css via when build page opens html format , css , feel not applying please tell can make correct. working correct on ie... have tried validating resulting html page , css file ( html validator ) ( css validator ) if validating , resolving errors not help, please post html , css.

(PHP) Checking if a field is empty in a database query call and output data if it isn't -

i'm putting database query search engine can specify whether row should have imagestring or not in result. in database field empty if there no image, or have random image name ( e.g. 1238791.jpg ). when construct query string check every field , add onto string requested in search. for example, if "username" field filled out, add "and username '%$searchusername%'" string example. however, i'm not sure how proceed find out if there image (checking null won't work here) since if there is image need extract name of image can use or print out in results. any appreciated. will work? not sure if understand.. select * tbl imagename != '' , imagename != null edit : if pick no, results not have images (blank/null field). if pick yes query will have check user input , have 2 queries setup based on input. should know fields pull.

lua api - Lua C API: Delete metatable created with luaL_newmetatable? -

how can delete metatable foo created lual_newmetatable( l, "foo" ); , lual_getmetatable( l, "foo" ); push nil value again? whatever reason may have delete metatable, possible. lual_newmetatable(l, "foo") creates table, stored in lua registry key "foo" . to delete table, set field "foo" in registry nil . code in c: lua_pushnil(l); lua_setfield(l, lua_registryindex, "foo"); equivalent code in lua: debug.getregistry()["foo"] = nil

serialization - How do I serialize and deserialize in Java when I have a black box to convert to/from a byte array? -

i have class following: public class foo { static byte[] converttoarray(foo f); static foo converttofoo(byte[] ba); } how can use converttoarray , converttofoo allow foo implement java.io.serializable? default serialization procedure doesn't seem solution class because require changing lot of other classes implement serializable. however, have way go , bytes, there should easy way foo implement serializable without having declare dependent members serializable. suspect overriding readobject , writeobject way go, correct way this, since these instance methods return type void? check out externalizable , subinterface of serializable. readexternal , writeexternal methods delegate serialization details programmer, sounds appropriate in case. during deserialization (in implementation of readexternal ), need use foo.converttofoo convert bytes objectinput foo object, , copy of state of foo object this . a snippet javadoc describes semantics of externalizable...

how can I configure log4j so that it stops showing xml escape characters -

hi in application logging xml requests file using patternlayout. xml has password field. in log log4 shows < &gt i want show '<' , '>' how can that? thanks, manoj i'm sure isn't log4j's fault, patternlayout not convert characters entities. must happening when xml constructed.

asp.net - gridview row eval: column as name parameter instead of index -

i have gridview , onrowdatabound event linked function: if (e.row.rowtype == datacontrolrowtype.datarow) { thisrow = e.row.dataitem myobjectmodel; if (thisrow.property1 == null) { e.row.cells[5].text = "-"; } this code looks @ value of property of object in data source , if it's null, converts null display "-" in column 5. problem i'm having if change order of columns of gridview, need change index of every other modification. i'd change statement "e.row.cells[5].text" says "the cell column header xyz". any suggestions? thanks. i think might better off handling in gridview code rather code behind, if shuffling columns around. here's example ponies. feel free edit needed. <asp:templatefield headertext="likes ponies?"> <itemtemplate> <asp:label id="uxlikesponieslabel" runat="server" text=’<%# databinder.eval(container.dataitem, ...

Is it redundant to have a PHP object mirror a Javascript object, for database interactivity? -

i'm immersing myself in php , javascript, i'm still new coding methodology , concepts; i'm looking little feedback on tentative approach. i'm building application user signs up, , gains access "node creation." want save node name , position per user, can log in , see there nodes left them (with correct names.) my question: "i planning on having 2 identical objects, 1 in javascript, , other in php... realized, might redundant; if need transfer data database javascript object, unnecessary use php "clone" object middle-man??" my thoughts might simpler manage (yay oop,) said, i'm new application development , love feedback on matter. php object example: class node { public $name; // stored js object name public $position; // stored js object position function setobject() { // set js object name on app load // set js object position on app loa...

c# - Linq to Entities - Projections against Query Syntax vs Method Syntax -

since linq query expression translated "under covers" call same methods corresponding method query call (at least think so), expect these 2 queries return same type. reason though this: var result = in db.invoices select new { i.invoicenum }; sets result iqueryable<'a> each member having invoicenum property, while this iqueryable<string> result2 = db.invoices.select(i => i.invoicenum); is smart enough return iqueryable<string> (obviously, since compiles) clearly 1 of assumptions wrong, , hoping expert me understand bit better. (this ef4, same happens linq-to-objects, , i'm guessing same happen l2s) when write new { } creating anonymous type try var result = in db.invoices select i.invoicenum; and see returns type expect.

Javascript Mobile Environment -

from script, on mobile browser, how can reliably know if onload event has been fired, if have no ability register it. problem j/s code can executed before or after onload event has been fired, , script has no way latching on (if latches on onload, , never comes because happened, rest of code won't execute) i'm not 100% sure understand question, i'm thinking you're asking.. you can like: <script type="text/javascript" charset="utf-8"> function onload(){ console.log("loaded"); } </script> <body onload="onload()">

How does a typical medium to large web application "grow up" infrastructure-wise? -

the skinny : when facebook / twitter / youtube (whatever) went basic idea in software to... bigger (maybe 100,000 users?), how did grow? is there "best practices" growth path medium sized web applications? the real question : when specifying or bidding on medium sized web application project, biggies? in case in question, use php framework, seems these generalize language. so programmers core application (to me) obvious part. user management, user interface, , special classes made handle application. seems me less half of real project. ultimately, growth, infrastructure , meta-ui issues main focus, right? 1) infrastructure: cloud application space, data storage, db synchronization multi-datacenter situations. 2) language , cultural issues: making app seem "likeable" or @ least useable in major "culture markets" 3) data indexing issues 4) api / interoperability issues (both embedded apps ala facebook , external access data both end users...

Python - Django documentation says this is an insecure way of serving static files - is it true, and if yes, how so? -

i follow this way of delivering static files according disclaimer @ top, it's both insecure , inefficient. true? how should doing instead? also, semi-off-topic question: terms 'media' , 'static files' interchangeable in context of web programming? see them thrown around lot , seem referring same thing. it's both insecure , inefficient. true? of course. why think it? how should doing instead? that's apache for. or ngingx or lighttpd or of large number of other web servers. are terms 'media' , 'static files' interchangeable in context of web programming? usually. django 1.3 make distinction between "media" stuff gets uploaded , downloaded , static files -- -- static.

Django check to see if field is blank? -

i retrieved object database. object has foreign key field, attribute blank=true. how can check see if left blank? thanks help! blank=true telling admin site field can left blank. unless set null=true well, database should complain if tried enter blank value. if foreign key field can take null values, return none on null, check if "left blank", check if field none . >>> obj.foreignkeyfield none true if not obj.foreignkeyfield: print "this field left blank"

semantic markup - How to code html forms which are complex? -

Image
i have been given task of coding form below. planning using tables, instructor told me using divs , since takes more resources or something(i think said intensive). can using divs, think waste of time because make below form using tables(i mean quickly). any ideas how proceed, use, tables or divs or thing better ?? as long form looks way should , validates valid html 4 or xhtml breeds, you're go unless instructor def wants use divs , css create layout. recommend latter if want proficient in modern practices using css based layouts. luck!

http - web application, best way to handle state -

i have crud pages have store state information, current page, records per page, current order, filter conditions, , way more information... i'd use friendly urls similar rest style, http://microformats.org/wiki/rest/urls (get browsing, post add, put edit, delete remove) the problem cookies if open several tabs, of them share same cookies, it's same session because session id stored in cookie if try keep params in url (something /clients?page=1&len=10&sort=name&filter=smith) issue post loose values the other solution store state on hidden inputs, , issue posts carrying around hidden inputs, in case can't use queries... so, how handle web presentation state??? -- added: to more specific i have crud page, user can filter, change page, page length, , sort order.. after issuing update or insert, how can retrieve former page, page length, sort order, criteria filters (that presentation logic state), etc... taking account if user opens tab ...

publish - Publishing H.264 data from a Non-DirectShow video capture card to FMS(Red5) as live stream -

i can't use fmle(flash media live encoder) here because video capture card such kind no directshow support. the video-capture-card captures video , encode video h.264 via clips on card. the card provides native interfaces can write app data card , send data fms/red5 , fms/red5 streaming it. my question is: how send h.264 data fms in rtmp protocol? i have read rtmp specification , understand how publish live stream, connect -> createstream -> publish -> metadata -> videodata but don't know need put metadata , video payload. rsp ? nalu? any suggestion welcome, thank you check source rtmpd server (rtmpd.com) in order find advanced implementation rtmp protocol. on other hand, solution problem simple using librtmp library (dll form - mplayer project) publish stream. good luck

asp.net - how to display server side dates in jquery datepicker? -

i have textbox1 in asp.net webform shows server side date : i want user not select date using jquery datepicker earlier date in textbox1 i m using following code show jquery calendar in other textbox2 : <link href="./themes/sunny/jquery.ui.all.css" rel="stylesheet" type="text/css"/> <link href="./themes/sunny/jquery.ui.all.css" rel="stylesheet" type="text/css"/> <script src="./js/jquery.min.js"></script> <link rel="stylesheet" href="./demos/demos.css"> <script src="./js/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".datepicker").datepicker({ buttontext: 'select date:', firstday: 1, buttonimage: "./demos/datepicker/images/calendar.gif", bu...

zend framework - How can I improve HTTP Basic Authentication? -

i working on api site based on zend framework. zf doesn't have sufficient support digest authentication , late shift framework now, thinking of implementing basic authentication. basic , digest not ideal way perform authentication, while digest better unfortunately not quite supported zend (implementing take work, need project done asap). 1 of big problem basic auth password sent in cleartext form. thinking instead of sending password in cleartext form, can somehow hash using one-way-hashing algorithm / bcrypt avoid sending password in cleartext form? still suffering man-in-the-middle attack though. but if comparing basic authentication current form-based authentication used web-apps, both sharing same security problem while transferring request server? your best option keeping request secure use ssl authentication requests ensure information isn't sent in plaintext. if try kind of hashing or encryption on client before sending authentication request, expose ...

perl - perl6: do I need the @-sigil for userdefined variables? -

is there can't without '@'-sigil when working user-defined variables? #!perl6 use v6; $list = <a b c d e f>; @list = <a b c d e f>; $list.list.perl.say; @list.perl.say; $list[2..4].say; @list[2..4].say; $list.elems.say; @list.elems.say; $list.end.say; @list.end.say; 'ok' if $list ~~ /^c$/; 'ok' if @list ~~ /^c$/; yes, variadic parameters require @ sigil: sub shout(*@a) { print @a>>.uc; } though that's cheating question, because @a formal parameter, not variable. actual variables only, scalars can need, though more effort if use appropriate sigil.

c# 4.0 - how to run c#4.0(visual studio 2010) windows desktop application in linux? -

i want run c#4.0 windows desktop application in linux?please having idea share me... saravanan.p the way run c# code on linux use mono project: http://www.mono-project.com/main_page but maybe framework 4.0 not yet ported. have test compile application against mono. hope helps.

Autoclose xml tag during xslt transformation -

i have : <input type="checkbox" name="idsproduct" value="{@id}" id="form_checkbox_product_{@id}"> <xsl:if test="$x=$y"> <xsl:attribute name="checked" >checked</xsl:attribute> </xsl:if> </input> and : <input type="checkbox" name="idsproduct" value="26294" id="form_checkbox_product_26294" checked="checked"></input> i want input tag : <input type="checkbox" name="idsproduct" value="26294" id="form_checkbox_product_26294" checked="checked" /> my xsl output : <xsl:output omit-xml-declaration="yes" method="xml" encoding="utf-8" indent="no" /> how can autoclose tag? this similar question (although problem direct inverse): using xsl:if doe...

javascript - Call function on file upload -

i have form i'm using upload files. in current situation if user choose image computer have click button upload upload image. i'm trying find way skip step button pressing. how call javascript function when file selected user ? the onchange event fired when user specify file upload filed. go this: <input type="file" name="somename" id="uploadid" /> javascript: var el = document.getelementbyid('#uploadid'); el.onchange = function(){ // code... }; however, javascript validation idea make sure actual validation on server-side :)

java - Deleting temporary directory -

i found code on here creating temporary directories in java. public static file createtempdirectory() throws ioexception { final file temp; temp = file.createtempfile("temp", long.tostring(system.nanotime())); if(!(temp.delete())) { throw new ioexception("could not delete temp file: " + temp.getabsolutepath()); } if(!(temp.mkdir())) { throw new ioexception("could not create temp directory: " + temp.getabsolutepath()); } return temp; } how can @ end of servlet's life handle on temporary directory , delete it? first: don't use method of creating temporary directory! it unsafe! use guava method files.createtempdir() instead (or re-implement manually, if don't want use guava). reason described in javadoc: a common pitfall call createtempfile , delete file , create directory in place, leads race condition can exploited create security vulnerabilities, when executable fil...

iphone - UIImage problem -

i loading images of size 450kb in uiimage view , adding uiscrollview. while scrolling 30 images continously,its getting crashed.. may reason..is memory leak issue...or image size problem...? in advance.. here code .. @try{ nsautoreleasepool *pool; pool = [[nsautoreleasepool alloc] init]; //nsarray *array = [global_contentstring componentsseparatedbystring:@"@@#"]; nsarray *array1 = [catalogurl componentsseparatedbystring:@"&"]; //**nslog(@"array1****** = %@",array1); nslog(@"loading catalog image(method: loadcatalogimage).......%@%@",baseurl, [[[array1 objectatindex:0] componentsseparatedbystring:@"##"] objectatindex:0]); //nslog(@"baseurl = %@",baseurl); nslog(@"loading catalog image.......%@%@",baseurl, [[[array1 objectatindex:0] componentsseparatedbystring:@"##"] objectatindex:0]); zoomedimageurl = [nsstring stringwithformat:@"%@%@", baseurl, [[[arra...

php - Tag cloud/weighted list -

what mean tag cloud, using how display entered text database... thanks... if " entered text " has counter or similar, can them sql order `counter` desc limit 0, 10 statement.

python - Google App Engine map static_dir to remote url -

i have files on remote ftp server accessible on web. mate developer works static files build frontend our project - works js/css/html etc. uploads files ftp server. these files accessible on web standard way. possible setup gae app way this: - url: /css static_dir: http://our-static-files-url.com/css the purpose why want way work on backend , create core accessible on web ajax/json. deploy whole project standard way gae sdk. way don't deal frontend files html templates, css sheets , javascript files. mate works them , want work independently. so, when add feature code, notify mate added endpoint use. makes necessary updates markup , javascript code consume data endpoint provided. best practices work on this? thanks! no , can't declare remote static_dir in app.yaml . what , friend want remote source code repository using git or mercurial ; have github free hosting solution example.

PHP fgetcsv encounters Fatal error: Maximum execution time exceeded on Firefox -

first of guess "fatal error: maximum execution time exceeded" in php server side error , shouldn't depend on browser version, right? seems does!?! i have code read csv data coming text area in form. $handle = tmpfile(); fwrite($handle, $csvclip); fseek($handle, 0); while (!feof($handle)) { $r = fgetcsv($handle, 1000, $delimiter, '"'); <---- here gives fatal error print $r[0]; } and data this, nothing special, 4 columns , 3 rows. a b 1 2 c d 3 4 e f 5 6 code works on browsers (ie, chrome, e.t.c), can see parsed data except firefox!!!!! tested on different pcs same. browsers ok firefox gives "fatal error: maximum execution time exceeded" line having "fgetcsv" i'm using php version 5.2.10 , 2 different firefox versions 3.5.16 , 3.6.6 anyone have seen problem before? edit: code tested on 2 different linux servers centos 5.3 , 5.5, using 2 different pc having browsers. edit 2: solved ok fou...

iphone - Creating AddressBook Groups on simulator -

hey all, trying create groups in addressbook of simulator through code. able on when run code on device on simulator same code doesn't work. not able create groups on simulator. can 1 me it? i getting few contacts server saving addressbook. , when contact server, group belongs. when contact, groups present on client in case zero. so, save contact , create group particular name contact record brought server. , after doing this, add contact group created. goes on over , over. seeing on simulator contacts getting added groups aren't getting created. on device, happens fine. thanks in advance. first off, make few contacts on simulator atleast 5-6 contacts pressing contact button. save them , run code again closing simulator , rerunning code. app should find contacts , should able create groups once ur code has contacts play around with

c# - IMAP GMAIL getting folder list problem -

i working on imap , trying list of folders in gmail account. i able working yahoo mail, not gmail. here's code: byte[] commandbytes = system.text.encoding.ascii.getbytes((("$ xlist \"\" \"*\" \r\n")).tochararray()); i had tried list well, it's not working. doing wrong? you cannot have space between "*" , trailing \r\n .

iphone - Add image into navigation bar -

when item added favorites. indicate has been added user having image of star fade in, navigation bar in place of right bar button. how can this? any appreciated! you can customize right bar button item using custom button. //custom button button = [uibutton buttonwithtype:uibuttontypecustom]; [button setbackgroundimage:[uiimage imagenamed:@"back.png"] forstate:uicontrolstatenormal]; [button addtarget:self action:@selector(backbuttonclicked) forcontrolevents:uicontroleventtouchupinside]; [button setframe:cgrectmake(-2, 0, 52, 30)]; uibarbuttonitem *btnitem = [[uibarbuttonitem alloc] initwithcustomview:button]; self.navigationitem.rightbarbuttonitem = btnitem; [btnitem release];

sql - Compare last to second last record for each contract -

to keep simple, question similar this question, part 2 , problem is, not running oracle , can not use rownumbers. for need more information , examples: i have table contractid date value 1 09/02/2011 1 13/02/2011 c 2 02/02/2011 d 2 08/02/2011 2 12/02/2011 c 3 22/01/2011 c 3 30/01/2011 b 3 12/02/2011 d 3 21/01/2011 edit: added line contractid. since had code myself, display following: contractid date value value_old 1 09/02/2011 2 08/02/2011 d 3 30/01/2011 b c 3 30/01/2011 b but not want ! result should still below! now want select last record before given date , compare previous value. suppose 'given date' 11/02/2011 in example , output should this: co...

python - Is the model specific put() called for each entity when db.put() is called with a list of entities? -

i've got models on gae app, , i've overriden put() on of them. when call db.put() list of these entites, there guarantee overriden put() on each entity called? what i'm seeing right entities getting saved without being called. there way make sure stuff done before every save, batches? no. need monkeypatch db.put() too. example of this, check out nick johnson's excellent blog post on pre- , post- put hooks datastore models . if @ source code db module, you'll see db.put() not call entity's put() function.

definition - In CUDA, what is memory coalescing, and how is it achieved? -

what "coalesced" in cuda global memory transaction? couldn't understand after going through cuda guide. how it? in cuda programming guide matrix example, accessing matrix row row called "coalesced" or col.. col.. called coalesced? correct , why? it's information applies compute capabality 1.x, or cuda 2.0. more recent architectures , cuda 3.0 have more sophisticated global memory access , in fact "coalesced global loads" not profiled these chips. also, logic can applied shared memory avoid bank conflicts. a coalesced memory transaction 1 in of threads in half-warp access global memory @ same time. oversimple, correct way have consecutive threads access consecutive memory addresses. so, if threads 0, 1, 2, , 3 read global memory 0x0, 0x4, 0x8, , 0xc, should coalesced read. in matrix example, keep in mind want matrix reside linearly in memory. can want, , memory access should reflect how matrix laid out. so, 3x4 matrix below ...

delphi - CTRL + Click not working -

code browsing not working project. set search path source units using. , deleted .local , .identcache files. project compiling no problems. can make ctrl + click work. thanks one bug aware of occurs when have class declares record inline, so: tmyclass = class private fdata: record mydata: integer; end; end; if have code many of ide's code insight/completion/whatever features stop working. fault stretches right delphi 6 , possibly beyond. i fix class private type declaration: tmyclass = class private type tdata = record mydata: integer; end; private fdata: tdata; end; but if syntax not available in d2007 you'd need declare record type outside class. another factor find can confuse ide if using lot of conditional statements ( $ifdef , like). finally i'd recommend installing andreas hausladen's idefixpack improve ide behaviour. of course, problem may caused else, without being able experiment actual code, have ...

ruby - How do I find elements in this hpricot object? -

given hpricot xml @ bottom of post, how select "item" without having use .each? every single piece of documentation uses variation of @res.items.each |item| # stuff end which pointless in case because there ever 1 "item". been tearing y hair out last ages trying right. edited add more information: ok judging comments, i'm missing point somewhere i'll provide more information. i'm using ruby gem called amazon-ecs retrieve product information amazon. on gem's site described as a generic ruby amazon product advertising api (previously known e-commerce rest api) using hpricot. uses response , element wrapper classes easy access rest api xml output. generic, can extend amazon::ecs support other not-implemented operations easily; , response object wraps around hpricot element object, instead of providing one-to-one object/attributes xml elements map. now hones don't understand means suspect bit wrapping response object what...

JBoss TreeCache vs PojoCache when using invaludation rather than replication -

we setting jboss cluster , building own distributed cache solution built upon jboss cache (cant use 2nd level cache orm layer in our case). want use invalidation , not replication cache mode. far can see after (very) little testing both solutions seem work, objects put cache , objects seem evicted when updated on of servers. leads me believe pojocache aop instrumentation needed when using replication can replicate updated field values , not whole objects. correct here or there other advantages using pojocache on treecache in our scenario? , if pojocache have advantages, still need aop instrumentation , annotate our entities @pojocacheable (yes, using jbcache 1.4.1) since not using relication? regards jonas heineson pojocache has ability through aop to: only replicate changed fields , not whole objects. makes difference if e.g. person object containes huge image of person , change password detect changes , can automatically put them on list replicated. treecache (p...

c# - header in reportViewer -

i use vs2010 , want put header (3-4 text lines) on first page , footer on last page( 3-4 text line). can me? thanks. use visibility property on label , add condition show on first page. not know exact syntax can use expression builder create it. edit : thing out for, visiblity property reversed usual. real name 'hidden', true hide control , false show it.

ipad - Objective C Odatagen tool -

i new odata wcf data services. trying use odatagen tool on terminal on mac os in order generate proxy classes. i getting "command not found" error though executing below command correct path. macuser-imac:desktop macuser$ odatagen /uri=http://localhost:13986/northwinddataservices.svc /out=/users/macuser/desktop/odatagenapp can me or there other way same? are sure it's in path? if odatagen command in same directory won't found. if that's case, try: ./odatagen /url... ensure looks in current directory.

java - JH Labs Quantize Usage to reduce image color depth -

Image
i trying use quantizefilter in http://www.jhlabs.com/ip/filters/index.html to reduce color depth of screen shot. here very simple code: robot robo = new robot(); bufferedimage notquantized = robo.createscreencapture( new rectangle ( 0, 0, 300, 300 ) ); bufferedimage quantized = new bufferedimage( 300, 300, bufferedimage.type_int_bgr); file nonquantized = new file ("c:\\nonquantized.png"); file quantized = new file("c:\\quantized.png"); nonquantized.createnewfile(); quantized.createnewfile(); quantizefilter bla = new quantizefilter(); int [] outpixels = new int[300*300*3]; int [] inpixels = new int[300*300*3]; notquantized.getraster().getpixels( 0, 0, 300, 300, inpixels ); bla.quantize( inpixels, outpixels, 300, 300,2, true, true ); quantized.getraster().setpixels( 0, 0, 300, 300, outpixels ); imageio.write( quantized, "png", quantized ); imageio.write( notquantized, "png",...

on wicket's continueToOriginalDestination() method -

what link between backbutton , continuetooriginaldestination(). method. how keep url saved continuetooriginaldestination() method while clcking browsers button. continuetooriginaldestination() used when request (temporarily) redirected intercepting page, example login page. when user requests secured page not yet authenticated, security framework hooks wicket (auth-roles, shiro, swarm/wasp) present user login page, , store original url. when user has authenticated, can call continuetooriginaldestination , wicket process original request, displaying requested secured page. not security frameworks can use this, can throwing restartresponseatinterceptpage exception. the button has nothing this, nor have affect on processing of original destination page. wicket keeps storing original destination until new 1 set, or until continuetooriginaldestination has been called. continuetooriginaldestination returns true when there page go to, , false when user landed on inte...

Embedded JavaScript - render HTML to page -

i'm rewamping site uses embedded javascript(http://embeddedjs.com/), works fine there problem seo - due fact html hidden. you can't see markup when viewing source - of know of way render html page, google's spiders can access content? this website: http://shop.cbb.dk/catalog.do this website pretty incompatible search engines not run javascript. if want them index site, you'll have create version contains content should crawlable.

android - Passing Values from a Context View item to a new intent! -

sorry im new android, , im doing project want edit data item selected in listview. prob dont have idea on how pass data. select item, item of type projitems(a class construct item); has gets, string getname(), date getdata(),int getprec(); and here want start new activity: public void oncreatecontextmenu(contextmenu menu,view v,contextmenu.contextmenuinfo menuinfo) { super.oncreatecontextmenu(menu, v, menuinfo); menu.setheadertitle("selected project"); menu.add(0, del, menu.none, r.string.remove); menu.add(0, edit, menu.none, r.string.edit).setintent(new intent(pm_list.this, pm_edit.class));//here want pass info menu.add(0, task_list, menu.none, r.string.task); menu.add(0, cancel, menu.none, r.string.cancel); } this info want pass new activity later show on textview! please me, happy, , grateful if do! best regards joão azevedo so can selected item underlaying adapter this. adaptercontextmenuinfo info = (adaptercontextmenuinfo...

java - How to exchange ONLY the keybindings between eclipse instances -

when exchange complete preferences, customized key bindings exported along other stuff, if select keys preferences export -> preferences menu, useless small subset of shortcuts exported. there possibility export bindings keys page worse useless suggests feature thet isn't there. don't want mess complete setup, so: there way transfer key bindings , nothing else? thank you btw : this post deals same topic isnt helpful reasons above. there no automatic way far know resulting file xml, can export preferences , delete don't want. the result should still load eclipse.

jsf - after filtering Empty rows blank rows displayed while paging in the datatable using Primefaces -

Image
i have problem datatable using primefaces 2.2.1 , jsf 2.0. i have used filtering , paging in datatable. when try filter selected data displayed , when remove filter entire data displayed. after when try use paging suddendly rows becomes blank(empty) see screenshot below any suggestions. please help. .xhtml file <p:datatable var="user" value="#{usermanagedbean.searchusersresults}" selection="#{usermanagedbean.selecteduser}" selectionmode="single" dynamic="true" onrowselectupdate="userupdateform" onrowunselectupdate="userupdateform" rowselectlistener="#{usermanagedbean.onuserselect}" rowunselectlistener="#{usermanagedbean.onuserunselect}" paginator="true" rows="10" style=...

refactoring - PHP - simple refactor -

i have following code: $image_1 = $value->getelementsbytagname("image1"); $image1 = $image_1->item(0)->nodevalue; $image_2 = $value->getelementsbytagname("image2"); $image2 = $image_2->item(0)->nodevalue; is there easier way, not repeat code if need $image_3 ? i.e. how can refactor this? thanks update: i using $images_x variables in further code, needs refactoring: update 2: - full code: $image_1 = $value->getelementsbytagname("image1"); $image1 = $image_1->item(0)->nodevalue; $image_2 = $value->getelementsbytagname("image2"); $image2 = $image_2->item(0)->nodevalue; $image_3 = $value->getelementsbytagname("image3"); $image3 = $image_3->item(0)->nodevalue; $filename_1 = basename($image1); $ch = curl_init ($image1); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_binarytransfer,1); $rawdata_1=curl_exec ($ch)...

asynchronous - dojox.widget.Wizard not rendering buttons -

i have wizard widget i'm loading via async contentpane. first wizardpane shows once it's loaded, buttons along bottom not. oddly, when inspect dom page, entries button regions there. highlight corresponding areas buttons when hover on them. there's nothing there! this happening on both chrome , firefox. any ideas might going on here? there trick loading dojo widgets async might missing? you're missing wizard css. add following css http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/widget/wizard/wizard.css (or locally if you're loading dojo locally). http://jsfiddle.net/kfranqueiro/glxhr/ updated , works

actionscript 3 - I want to scale swf up to 100%, but at any percent down. Any ideas how to do that? -

i want allow swf scale when browser window resized, don't want increase on 100% (so should scale down). this example of kind of scaling client wants: http://www.voosfurniture.com/ but again, should stop @ 100% going up. you can need put content in container (variable "_container" below) : package { import flash.display.sprite; import flash.display.stagealign; import flash.display.stagescalemode; import flash.events.event; import flash.geom.point; import flash.geom.rectangle; public class test extends sprite { private var _initialestagebounds : point = new point; private var _container : sprite = new sprite; public function test() { _container.graphics.beginfill(0x556699); _container.graphics.drawrect(0,0,100,100); addchild(_container); _initialestagebounds.x = stage.stagewidth; _initialestagebounds.y = stage.stageheight; ...

CMake missing environment variables errors -

i'm attempting use cmake on mac osx i've installed both binary version , source. continue receive following errors when attempting create makefile. cpc1-dumb4-2-0-cust166:build bcrowhurst$ cmake . cmake error: error required internal cmake variable not set, cmake may not built correctly. missing variable is: cmake_on_compiler_env_var cmake error: error required internal cmake variable not set, cmake may not built correctly. missing variable is: cmake_on_compiler cmake error: not find cmake module file:/users/bcrowhurst/netbeansprojects/appon/build/cmakefiles/cmakeoncompiler.cmake cmake error: not find cmake module file:cmakeoninformation.cmake cmake error: cmake_on_compiler not set, after enablelanguage -- boost version: 1.43.0 -- found following boost libraries: -- system -- configuring incomplete, errors occurred! my cmakelists.txt follows: cmake_minimum_required( version 2.6 ) project( application on ) find_package( boost components system req...

iphone - Preserving the previous SDK when installing a new iOS SDK -

each time install new version of sdk lose previous one. want use new sdk, need build using oldest one. there method keep installed sdk when installing new one? the recommended approach set base sdk latest 1 change deployment target version want support.

php - Reload page if user has no javascript enabled -

is there way reload web-page, when javascript disabled in brwoser? i mean, if user visits page first time, , has no javascript enabled, page reloads parameter page.php?js=false. maybe, hints. the way force page reload, without javascript, use of meta refresh tag. however, wrong way go: better display page javascript-deprived, , redirect have javascript more appropriate page instead.

sql server - SQL query taking a long time to execute -

use pooja go ----create testtable create table testtable(rtjobcode varchar(20), rtprofcode smallint,rttestcode smallint,profcode smallint,testcode smallint) ----insert testtable using select insert testtable (rtjobcode, rtprofcode,rttestcode,profcode,testcode) select rtjobcode,rttestcode,testcode,rtprofcode,profcode dbo.resulttest,dbo.test,dbo.profiles rttestcode=any(select testcode dbo.test) ----verify data in testtable select * testtable go the above code tries take out entries table called resutltest , profiles , test, the problem during creation of cube encountering data not consistent in tables, tried join on tables tables contained huge number of columns was'nt feasible tried making code keeps on executing without stopping , not displaying data resulttest's rttestcode foreign key testcode your query slow because making cartesian product between resulttest, test , profiles. need provide "join" conditions link tables together. select rtjobco...

wcf - Content-based Correlation in WF 4 on inherited DataMember property -

in windows workflow foundation under .net 4.0, there way correlate operations based on inherited data member? example given following classes [datacontract] [knowntype(typeof(derivedmessage))] public abstract class basemessage { [datamember(order = 1)] public guid messageid { get; set; } } [datacontract] public class derivedmessage : basemessage { [datamember(order = 1)] public string additionalproperty { get; set; } } shouldn't possible correlate using property messageid on operation accepting instance of derivedmessage ? when attempting use such property in correlateson definition dialog of receive activity in vs2010 following error thrown: cannot find path member when generating xpath query. am doing wrong here? error message isn't helpful see no reason why shouldn't able generate xpath query messageid property on derivedmessage. the ui helper generate relevant xpath query y...

Open web popup from WPF application and close it with javascript -

i have wpf application communicates 3rd party server. after user completed task in wpf tool, need display specific web site server in popup window. popup must closed using 1 of buttons on site (which confirm task). when javascript wants close window, internet explorer open dialog box , ask user confirm closing popup. i looking simple solution disable dialog box. can't change behaviour of server need work around it. my old approach annoying confirmation dialog run iexplore.exe popups url parameter (via system.diagnostics.process ). my new approach hidden <frame x:name="popupframe" /> element. when popup should openend set source attribute of popupframe page opens popup. popup has base window , javascript can close without confirmation dialog. doesn't work on several systems (probably because of security settings) , involves page redirect/popup. is there easier way that? update: ok, realized don't have control on web page, can think o...

jQuery image replacement animation (mimic animated gif) -

i have sequence of jpgs in form of: logo_1001.jpg logo_1002.jpg logo_1003.jpg logo_1004.jpg logo_1005.jpg ... way logo_1208.jpg i trying change source of images every second (roughly) mimic animated gif, using these jpgs. animation starts when click on image. here im working far, although im sure coded better. also, isnt working right ;x function startanimation() { var name = $('#logo').attr('src'); var index = name.indexof(".jpg"); var int = name.slice(index-4,index); while(int<1208){ int++; var newname=name.slice(0,index-4); newname=newname+int; name=newname+".jpg"; $('#logo').attr('src',name).delay(500); } } $("#logo").click(function() { startanimation() }); thoughts? aid? thanks just got working using settimeout. $("#logo").click(function() { var $logo = $(this), src = $logo.attr("src"); var in...

asp.net - Using SiteMapPath to create a dynamic page title? -

i use sitemappath generate breadcrumb asp.net 3.5 (vb.net) pages , works great. now trying figure out how might able use same control build dynamic page title (in tag). want reverse path listed, sitemappath control includes links , bunch of styling spans. there way remove of that, , plain path separators? for example, let's on "press releases" page inside of "about" section of site. the breadcrumb shows as: home > > press releases i want have page title be: press releases - - company name so need reverse order, drop spans, links , styling (since inside tag) , drop root node "home" , add company name end. since menu nav , breadrumbs driven sitemap file, thought make sense try make title same. any thoughts? thanks. the best way achieve desired output ignore sitepath control, , instead use sitemap's sitemapnode's collection. server parses web.sitemap collection of sitemapnodes , wires sitemap.currentnode fi...

statistics - How to create a fractional factorial design in R? -

i'm struggling create rather elaborate fractional factorial design using r. (see http://en.wikipedia.org/wiki/fractional_factorial_design ) i've searched google , r-lists , have checked out several promising packages (algdesign, doe.base, acepack) but have not found thing can handle fractional design (only interested in main effects) 8 factors have either 3, 4, 6, or 11 levels each! can point me in right direction? thanks! i have used package algdesign generate fractional factorial designs: generate full factorial design using function gen.factorial() . pass results optfederov() - try find optimum fractional design, using federov algorithm. the following code takes 3 minutes run on windows laptop. example finds approximate optimum fractional factorial design 8 factors 3, 4, 6 or 11 levels each, specified. note use optfederov(..., approximate=true) - finds approximate solution. on machine, when set approximate=false code takes long run , win...

Accessing self hosted WCF service from Silverlight 4 -

i have self hosted wcf 4 service, catering same contract via basichttpbinding silverlight 4 clients , wshttpbinding others. code short , simple , provided here. i following error when trying access service method wcf: message=an error occurred while trying make request uri http://localhost:8008/wcf4silverlight.myservice/sl . due attempting access service in cross-domain way without proper cross-domain policy in place, or policy unsuitable soap services. may need contact owner of service publish cross-domain policy file , ensure allows soap-related http headers sent. error may caused using internal types in web service proxy without using internalsvisibletoattribute attribute. please see inner exception more details. i have method, getclientaccesspolicy() serving cross-domain policy using webget attribute, , kind of sure there problem getting exposed properly. insight problem highly appreciated. if type http://localhost:8008/wcf4silverlight.myservice/clie...