Posts

Showing posts from July, 2011

mysql - INSERT INTO tbl_1 with data from tbl_2 with a WHERE clause -

i need copy data 1 table need use clause in order have work properly. tbl_1 has classid vendorid category_id ( edit: category_id empty, i'm trying copy other table... ) , departmentid tbl_2 has class_code department_id , category_id i want grab category_id in tbl_2 , put tbl_1 tbl_1.classid = tbl_2.class_code , tbl_1.departmentid = tbl_2.department_id i tried using: insert tbl_1 select tbl_2.gateway_id tbl_2 tbl_1.classid = tbl_2.class_code , tbl_1.departmentid = tbl_2.department_id but, no luck. error 'unknown column tbl_1.classid in clause' should using update or that? thanks help. i think looking update update existing rows in tbl_1 correct category_id taken tbl_2 , not insert add rows tbl_1 update tbl_1 join tbl_2 on tbl_1.classid = tbl_2.class_code , tbl_1.departmentid = tbl_2.department_id set tbl_1.category_id = tbl_2.category_id

c# - Problem getting value of a ASP.NET form field from httpContext -

i have declared form input in asp.net ascx file: <input type="hidden" id="hidservicetype" name="hidservicetype" value="somevalue" /> and in web service / web method, trying value of this httpcontext postedcontext = httpcontext.current; servicetype = postedcontext.request.form["hidservicetype"]; i can dig down postedcontext.request.form , see 2 keys 1 being "hidservicetype" "servicetype" variable = ""; what missing, seems trival. why don't add runat="server" attribute input field , access else code-behind?

python - Working with Beaker Cache and SQLAlchemy -

i'm trying use beaker cache sqlalchemy i've been receiving errors. here table definitions. class post(base): .... .... user = relation(user, primaryjoin = user.id == id) tags = relation('tags', backref = 'posts') class tags(base): ... ... user = relation(user, primaryjoin = user.id == id) post = relation(post, primaryjoin = post.id == id) beaker cache works other sqlalchemy classes except these ones. when run program, receive following error; detachedinstanceerror: parent instance <post @ 0x101f90b10> not bound session; lazy load operation of attribute 'user' cannot proceed. i've searched on stackoverflow , have found in thread need disable lazy loading i've changed line user = relation(user, primaryjoin = user.id == id) to user = relation(user, primaryjoin = user.id == id, lazy='dynamic') but occurs following error in template( post.user.fullname ); attributeerror: 'appenderquery...

How to "respond with" HTTP files using Fiddler's AutoResponder? -

is there way have fiddler use http-delivered file response when using autoresponder? i have autoresponder rule set similar this: if uri matches... http://www.liveserver.com/scripts/javascript_file.js respond with... http://internal-dev-server.ext/scripts/javascript_file.js so can qa different javascript before publishing live. but responses via http ways return 404 error. specifically: fiddler - file c:\users\me\documents\fiddler2\captures\responses\http://internal-dev-server.ext/scripts/javascript_file.js not found. i same thing if start request , response "exact:" supported in v2.3.2.5, in alpha form @ https://www.fiddler2.com/dl/fiddler2alphasetup.exe you can either use http/https url directly, or can use syntax like: *redir:http://othersite.com/whatever the advantage of redir syntax server return 307 response new outbound request bears cookies , other information "othersite.com" instead of "originalsite.com". may or...

silverlight - Registered an Assembly for COM, but only works on dev computer -

hey, wondering if guys see wrong/suggest solution. i have dll assembly com built c#, , trying com object silverlight out-of-browser. want siverlight application mobile between computers, put neccesary files in zip along batch installer followingto register assembly: cd %windir%\microsoft.net\framework\v4.0.30319\ regasm.exe "%userprofile%\my documents\homework clock\windowshook.dll" /tlb /nologo my application finds assembly , works fine on dev computer, when move application test computer (along dll , other neccesary files), batch file says registers application doesn't find it. however, when rebuild assembly c# on test computer , replace dll moved dev computer rebuilt dll, application finds fine. convenient clients if didn't have rebuild assembly using c# if wish use application, wondering if there way fix this. i looked problem while , thought might because assembly wasn't strong named assembly, since think c# automatically, tried doing in batch f...

Hide or Show if Current, jQuery -

i have list: <ul class="pagination"> <li class="dl-nav-1 current"><a href="#">spring training 2001</a><span class="visible"><img src="img/indicator.png" alt="" /></li> <li class="dl-nav-2"><a href="#">nfl 2011</a><span class="hidden"><img src="img/indicator.png" alt="" /></span></li> <li class="dl-nav-3"><a href="#">fantasy baseball</a><span class="hidden"><img src="img/indicator.png" alt="" /></span></li> </ul> i need show <span> when li class current, , hide <span> when not current. there js plugin change li class, when changes current, make <span> visible , when removes current, hide <span> terrible attempt: $(function) () { if($(ul.paginat...

c++ - Standard way to implement a buffered stream that flushes at a constant interval? -

i'm simulating packets source produces packets @ given packet/second interval. want make stream class operates ostream object, allowing operator<< used output things through it, caveat each value inserted should released buffer file descriptor, in order, @ specified interval. so, instance, might have socket file descriptor sockfd , say: mybuffer buffer(sockfd, 1000); //interval of 1000 milliseconds buffer << 1 << 2 << 3; and output timed such output 1 <1 second gap> 2 <1 second gap> 3 to socket. i'm looking @ boost.iostreams right now, solution? there magical phrase can google describes problem i'm not aware of? any appreciated. thanks brad one option doing that's orthogonal building custom streams class maintain queue of strings that's polled thread every second. each time queue polled, thread reads out first element , sends across network. this doesn't use streams library, think might want. ...

iphone - Actual frequency of device motion updates lower than expected, but scales up with setting -

i porting app wrote using accelerometer ios 3, incorporate new ios 4 motion capabilities. while capturing motion, application little else - no graphics updates example. i'm doing following set motion updates, replacement previous use of accelerometer. realize rebuild own polling using nstimer or something, , may pursue yet. [motionmanager setdevicemotionupdateinterval:updateinterval]; cmdevicemotionhandler motionhandler = ^(cmdevicemotion *motion, nserror *error) { [self processmotion:motion witherror:error]; }; [motionmanager startdevicemotionupdatestoqueue:[nsoperationqueue currentqueue] withhandler:motionhandler]; this works, update interval doesn't behave expected. i've stripped out execution code in processmotion method, except saving off timestamps in order see real motion update rate is. i've tested enough prove myself it's repeatable, strange result 1/40. table below shows i'm seeing: updateinterval actual events per second 1.0/...

flash - Problem Loading swf on chrome -

i have following swf loaded html tag , not use swfobject.on google chrome see after mouse click on html page swf file shows up.any 1 knows why or doing wrong here <div> <object id="mymoviename" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"> <param value="movie.swf" name="movie"> <param value="high" name="quality"> <param value="#ffffff" name="bgcolor"> <embed align="" type="application/x-shockwave-flash" name="mymoviename" bgcolor="#ffffff" quality="high" src="movie1.swf" href="movie1.swf"> </object> </div> have tried takeing embed node out of object node? it like: <object id="mymoviename" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"> <param value="movie.swf" name="movie"> <par...

How are inner and left and right outer joins implemented in SQL Server? -

i'm looking high-level, algorithmic understanding can big-o sense of sql-server doing perform joins. feel free concise, i'm not looking extremely nitty gritty. thing prompted me understand how joins implemented better scenario behind this question posted. felt 2 separate questions though, why didn't combine them. thanks! here's reading started. nested loop join merge join hash join summary of join properties

ruby on rails - Devise Remember Me and Sessions -

i'm confused devise gem config settings: # time user remembered without asking credentials again. config.remember_for = 2.weeks # time want timeout user session without activity. after # time user asked credentials again. config.timeout_in = 10.minutes i want have user select "remember me" checkbox (i.e., keep me logged in), default session timeout 10 minutes. after 10 minutes asks me log in again though have clicked "remember me". if true remember_for meaningless. i'm missing here. the timeout_in automatically log out within 10 minutes of inactivity , incompatible remember_me checkbox. can have one, not both.

ruby on rails - Save a Prawn PDF as a Paperclip attachment? -

i'm using prawn , prawnto display pdf-based reports user, in circumstances, i'd save pdf attachment 1 of models. i'm using paperclip of attachments. have suggestions on how this? thanks! when using prawnto need eval variables in .pdf.prawn template. second step mimic real file paperclip. generating pdf: #find prawwnto template want template = file.read("#{rails_root}/app/views/reports/your_report.pdf.prawn") pdf = prawn::document.new(:page_size => 'a4', :your_options => :etc) pdf.instance_eval @report = find_report #put here, local variables pdf template needs eval(template) #this evaluates template variables end attachment = pdf.render save pdf paperclip: file = stringio.new(attachment) #mimic real upload file file.class.class_eval { attr_accessor :original_filename, :content_type } #add attr's paperclip needs file.original_filename = "your_report.pdf" file.content_type = "application/pdf" #now...

css - YUI3 (JS) setStyle using vendor prefixes -

how use yui3's set style set -webkit-border-radius: 10px; ? example: y.one('#mydiv').setstyle('-webkit-border-radius', '10'); should work. i think missing 'px' y.one('#mydiv').setstyle('-webkit-border-radius', '10'); should be y.one('#mydiv').setstyle('-webkit-border-radius', '10px');

asp.net mvc 2 - ASP .NET MVC 2 - How do I pass an object from View to Controller w/ Ajax? -

i have object mainobject list of objects, subobjects, among other things. trying have user click link on view add new subobject page. however, unable pass mainobject working action method. mainobject receive empty, values set null. how send controller action mainobject used render view originally? the relevant section of view looks this: <div class="editor-list" id="subobjectslist"> <%: html.editorfor(model => model.subobjects, "~/views/mainobject/editortemplates/subobjectslist.ascx")%> </div> <%: ajax.actionlink("add ajax subobject", "addblanksubobjecttosubobjectslist", new ajaxoptions { updatetargetid = "subobjectslist", insertionmode = insertionmode.replace })%> the relevant function controller looks this: public actionresult addblanksubobjecttosubobjectslist(mainobject mainobject) { mainobject.subobjects.add(new subobject()); return part...

algorithm - Data Set Manipulation -

Image
i need reverse engineer data set original form. original data set derived process multiple users have multiple characteristics enter room , click on button. column variables in indicator form user click on button or have characteristic recorded 1 , don't it's indicated zero. data set transformed in form characteristic types observations represented 2 characteristic variables. new data set shows users have 2 characteristics, amount of them, , button clicks. encompasses users. explanation might not clearest here image might might explanation i'm thinking of using type of algorithm solve not might efficient. unfortunately, in general, not able unambiguously reverse engineer data set. ignoring moment action column, consider following 2 data sets: data set 1: a b c 1 1 1 1 1 0 0 1 1 1 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 data set 2: a b c 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 1 unless i'm mistaken, these 2 data sets show same numbe...

mysql - Is DB Replication a proper solution for this scenario/problem? -

i'm investigating wheter use of replication operation mode way of tackling following design problem. have no prior experience replication of mysql databases, keep in mind while reading. i have develop distributed system of remote computers (tablets in specific), sharing (central) mysql database data storage. system composed central unit containing mysql database, terminal interfaces database simple quering , portable device (tablet) interfaces database throught wifi network. this system serves management of customers, orders, sales , stock local shop selling products out home tablets. each "transaction" need syncronize tablet mysql database before exits local network, inserting necessary data taken mysql tables, describing customers, products , more. i'm using sqlite database on tablet containing necessary data , outside activity exploits inserting new sales, update customers state etc. @ end of transiction tablet comes home , must synchronize again central...

error of importing DBI in Perl -

i writing code in perl , try save in extension .pm not .pl and use use dbi; import dbi in order can execute query. and error compilation failed in require . however, did use in script.pl , s okay.. works.. please , thank much you miss "1;" @ end of .pm file. perl modules have return "true" value. accomplished putting "1;" @ end of file. more information can found in example code of perl modules in perlmod documentation.

How to retrieve certificates from a pfx file with c#? -

i've been googling around half day looking way read .pfx file , import certificates certstore . so far, able read .pfx file x509certifcate , able import 1 certificate within .pfx file. far good, there 3 certificates in .pfx file , when loading .pfx x509certificate , not able see other 2 certificates. the certificate exported *personal information exchange - pkcs #12 (.pfx) include certificates in certification path if possible enable strong protection (requires ie 5.0, nt 4.0 sp4 or above) those options selected when exporting certificate(s). know there 3 certificates because manually go certstore (mmc) , import personal folder myself. you should able collection object containing certs in .pfx file using x509certificate2collection class... here's c# example code: string certpath = <your pfx file path>; string certpass = <your password>; // create collection object , populate using pfx file x509certificate2collection collection =...

php - How to remove everything behind the empty space? -

how can delete behind empty space. have date like: 10.10.2010 18:34 empty space between year , 18. need first part of string (only 10.10.2010). tried use preg_replace remove behind empty space, doesnt work. how expression have be? thank help! phpheini based on simple requirements, rather going full regex solution, can tokenize string using strtok() $datepart = strtok($datestring, ' '); edit: reason see involve regular expressions validate date-time string @ same time extracting parts. example if (preg_match('/(\d{1,2}\.\d{1,2}\.\d{4}) (\d{1,2}:\d{2})/', $datetimestring, $parts)) { $date = $parts[1]; $time = $parts[2]; } else { throw new exception('invalid date-time string format'); }

javascript - Does Internet Explorer 9 choke on extra commas at the end of array and object literals? -

modern browsers , environments node.js allow {a:1, b:2,} or [1,2,3,]. has historically been problematic internet explorer. fixed in internet explorer 9? there 2 different answers this, 1 dangling commas in object initializers , 1 dangling commas in array initializers: for object initializers , e.g.: var obj = { a: 1, b: 2, c: 3, }; it's fixed in ie8 , above. test here: http://jsbin.com/uxuhopec/1 ( source ). ie7 , earlier throw syntax error on } after dangling comma. for array initializers , e.g.: var arr = [ 1, 2, 3, ]; it "fixed" in ie9 , above. test here: http://jsbin.com/uxuhopec/2 ( source ). ie8 , earlier give array four entries, last 1 having value undefined . ie9 , above give 3 entries. i put "fixed" in quotes because spec unclear whether array should have final undefined entry or not, neither behavior incorrect. it's ie went 1 way , else went other. :-)

java - JFrame and JPanel problems -

i attempting make program local bagel shop sells pastries, bagels, , coffee. having trouble implementing panels have made jframe any understanding how make jframe helpful http://kepler.covenant.edu/cos150/bagel_files/image002.jpg once have working hope have middle set of panels change depending on product selected. not entirely sure how make buttons , panels talk 1 another. thanks help! here code jframe far. import java.awt.borderlayout; import javax.swing.jframe; import javax.swing.jlabel; public class bagelorder extends jframe { jlabel toplabel; sizepanel sp = new sizepanel(); typepanel tp = new typepanel(); productspanel pp = new productspanel(); buttonpanel bp = new buttonpanel(); extraspanel ep = new extraspanel(); public bagelorder() { settitle("order entry screen"); setsize(800, 800); setdefaultcloseoperation(jframe.exit_on_close); toplabel = new jlabel("order entry screen"); add(pp, borderlayout.west); add(toplab...

From C# to Java -

can me convert c# function java function? could make simple loop instead of these foreach? static queue radixsort(queue items, int digits) { int digit = digits - 1; while (digit >= 0) { queue 0 = new queue(); queue 1 = new queue(); queue 2 = new queue(); queue 3 = new queue(); queue 4 = new queue(); queue 5 = new queue(); queue 6 = new queue(); queue 7 = new queue(); queue 8 = new queue(); queue 9 = new queue(); int upperlimit = items.count; int counter = 1; while (counter <= upperlimit) { int = convert.toint32(items.dequeue()); counter++; switch (i.tostring().padleft(digits, '0')[digit]) { case '0': zero.enqueue(i); continue; ...

Does ruby expression expansion via #{} do double expansion? -

okay, per suggestions on clarifying intent have restated question. hope example clear. $funcname = "" $message = "" $debugformat = "within #{$funcname} message: #{$message}" def $funcname = "something" # . # . # . $message = "an important message." puts "#{$debugformat}" end def $funcname = "another" # method related code ... $message = "result message output" puts "#{$debugformat}" end so, idea have various debug related strings use in various places without needing repeat same formatting , such. anyway, isn't super critical it's more attempt try , learn ruby better. go easy, -daniel no, not possible have shown. #{} syntax string interpolation, when write pp = "[#{fname}]" , it's storing string [empty] in variable pp . strings have no memory of code used produce them. it's unclear you're attempting achieve...

Basic CSS debugging in Internet Explorer 8 using compatibility mode -

okay, i'm not doing fancy here, it's driving me crazy can't work. i'm having trouble button formatting on form, in internet explorer 7. i have simple form: <div id="menusearch"> <form id="searchform" method="get" action="process.php"> <div> <input type="text" value="" name="s" id="s_name" class="input_text" /> <input type="submit" class="button submit" accesskey="s" value="" /> </div> </form> </div> the css button follows: #menusearch .button { margin: 0; width:97px; height:30px; background-image: url('images/search.png'); background-repeat:no-repeat; background-position:left top; border: none; } the background image simple button image, in internet explorer 7 it's showing standard default b...

visual studio 2010 - Ignore file from delete during WebDeploy -

i'm using teamcity build , deploy collection of mvc applications via msbuild , webdeploy. in step previous solution build/deploy, copy app_offline.htm deploy directory can perform sql updates , other web/solution management steps including build. one of setting in webdeploy delete files aren't included in project, or not needed run site. deletes app_offline.htm file each time. while understand kind of desired result, there way exclude file being deleted deployment directory upon deploy? i've tried adding itemgroup excludefrompackagefiles option, no results. i had similar problem, wanting keep minified javascript files in deployment package though they're not part of project. i added custom msbuild target this, works me: <!-- ====== package minify files ===== --> <propertygroup> <copyallfilestosinglefolderforpackagedependson> customcollectfiles1; $(copyallfilestosinglefolderforpackagedependson); </copyallfiles...

sql - How does a database 'cursor' work? -

with drivers relational databases, default , preferred way access results use cursor or iterator. what i'm guessing database like: runs query. prepares result, stores in ram? returns cursor result client. whenever database driver gets call fetch next result, passes cursor database, gives next result. however, i'm not sure if that's correct. 1 thing stumps me if database client , database server on different nodes , communicating via network, isn't slow? use such lazy approach? makes sense not return data, there middle path takes? the database sends complete result set in 1 go. cursor/iterator in driver on client side.

Authorize.net CIM - How to delete a customer profile from Authorize.net CIM -

in project creating customer profile (not payment profile) in authorize.net (cim) each user registration, have implemented that. have delete these customer profiles (not payment profile) dynamically i.e when site admin deleting each user project, have delete customer profile authorize.net merchant account. please me!!!! as per authorize.net cim xml guide use deletecustomerprofileresponse api call on page 57: this function used delete existing customer profile along associated customer payment profiles , customer shipping addresses. <?xml version="1.0" encoding="utf-8"?> <deletecustomerprofilerequest xmlns="anetapi/xml/v1/schema/anetapischema.xsd"> <merchantauthentication> <name>youruserlogin</name> <transactionkey>yourtrankey</transactionkey> </merchantauthentication> <customerprofileid>10000</customerprofileid> </deletecustomerprofilerequest> ...

How to create cookie using selenium? -

i want create cookie using selenium. have seen method supports selenium.createcookie(arg1,arg0) , i'm bit confused arguments passed. can please give me example? createcookie ( namevaluepair,optionsstring ) create new cookie path , domain same of current page under test, unless specified path cookie explicitly. arguments: namevaluepair - name , value of cookie in format "name=value" optionsstring - options cookie. supported options include 'path' , 'max_age'. optionsstring's format "path=/path/, max_age=60". order of options irrelevant, unit of value of 'max_age' second. source: selenium reference

mercurial - How can we customize the default commit message used by the fetch extension? -

the default commit message fetch uses, "automated merge ...." long, ugly , litters history local directory paths. i'd replace simple "automated merge" or "merge". by default message not customizable (check out "library.zip" under mercurial install folder, you'll see message in plain text under hgext\fetch.pyc ). so way update source code of "fetch" - try this version , changed message "fetch merge" , works blast :) you'd need remove library.zip\hgext\fetch.pyc , put there fetch.py (plain python file) content link above.

PHP declaring empty arrays? -

i have make two-dimensional array based on number of lets car parts submitted on form. possible declare array of size , go , fill it? php arrays dynamically allocated. there's no reason create ahead of time. start using indexes need them: $mynewvar[0] = 'data';

jquery validation based on radio button selection -

in form have 2 radio buttons(seller , buyer).same form fields both radio buttons. diffrence while click buyer radio button fields hide used javascript hide that. used jquery form validation.also used jquery validation hide fields. in seller mode form submitted sucessfully.in buyer mode while click submit button jquery validate hide fields. want stop validate in buyer mode. how that? you can call validate function different options in handler, switches buyer/seller mode. or can add/remove rules in handler

eclipse - HTML5 Validation for Zend Studio -

i'm trying keep project error free possible, phtml files contain <nav> , <aside> , <article> , other html5 tags cause errors. how can configure validator recognize these new elements? have tried request support source here http://forums.zend.com/viewtopic.php?f=59&t=10463 no answers far use html5 dtd komodo, extension of xhtml dtd, new mapping in eclipse xml catalog . <!-- html 5 dtd same html 4 transitional except updates html 5 specication. --> <!--================ character mnemonic entities =========================--> <!entity % htmllat1 public "-//w3c//entities latin 1 xhtml//en" "html5-lat1.ent"> %htmllat1; <!entity % htmlsymbol public "-//w3c//entities symbols xhtml//en" "html5-symbol.ent"> %htmlsymbol; <!entity % htmlspecial public "-//w3c//entities special xhtml//en" "html5-special.ent"> %htmlspecial; <!...

Unable to Connect IBM MQ Via ASP.NET - Unable to load DLL 'amqxcs2.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) -

i trying check connection 1 of active ibm mq’s getting error.. unable load dll 'amqxcs2.dll': specified module not found. (exception hresult: 0x8007007e) using following code.. included amqmdnet.dll , amqmdxcs.dll in bin , gave same reference project. using ibm.wmq; using ibm.wmq.pcf; any remedy this. sreenath seems file not present, make sure library either application needs or library in gac. if file present , error still occurs, make sure file not blocked. open file properties , check if there button "unblock" in "general" tab of properties window. if so, klick , try again. seems happen when download library or extract library archive downloaded untrusted source.

which is better expression to make string into xml object[php]? -

which better expression make string xml object[php]? $xml = new simplexmlelement($xml_string); vs $xml = simplexml_load_string($xml_string); same? they're identical. simplexmlelement::__construct accepts data strings or file paths, if set appropriate options. simplexml_load_file , simplexml_load_string convenience function wrappers amount same thing new simplexmlelement() correct options set.

c# - "Turning" an IEnumerable<IEnumerable<T>> 90 degrees -

what i'm looking basic operation (which i'm sure have name i'm unaware of atm). have matrix like: {1,2,3} {a,n,f} {7,8,9} which i'd mutate into {1,a,7} {2,n,8} {3,f,9} (the above identifiers objects not real values. actual objects of same type , unordered) i'd prefer declarative solution speed factor. i'm going have turn quite few tables (100k cells min) , slow version on critical path. however i'm still more interested in readable solution. i'm looking alternative solutions below. (by alternative not mean variations different approach) var arrays = rows.select(row => row.toarray()); var cellcount = arrays.first().length; for(var = 0;i<cellcount;i++){ yield return getrow(i,arrays); } ienumerable<t> getrow(int i,ienumerable<t[]> rows){ foreach(var row in rows}{ yield return row[i]; } } amongst 2 equally readable solutions i'd go faster readability goes before speed edit square matrix ...

python - How to access the control identifiers in pywinauto -

i trying access control identifiers gets displayed unable so. when open window gets popped ok , cancel button able access.. not able acccess othe options. please once have dialog open , assigned variable print_control_identifiers() (also aliased printcontrolidentifiers) method should print available controls. >>> app = application.start('notepad') >>> app.untitlednotepad.menuitem("edit -> replace").select() >>> app.replace.print_control_identifiers() control identifiers: static - 'fi&nd what:' (l1456, t336, r1528, b349) 'fi&nd what:' 'fi&nd what:static' 'static' 'static0' 'static1' edit - '' (l1531, t332, r1702, b352) 'edit' 'edit0' 'edit1' 'fi&nd what:edit' static - 're&place with:' (l1456, t363, r1528, b376) 're&place with:' 're&place with:static' 'st...

ASP.NET MVC 3 and authentication support from multiple sources -

i know what's best way deal authentication in asp.net mvc 3 multiple sources : custom form authentication social networking (facebook, twitter, etc.) other ? i found link : looking .net library authentication support multiple sources sure if there more means make authentication since question asked. i don't want tightly coupled 1 specific provider maybe should write wrapper around it, if have guidance, nice hear experience. thanks the popular social networking sites (such facebook , twitter) implement openid functionality; , can own authentication use openid. implement own openid membership provider. on side note, means authenticate users on stackoverflow too! let me know if can help. matt

cordova - Phonegap with iphone -

i want know how phonegap communicate server in iphone... , how implement phonegap o iphone.. phonegap wraps web app , packages distribution app. as web app communicate server same way in web app, ie. ajax.

html5 - Webkit notifications requestPermission function doesn't work -

i trying implement support webkit's native desktop notifications on site. when try ask user's permission use notifications, absolutely nothing happens. example, following html not prompt chrome ask me permission: <html lang="en"> <head></head> <body> <h1>testing</h1> <script> window.webkitnotifications.requestpermission(); </script> </body> </html> i know there no problem version of chrome because other sites (e.g. http://www.html5rocks.com/tutorials/notifications/quick/ ) work fine: can see both prompt , subsequent notifications. check specification @ chromium api docs . can call feedback user gesture/action - mouse click etc. requestpermission requests user agent ask user permission show notifications scripts. this method should called while handling user gesture ; in other circumstances have no effect. method asynchronous. function provided in call...

asp.net mvc 3 - Adding image to MVC 3 Web grid column header -

recently using web grid of mvc 3 . in 1 of columns need display image next header text . eg: + possible mvc web grid. thx currently not possible unless use css (provide column header style , set background image in css) or javascript. example css3: @grid.gethtml(headerstyle: "header", columns: grid.columns( grid.column("id"), grid.column("title") )) and in order set background image in second column header using css3: <style type="text/css"> .header th:nth-child(2) { background-image: url(foo.png); } </style>

python - How to draw the largest polygon from a set of points -

so, have set of points (x,y), , want able draw largest polygon these points vertices. can use patches.polygon() in matplotlib, draws lines between points in order give them. doesn't automatically want. example, if want draw square, , sort points increasing x, , increasing y, won't square, 2 connecting triangles. (the line "crosses over") so problem find way sort list of points such "go around outside" of polygon when iterating on list. or there maybe other functionality in matplotlib can me? as suggested ready simple solution calculate angles inner point points , sort them. so here numpy function calculate ccworder : in []: def ccworder(a): ..: a= a- mean(a, 1)[:, none] ..: return argsort(arctan2(a[1, :], a[0, :])) ..: and simple demonstration: in []: out[]: array([[0, 0, 1, 1], [0, 1, 1, 0]]) in []: ccworder(a) out[]: array([0, 3, 2, 1]) update: may seem kind ordering somehow tedious calculate, numpy ca...