Posts

Showing posts from September, 2010

authentication - How can you add a Certificate to WebClient in Powershell -

i wan't examine webpage requires client side certificate authentication. how can provide cert certstore webrequest: there way specify in credentials odr within proxy? $webclient = new-object net.webclient # next 5 lines required if network has proxy server $webclient.credentials = [system.net.credentialcache]::defaultcredentials if($webclient.proxy -ne $null) { $webclient.proxy.credentials = ` [system.net.credentialcache]::defaultnetworkcredentials } # main call $output = $webclient.downloadstring("$url") ps: maybe helps: how can add certificate webclient (c#)? don't it.. ;-) using new add-type functionality in powershell v2, can craft custom class can use make typical webrequest. have included method on custom class allow add certificates can used authentication. ps c:\> $def = @" public class clientcertwebclient : system.net.webclient { system.net.httpwebrequest request = null; system.security.cryptography.x5...

html - z-index not working on drop down menu -

i have drop down menu has following html structure: <ul class="menu"> <li><a href="">menu item 1</a> <ul class="sub-menu"> <li><a href="">sub menu item 1</a></li> </ul> </li> </ul> and have following css rules: .menu {float:left} .menu > li {position:relative; float:left} .menu > li > {display:block} .sub-menu {display:none; z-index:100; position:absolute; top:40px; width:180px;} i'm using javascript show drop down menu. the issue have sub-menus appearing below slideshow have close navigation. no matter how high or how low set z-index of .sub-menu, nothing changes. does know possibly trigger z-index not work @ all? thanks. edit: issue browsers. testing in firefox, chrome , internet explorer i think have found issue. using opacity on div containing menu. reason caused z-index not work on sub-menu. not sure w...

java - ClassCastException when trying to create Proxy object -

i'm trying create proxy given runnable object using following code: public class workinvocationhandler implements invocationhandler { public static runnable newproxyinstance(runnable work) { return (runnable)java.lang.reflect.proxy.newproxyinstance( work.getclass().getclassloader(), getinterfaceswithmarker(work), new workinvocationhandler(work)); } private static class[] getinterfaceswithmarker(runnable work) { list allinterfaces = new arraylist(); // add direct interfaces allinterfaces.addall(arrays.aslist(work.getclass().getinterfaces())); // add interfaces of super classes class superclass = work.getclass().getsuperclass(); while (!superclass.equals(object.class)) { allinterfaces.addall(arrays.aslist(superclass.getinterfaces())); superclass = superclass.getclass().getsuperclass(); } // add marker interface ...

What design pattern should I be utilizing if I require a group of singleton classes to be searchable/retrievable? -

i need have single instances of bunch of classes in project. however, need them searchable/retrievable (like array). design pattern should utilizing? i'm not sure if understand correctly, think maybe need dependency injection container. take inversion of control/dependency injection patterns. microsoft patterns &practices provides implementation of di container called unity . there other open source projects castle windsor , others you can register types in container, specifying, example, want types singleton: iunitycontainer container = new unitycontainer(); container.registertype<myclass>(new containercontrolledlifetimemanager()); ... var mysingletontype = container.resolve<myclass>(); // calls method // return same instance ioc/di more this, hope example useful start point.

actionscript 3 - Application AS2 to AS3 -

i want use following application as2 in as3. great. thanks. going after kind of zoom in , mouse tracking functionality. http://www.senocular.com/flash/source/?entry=649 maybe google maps api flash can you: here's beginners guide http://code.google.com/intl/nl-nl/apis/maps/documentation/flash/intro.html#settingup update: maybe can guide in right direction on how it: you'll need 2 movieclips. 1 zoom (scale adjustments, use slider, scroll / down events , or provide both), , 1 dragging (just use builtin startdrag on movieclip.mouse_down / mouse_up), put 1 inside other, map zooms in you'd expect it. good luck.

iphone - Cocoa - UITableViewController strange behaviour ! -

