Posts

Showing posts from September, 2013

internet explorer 8 - Visual Studio 2008 / Web site problem -

i using vs 2008 sp1 , ie 8 beta 2. whenever start new web site or when double-click aspx in solution explorer, vs insists on attempting display aspx page in free-standing ie browser instance. address local file path aspx it's trying load , error says, "the xml page cannot displayed" shown. otherwise, things work work correctly (i close offending browser window. asp.net registered iis , have no other problems. have tested same configuration on other pcs , works fine. has had problem? thanks rp right click on file, select 'open with' , choose "web form editor" , click "set default".

osx - Mac font rendering on Windows -

i love way mac os beautifully renders fonts (not browsers). wondering if somehow same rendering in browsers running on windows? someone recommended sifr guess that's useful when need use non-standard fonts? check out gdi++/freetype ( link , link ). it's highly configurable font-rendering replacement windows. configuration of hinting, anti-aliasing, etc, should able approximate osx style font rendering close.

XPath check for non-existing node -

im having bit of trouble finding right xpath syntax check if particular node in xml exists. i'm allowed use xpath (so no xsl or else that, has pure xpath expression syntax). i have xml , has node filename doesn't exist in every case. when filename isn't specified, livecycle proces use different route fill in filename. how check if filename node exists? you can use count function - passing in path of nodes checking. if not exist, value of count 0: count(//filename) = 0

sharepoint - Retrieving the associated shared service provider's name? -

how programmatically retrieve name of shared services provider that's associated specific sharepoint web application? i have custom solution needs to: enumerate web applications it's deployed to figure out shared services provider each of web applications associated with access business data catalog installed on ssp retrieve data enumerate through site collections in web applications perform various tasks within site collections according data i got points 1, 3, 4 , 5 figured out, 2 troublesome. want avoid hardcoding ssp name anywhere , not require farm administrator manually edit configuration file. information need in sharepoint configuration database, need know how access through object model. unfortunately there no supported way know of can done. relevant class sharedresourceprovider in microsoft.office.server.administration namespace, in microsoft.office.server dll. it's marked internal pre-reflection: sharedresourceprovider sharedresourcepro...

php - How much important is it to develop different database specific escaping mechanisms for different projects? -

as know, magic quotes in php deprecated, done discourage relying on feature preventing sql injection , encourage developers develop database specific escaping mechanisms.[source: php.net] neccessary? if yes, why? why can't use functions mysql_real_escape_string() , addslashes() , stripslashes() achieve same thing instead of developing different escaping mechanisms? an answer example appreciated. thanks mysql_real_escape_string() database specific escaping mechanism :) if choosing database layer new project, sure take @ pdo prepared statements automatically take care of necessary escaping.

java - Face recognition library in android -

i there face recognition sdk/library available 1 can use in android ? whenever search on google came across recognizr , has idea sdk or helps developer in developing face recognition application are looking face detection (find face in photo) or face recognition (identify face in photo)? facedetection.com has decent list of opensource , commercial software detection and/or recognition. for face recognition, here's found on sourceforge: http://sites.google.com/site/elsamuko/c-cpp/opencv-facerecog https://github.com/b051/facereco (moved facereco.com redirects sketchy, unrelated site) then there commercial offerings: http://www.betaface.com http://www.ayonix.com/ http://www.cognitec-systems.de when googling keeps handing result don't want (e.g., recognizr), trick add term search leading minus ( -recognizr ) negate term.

visual studio - Can VS be configured to automatically remove blank line(s) after text is cut? -

is there way (or shortcut) tell vs 2008 cuts line this: before: some text here gets cut code there after: some text here code there what want: some text here code there ps: don't want select whole line or this... text want cut. unless misunderstood you: place cursor on line want cut (no selection) , press ctrl + x . cuts line (leaving no blanks) , puts text in clipboard. (tested in ms vc# 2008 express no additional settings i'm aware of) is want?

flex - Silverlight Install Base - How big is it? -

silverlight v2.0 getting closer , closer rtm have yet hear stats how many browsers running silverlight. if ask adobe (by googling "flash install base") they're only happy tell me 97.7% of browsers running flash player 9 or better. not believe read, where these statistics microsoft or other vendor silverlight? i'm going making technology choice , little bit of empirical evidence asset @ point... all silverlight developers out there, show me stats! quick answer: www.riastats.com this site compares different ria plugins using graphical charts , graphs. it gets data small snippets of javascripts running on sites accross web (approx 400,000 last time looked) at time of post, silverlight 2 sitting @ close 11%. i not take end-all, be-all in ria stats, it's best site i've found far.

