Posts

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...