i'm losing mind on this: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *myidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:myidentifier]; uilabel *label; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithframe:cgrectzero reuseidentifier:myidentifier] autorelease]; label=[[uilabel alloc]initwithframe:cgrectmake(20, 20, 200, 30)]; [cell addsubview:label]; [label settext:[nsstring stringwithformat: @"%d",indexpath.row]]; } return cell; } in cells' labels, see numbers instead of progression expecting (0,1,2,3,4...): 0 1 2 0 4 1 2 0 4 1 any idea where's error? seems can't figure out. edit resolved after putting initialization of label after cell==nil{} block.(don't know why put there in first place.) you need perform cell configuration outside...

Control draggable movement in jQuery -

how can control de movement of draggable in jquery? i need similar "snap grid" draggable moves every "x" , "y" pixels i can't use "grid: [x, y]" (2d) because need make drag on isometric grid (3d) (i develop grid later, first need controll drag) for example: when start dragging, draggable shouldn't move, has snap position when "x" , "y" under conditions thanks in advance! try using options inherent in .draggable() function @ http://jqueryui.com/demos/draggable/ basically says need have snap option set true this: $( ".selector" ).draggable({ snap: true, snapmode:'outer', snaptolerance:40 }); snapmode "...determines edges of snap elements draggable snap to. ignored if snap false. possible values: 'inner', 'outer', 'both'." , snaptolerance "...the distance in pixels snap element edges @ snapping should occur." or try using grid o...

apache - .htaccess question - redirects after the domain name -

apologies if answered elsewhere. had search on here, i'm quite confused i'm not 100% search in first place. i have wordpress site @ exampledomain.com . own exampledomain.co.uk , , have put in .htaccess file follow lines: rewritecond %{http_host} ^exampledomain.co.uk [nc] rewriterule ^(.*)$ http://exampledomain.com/$1 [r=301,nc] these work fine in terms of changing exampledomain.co.uk exampledomain.com , moment add in after exampledomain.co.uk (i.e. exampledomain.co.uk/page1 ) .htaccess file doesn't change tries load. is there can add .htaccess file sort this, that, example, if type exampledomain.co.uk/page1 redirect exampledomain.com/page1 ? thanks, charlie p.s. apologise weirdly parsed example links, new user won't let me include more 2 hyperlinks. why not redirectpermanent / http://exampledomain.com in co.uk's config instead? mod_rewrite handy, simple domain redirector, it's major overkill. comment followup: i'd go...

python - Django settings outside of project -

i have django project uses sqlalchemy use legacy orm objects. application hits ldap server user authentication. getting sick of moving development production servers both ldap , database. hoping create is_development variable in settings.py. 1 problem running orm modules not in django project. i know django.conf great job of parsing settings file , making settings available throughout application. can not figure out how make same settings available myself outside of app. anyone done 1 before? "standalone django scripts"

jquery - How do I implement image elements of unequal width in simplyScroll? -

i'm using simplyscroll v1 horizontally scroll images of varying width list items containing images of fixed width. you can view scrolling content here . how achieve list items varying width? the author suggests following: if want scroll unequal size elements try putting them in container div, initialising simplyscroll on (note hack double amount of elements scrolled!) the list appears within container div: div.simply-scroll-container what author mean "initializing" on container div? a similar thread exists here though ambiguous me. appreciated. the width of li set in simply-scroll css file, if wish use varying sizes can remove width property: before: .simply-scroll .simply-scroll-list li { float: left; /*width: 290px;*/ width: 290px; /*height: 200px;*/ height: 180px; } after: .simply-scroll .simply-scroll-list li { float: left; /*height: 200px;*/ height: ...

javascript - How do I format a number to 2 decimal places, but only if there are already decimals? -

i have jquery 1.5+ script, , select quantity in drop-down menu (1,2,3, etc) , multiplies quantity $1.50 show total price. - it's multiplying quantity selected (1, 2, 3, etc) base price of $1.50 - - can't figure out how display price correctly decimals - example: if select quantity of 2, price displays correctly $3 (no decimals). but, if choose 1, or 3, price displays $1.5 / $4.5 - missing 0 in hundredths decimal place. here's code - idea how show second 0 in case there not 2 decimals? $3 should stay $3, $4.5 should become $4.50, etc - can't work without showing numbers 2 decimals, , that's i'm stuck! <script type='text/javascript'> $(function() { $('#myquantity').change(function() { var x = $(this).val(); $('#myamount').text('$'+(x*1.5));// part isn't displaying decimals correctly! }); }); </script> i...

image - objective-c scale background on one axis -

hi have background pattern image (vertical lines) like: llllllllllllllllllllllllll the line pattern image: bgimg.backgroundcolor = [uicolor colorwithpatternimage:[uiimage imagenamed:@"pd_line2.png"]]; my problem: reframe bgimg - should repeat line on x-axis: stretch line on y-axis. next problem: pattern image uses alpha channel. is possible? can please give me hint? thanks in advance well can scale image in various ways via gccontext functions, perhaps easier way making view transparent (clearcolor background) , adding uiimageview (with pd_line2.png in it) underneath. uiimageview's built-in stretching options may enough achieve need without coding.

sql server - Comparing the Tables of one Database to another -

i have 2 different databases share of same tables, , differ few tables. there way can output of differences between table names in databases? i'm using ms sql server, , both of tables on same db server. you can use database compare tool dbcomparer absolutely free , works great me.

google maps - Blank screen when zooming in/out in MapView in Android 2.2 -

i have application puts overlays in mapview of google maps api android working in android 1.6, , when tested in android 2.2 (lg optimus one) when zooming in/out (fast) mapview fails render overlays , map, showing nothing, blank screen. now, have noticed if 1 connected internet, map reloads after downloading maptile, fixing problem. but, if devices fails connect internet, mapview doesn't restore view, having restart app. checked android log didn't found warnings/errors. i have checked "empty" application adds 1 overlay in empty mapview, , problem persisted, , couldn't reproduce problem in google maps application. i know if else can reproduce issue or has fix it.

jboss - JbossAS 5.0.1 / jbossall-client 4.0.4 backward compatibility -

our old system contained jbossas4 , several different client applications. building new system, migrated jboss 5.0.1 must maintain backward compatibility old client applications. if try connect old application new jboss recieving java.lang.classcastexception: javax.naming.reference cannot cast to.... which says how jbossclient-all not compatible as5 one. if change jboss client jar new libraries, works fine our problem can not change applications in production. have found following link descibing jboss server/client compatibilites, unfortunatelly couln't find regarding as5. if believe this page describing, of client/server versions seem communicate without problem. do guys know if there way make 2 versions compatible? if there no way having idea of creating "adapter" deployed on jbossasç , forward calls jboss5. do have experience making ejb calls within 2 different jboss versions? seems how not straightforward. last option use ws calls between jboss4 , 5...

drupal - PHP unserialize(): Error at offset -

i have problem drupal 6.20. possibly after php update, site stopped working. get: notice: unserialize() [function.unserialize]: error @ offset 0 of 22765 bytes in /path/includes/cache.inc on line 33 this line: $cache->data = unserialize($cache->data); i appreciate help. this problem happen when have drupal 6.x running on postgresql 9.0 because bytea type modified. there suggested solutions here: http://postgresql.1045698.n5.nabble.com/bytea-error-in-postgresql-9-0-td3304087.html running on database should fix it: alter database databasename set bytea_output='escape';

java - Request for suggestion to develop GWT based Web 2.0 applicaion -

i did web 2.0 applications flex. time, wish learn , develop gwt. inspired jbpm console application, i'm thinking using gwt-mosiac user interface(better suggestions welcome , i'm thankful). for example, 1 of stacks in flex [flex+parlsey] - [blazeds-spring/jpa] - mysql. gwt ? kindly suggest stack or system architecture based on experience develop web 2.0 application gwt. please help, thank you. i'd suggest not use third party frameworks if aren't necessary. been there, done that. libraries come , dissapear, making app stick old gwt versions. in case pure gwt ejb+jpa plays pretty well, don't try use domain objects in gwt client code. it's tempting , possible makes app hard maintain. it's better map domain objects gui objects if requires mapping code. regarding @yekmer comparison jquery think it's completly different pair of shoes. gwt power lies in java. jquery superb writing complex apps nightmare in opinion.

bitmap size for background image problem in android for samsung galaxy tab -

possible duplicate: java.lang.outofmemoryerror: bitmap size exceeds vm budget hi frineds putting background image layout in android while putting bacground , giving fillparent layout.i getting below exception can tell how avoid this 04-11 21:47:36.435: error/androidruntime(316): fatal exception: main 04-11 21:47:36.435: error/androidruntime(316): java.lang.runtimeexception: unable start activity componentinfo{com.gcm/com.gcm.myprofileactivity}: android.view.inflateexception: binary xml file line #10: error inflating class android.widget.tablelayout 04-11 21:47:36.435: error/androidruntime(316): @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) 04-11 21:47:36.435: error/androidruntime(316): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) 04-11 21:47:36.435: error/androidruntime(316): @ android.app.activitythread.access$2300(activitythread.java:125) 04-11 21:47:36.435: error/androidruntime(316): @ ...

extract a substring from an array of strings in python -

i'm new python. know if there way extract array (or list) of substrings (all characters position 1 position 2) elements of string array (or list of strings) without making loop. for example, have: aa=['ab1cd','ab2ef'] , , want output be: out=['b1','b2'] for single string variable out=aa[1:3], can't figure how list or array (without loop). thanks cheers you need some kind of loop. list comprehension easiest way: out = [x[1:3] x in aa]

sql server - SQL same unit between two tables needs order numbers in 1 cell -

i have 2 tables: select unitid dbo.tblunits select unitid, workordernumber dbo.tblworkorders i need display unitid's dbo.tblunits in 1 column diplay workorders seperated comma. so here sample data: dbo.tblunits: unitid 123 156 178 dbo.tblworkorders unitid workordernumber 123 1 123 2 156 4 178 5 178 9 178 10 i have use tblunits table because pulling more data final result want show this: unitid workordernumber 123 1,2 156 4 178 5,9,10 any ideas? thanks select unitid, stuff((select ', ' + convert(varchar, workordernumber) tblworkorders t2 t1.unitid = t2.unitid xml path('')), 1,2,'') workordernumbers tblworkorders t1 group unitid

ruby - End of Line Problems -

i'm trying download images gmail account using gmail gem. works fine, except file downloaded through gem has cr + lf line endings , actual file has lf line endings. why happening? how can fix it? are on mac? suspect gmail gives lf line endings seeing basing in browser's user-agent. in case, proper solution problem convert text using universal_newline converter. see documentation ruby built-in converters here: http://ruby-doc.org/core-1.9/classes/encoding/converter.html

email - how to overide simplenews for drupal tpl and subscribe without being registered -

how make simple block subscribe myself providing email in simlenews, without having register myself. i'm using drupal 6 you need enable subscribe newsletters in "simplenews module" go permission -->simplenews module -->subscribe newsletters [enable anonymous user] save , clear cache

c++ - Are there any Serious Graph databases not written in Java? -

i looking serious graph database system not written in java. i not interested in rdf databases, since expect able store more complex graphs (actually hypergraphs) within java camp, orientdb example of looking for. disclaimer: this not flamebait. have nothing against java, want have idea of out there, implemented in other languages, perhaps extension other dbms, such mysql, mongodb or couchdb. depending on requirement is, try out phoebus . isn't graphdb more of distributed graph processing framework.

reflection - How do I retrieve attributes on properties in C#? -

i trying implement simple api user can dictate sorting of object properties property attribute. something like: [sorting(sortorder=0)] public string id { get; set; } in basic tostring() method, use reflection pull properties object. type currenttype = this.gettype(); propertyinfo[] propertyinfoarray = currenttype.getproperties(bindingflags.public); array.sort(propertyinfoarray, this.comparer); i have written custom class using icomparer interface array.sort, once i'm in there stuck trying retrieve [sorting] attribute. have looks this: propertyinfo xinfo = (propertyinfo)x; propertyinfo yinfo = (propertyinfo)y; i thought use xinfo.attributes, propertyattributes class not need do. have guidance how retrieve [sorting] attribute? have looked around lot, how overloaded word attribute in programming keep getting lot of false leads , dead ends. use memberinfo.getcustomattributes system.reflection.memberinfo info = typeof(student).getmembers() ...

javascript - replacing an input field's display -

i'm trying write lightweight html/javascript widget lets me colour each character entered. thinking way have input field reacted events, actual display overlaid html div reads input field's value, highlights it, , writes out. recommended way things? there library out there implements this, , takes care of fiddly details might not have thought of? edit: searching ways implement cronoklee's contenteditable idea brought nice article: http://perplexed.co.uk/993_contenteditable_cross_browser_wysiwyg.htm this might of interest: http://www.w3.org/tr/html5/editing.html#contenteditable i set contenteditable div, , call javascript function on keypress wraps last inputted character in styled span tags. if need submit inputted data, set input type='hidden' , populate on keypress. no need overlay 1 on other! edit: realised (months later!) can use div.textcontent content of input. show text without styling no need input field catch characters.

about lispbox. how to run .lisp file by using it? -

i download lispbox lisp ide on mac os. can run lisp command in lispbox @ interactive mode. question how can run .lisp code using it? thank you. you can use common lisp load function in interactive mode: (load "pathname.lisp") alternatively, see if can use shortcut ctrl-c ctrl-l in editor load lisp file.

ASP.NET VB.NET - Winforms to Web - implementing LostFocus listview control equivalent for web -

Image
background: have winform app registers user in database based on information provided, auto-generates random password , username, , e-mails user link take application based on marketing company selected. problem: when user selects lbcarrier(s), bundles don't show in listbox b/c lostfocus feature doesn't work asp.net. code can use auto-populate bundles listbox based on selected in lbcarrier listbox asp.net. code default.aspx.vb: private sub lbcarriers_lostfocus(byval sender object, byval e system.eventargs) handles lbcarriers.lostfocus dim splt() string dim ac1 array bundles.items.clear() each item in lbcarriers.items splt = split(item.text, "|") ac1 = proxy.getcontractingbundles("test", "test", trim(splt(0))) each pitem in ac1 bundles.items.add(trim(splt(2)) & " | " & pitem.formbundlename) next next end sub protected sub lbcarriers_selectedindexchan...

nosql - Equivalent of an ORM for a distributed key/value store? -

i'm in process of evaluating how implement using distributed key/value store end. i'd have layer on top of key/value supporting object model similar i'd object-relational mapper. can point me @ examples of other people doing this? i'm looking design ideas, though if run across enough may use instead of writing own. i'm going wind implementing mine in perl on top of riak, decisions not final. we have used riak similar, using ruby client ripple exposes acivemodel interface. however, have advise against (as others have). using heavy orm on top of key/value store lose it's main advantage, speed. we moving towards skipping ripple , talking directly riak lot of speed conscious things (we moving erlang , using pbc rather http interface, that's story :d), here how it: in our objects store json document, in ripple compatible format. although have requirement of still use ripple things, if again without ripple still use format. use riak links j...

visual c++ - How to map textures in openGL -

Image
how map textures in opengl.specifically having 1 cube , want paste texture. texture transparent , "source" written on it. possible. if want can give code of cube also. please let me know. thank you please check lesson 06 nehe :

iphone - Loading a view into a UIScrollView AND getting the content inside to work -

i have tab based application working on. i have view controller named detailsview.m, accompanying nib file called detailsview.xib. has couple of uilabels in, linked using iboutlet detailsview.m view controller. when load view controller/view using tab bar controller, works fine , uilabels populated dynamically. now want load entire view inside uiscrollview instead can fit more content in. so created view controller called detailsholder.m nib file called detailsholder.xib, , assigned tab bar controller. i wrote code below load first view (detailsview) uiscrollview in second view (detailsholder). wrote in viewdidload method of detailsholder: detailsview* detailsview = [[detailsview alloc] initwithnibname:@"detailsview" bundle: nil]; cgrect rect = detailsview.view.frame; cgsize size = rect.size; [scrollview addsubview: detailsview.view]; scrollview.contentsize = cgsizemake(320, size.height); this correctly loads sub view uiscrollview, however, labels inside d...

c++ select async programming -

is there way have 'select' waiting reads , writes, while being able add new file descriptors? preferrably on 1 thread? now know scenario (a socket-based server may want accept new incoming connections), did know can append file-descriptor listening socket list select ? see e.g. http://www.lowtek.com/sockets/select.html . (paraphrased example:) fd_set socks; fd_zero(&socks); // add listener socket listen(sock, n); fd_set(&socks, sock); // add existing socket connections (i = 0; < num_existing_connections; i++) { fd_set(&socks, connection[i]); } // break if of existing connections active, // or if new connection appears. select(..., &socks, ...);

java - AndroidManifest.xml writing to file system is there a way -

is there setting can set in androidmanifest.xml have app write file system , not sdcard? *cheers you should use 1 of options data storage defined here storing data. accessing other places need root privileges.

sharepoint - Permission class in InfoPath C# -

i new infopath sharepoint 2010. trying set permissions of infopath form if checkbox checked in form, user groups in sharepoint can view form. however, have found little documentation online permission class , no example code. have example code post or links sites have information permission class? just incase, here code have far: string chkbox = getnodevalue("/my:mytiplead/my:obdm/my:documentdesignation/my:allcisol1and2members"); if (chkbox == "allcisol1and2members") { } edit: if has info on of other sharepoint/infopath classes accomplish assigning permission levels specific form, love hear it. i needed permissions on infopath form based on group membership, unable find way. here's closest found. it suggests might create sharepoint list emulate role/permission you're going use in infopath. drawback need maintain security in 2 places. retrieving 'permission' sharepoint list becomes ...

php - How can I get mediawiki to email me on every db error? -

i'm looking hook or way send out emails every time database error on mediawiki. realize might have add functionality database class i'm not sure @ moment if should doing that. i not want solution includes daemons, crons, or else that'll read , send out emails based on sql query log. the practical way of doing registering custom exception handler. there check if exception database error , send e-mail accordingly. i’ve come simple code: $wghooks['setupaftercache'][] = 'onsetupaftercache'; function onsetupaftercache() { set_exception_handler( 'customexceptionhandler' ); return true; } first have set hook register our exception handler. if registered in localsettings.php overriden wfinstallexceptionhandler() . function customexceptionhandler( $e ) { if( $e instanceof dberror ) { $from = new mailaddress( 'dberror@example.com' ); $to = new mailaddress( 'personal.mail@example.com' ); ...

c++ - Conversion from Qstring to std::string throws an exception -

surprisingly below code throwing exception. qstring qtemp = qdir::temppath(); std::string temp = qtemp.tostdstring(); std::cout<<temp<<std::endl; when debugged using visual studio - go value variable qtemp . in next step bad pointer debugger results in exception when cout same. this known symptom if you're mixing debug , release dlls.

php - How can i keep a log of how many Facebook likes a page has? -

i want rank pages ammount of facebook likes have (via facebook api). there way me automatically insert value mysql via php when button clicked? or way me collect ammount of likes page insert value? there anyway of doing facebook api? :) you can subscribe edge.create event: http://developers.facebook.com/docs/reference/javascript/fb.event.subscribe/ fb.event.subscribe('edge.create', function(response) { // update database using ajax here or else... }); i have never tested should work according fb's documentation.

parsing - Creating shift-reduce / reduce-reduce free grammars -

i'm trying implement simple java language parser in sablecc, although i'm running shift-reduce / reduce-reduce problems when implementing if , while , block statements. for instance, i've considered following: stmts = stmt* ; stmt = if_stmt | block_stmt | while_stmt ; block_stmt = { stmts } | ; ; while_stmt = while ( predicate ) { stmts } | while ( predicate ) ; this grammar, will, instance, cause problem when have of form while (true) ; the parser won't able know whether reduce ; (from block_stmt ) or full while (true); (from while_stmt ). i've been reading everywhere reasons shift-reduce / reduce-reduce problems , think understand them. 1 thing know causes them, , different knowing how structure grammars such avoid them. i've tried implementing grammars in different ways , end problems nonetheless. i guess instead of trying run specific ss / rr problem, there must kind of paradigm follow such avoid kinds of ...

filesystems - Simple in memory file system -

can point me simple (can't stress enough) implementation of in memory file system? if can create file , simple cat file.txt it's more enough. i use part of toy os. in opinion, in-memory file systems should basic possible. here virtual file system implemented in user-mode windows, design principals can used in own os. http://www.flipcode.com/archives/programming_a_virtual_file_system-part_i.shtml . might basic os. wing , create linked list of file descriptors include file attributes, file name, , file path each file.

java - DefaultHttpClient, Certificates, Https and posting problem! -

my application needs able post https , preserve session created cookies. far, have several different ways of trying problem , none working. looking using defaulthttpclient because supposed automatically preserve sessions created cookies. saves me pain of reading cookie , submitting every other post. however, when try post using code have, post fails certificate error listed below. i had certificate error earlier way trying solve problem , got working httpsurlconnection, not preserve sessions cookies automatically. can please take @ code , tell me doing wrong, can better , needs change work.? thanks!! i have been trying solve problem few days , getting know where. every time little further pushed further back. can please assist me! =) //my posting function private static string post(string urlstring, list<namevaluepair> namevaluepairs) throws malformedurlexception, protocolexception, ioexception { dataoutputstream ostream = null; hostnameverifi...

c - Does Android not really have wchar_t? -

i built simple method below wchar_t buf[1024] = {}; void logdebuginfo(wchar_t* fmt, ...) { va_list args; va_start(args, fmt); vswprintf( buf, sizeof(buf), fmt, args); va_end(args); } jstring java_com_example_hellojni_hellojni_stringfromjni( jnienv* env, jobject thiz ) { logdebuginfo(l"test %s, %d..", l"integer", 10); return (*env)->newstringutf(env, buf); } i got following warning in function 'java_com_example_hellojni_hellojni_stringfromjni': warning: passing argument 1 of 'logdebuginfo' incompatible pointer type note: expected 'wchar_t *' argument of type 'unsigned int *' and resulting string not correct. if removed l prefix before formatting string, weird, worked. l prefixes used everywhere in legacy code. first know wchar_t not portable enough , compiler-specific. size of wchar_t expected supposed 16 bits. read other posts said it...

iphone - Xcode: Build error: tried to link DWARF for unsupported file: -

i've changed in project settings , when run project build , debug build error: generatedsymfile error: tried link dwarf unsupported file: "correct path application executable here" but! when press run once more works charm , app starts in simulator. need press cmd-r twice every time debug app. it normal in previous version of project don't know changes i've made %) other projects works fine , can recreate project, want figured out - trigger error. tried ask question on apple devforums without success. any here? thx ) ps error shows xcode3 xcode4 there same file name project name in bundle rid of file renaming , use accordingly. clean project , run project. go.

c# - how does form authentication work in asp.net? -

how start learning form authentication in asp.net? you might need base following through excellent series of tutorials.

YII vs Zend Framework -

hi folks! i developed projects using zend framework . i having on yii framework . after spending few moments looking , similar ruby on rails. has else evaluated it? is bet go? please provide valuable feedbacks. thanks in advance.

javascript - extending Function -

i've been seeing syntax: var module = { func: function(value) { code; }.func2("value"); } cropping in various places, wondering how done. remember seeing article while back, can't find now. whatever try .func2("value") trows syntax errors. for example, take @ sproutcore's intro templateview. todos.statsview = sc.templateview.extend({ remainingbinding: 'todos.todolistcontroller.remaining', displayremaining: function() { var remaining = this.get('remaining'); return remaining + (remaining === 1 ? " item" : " items"); }.property('remaining').cacheable() }); seems useful tool give users when writing factories. thanks. you can add properties function's prototype , chain function definitions. example: function.prototype.trigger = function(trigger) { var setvalue = this; return function(thevalue) { alert(trigger + ' set ' + th...

How to create a temporary table in SSIS control flow task and then use it in data flow task? -

Image
i have control flow create temp database , table in t-sql command. when add dataflow query table can't because table doesn't exist grab information from. when try errors logging in because database doesn't exist (yet). have delay validation true. if create database , table manually add dataflow query , drop database sticks doesn't seem clean solution. if there better way create temporary staging database , query in dataflows please let me know. solution: set property retainsameconnection on connection manager true temporary table created in 1 control flow task can retained in task. here sample ssis package written in ssis 2008 r2 illustrates using temporary tables. walkthrough: create stored procedure create temporary table named ##tmpstateprovince , populate few records. sample ssis package first call stored procedure , fetch temporary table data populate records database table. sample package use database named sora use below create stor...

javascript - Mootools - Fx.Tween vs Fx.Morph -

i'm new mootools. notice morph effect similar tween effect. is difference tween 1 attribute , morph multiple. can 1 please tell me effects best used for, i.e 2 scenarios 1 effect suited more other. thanks! fx.tween more performant fx.morph when animating 1 property, ie: el.tween('height', 100); versus el.morph({ height: 100 }); what don't want do, ever, is: el.tween('height', 100); el.tween('width', 100); instead of: el.morph({ height: 100, width: 1000 });

c# - Restricting number of continuous comma in a textbox -

how limit number of continuous 'comma' in textbox?...ex should not allow user enter more 2 comma continuously this should handle scenarios, believe: private void textbox_textchanged(object sender, eventargs e) { textbox tb = sender textbox; if (tb != null) { int pos = tb.selectionstart; int length = tb.text.length; tb.text = tb.text.replace(",,", ","); int diff = length- tb.text.length; tb.selectionstart = pos == 0 || diff == 0 ? pos : pos - diff; } } this works when type text textbox , when paste text it.

how to detect if a file operation is currently done on a file on linux -

how can detect if file open , file operation being done on process on linux using c or c++? know lsof lists open files dont how gets information. thx i'm not sure lsof working this, way implement this: get process' open files looknig /proc/$pid/fd/ files. look any other process' /proc/$pid/fd/ in order see reading same files.

Ruby - free up memory used by required gems? -

is there way free memory used required gems? rails app grows in memory usage , use gems when need them , after free them up, if possible. thanks! the whole purpose of memory managed programming language (ruby) avoid developers having concern such issues. if memory become sticking point, you'll need profile memory using following tools ruby/ruby on rails memory leak detection although control on memory limited ensuring memory leaks avoided , overall architecture inline best practices. example imagemagick takes excessive memory, rather having images being converted rails mongrels/passengers, restricting conversion dedicated ruby services, avoid large memory footprint.

performance - PHP: are switch-case statements with strings inefficient? -

in php layer i'm receiving error codes strings ("not_found", "expired", etc). it's small list of possible strings, perhaps dozen. what's efficient way of dealing these? using switch-case against string constants stored in class, or should parse them numbers (or something) first? or php smart enough doesn't matter? you might want consider using constants? let's have class error , define error codes there this: class error { const not_found = 0; const expired = 1; // , forth } and can use them in code accessing them error::not_found , switch statement wouldn't need compare strings has plain ints without downgrading readability.

Nested Grid IN EXTJS -

hi how design nested grids in extjs please provide samples(how use rowexpander in extjs gridpanel) try this: //create row expander. var expander = new ext.ux.grid.rowexpander({ tpl : new ext.template('<div id="myrow-{id}" ></div>') }); //define function called when row expanded. function expandedrow(obj, record, body, rowindex){ //absid parameter http request absence details. var absid = record.get('id'); var dynamicstore = //the new store nested grid. //use id give each grid unique identifier. id used in row expander tpl. //and in grid.render("id") method. var row = "myrow-" + record.get("id"); var id2 = "mygrid-" + record.get("id"); //create nested grid. var gridx = new ext.grid.gridpanel({ store: dynamicstore, striperows: true, columns: [ //columns ], height: 120, id...

c# - How to generically format a boolean to a Yes/No string? -

i display yes/no in different languages according boolean variable. there generic way format according locale passed it? if there isn't, standard way format boolean besides boolvar ? resources.yes : resources.no . i'm guessing boolvar.tostring(iformatprovider) involved. assumption correct? the framework not provide (as far know). translating true/false yes/no not strike me more common other potential translations (such on/off , checked/unchecked , read-only/read-write or whatever). i imagine easiest way encapsulate behavior make extension method wraps construct suggest in question: public static class booleanextensions { public static string toyesnostring(this bool value) { return value ? resources.yes : resources.no; } } usage: bool somevalue = getsomevalue(); console.writeline(somevalue.toyesnostring());

c# - ASP.NET custom control for short term memory -

i'm reasonably new web programming, , i'm still struggling grips fact server has terrible short term memory, forgetting what's on screen time see it. i'm trying create custom control allows edit data fields inside repeater. depending on format of fields (the elementformat property), either text box or drop down list should generated. inside markup of page have: <custom:editfieldcontrol id="editfieldcontrol" runat="server" elementid='<%#eval("id")%>' elementvalue='<%#eval("value")%>' elementformat='<%#eval("format")%>' visible="false" /> control code-behind looks this: public class editfieldcontrol : webcontrol { private textbox textbox; private dropdownlist dropdownlist; protected override void createchildcontrols() { switch (the format of field...

android - how to resolve unusual time delay problem in webview content loading -

i'm facing unusual problem while loading webview new content. imagine ebook reader app im going implement... app allows user swap(fling) screen backward , forward see chapter content(nothing reading book). book contains several chapters , i'm keeping each chapter in separate webpage when activity begins load first chapter in webview. i'm loading new chapter 1 chapter ends (user unaware of loading new page web view turning pages forward , backward) after first chapter 2,3,4 ..n chapters.. as going next chapter need allow user come previous chapter. in condtion imagine if user finishes chapter 1 , come chapter 2 . user may want refer previous page . should load chapter 1. i can loading previous chapter. content visible user should not beginning of chapter should end of chapter. im scrolling end of chapter see end of below code. logic not working .. public void fling(...){ //swap forward if (end_of_page==false) scrollby(480); else if (...

vim + janus / indent a perl block -

using vim + janus (https://github.com/carlhuda/janus) enabled default in .vim/vimrc filetype plugin indent on i'm writing perl, every newline indented default. how can select block (or full document) , reindent automatically? you can select block going visual mode (press v or shift + v or ctrl + v in normal mode). reindent can done pressing = after selection of block.

symfony1 - how to revert back to older vs of symfony? -

i have project directory: ~/traffic_2/phoenix$ symfony version here 1.4.11 because tried install symfony in project directory using command: ~/traffic_2/elemental/webroot$ sudo pear install symfony/symfony so updated version 1.4.11 in directory ~/traffic_2/phoenix ! i want revert previous version of symfony 1.4.2 please in above dir??? please how do this?? ~/traffic_2/phoenix$sudo pear install symfony/symfony-1.4.2 ????? thank you after uninstalling previous package, should ok. here : how install older version of phpunit through pear?

PHP Open Source eCommerce Software -

i hope today, query simple 1 searching open source ecommerce solution can extended own modules etc. after scouring google there loads of open source solutions , different websites recommend different solutions. i trust community of stack far more random websites on google, can please make recommendations on systems have used , how found them on overall. thanks in advance. for big application, take @ magento : it's robust solution, both community , entreprise version. another idea (that might lighter) might prestashop . might suggest oscommerce , it's old software -- , if had success years ago, doesn't anymore (i've never used myself, colleagues of mine have worked -- , have since switched magento) .

Processing Android camera frames in real time -

i'm trying create android application process camera frames in real time. start off with, want display grayscale version of camera sees. i've managed extract appropriate values byte array in onpreviewframe method. below snippet of code: byte[] pic; int pic_size; bitmap picframe; public void onpreviewframe(byte[] frame, camera c) { pic_size = mcamera.getparameters().getpreviewsize().height * mcamera.getparameters().getpreviewsize().width; pic = new byte[pic_size]; for(int = 0; < pic_size; i++) { pic[i] = frame[i]; } picframe = bitmapfactory.decodebytearray(pic, 0, pic_size); } the first [width*height] values of byte[] frame array luminance (greyscale) values. once i've extracted them, how display them on screen image? not 2d array well, how specify width , height? you can extensive guidance opencv4android sdk . available examples, tutorial 1 basic. 0 android camera but, in case, intensive image processing, slower accep...

functional programming - Implementing a tail recursive version of quicksort-like function in F#/OCaML -

is possible implement tail recursive version of quick sort algorithm (via continuation pattern)? , if is, how 1 implement it? normal (not optimized) version: let rec quicksort list = match list | [] -> [] | element::[] -> [element] | pivot::rest -> let ``elements smaller pivot``, ``elements larger or equal pivot``= rest |> list.partition(fun element -> element < pivot) quicksort ``elements smaller pivot`` @ [pivot] @ quicksort ``elements larger or equal pivot`` direct style: let rec quicksort list = match list | [] -> [] | [element] -> [element] | pivot::rest -> let left, right = list.partition (fun element -> element < pivot) rest in let sorted_left = quicksort left in let sorted_right = quicksort right in sorted_left @ [pivot] @ sorted_right my first, naive translation similar laurent's version, except indented bit weirdly make apparent ...

Does translating a library into another language make it a “derivative work” for the purposes of GPL/LGPL? -

i developing iphone application use existing code published under lgpl. because of nature of apple’s app store application not open source , charge amount (either $0.99 or $1.99) in order cover expanses publishing in store. have studied lgpl , know allows use of code proprietary software if using library. however, code in question written in javascript need convert objective-c, believe make considered “derivative work” , guess requires must open-sourced (please correct me if wrong). question if translating library language makes “derivative work”, , if enough open-source library, or must entire application using published under lgpl well? i have sub-question. there exists previous version of library has been translated several languages, including objective-c. however, written while library released under gpl (which prohibits using in closed-source software). in mean time license changed lgpl (for original javascript version), affect translated versions or still pure gpl? ...

java me - "Undefined methods for the type "error after importing Netbeans project to Eclipse Pulsar -

i imported netbeans project eclipse ( pulsar mobile developers.version: helios service release 1, build id: 20100917-0705). have 2 errors multiple times - the method nextint() in type random not applicable arguments (int) the method equalsignorecase(string) undefined type string the project works fine in netbeans unable debug due outofmemoryerror , hence switch eclipse. i have seen this did not solve problem. any other hint solve problem ? salil this bug on wtk/eclipse integration https://bugs.eclipse.org/bugs/show_bug.cgi?id=315209