mysql - In what order are ON DELETE CASCADE constraints processed? -

here example of i've got going on: create table parent (id bigint not null, primary key (id)) engine=innodb; create table child (id bigint not null, parentid bigint not null, primary key (id), key (parentid), constraint fk_parent foreign key (parentid) references parent (id) on delete cascade) engine=innodb; create table uncle (id bigint not null, parentid bigint not null, childid bigint not null, primary key (id), key (parentid), key (childid), constraint fk_parent_u foreign key (parentid) references parent (id) on delete cascade, constraint fk_child foreign key (childid) references child (id)) engine=innodb; notice there no on delete cascade uncle-child relationship; i.e. deleting child not delete uncle(s) , vice-versa. when have parent , uncle same child, , delete parent, seems innodb should able "figure out" , let cascade ripple through whole family (i.e. deleting parent deletes uncle , child well). however, instead, following: ...

inheritance - C++: Why does my DerivedClass's constructor not have access to the BaseClass's protected field? -

i have constructor attempting initialize field in base class. compiler complains. field protected, derived classes should have access. //the base class: class baseclass { public: baseclass(std::string); baseclass(const baseclass& orig); virtual ~baseclass(); const std::string getdata() const; void setdata(const std::string& data); protected: baseclass(); std::string m_data; }; baseclass::baseclass(const std::string data) : m_data(data) { } baseclass::baseclass() { } baseclass::baseclass(const baseclass& orig) { } baseclass::~baseclass() { } void baseclass::setdata(const std::string& data) { m_data = data; } const std::string baseclass::getdata() const { return m_data; } //the derived class: class derivedclass : public baseclass { public: derivedclass(std::string data); derivedclass(const derivedclass& orig); virtual ~derivedclass(); private: }; derivedclass::derivedclass(std::string data) :...

wpf - How to load an xml string in the code behind to databound UI controls that bind to the XPath of the XML? -

every sample have seen uses static xml in xmldataprovider source, used databind ui controls using xpath binding. idea edit dynamic xml (structure known developer during coding), using wpf ui. has found way load dynamic xml string (for example load file during runtime), use xml string xmldataprovider source? code snippets great. update: make more clear, let's want load xml string received web service call. know structure of xml. databind wpf ui controls on wpf window. how make work? samples on web, define whole xml inside xaml code in xmldataprovider node. not looking for. want use xml string in codebehind databound ui controls. here code used load xml file disk , bind treeview. removed of normal tests conciseness. xml in example opml file. xmldataprovider provider = new xmldataprovider(); if (provider != null) { system.xml.xmldocument doc = new system.xml.xmldocument(); doc.load(filename); provider.document = doc; provider.xpath = "/opml/body/out...

telephony - Programmatically get own phone number in Symbian -

how phone number of device in symbian? according gsm specs, imsi required available on sim card. the actual phone number msisdn stored on hlr database in operator's network , not need available on sim card or transmitted phone. so no matter technology using (symbina, java ...) can never count on being able consistently own phone number device or sim. might lucky if operator stores on sim or if phone provides user possibility enter manually, not have way.

asp.net - IIS Integrated Request Processing Pipeline -- Modify Request -

i want implement isapi filter feature using httpmodule in iis7 running under iis integrated request processing pipeline mode. the goal @ incoming request @ web server level, , inject custom httpheaders request. (for ex: http\_eauth\_id) and later in page lifecycle of aspx page, should able use variable as string eauthid = request.servervariables["http\_eauth\_id"].tostring(); so implementing module @ web server level, possible alter servervariables collection ?? httprequest.servervariables property read-only collection. so, cannot directly modify that. suggest storing custom data in httpcontext (or global application object or database) httpmodule , reading shared value in aspx page. if still want modify server variables, there hack technique mentioned in thread using reflection.

.net - Does SqlCommand.Dispose close the connection? -

