Posts

Showing posts from May, 2012

ios - change navigation bar title's color -

i know how change color of navigation bar title when write code: uilabel * label = [[[uilabel alloc] initwithframe:cgrectmake(0,0,45,45)] autorelease]; label.textcolor = [uicolor yellowcolor]; label.backgroundcolor=[uicolor clearcolor]; self.navigationitem.titleview = label; label.text=@"title"; //custom title [label sizetofit]; i want navigation bar show cell's title, not custom title. here table view code: -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return ghazallist.count; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *simpletableidentifier = @"simpletableidentifier"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:simpletableidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:simpletableidentifier] autor...

implementing facebook search in application -

i need design search box in facebook desktop application, functionality same of facebook search. if name 'sam' entered, users in name 'sam' comes should listed. same output of sql query: select uid, name users name '%sam%'. is there way implement this? you hand, doing right can pretty big difficult task. looking @ fb dev wiki though, came across this . looks use facebook typeahead widget whatever options want. can gather friendlist via friends.get or fql query, render xfbml fb typeahead widget. it looks tag in beta , has open bug reports, it's worth give shot before going trouble of doing typeahead yourself.

python - Django: information leakage problem when using @login_required and setting LOGIN_URL -

i found form of information leakage when using @login_required decorator , setting login_url variable. i have site requires mandatory login content. problem redirected login page next variable set when it's existing page. so when not logged in , asking for: http://localhost:8000/validurl/ you see this: http://localhost:8000/login/?next=/validurl/ and when requesting non existing page: http://localhost:8000/faultyurl/ you see this: http://localhost:8000/login/ which reveals information dont want. thought of overriding login method, forcing next empty , calling 'super' on subclassed method. an additional problem of tests fail without login_url set. redirect '/accounts/login/' instead of '/login/'. hence why i'd use login_url disable 'auto next' feature. anybody can shed light on subject? thanx lot. gerard. you can include line last pattern in urls.py file. re-route urls not match other pattern login pa...

cakephp - php e() and h() functions? -

i , lately i'm seeing h() , e() functions in php. have googled them, short results don't give idea of are. got results exponential or math related functions. example: <td><?php echo h($room['room']['message']) ?></td> does have idea? or maybe not called functions? (i think read long ago, can remember real name) added: thanks, replies. using cakephp , found e() example: <?php e($time->niceshort($question['question'] ['created'])) ?> if escaping somehow strings think make sense, since see them right next "echo" i still don't know ;( it looks might cakephp. see e() , h() .

javascript - getXMLHTTP() issue -