can use approach efficiently? using(sqlcommand cmd = new sqlcommand("getsomething", new sqlconnection(config.connectionstring)) { cmd.connection.open(); // set parameters , commandtype storedprocedure etc. etc. cmd.executenonquery(); } my concern : dispose method of sqlcommand (which called when exiting using block) close underlying sqlconnection object or not? no, disposing of sqlcommand not effect connection. better approach wrap sqlconnection in using block well: using (sqlconnection conn = new sqlconnection(connstring)) { conn.open(); using (sqlcommand cmd = new sqlcommand(cmdstring, conn)) { cmd.executenonquery(); } } otherwise, connection unchanged fact command using disposed (maybe want?). keep in mind, connection should disposed of well, , more important dispose of command. edit: i tested this: sqlconnection conn = new sqlconnection(connstring); conn.open(); using (sqlcommand cmd = new sqlcommand(...

html - Code to make a DHTMLEd control replace straight quotes with curly quotes -

i've got old, legacy vb6 application uses dhtml editing control html editor. microsoft dhtml editing control, a.k.a. dhtmled, nothing more ie control using ie's own native editing capability internally. i'd modify app implement smart quotes word. specifically, " replaced “ or ” , ' replaced ‘ or ’ appropriate typed; , if user presses ctrl+z after replacement, goes being straight quote. does have code that? if don't have code dhtml/vb6, have javascript code works in browser contenteditable regions, use that, too here's vb6 version: private sub dhtmledit1_onkeypress() dim e object set e = dhtmledit1.dom.parentwindow.event 'perform smart-quote replacement' select case e.keycode case 34: 'double-quote' e.keycode = 0 if isatwordend insertdoubleundo chrw$(8221), chrw$(34) else insertdoubleundo chrw$(8220), chrw$(34) end if case 39: 'singl...

Switching editors in Eclipse with keyboard, rather than switching Design/Source -

in eclipse, can switch through open editors using control-page up/down. works great, except editors xml or javascript, there design , source tabs. editors, toggles between different tabs. there way eclipse ignore them? know alt-f6 "next editor", doesn't use same order editor tabs displayed in, it's confusing. with ctrl-e can jump directly editor typing beginning of it's name. quite handy when you've got lot of editors open.

append - How to add a list item in the middle of a list with JQuery -

i have list 2 items, want add additional items after first item when content loaded. how done? can add items, show on end of list. have call or use list element array? first create new list item ( <li> ) , populate list item content. think need define position of list item before or while add li item. if(x > 0){ $('<li></li>').attr('id','liadult_'+x).appendto($("ul:#uladultlist")); //$("ul:#uladultlist").add($('<li></li>').attr('id','liadult_'+x)).after($('#liadult_0')); $('<img/>').attr({'id':'imgadultavatar_'+x,'src':'./images/person_20x20.jpg','class':'imgavatar','title':'the persons avatar','alt':'avatar adults'}).appendto($('#liadult_'+x)); $('<span></span>').attr({'id':'sadultfirstname_'+x,'class':'sadult...

embedded - Power Efficient Software Coding -

in typical handheld/portable embedded system device battery life major concern in design of h/w, s/w , features device can support. software programming perspective, 1 aware of mips, memory(data , program) optimized code. aware of h/w deep sleep mode, standby mode used clock hardware @ lower cycles or turn of clock entirel unused circutis save power, looking ideas point of view: wherein code running , needs keep executing, given how can write code "power" efficiently consume minimum watts? are there special programming constructs, data structures, control structures should @ achieve minimum power consumption given functionality. are there s/w high level design considerations 1 should keep in mind @ time of code structure design, or during low level design make code power efficient(least power consuming) possible? like 1800 information said, avoid polling; subscribe events , wait them happen update window content when necessary - let system decide when r...

c - 'bad address' error from copy_to_user -

i attempting copy custom struct kernel space user space. inside user space errno returns 'bad address'. usual cause of bad address error? if(copy_to_user(info, &kernel_info, sizeof(struct prinfo))) bad address error means address location have given invalid. case have above guess because passing copy of info instead of pointer info 's memory location. looking @ docs, copy_to_user defined as copy_to_user(void __user * to, const void * from, unsigned long n); so unless info variable pointer update code be: if(copy_to_user(&info, &kernel_info, sizeof(struct prinfo)) ) { //some stuff here guess }

c# - How to install a program so it can be launched at startup with admin rights on Windows Vista/7 -

i read how service, wanna know if it's possible simple application. i'm using c#. thank you it's not possible. closest experience have create service run elevated , winforms app runs without elevation , front end service. have careful though, cause security concerns if don't wall if off correctly.

Scala - how to build an immutable map from a collection of Tuple2s? -

in python, dictionary can constructed iterable collection of tuples: >>> listoftuples = zip(range(10), [-x x in range(10)]) >>> listoftuples [(0, 0), (1, -1), (2, -2), (3, -3), (4, -4), (5, -5), (6, -6), (7, -7), (8, -8), (9, -9)] >>> thedict = dict(listoftuples) >>> thedict {0: 0, 1: -1, 2: -2, 3: -3, 4: -4, 5: -5, 6: -6, 7: -7, 8: -8, 9: -9} >>> is there equivalent scala syntax? see can use varargs type amount of tuple2s construct map, e.g. scala> val themap = map((0,0),(1,-1)) themap: scala.collection.immutable.map[int,int] = map((0,0), (1,-1)) scala> themap(0) res4: int = 0 scala> themap(1) res5: int = -1 scala> val tuplepairs = list((0,0),(1,-1)) tuplepairs: list[(int, int)] = list((0,0), (1,-1)) scala> val mapfromiterable = map(tuplepairs) <console>:6: error: type mismatch; found : list[(int, int)] required: (?, ?) val mapfromiterable = map(tuplepairs) ^ ...

iis - Remove HTTP headers inserted by Managed Fusion URL Rewriter -

i'm toying managed fusion's url rewriter , noticed adds couple http headers iis’ response: x-rewritten-by: managedfusion (rewriter; reverse-proxy; +http://managedfusion.com/) x-managedfusion-rewriter-version: 3.5 how can remove these headers? (i'd keep things small performance reasons.) unfortunately, documentation little sparse. configuration example suggests: <!-- minimal sample configuration file shows how declare configuration sections. because xml schema definition (xsd) generated each configuration section, should trivial edit these files because have intellisense on xml definition. --> however, i'm not seeing intellisense in visual studio, can't see if configuration option can stick in web.config. ended finding configuration option after perusing the xsd in source. the relevant attribute allowvanityheader . <managedfusion.rewriter xmlns="http://managedfusion.com/xsd/managedfusion/rewri...

shell - echo smbpasswd by --stdin doesn't work -

i want make creating samba password automated command doesn't work: echo "passwd"|smbpasswd -a -s $user it shows error: mismatch - password unchanged. unable new password. could please suggest option make script automated? you need repeat password, "for confirmation" speak, e.g. printf "passwd\npasswd\n" | smbpasswd -a -s $user should work.

iphone - Grid Table VIew -

in application m using uitableview in grid format contain 16 columns . so query want horizontal scroll bar inn uitable view , how apply in codes. please send me necessary code it. thanks in advance before loading table view, load scroll view content size per requirement, , set delegate self scroll view, add table view scroll view , enable horizontal , vertical scroll. there problem rectifies , enjoy coding..

java - How can I get Axis 1.4 to not generate several prefixes for the same XML namespace? -

i receiving soap requests client uses axis 1.4 libraries. requests have following form: <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <soapenv:body> <placeorderrequest xmlns="http://example.com/schema/order/request"> <order> <ns1:requestparameter xmlns:ns1="http://example.com/schema/common/request"> <ns1:orderingsystemwithdomain> <ns1:orderingsystem>internet</ns1:orderingsystem> <ns1:domainsign>2</ns1:domainsign> </ns1:orderingsystemwithdomain> </ns1:requestparameter> <ns2:directdeliveryaddress ns2:addresstype="0" ns2:index="1" xmlns:ns2="http://example....

Hiding and showing parts of an html with PHP? -

the example have in html: <div id="red-nav-warp"> <ul id="red-nav-logo"> <li><img class="sponsors" id="sponsorone" src="media/img/logosmall.png" /></li> </ul> <ul class="clearfix" id="red-nav-list-member" > <li><?php $themesys->href('logout',$langsys->get('logout')); ?></li> <li><?php $themesys->href('settings',$langsys->get('settings')); ?></li> </ul> <ul class="clearfix" id="red-nav-list" > <li><?php $themesys->href('home',$langsys->get('home')); ?></li> <li><?php $themesys->href('why',$langsys->get('why')); ?></li> <li><?php $themesys->href('register',$langsys->get('register')); ?></a></li> ...

webforms - PHP: Having trouble uploading large files -

i doing file upload using php, works fine file of size 2.8mb on localhost - not mediatemple gs host. files smaller 2mb work fine, larger seems not work... not getting error message when upload finishes, file not found in uploads directory... i googled around, , added following lines .htaccess file: php_value memory_limit 120m php_value max_execution_time 120 php_value upload_max_filesize 10g php_value post_max_size 10g i know of above values overkill, then, not seem help... else might missing? the 1 missed max_input_time , , check whether edits reflected in phpinfo(); .

matlab - binary linear programming solver in Python -

i have python script in need solve linear programming problem. catch solution must binary. in other words, need equivalent of matlab's bintprog function. numpy , scipy not seem have such procedure. have suggestions on how 1 of these 3 things: find python library includes such function. constrain problem such can solved more general linear programming solver. interface python matlab make direct use of bintprog . just rigorous, if problem binary programming problem, not linear program. you can try cvxopt . has integer programming function (see this ). make problem binary program, need add constrain 0 <= x <= 1. edit : can declare variable binary, don't need add constrain 0 <= x <= 1. cvxopt.glpk.ilp = ilp(...) solves mixed integer linear program using glpk. (status, x) = ilp(c, g, h, a, b, i, b) purpose solves mixed integer linear programming problem minimize c'*x subject g*x <= h a*x = b ...

c# - Load a form without showing it -

short version: want trigger form_load() event without making form visible. doesn't work because show() ignores current value of visible property: tasksform.visible = false; tasksform.show(); long version: have winforms application 2 forms: main , tasks. main form displayed. user can either click button open tasks form, or click buttons run task directly without opening tasks form. when user asks run task directly, i'd call public methods on tasks form without showing it. unfortunately, task logic depends on stuff happens in form_load() event. way can find trigger form_load() call show(). best i've been able show form in minimized state: tasksform.windowstate = formwindowstate.minimized; tasksform.show(); i suppose cleanest solution pull tasks logic out of tasks form , controller class. can use class main form , tasks form, , load tasks form when need visible user. however, if it's easy thing load form without displaying it, smaller change. i total...

iphone - cancel a background thread in Objective-C -

how cancel background thread in objective-c? i calling background threads so: [self performselectorinbackground:@selector(setupthumbnails) withobject:nil]; it called when swipe happens, each swipe want cancel previous background thread request. maintain cancellation property thread, , check periodically within thread. you'll need either use lock or atomic function (as provided operating system , frameworks, not implemented yourself!) indicate thread should cancelled. system-provided atomic functions documented in atomic manpage. even better use nsoperation on nsoperationqueue instead of nsthread. still perform work in background using thread, lets framework , operating system manage thread pool on behalf, , nsoperation has iscancelled property can check - ability cancel either individual nsoperation or operations in entire nsoperationqueue. for example, have "set 1 thumbnail" operation, , add 1 such operation queue each thumbnail set up. os , ...

python - Cannot access members of UserProperty in code -

i'm new google apps , i've been messing around hello world app listed on google app site. once finished app, decided try expand on it. first thing added feature allow filtering of guestbook posts user submitted them. all have changed/added handler wsgiapplication , new class handler. model same, i'll post reference: class greeting(db.model): author = db.userproperty() content = db.stringproperty(multiline = true) date = db.datetimeproperty(auto_now_add=true) using django template changed line displays authors nickname from: <b>{{ greeting.author.nickname }}</b> wrote: to: <a href="/authorposts/{{ greeting.author.user_id }}"> {{ greeting.author.nickname }} </a></b> wrote: the issue i'm having inside python code cannot access "greeting.author.nickname", or of other properties, such "user_id". accessible django template, code listed above template works , correctly creates link a...

algorithm - Finding groups of similar strings in a large set of strings -

i have reasonably large set of strings (say 100) has number of subgroups characterised similarity. trying find/design algorithm find theses groups reasonably efficiently. as example let's input list on left below, , output groups on right. input output ----------------- ----------------- jane doe mr philip roberts mr philip roberts phil roberts foo mcbar philip roberts david jones phil roberts foo mcbar davey jones => john smith david jones philip roberts dave jones dave jones davey jones jonny smith jane doe john smith jonny smith does know of ways solve reasonably efficiently? the sta...

security - Dynamic IP-based blacklisting -

folks, know ip blacklisting doesn't work - spammers can come in through proxy, plus, legitimate users might affected... said, blacklisting seems me efficient mechanism stop persistent attacker, given actual list of ip's determined dynamically, based on application's feedback , user behavior. for example: - trying brute-force login screen - poorly written bot issues strange http requests site - script-kiddie uses scanner vulnerabilities in app i'm wondering if following mechanism work, , if so, know if there tools it: in web application, developer has hook report "offense". offense can minor (invalid password) , take dozens of such offenses blacklisted; or can major, , couple of such offenses in 24-hour period kicks out. some form of web-server-level block kicks in on before every page loaded, , determines if user comes "bad" ip. there's "forgiveness" mechanism built-in: offenses no longer count against ip after while. th...

Should I compile my Android apps against the latest SDK? -

my app requires devices running @ least android 2.0 os. make more sense me compile project 2.0 sdk or make more sense compile project using latest sdk, if it's beyond 2.0...? the problem compiling against 2.1 example don't know if android 2.0 device run app compiled 2.1...? you can target later sdk version using android:targetsdkversion while still permitting app run on earlier versions (since apps filtered out based on android:minsdkversion ). if use api's aren't supported, app force close. so, you'll have pay attention api level annotations in documentation functions, , test app on emulator set use minimum sdk version. however, android developer's blog has some advice on how write applications support earlier sdk versions - @ cost of added work, of course. whether it's worth depends on whom want reach, obviously.

workflow - How can you program if you're blind? -

sight 1 of senses programmers take granted. programmers spend hours looking @ computer monitor (especially during times when in zone ), know there blind programmers (such t.v. raman works google). if blind person (or becoming blind), how set development environment assist in programming? (one suggestion per answer please. purpose of question bring ideas top. in addition, screen readers can read ideas earlier.) i totally blind college student who’s had several programming internships answer based off these. use windows xp operating system , jaws read appears on screen me in synthetic speech. java programming use eclipse, since it’s featured ide accessible. in experience general rule java programs use swt gui toolkit more accessible programs use swing why stay away netbeans. .net programming use visual studio 2005 since standard version used @ internship , accessible using jaws , set of scripts developed make things such form designer more accessible. for c , c++ pr...

security - Irretrievably destroying data in Java -

is there anyway in java delete data (e.g., variable value, object) , sure can't recovered memory? assigning null variable in java delete value memory? ideas? answers applicable other languages acceptable. due wonders virtual memory, impossible delete memory in irretrievable manner. best bet 0 out value fields; however: this not mean old (unzeroed) copy of object won't left on unused swap page, persist across reboots. neither stop attaching debugger application , poking around before object gets zeroed or crashing vm , poking around in heap dump.

c++ - What are the rules for calling the superclass constructor? -

what c++ rules calling superclass constructor subclass one? for example, know in java, must first line of subclass constructor (and if don't, implicit call no-arg super constructor assumed - giving compile error if that's missing). base class constructors automatically called if have no argument. if want call superclass constructor argument, must use subclass's constructor initialization list. unlike java, c++ supports multiple inheritance (for better or worse), base class must referred name, rather "super()". class superclass { public: superclass(int foo) { // foo } }; class subclass : public superclass { public: subclass(int foo, int bar) : superclass(foo) // call superclass constructor in subclass' initialization list. { // bar } }; more info on constructor's initialization list here , here .

python - How to parse an ISO 8601-formatted date? -

i need parse rfc 3339 strings "2008-09-03t20:56:35.450686z" python's datetime type. i have found strptime in python standard library, not convenient. what best way this? the python-dateutil package can parse not rfc 3339 datetime strings 1 in question, other iso 8601 date , time strings don't comply rfc 3339 (such ones no utc offset, or ones represent date). >>> import dateutil.parser >>> dateutil.parser.parse('2008-09-03t20:56:35.450686z') # rfc 3339 format datetime.datetime(2008, 9, 3, 20, 56, 35, 450686, tzinfo=tzutc()) >>> dateutil.parser.parse('2008-09-03t20:56:35.450686') # iso 8601 extended format datetime.datetime(2008, 9, 3, 20, 56, 35, 450686) >>> dateutil.parser.parse('20080903t205635.450686') # iso 8601 basic format datetime.datetime(2008, 9, 3, 20, 56, 35, 450686) >>> dateutil.parser.parse('20080903') # iso 8601 basic format, date datetime.datetime(2008,...

javascript - How can I let a table's body scroll but keep its head fixed in place? -

i writing page need html table maintain set size. need headers @ top of table stay there @ times need body of table scroll no matter how many rows added table. think mini version of excel. seems simple task every solution have found on web has drawback. how can solve this? i had find same answer. best example found http://www.cssplay.co.uk/menu/tablescroll.html - found example #2 worked me. have set height of inner table java script, rest css.

regex - Free alternative to RegexBuddy -

are there alternatives support writing regexps in different flavors , allow test them? here's list of regex tools mentioned across threads: regulater expresso .net regular expression designer regex-coach larsolavtorvik online tool regex pal regular expression workbench rubular reggy regexr

php - Looking for super simple but effective BUG/Feature list that users can vote -

i looking javascript or php code allows enter in list, , allows people vote (1 vote per ip or cookie) or rate (not important, ok, important). there 2 lists, 1 people suggest features , rate features , down in list. other bugs, people vote bug want fixed or submit new bug. this used 50 users simplicity wanted. does have basic script or example of this? need of way track users want in application, , give them way submit stuff want fixed. an idea inspired this page: http://kryogenix.org/bugs/sorttable/ seems manually done, not automated though. try http://uservoice.com/ it's not bug tracker in classical sense, allows users add suggestions , have other users vote on them (just asked for). 1 list free. if need multiple list have pay fee, give discounts non-profits.

Plot confidence bands on log-scaled plot in R -

i have custom function produces scatter plot, fits ols model , plots best fit line 95% ci bands. works well, want log data , change plot's axes log-scaled version of original data (this done using 'plot' function's built in 'log' argument alter plot axes - log="xy"). problem is, plotting of cis , regression line based on scale of (logged) data, in case range between values of 0 2, while plot's axes range 0 200. cis , regression line not visible on plot. i can't seem find way alter cis , regression line fit logged plot, or alter plot axes manually mimic using log="xy". to see mean, can alter beginning of plot function read: plot(x, y, log="xy", ...) here made data , function , function call: # data x <- c(33.70, 5.90, 71.50, 77.90, 71.50, 35.80, 12.30, 9.89, 3.93, 5.85, 97.50, 12.30, 3.65, 5.21, 3.9, 42.70, 5.34, 3.60, 2.30, 5.21) y <- c(1.98014, 2.26562, 3.53037, 1.08090, 0.95108, 3.00287, 0.81037...

algorithm - The “pattern-filling with tiles” puzzle -

i've encountered interesting problem while programming random level generator tile-based game. i've implemented brute-force solver exponentially slow , unfit use case. i'm not looking perfect solution, i'll satisfied “good enough” solution performs well. problem statement: say have or subset of following tiles available (this combination of possible 4-bit patterns mapped right, up, left , down directions): alt text http://img189.imageshack.us/img189/3713/basetileset.png you provided grid cells marked (true) , others not (false). generated perlin noise algorithm, example. goal fill space tiles there many complex tiles possible. ideally, tiles should connected. there might no solution input values (available tiles + pattern). there @ least 1 solution if top-left, unconnected tile available (that is, pattern cells can filled tile). example: images left right: tile availability (green tiles can used, red cannot), pattern fill , solution alt text http://img...

iPhone iAd -- not getting callbacks to didFailToReceiveAdWithError -

i testing iad app on ipod touch. ipod connected internet. in testing, have received 1 callback didfailtoreceiveadwitherror. here relevant code: #ifdef mapphasads - (void)bannerviewdidloadad:(adbannerview *)banner { nslog (@"triangle ad"); bannerview.hidden = no; } - (void)bannerview:(adbannerview *)banner didfailtoreceiveadwitherror:(nserror *)error { nslog (@"no triangle ad"); bannerview.hidden = yes; } #endif and here of nslogs seeing. note of timestamps 1 minute or 1 min 30 sec apart. me, indicates ads failed arrive. there no callback. 2010-07-25 20:11:36.403 universaltrianglesolver[10490:307] triangle ad 2010-07-25 20:12:35.684 universaltrianglesolver[10490:307] triangle ad 2010-07-25 20:13:05.684 universaltrianglesolver[10490:307] triangle ad 2010-07-25 20:13:35.684 universaltrianglesolver[10490:307] triangle ad 2010-07-25 20:14:35.686 universaltrianglesolver[10490:307] triangle ad 2010-07-25 20:16:05.689 universaltrianglesolv...

Saving Android Activity state using Save Instance State -

i've been working on android sdk platform, , little unclear how save application's state. given minor re-tooling of 'hello, android' example: package com.android.hello; import android.app.activity; import android.os.bundle; import android.widget.textview; public class helloandroid extends activity { private textview mtextview = null; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mtextview = new textview(this); if (savedinstancestate == null) { mtextview.settext("welcome helloandroid!"); } else { mtextview.settext("welcome back."); } setcontentview(mtextview); } } i thought enough simplest case, responds first message, no matter how navigate away app. i'm sure solution simple overriding onpause or that, i've been poking away in documentation 30 minutes or , haven't found obvious. ...

ASP.NET user login best practices -

i want make login system using asp.net (mvc). on internet, found bad examples involved sql in click events. other information pointed asp.net built-in membership provider. however, want roll own. don't want use built-in membership provider, seems work on ms sql, , don't idea of having few foreign tables in database. i think of something, need few pointers in right direction. not have high-security, regular common-sense security. and have few direct questions: a lot of systems seem have session id stored in user table. guess tie session user prevent hijacking. check every time user enters page? , do if session expires? hashing, salting, do? know of md5 hashing , have used before. not salting. best practices cookies? i dont know best practices can tell do. not hitech security job. i use forms authentication. receive password secured ssl via textbox on login page. take password , hash it. (hashing 1 way encryption, can hash code cant reversed password)...

text editor - What's in your .emacs? -

i've switched computers few times recently, , somewhere along way lost .emacs. i'm trying build again, while i'm @ it, thought i'd pick other configurations other people use. so, if use emacs, what's in your .emacs? mine pretty barren right now, containing only: global font-lock-mode! (global-font-lock-mode 1) my personal preferences respect indentation, tabs, , spaces. use cperl-mode instead of perl-mode. a shortcut compilation. what think useful? use ultimate dotfiles site . add '.emacs' here. read '.emacs' of others.

Sending a message to nil in Objective-C -

as java developer reading apple's objective-c 2.0 documentation: wonder " sending message nil " means - let alone how useful. taking excerpt documentation: there several patterns in cocoa take advantage of fact. value returned message nil may valid: if method returns object, pointer type, integer scalar of size less or equal sizeof(void*), float, double, long double, or long long, message sent nil returns 0. if method returns struct, defined mac os x abi function call guide returned in registers, message sent nil returns 0.0 every field in data structure. other struct data types not filled zeros. if method returns other aforementioned value types return value of message sent nil undefined. has java rendered brain incapable of grokking explanation above? or there missing make clear glass? i idea of messages/receivers in objective-c, confused receiver happens nil . well, think can described using contriv...

math - Is mathematics necessary for programming? -

i happened debate friend during college days whether advanced mathematics necessary veteran programmer. used argue fiercely against that. said programmers need basic mathematical knowledge high school or fresh year college math, no more no less, , of programming tasks can achieved without need advanced math. argued, however, algorithms fundamental & must-have asset programmers. my stance computer science advances depended solely on mathematics advances, , therefore thorough knowledge in mathematics programmers when they're working real-world challenging problems. i still cannot settle on side of arguments correct. tell stance, own experience? to answer question posed have say, "no, mathematics not necessary programming". however, other people have suggested in thread, believe there correlation between understanding mathematics , being able "think algorithmically". is, able think abstractly quantity, processes, relationships , proof. i star...

Does Common Lisp have a something like java's Set Interface/implementing classes? -

i need this , collection of elements contains no duplicates of element. common lisp, sbcl, have thing this? for quick solution, use hash tables, has been mentioned before. however, if prefer more principled approach, can take @ fset , “a functional set-theoretic collections library”. among others, contains classes , operations sets , bags. (edit:) cleanest way define set-oriented operations generic functions. set of generic functions equivalent java interface, after all. can implement methods on standard hash-table class first prototype , allow other implementations well.

c - How to BSWAP the lower 32-bit of 64-bit register? -

i've been looking answer how use bswap lower 32-bit sub-register of 64-bit register. example, 0x0123456789abcdef inside rax register, , want change 0x01234567efcdab89 single instruction (because of performance). so tried following inline function: #define bswap(t) { \ __asm__ __volatile__ ( \ "bswap %k0" \ : "=q" (t) \ : "q" (t)); \ } and result 0x00000000efcdab89 . don't understand why compiler acts this. know efficient solution? ah, yes, understand problem now: the x86-64 processors implicitly zero-extend 32-bit registers 64-bit when doing 32-bit operations (on %eax, %ebx, etc). maintain compatibility legacy code expects 32-bit semantics these registers, understand it. so i'm afraid there no way ror on lower 32 bits of 64-bit register. you'll have use series of several instructions...

javascript - Converting punycode with dash character to Unicode -

i need convert punycode niato-otabd nñiñatoñ . i found a text converter in javascript other day, punycode conversion doesn't work if there's dash in middle. any suggestion fix "dash" issue? i took time create punycode below. it based on c code in rfc 3492. use domain names have remove/add xn-- from/to input/output to/from decode/encode. the utf16-class necessary convert javascripts internal character representation unicode , back. there toascii , tounicode functions make easier convert between puny-coded idn , ascii. //javascript punycode converter derived example in rfc3492. //this implementation created some@domain.name , released public domain var punycode = new function punycode() { // object converts , puny-code used in idn // // punycode.toascii ( domain ) // // returns puny coded representation of "domain". // converts part of domain name // has non ascii characters. i.e. dosent matter if /...