i have following code: <script type="text/javascript" language="javascript"> <!-- function getxmlhttp() { //function return xml http object var xmlhttp=false; try{ xmlhttp=new xmlhttprequest(); } catch(e) { try{ xmlhttp= new activexobject("microsoft.xmlhttp"); } catch(e){ try{ req = new activexobject("msxml2.xmlhttp"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function wait1() { document.getelementbyid('comment').innerhtml="please wait..."; } function getcomment(strurl) { var req = getxmlhttp(); if (req) { req.onreadystatechange = function() { if (req.readystate == 4) {...

.net - Storing a list of methods in C# -

i have list of method call in specific order. therefore want store them either in ordered list or in table specified index. way list thing change day want change call order. i found this article explaining how using array , delegates. read in comments , other places done using dictionary , or linq. advices ? you can define action objects, parameterless delegates return void . each action pointer method. // declare list list<action> actions = new list<action>(); // add 2 delegates list point 'somemethod' , 'somemethod2' actions.add( ()=> someclass.somemethod(param1) ); actions.add( ()=> otherclass.somemethod2() ); // later on, can walk through these pointers foreach(var action in actions) // , execute method action.invoke();

How to efficiently (performance) remove many items from List in Java? -

i have quite large list named items (>= 1,000,000 items) , condition denoted <cond> selects items deleted , <cond> true many (maybe half) of items on list. my goal efficiently remove items selected <cond> , retain other items, source list may modified, new list may created - best way should chosen considering performance. here testing code: system.out.println("preparing items"); list<integer> items = new arraylist<integer>(); // integer demo (int = 0; < 1000000; i++) { items.add(i * 3); // demo } system.out.println("deleting items"); long startmillis = system.currenttimemillis(); items = removemany(items); long endmillis = system.currenttimemillis(); system.out.println("after remove: items.size=" + items.size() + " , took " + (endmillis - startmillis) + " milli(s)"); and naive implementation: public static <t> list<t>...

PHP Session Management - Basics -

i have been trying learn session management php... have been looking @ documentation @ www.php.net , looking @ these examples . going on head.... what goal when user logs in ... user can access reserved pages , and without logging in pages not available... done through sessions material on internet difficult learn... can provide code sample achieve goal can learn or reference tutorial... p.s. excuse if have been making no sense in above because don;t know stuff beginner every pages should start session_start() display login form on public pages minimum login credentials (username/password, email/password) on submit check submitted data against database (is username exists? » password valid?) if so, assign variable $_session array e.g. $_session['user_id'] = $result['user_id'] check variable on every reserved page like: <?php if(!isset($_session['user_id'])){ //display login form here }else{ //everything fine, display secret conte...

Remove HTML remove aligment using Java -

i have faces issue removeing alignment in html document. <html> <head> </head> <body> <p style="margin-top: 0" align="center"> hello world </p> <p style="margin-top: 0" align="center"> java world </p> </body> </html> my issue how remove alignment of first paragraph out affecting second paragraph . if use regex will remove alignment of second para also. appricite comment regarding issue. use replacefirst function.

Should we allow null/empty parameters? -

i had discussion co-worker on whether should allow null or empty collections passed method parameters. feeling should cause exception, breaks method's 'contract', if not break execution of method. has advantage of 'failing fast'. co-worker argues leads littering code 'not null/not empty' checks, when wouldn't matter. i can see point, allowing null or empty parameters makes me feel uneasy. hide true cause of problem delaying failure! let's take 2 concrete examples: 1) given have interval class overlaps(interval) method, should happen if null passed parameter? feeling should throw illegalargumentexception let caller know wrong, co-worker feels returning false sufficient, in scenarios uses it, doesn't matter if second interval null or not (all matters whether overlap). 2) given method fetchbyids(collection ids), should happen if empty collection provided? once again i'd warn caller abnormal happening, coworker fine receiving empty li...

php - Can I use an exception with a database query? -

is possible use exception @ end of mysql query instead of die()? i'd throw exception , log instead of killing script. would done like: mysql_query(...) or throw new exception()?? this way it. have database in wrapper class, $this refers wrapper. private function throwexception($query = null) { $msg = mysql_error().". query was:\n\n".$query. "\n\nerror number: ".mysql_errno(); throw new exception($msg); } public function query($query_string) { $this->queryid = mysql_query($query_string); if (! $this->queryid) { $this->throwexception($query_string); } return $this->queryid; } that packages nice error message me, can see problem query. keep simpler of course, , do: mysql_query($sql) or throw new exception("problem query: ".$sql);

asp.net mvc - Do Virtual Directories in shared hosting conflict with stuff in wwwroot? -

i have asp.net mvc application, phpbb forum , asp.net webservice want them in same wwwroot. my shared hosting allows virtual directories went head , made one. made directory , web.config in it. i uploaded asp.net webservice , overrode web.config in virtual directory 1 webservice. not load file or assembly 'system.web.mvc, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. system cannot find file specified. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.io.filenotfoundexception: not load file or assembly 'system.web.mvc, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. system cannot find file specified. source error: unhandled exception generated during execution of current web request. information regarding origin , location of exception can identif...

javascript - asp.net MVC 2: in a create form, how to add new model relation entity with ajax request -

first of , use mvc 2 entity framework 4. have 2 entities. customers , emails there relation 1 many between customer , email. 1 customer ca have many email. question : in customer creation page form, have info related customer. ex: <%: html.labelfor(model = model.firstname) %> <%: html.textboxfor(model = model.firstname) %> <%: html.labelfor(model = model.lastname) %> <%: html.textboxfor(model = model.lastname) %> have add button create email fields in javascript. when save customer, associate email customer. how can perform task?? have couple of ideas, not sure if it's ok way think. one of them when click add button email, show popup email fields, when click save email , call create method , save email in database. problem here is, how can associate email entry customer if customer not saved in database?. steve sanderson has nice bit of code this: http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspne...

javascript - Remove an element from find return -

with fallowing code want delete last element inside steps variable, var steps = $(element).find("fieldset"); var count = steps.size(); steps[count-1] = null; but when iterate each method, doesn't seems see null value steps.each(function(i) { }); you use not() create new jquery object removing elements don't want: steps = steps.not(steps.last());

java - print arraylist element? -

how print element "e" in arraylist "list" out? arraylist<dog> list = new arraylist<dog>(); dog e = new dog(); list.add(e); system.out.println(list); do want print entire list or want iterate through each element of list? either way print meaningful dog class need override tostring() method (as mentioned in other answers) object class return valid result. public class print { public static void main(final string[] args) { list<dog> list = new arraylist<dog>(); dog e = new dog("tommy"); list.add(e); list.add(new dog("tiger")); system.out.println(list); for(dog d:list) { system.out.println(d); // prints [tommy, tiger] } } private static class dog { private final string name; public dog(final string name) { this.name = name; } @override public string tostring(...

jquery - multiply two fields -

there 1 section of orders page users can add new fields add new products. choose product drop down menu , price written in column. need add functionality allow users enter quantity amount, , total price updated quantity amount changes. tried following codes keep receiving 0 total price. my codes. $('#addproduct').click(function() { var = 0; var adding = $(+(i++)+'<div class="row'+(i)+'"><div class="column width50"><input type="text" id="productname" name="productname'+(i)+'" value="" class="width98" /><input type="hidden" class="productid" name="productid" /><input type="hidden" class="unitprice" name="unitprice'+(i)+'" /><small>search products</small></div><div class="column width20"><input type="text" class="unitquantity...

How do i convert a hexadecimal VARCHAR to a VARBINARY in SQL Server -

i have hexadecimal string in varchar field , need convert varbinary. how 1 this? you create udf used in this post . , do: select cast(dbo.hex2bin('7fe0') varbinary(8000)) bin;

cbitmap - how to add bitmap image to buttons in MFC? -

i trying add image existing button..i have done extent, problem can add ownerdrawn image not able add extact image want.. example see below code cbutton* pbtn= (cbutton*)getdlgitem(id_wizback); pbtn->modifystyle( 0, bs_icon ); hicon hicn= (hicon)loadimage( afxgetapp()->m_hinstance, makeintresource(idi_icon3), image_icon, 0,0, // use actual size lr_defaultcolor ); pbtn->seticon( hicn ); with above code converting bitmap icon add button...how can add exact bitmap image directly existing button.please me frnds.. i fixed problem..what did replaced hicon hbitmap , working perfect...basically both work fine in case when loaded icon button background of icon not changing...i tried bitmap work great. working on positioning image , add text...think go through

Facebook API login button without using FB.Login() (i.e. no pop-up) -

i'm creating facebook app , wanted avoid firing off allow box, looks i'm going have that. one option call fb.login(), generates pop-up blocked user. another option use fbml: <fb:login-button></fb:login-button> when user clicks on button, window opens appears pop-up isn't (i.e. it's not blocked). ideal. the question how can launch window opens without having have user click button? i'd not have button show, it's clicked state show. is there way can auto-click button? thanks. if user can interact can in javascript, long it's not alert box or 1 of it's ilk (cos spawn out system handled, no longer in domain of dom). so why not call onclick of button?

plugins - Can I run the Eclipse c++ Formatters from the command line -

i found this page shows how run java formatter cannot find similar resources run built-in c/c++ formatters. it possible this? its possible. can call eclipse parameter: eclipse.exe -application org.eclipse.jdt.core.javacodeformatter -config "./org.eclipse.jdt.core.prefs" "../lala/tmp" ...

c# - Multiple animations in a Storyboard at the same time? -

i created few coloranimations , want them run @ same time (whether run syncronized doesn't matter). sadly 1 of them runs. storyboard = new storyboard(); //animation auditorium coloranimation spotlightanimation = new coloranimation(); spotlightanimation.to = color.fromargb(1, convert.tobyte(random.next(0, 255)), convert.tobyte(random.next(0, 255)), convert.tobyte(random.next(0, 255))); spotlightanimation.duration = timespan.fromseconds(3); spotlightanimation.completed += new eventhandler(storyboard_completed); this.registername("myspotlight", karte.spotlightauditorium); storyboard.settargetname(spotlightanimation, "myspotlight"); storyboard.settargetproperty(spotlightanimation, new propertypath(spotlight.colorproperty)); storyboard.children.add(spotlightanimation); //animation wohnzimmer coloranimation spotlightwohnzimmeranimation = new coloranimation(); ...

Executing BatchFile from C# Program -

i writing batch file , executing through c# program. writing batch file : i path, executable name , arguments app.config , write them batch file. executing batch file : once write batch file pass file name below function executes batch file launches application. problem : my program write lot of batch files executed after each , every file written. find that, times applications not started means batch files not executed. dint error messages or prompts failure of batch file execution. expected solution : any problem in executing batch file, should able log or prompt error. code executes batch file : system.diagnostics.processstartinfo procinfo = new system.diagnostics.processstartinfo("cmd.exe"); procinfo.useshellexecute = false; procinfo.redirectstandarderror = true; procinfo.redirectstandardinput = true; procinfo.redirectstandardoutput = true; system.diagnostics.process proce...

objective c - Creating Dashbord Widgets (using XCode?) based on iPhone app -

some time ago developed app client. it's simple calculator. because asked me if possible create dashboard widget same functionality based on iphone app. i have never before developed widget, know html + css based, raises few questions me: is using html + css way create widget? if no: can xcode used create widget? is possible wrap cocoa applications widget? if yes, there convenience tools create cocoa-touch-like look, feel , functionality (especially of tableviews)? i guess superquestion above questions be: there chance can reuse parts of existing iphone project or need create widget scratch? thanks alot! in /developer/applications/ directory, find * dashcode might develop dashboard widget. yes it's html+css. can add cocoa plug-in, described here . however, cocoa plug-in can't draw using cocoa methods onto webview of widget. you can create webkit plugin described here , can draw using cocoa methods onto webview of widget. can package them i...

javascript - Click Toggle (jQuery) -

$("li").hover( function () { // x }, function () { // y }); .. thats hover, how same click toggle, i.e x on click , y on second click? manythanks $('li').toggle(function() { alert(1) }, function() { alert(2); });

jQuery: what is being extended here? -

$.ajax($.extend(true, {... can explain code doing? yes. from: http://docs.jquery.com/utilities/jquery.extend extend 1 object 1 or more others, returning modified object. if no target specified, jquery namespace extended. can useful plugin authors wishing add new methods jquery. keep in mind target object modified, , returned extend(). if boolean true specified first argument, jquery performs deep copy, recursively copying objects finds. otherwise, copy share structure original object(s). undefined properties not copied. however, properties inherited object's prototype copied over.

PHP ORMs: Doctrine vs. Propel -

i'm starting new project symfony readily integrated doctrine , propel , of course need make choice.... wondering if more experienced people out there have general pros and/or cons going either of these two? thanks lot. edit: responses, useful stuff. there's no correct answer question i'll mark approved 1 got popular up-votes. i'd go doctrine. seems me more active project , being default orm symfony better supported (even though officially orms considered equal). furthermore better way work queries (dql instead of criteria): <?php // propel $c = new criteria(); $c->add(examplepeer::id, 20); $items = examplepeer::doselectjoinfoobar($c); // doctrine $items = doctrine_query::create() ->from('example e') ->leftjoin('e.foobar') ->where('e.id = ?', 20) ->execute(); ?> (doctrine's implementation more intuitive me). also, prefer way manage relations in doctrine. i think pa...

windows - Find system folder locations in Python -

i trying find out location of system folders python 3.1. example "my documents" = "c:\documents , settings\user\my documents", "program files" = "c:\program files" etc etc. i found a different way of doing it . way give location of various system folders , uses real words instead of clsids. import win32com.client objshell = win32com.client.dispatch("wscript.shell") alluserdocs = objshell.specialfolders("allusersdesktop") print alluserdocs other available folders: allusersdesktop, allusersstartmenu, allusersprograms, allusersstartup, desktop, favorites, fonts, mydocuments, nethood, printhood, recent, sendto, startmenu, startup & templates

cocoa - C: fscanf and character/string size -

i parsing text (css) file using fscanf. basic goal simple; want pull out matches pattern: @import "some/file/somewhere.css"; so i'm using fscanf, telling read , discard '@' character , store until reaches ';' character. here's function this: char* readdelimitedsectionaschar(file *file) { char buffer[4096]; int charsread; { fscanf(file, "%*[^@] %[^;]", buffer, &charsread); } while(charsread == 4095); char *ptr = buffer; return ptr; } i've created buffer should able hold 4095 characters, understand it. however, i'm discovering not case. if have file contains matching string that's long, this: @import "some/really/really/really/long/file/path/to/a/file"; that gets truncated 31 characters using buffer of char[4096]. (if use printf check value of buffer, find string cut short.) if increase buffer size, more of string included. under impression 1 character takes 1 byte (though aware affected encodi...

iphone - How to instantiate a UITableViewCell from a nib -

one can add tableviewcell in nib of tableviewcontroller, how it? apple has great explanation on how in the table view programming guide

addressbook - Retrieve iPhone Address Book sorting preference programmatically? -

is possible detect sorting technique used address book on particular user's phone? (for instance, "sort last name" or "sort first name".) thanks. from docs abpersongetsortordering returns user’s sort ordering preference lists of persons. abpersonsortordering abpersongetsortordering ( void );

c# - Implementing XOR in a simple image encryption method -

so of guys finished creating simple image encrypter. it's enough keep non-tech person out, right? :p now next step. suggested use xor. read xor , it's logical table determines answer between 2 bits, right? only when 1 true, statement true. 0 0 = false 1 0 = true 0 1 = true 1 1 = false is correct? so, how go xor encrypting image? here's previous way using caeser cipher. private void encryptfile() { openfiledialog dialog = new openfiledialog(); dialog.filter = "jpeg files (*.jpeg)|*.jpeg|png files (*.png)|*.png|jpg files (*.jpg)|*.jpg|gif files (*.gif)|*.gif"; dialog.initialdirectory = @"c:\"; dialog.title = "please select image file encrypt."; byte[] imagebytes; if (dialog.showdialog() == dialogresult.ok) { imagebytes = file.readallbytes(dialog.filename); (int = 0; < imagebytes.length; i++) { imagebytes...

ruby on rails - Mongoid named scope comparing two time fields in the same document -

i need create named scope in mongoid compares 2 time fields within same document. such as scope :foo, :where => {:updated_at.gt => :checked_at} this won't work treats :checked_at symbol, not actual field. suggestions on how can done? update 1 here model have scope declared, lot of code stripped out. class user include mongoid::document include mongoid::paranoia include mongoid::timestamps field :checked_at, :type => time scope :unresolved, :where => { :updated_at.gt => self.checked_at } end this gives me following error: '<class:user>': undefined method 'checked_at' user:class (nomethoderror) as far know, mongodb doesn't support queries against dynamic values. use javascript function: scope :unresolved, :where => 'this.updated_at >= this.checked_at' to speed add attribute "is_unresolved" set true on update when condition matched ( , index ).

strong typing - What asp.net-mvc strongly typed helpers uses underneath? -

for example, if use in view: ${html.textboxfor(u=>u.username)} how can var name = [xxx].namefor<user>(u=>u.username); from elsewhere? possible? system.web.mvc.expressionhelper.getexpressiontext(lambdaexpression expression)

c99 - In C, if this isn't an address constant, what is it? -

what, exactly, numbers in following declaration, if not address constant? int main() { int numbers[3] = {1,2,3}; return 0; } disassembling program shows 1, 2, , 3 dynamically placed on local stack space, rather whole array being treated constant. hence, {1,2,3} not have static storage duration, numbers not address constant, per c99 spec. c99, section 6.6.9: "an address constant null pointer, pointer lvalue designating object of static storage duration, or pointer function designator..." however, adding line numbers++ after declaration causes following compile error in gcc 4.1.2: error: invalid lvalue in increment so constant, isn't address constant. know official name of type of constant in c99 (or similar)? numbers non-constant, automatic, array variable of function main . because automatic , non-constant can not have static storage. because array variable (and not you'll notice pointer) can not incremented. note can do...

asp.net mvc - How to get the Model from an ActionResult? -

i'm writing unit test , call action method this var result = controller.action(123); result actionresult , need model somehow, knows how this? in version of asp.net mvc there no action method on controller. however, if meant view method, here's how can unit test result contains correct model. first of all, if return viewresult particular action, declare method returning viewresult instead of actionresult . as example, consider index action public viewresult index() { return this.view(this.userviewmodelservice.getusers()); } you can model this var result = sut.index().viewdata.model; if method signature's return type actionresult instead of viewresult, need cast viewresult first.

objective c - Trying a tiny winy 3D classes for iPhone -

ok, i'm trying save time creating generic classes draw objects in 3d space. i created object3d class properties x, y, , z. the thumbnail3d "son" of object3d using inheritance. vertex3d struct glfloat every coord. the problem when try compile method initwithposition:( vertex3d *)vertex, , error is: request member 'x' in not structure or union. request member 'y' in not structure or union. request member 'z' in not structure or union. but, structure on import... #import <uikit/uikit.h> #import <opengles/es2/gl.h> @interface object3d : nsobject { glfloat x; glfloat y; glfloat z; } @property glfloat x; @property glfloat y; @property glfloat z; -(void) render; @end the render still hardcoded #import "thumbnail3d.h" #import "constantsandmacros.h" #import "openglcommon.h" @implementation thumbnail3d @synthesize width; @synthesize height; -(void)render { triangle3d ...

javascript - JQuery UI slider show but doesn't respond to events after the first click -

i setup 3 sliders. 1 range, , other 2 regular. sliders render on page, on first click go either min or max. after seem stuck. adding console.log event handlers show don't respond anymore events after first click. there no console errors either. not sure how go debugging this. else can try? <script type='text/javascript'> jquery(function($) { $(".slide-container").each(function(i, v) { $(v).children(".slide").slider({ range: "min", animate: true, min: $(v).children(".min").html(), max: $(v).children(".max").html(), value: $(v).children(".value").html(), slide: function(event, ui) { $(v).children(".value").html(ui.value); true; } }); }); $(".range-container").each(function(i, v) { $(v).children(".range").slider({ ...

c# - Inheritance and interfaces .NET -

quirky question: imagine have base class called basefoo. have interface methods called ifoo. , have tons of classes beneath basefoo. if implement interface in basefoo, dont need implement in inherited classes, correct? ok, imagine have generic function treat ifoo's. need explicitely declare implement ifoo? like (pseudo-illustrational-code) public class basefoo:ifoo; public interface ifoo; should this? public class ambarfoo:basefoo,ifoo or? public class ambarfoo:basefoo what correct way? effects same? if test if ambarfoo ifoo get? thanks it behave same way regardless. you'd need restate interface name if wanted reimplement interface explicit interface implementation. instance of ambarfoo indeed "say" implements ifoo .

Is it possible to unpack a tuple in Python without creating unwanted variables? -

is there way write following function ide doesn't complain column unused variable? def get_selected_index(self): (path, column) = self._tree_view.get_cursor() return path[0] in case don't care second item in tuple , want discard reference when unpacked. in python _ used ignored placeholder. (path, _) = self._treeview.get_cursor() you avoid unpacking tuple indexable. def get_selected_index(self): return self._treeview.get_cursor()[0][0]

Plugin: Kwicks for Jquery works perfectly with Jquery 1.2.6 but not 1.4.2 -

this (mootools-like) kwicks jquery plugin: http://www.jeremymartin.name/projects.php?project=kwicks i have same problem guy here jquery kwicks issue (kwicks jquery works fine on test site not on live site) in case know problem is, can't find answer yet, , kwicks plugin no longer under active development. i believe problem jquery version. this plugin works great 1.2.6 on 1.4.2 wont work. have tried check code plugin don't know how upgrade 1.4.2 jquery compatible. i have never used 1.2.6 don't know need change make work 1.4.2. please help. thank you! p.s> please find below source code plugin (jquery 1.2.6 compatible). (function($){ $.fn.kwicks = function(options) { var defaults = { isvertical: false, sticky: false, defaultkwick: 0, event: 'mouseover', spacing: 0, duration: 500 }; var o = $.extend(defaults, options); var woh = (o.isvertical ? 'height' : 'width'); // woh...

sql server - Setting PathAnnotation on SSIS path from code -

i have been trying lately create ssis packages .net code rather using drag , drop in visual studio. part of package documentation, able annotate data flow paths. the code below - copied msdn - establishes path between 2 ssis data flow components. adding path.name = "my name"; new application().savetosqlserver(package, null, "localhost", "myuser", "mypassword"); i can set name of path whatever , save package in local sql server. when open package in visual studio 2008, however, name of path can seen under path properties. in visual studio, there path property, pathannotation, value asneeded , additional possibilities sourcename, pathname, never. changing value pathname gives me want: path name appears next path in data flow tab in visual studio. my question is: possible set value of pathannotation property code? using system; using microsoft.sqlserver.dts.runtime; using microsoft.sqlserver.dts.pipeline; using microsoft.sql...

c# - How to pin the header row in Excel in .NET? -

i creating excel spreadsheet in c#. have header (first) row pinned in place when user scrolls rows. how can in c# (or vb.net)? i know not detailed answer, should in right direction. when did lot of perl , later ruby automation of excel , wanted know how achieve , recorded macro , inspected code see how vba interacted objects. did task , got: sub makro1() ' ' makro1 makro ' ' activewindow.splitrow = 1.1 activewindow .splitcolumn = 0 .splitrow = 1 end activewindow.freezepanes = true end sub i leave else translate c#, should walk in park.

iis 7 - Programmatically enable forms authentication in IIS 7.0 -

i'm using system.directoryservices.directoryentry , 'authflags' property therein set anonymous access virtual web. enable anonymous access give value of 1. value need set enable forms auth? i have idea in of head maybe set via web.config? i notice you're using system.directoryservices configure these features on iis7 (according tags). in iis7 can configure both of these settings using microsoft.web.administration library instead: setting authentication type (replaces authflags ): iis 7 configuration: security authentication <authentication> to configure forms authentication: using microsoft.web.administration; ... long iisnumber = 1234; using(servermanager servermanager = new servermanager()) { site site = servermanager.sites.where(s => s.id == iisnumber).single(); configuration config = servermanager.getwebconfiguration(site.name); configurationsection authenticationsection = config.getsection("s...

php - Simple animation - Flash or jQuery? -

i have animation try, kind of shopping cart/checkout action animation. wanted know if flash or jquery (javascript) best? the backend in php , thinking of using amfphp (if flash) or jquery (any frameworks???) wanted know drawbacks/features of each approach. thanks advice, --phill --update-- okay animation when purchased display text , image of item in sort of slick animation. want give flash feel maybe in jquery? -- update-- have tv commercial feel interactive, not sure of animation(s). clean, crisp, fresh, etc... jquery better because it's easy program compelling experience notepad. rule of thumb "if don't need flash, don't use flash." lot of people using iphones surf internet now, don't want alienate market plopping big flash hurdle in front of them can't jump. check out themeforest.net , see designers doing jquery. it's pretty amazing how far we've come simple javascript.

wpf controls - Wpf button second click -

i wanna ask second button_click event. have grid on window. when click button, wanna grid visible , when second clicked button.i wanna grid hidden. windows start menu. codes follows. in advance. private void topics_click(object sender, routedeventargs e) { tgrid.visibility = visibility.hidden; } why don't use current visibility determine whether hide or show it? private void topics_click(object sender, routedeventargs e) { tgrid.visibility = tgrid.visibility == visibility.hidden ? visibility.visible : visibility.hidden; }

asp.net - Google friend connect - simple question about API and .net variables -

i want store person.field.id number of logged-in person in .aspx .net variable can use in vb script. using sign-in gadget on site. how do this? check out .net opensocial client library , c# port of chow down . these 2 alternate methods pulling in gfc id of current viewer in .net, though you'd have translate latter c# vb.net if wanted use it, since it's not shared library. unfortunately, don't think client library written friend connect in mind, simpler fcauth method isn't available. you'll have go through 2-legged oauth process . assume client library supports this, since it's port of java version, does. if sounds complicated, , need id, might pass simple ajax/xhr call. here's js api call getting id: var req = opensocial.newdatarequest(); req.add(req.newfetchpersonrequest('viewer'), 'viewer'); req.send(function(response) { var data = response.get('viewer').getdata(); if (data) { visitorid = data.geti...