Posts

Showing posts from January, 2014

Ruby how to reset class methods -

using module_eval, code allows me dynamically create , add new methods class based on input parameters. see post example ruby class_eval , yield now question how reset class original methods? there simple method can use reset class it's original state? reason once new methods added class, persists , need rid of them if create new object different set of methods. also must apologize if question doesn't quite make sense, i've been 24 hours , needed rest think clearly. if not clear, can provide example. in advance. edit: added complete solution if keep list of methods added in earlier post, can use remove_method remove these methods like: class mytest @@methods_list = [] def self.show_methods @@methods_list end def self.reset_methods @@methods_list.each |method| remove_method(method) end @@methods_list = [] end def self.add_methods define_method("method1") { puts "this method1" } define_me...

How do I insert a line in a file to the beginning of a file in Perl? -

i used perl helper code this. looks missing character or something. need write new text top of text file. open (logfile, ">> complete.txt") ; # writes new bottom $datetime = localtime ; print logfile "\n" ; print logfile $datetime\n" ; print logfile "$name\n" ; print logfile "has completed work\n" ; close (logfile) ; this answered in perl faq . how change, delete, or insert line in file, or append beginning of file? if you're programming in perl, it's worth taking hour or skim faq. it's full of useful information.

automated tests - Don't stop on Rails TestTask failure -

i'm adding test task in rakefile, similar this: namespace :test do desc "test lib source" rake::testtask.new(:lib) |t| t.libs << "test" t.pattern = 'test/lib/**/*_test.rb' t.verbose = true end end and adding (have done using "enhance" same result: task :test => [ 'test:lib' ] my problem if there error encountered in test:lib, suite stops running. that's not terrible thing, ideally go on run rest of suite let me know there more issues later in suite. anyone know how make report errors/failures in test:lib go on run full suite? thanks! used along these lines (minus "on fly" bit): http://toolmantim.com/articles/creating_rake_testtasks_on_the_fly

.net - Any BNF IDE with test features -

i'm working on new language , while writting grammar i'd able test grammar completeness, conflicts , similar. i'm not concern underlaying parser generator (but 1 .net preferrable) so feature list in short be: text editor build functionality syntax/sematics error reporting conflicts reporting grammar test functionality (i.e. window writting code in intended grammar verify correctness of grammar definition) a codeplex project called irony have simlar i'm asking not support writing grammar bnf required. i recommend antlr parser generator. it's feature complete , supports c# host of other target languages. for ides, there's plugin eclipse called antlr ide , standalone ide called antlrworks , both of work well. note, however, antlr uses ll(*) algorithm instead of lr(k) algorithm. still, it's nice , antlrworks can of necessary left factoring.

SQL Azure Backups -

has come way backups of sql azure databases? the 2 approaches seem ssis or bcp. ssis looks requires local install of ms sql 2008 don't have. bcp looks bit more promising haven't managed find examples of using sql azure of yet. at pdc09 announced sql azure data sync, preview designed let keep local sql server in sync azure sql server. in terms of database backups maintenance etc, of course part of service pay azure ms manage. the sync framework team have blog on number of issues surrounding data syncronisation between azure , local db - http://blogs.msdn.com/sync/default.aspx

php - I need to create a custom query using specific characters from database -

what have rather large database of flight numbers based on divisions. flight number entered following eg: ccc-noc001 number breaks down follows ccc airline code noc division code , 001 actual flight number. now trying create filter select flight number schedule based on division code. clarify way flight numbers entered database in 2 fields first being code entered ccc , flight number noc001 etc. so need if possible strip numbers end of flight number searched noc or 1 of other division codes there 9 separate divisions. , able filter queries if drop down list select noc flight numbers noc show in table. ccc-noc001 ccc-noc002 .... can give me appreciated $dbh = new pdo($dsn, $user, $password); $query = "select * [tablename] [columnname] '%noc%'"; $stmt = $dbh->prepare($query); $stmt->execute(); if ($stmt->rowcount() > 0) { $resultset = $stmt->fetchall(pdo::fetch_assoc); foreach ($resultset $row) { $flight = $row['colum...

XSLT: Use of template tag variable and break condition in for-each loop -

i using xslt have created <xsl:template> tag validation using <xsl:for-each> statement , sets value of <xsl:variable> or <xsl:param> true or false. is there way break statement in for-each if condition true? can use value of template variable or param main calling routine? example: <!-- main xslt --> <xsl:template> <xsl:call-template name ="testtemplate"> <!-- here want use variable or param defined in testtemplate, possible? --> </xsl:call-template> </xsl:template> <xsl:template name ="testtemplate"> <xsl:param name="eee"/> <xsl:for-each select ="//rootnode/leafnode"> <xsl:choose> <xsl:when test ="@type='abc'"> <xsl:value-of select ="true"/> </xsl:when> <xsl:otherwise>false</xsl:otherwise> </xsl:choose> </xsl:for-...

How to use Jquery to address individual posts in Wordpress -

i'm designing wordpress theme, , require bit of javascript hover effect. i'm using wordpress jquery + jquery color animations plugin. the structure: i use div (class="post") container wordpress post, , within "post" div, have span (class="title") use display title of post. what want is: when user hovers on "post" div: ".title" spans's background color fades black red. when user hovers out (onmouserout) "post" div: ".title" spans's background color fades black. the code $j(document).ready(function(){ $j(".posts").hover(function(){ $j (".posts .title").animate({ backgroundcolor: "#ff0062" }, 300); },function(){ $j(".posts .title").animate({ backgroundcolor: "#231f20" }, 300); }); }); the problem the code works, except when user hovers on "post" div, "title" span change color. question...

node.js - couchdb design views, updating fields on doc creation -

is possible have couch update or change fields on fly when create/update doc? example in design view.... validate_doc_update: function(newdoc, olddoc, userctx) { } within function can throw errors like: if(!newdoc.user_email && !newdoc.user_name && !newdoc.user_password){ throw({forbidden : 'all fields required'}); } my question how reassign field? tried this: newdoc.user_password ="changed"; with changed being new value or hashed value. overall goal build user registration/login system node , couchdb , have not found examples. the validate_doc_update function cannot have side effects , cannot change document before storage. has power block update or let through. important, because function not called when user requests update, when changes replicated 1 couchdb instance another. function can called multiple times 1 document. however, couchdb supports document update handlers can modify document or build scratch. these c...

Different user profiles with django-profiles & django-registration -

my models.py: user_types = ( ('d', 'demo' ), ('f', 'free' ), ('p', 'premium'), ) class baseprofile(mode...

How to setup Oracle on Windows not to run as local system user -

i need oracle database (single instance 10gr2) able access files on network. running service under local system account prevents this. using unc paths won't run drive mapping issues. what account should use? how setup such account? any expriences welcome. go services manager (start -> run -> "services.msc") select oracle services need change, right-click, , choose "properties" click "log on" tab you can set account there.

api key - Google maps api keys: dev -> staging -> production workflow -

does have solution managing maps api key, given that: developers work locally, using localhost we have staging server, accessed internally via http://stagehost , externally (for customers) via ip address finally, production server ( http://some.domain.com ) two questions: first, how people manage keys in type of scenario, given there's chance mixup. internal servers not accessible via stagehost.domain.com second, how can address staging server issue? ip address not accessible internally. possible? i have table in database stores google map keys of different urls. pull out correct key based on url. lets same code work dev, test, & production across 100 sites.

apache - Is it possible to obtain the domain where my Flash app is embedded? -

the company work has own flash based video player , question our execs "can tell website our player embedded on?" at first, hypothesized use apache mod_rewrite, extract http_reffer, , append end of requested url. browser gets http://.../viewer.swf , slap on ?ref=otherdomain.com however, don't think our cdn cater our htaccess file. plus, access_log entries show dash rather domain. so i'm casting question our here see if catch ideas or solutions. currently, points 'not possible'. caveat: don't know flash @ all... not sure how need capture this, possible flash player grab url on client (or containing frame maybe?) , post/put/get server? thinking after retrieving viewer.swf prior opening content stream (underlying assumption of how players work). not sure if useful or not.

cron - How to use at command to set python script execute at specified time -

when try use cron execute python script in future time, found there command at, afaik, cron periodically execute, scenario execute once in specified time. , question how add python script @ command, there python package control @ command my dev os ubuntu 10.04 lucid,and product server ubuntu-server 10.04 lucid version. in fact, want through python script add python script tasks @ command, file's change can effect @ command add or remove new jobs just python file | @ time > app.log replace: file - .py file (include shebang) time - time

nginx - client_max_body_size has no effect -

nginx keeps saying client intended send large body . googling , rtm pointed me client_max_body_size . set 200m in nginx.conf in vhost conf , restarted nginx couple of times i'm still getting error message. did overlook something? backend php-fpm ( max_post_size , max_upload_file_size set accordingly). following nginx documentation , can set client_max_body_size 20m ( or value need ) in following context: context: http, server, location

html - How do I disable text selection with CSS or JavaScript? -

possible duplicate: css rule disable text selection highlighting i making html/css/jquery gallery, several pages. i indeed have "next" button, simple link jquery click listener. the problem if user click button several times, text of button selected, , full line of text. in darky design, ugly , nonsensical. so here question: can disable text selection on html? if not, i'll terribly miss flash , high level of configuration on textfields... <div style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;-o-user-select:none;" unselectable="on" onselectstart="return false;" onmousedown="return false;"> blabla </div>

monodevelop - How to development in Visual Studio and then deploy apps to Linux machine (OS - Ubuntu, web server - Nginx) -

how develop app in visual studio , deploy apps linux machine (os - ubuntu, web server - nginx). can explain steps, great help i there 3 ways how can develop apps linux using mono. first using visual studio development , time time deploy app linux see potential issues. use scenario because it's simple , when not messing ms specific stuff or yet unsupported things shouldn't have problems (at least didn't far). disadvantage discover mono specific problems during runtime on linux machine. second approach using visual studio mono tools . tested when in beta , quite handy (you move phase of discovering mono specific problems dev environment, can still have issues on linux machine), since tool doesn't support debugging don't use personally. third approach use monodevelop on linux (since debugging supported in linux). 2.2 release ide becomes , suitable development have tested console , basic asp.net mvc apps can't tell if it's ready bigger projec...

flex - Dynamically adding radiobuttongroup -

i'm trying make quiz in flex , loading data xml file. each question want create radiobuttongroup can associate radio buttons it. how can accomplish actionscript? can see addchild method works displayobjects , presume radiobuttongroup not 1 because i'm receiving errors. how can dynamically add radiobuttongroup actionscript in flex application? thanks. if add radio buttons formitem, automatically grouped together. so, assuming quiz uses flex form layout, generate formitem each question, add button each option formitem, add formitem main form. private function generatequestions(questions:xml):void { var form:form = new form(); this.addchild(form); each (var question:xml in questions.question) { var questionitem:formitem = new formitem(); form.addchild(questionitem); questionitem.label = question.@text; each (var option:xml in question.option) { var optionbutton:radiobutton = new radiobutton(); ...

Setting checkbox input when specific value equals variable in jquery -

i trying use jquery set checkbox checked if input value of checkbox equal other variable have. code looks like: var test_val = "test"; $('#checkbox[value='+test_val+']').attr('checked', true); this not seem working, help try this $('#checkbox[value="'+test_val+'"]').attr('checked', true); you missing quotes around value.

c# - Error building ASP MVC solution with Team City -

im testing out new mvc2 framework, , there have tried out new areas functionality. im following example: walkthrough: creating asp.net mvc areas application using multiple projects everything builds , runs okay locally, when try commit repository , use build automation engine team city build error. error msb4062: "microsoft.web.mvc.build.createareamanifest" task not loaded assembly microsoft.web.mvc.build, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35. not load file or assembly 'microsoft.web.mvc.build, version=2.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. system cannot find file specified. confirm declaration correct, , assembly , dependencies available. i have built other mvc2 applications on team city server , worked out fine, when added whole "areas" thing not right. any ideas? i sounds microsoft.web.mvc.build isn't gac'd on server, happens automatically when mv...

java - ehcache memorystoresize and diskstoresize -

[avatar] 2010-09-23 18:20:41 ist have following configuration ehcache. <cachemanager dynamicconfig="true" monitoring="autodetect" name="cachemanager1" updatecheck="true"> <diskstore path="java.io.tmpdir" /> <defaultcache clearonflush="true" copyonread="false" copyonwrite="false" diskaccessstripes="1" diskexpirythreadintervalseconds="5" diskpersistent="true" diskspoolbuffersizemb="20" eternal="true" logging="true" maxelementsinmemory="100" maxelementsondisk="100" memorystoreevictionpolicy="lru" name="cache1" overflowtodisk="true" statistics="true" timetoidleseconds="0" timetoliveseconds="60" transactionalmode="off"> </defaultcache> <cache clearonflush="true" copyonread="false" copyonwrite...

C# Com Interop with Windows Media Player Visualisation (With Sample Code) -

i attempting create windows media player (wmp) visualization plugin in c#. quite new exposing c# com , may have missed basic. have persisted 3 days (about 20 hours) , not got past single issue describe below. for don't know, wmp visualizations pretty images show in media player while listening music. in nutshell : wmp call methods on c# com interface, not others. i have wmp 11 installed i downloaded latest windows sdk contains c++ plugin wizard compile working visualization sample. sample registers , works without issues in wmp. the dev kit contains c++ header file named effects.h contains 2 interfaces must implemented plugin work wmp. doesn't appear more complicated that. here are midl_interface("d3984c13-c3cb-48e2-8be5-5168340b4f35") iwmpeffects : public iunknown { public: virtual /* [helpstring][local] */ hresult stdmethodcalltype render( /* [in] */ timedlevel *plevels, /* [in] */ hdc hdc, /* [in] */ rect *prc) = 0; ...

fancy css float + clearing -

okay, have 4 divs of unknown height, fixed width. although height unknown, can assumed div1 > div3 > div2. (currently) in row, floated. example: 1111 2222 3333 4444 1111 2222 3333 4444 1111 2222 3333 1111 3333 1111 when resize viewport, i'd rightmost element reposition itself, "highest" possible position, , not clearing left of it. eg: 1111 2222 3333 1111 2222 3333 1111 2222 3333 1111 4444 3333 1111 4444 (this not happens under ordinary circumstances. 4 positioned further down, such clears bottom of 3) and, on next resize, "compact" arrangement, so: 1111 2222 1111 2222 1111 2222 1111 3333 1111 3333 4444 3333 4444 (and again, 4 positioned lower down, such clears 3). and lastly: 1111 1111 1111 1111 1111 2222 2222 2222 3333 3333 3333 4444 4444 i've tried creative arrangements, wrapping pairs of divs in container div , applying different styles that, positioning elements absolutely, setting min / max widths on container divs, ...

sql - Indexing a column used to ORDER BY with a constraint in PostgreSQL -

i've got modest table of 10k rows sorted column called 'name'. so, added index on column. selects on fast: explain analyze select * crm_venue order name asc limit 10; ...query plan... limit (cost=0.00..1.22 rows=10 width=154) (actual time=0.029..0.065 rows=10 loops=1) -> index scan using crm_venue_name on crm_venue (cost=0.00..1317.73 rows=10768 width=154) (actual time=0.026..0.050 rows=10 loops=1) total runtime: 0.130 ms if increase limit 60 (which use in application) total runtime doesn't increase further. since i'm using "logical delete pattern" on table consider entries delete_date null . common select make: select * crm_venue delete_date null order name asc limit 10; to make query snappy put index on name column constraint this: create index name_delete_date_null on crm_venue (name) delete_date null; now it's fast ordering logical delete constraint: explain analyze select * crm_venue delete_date null order na...

c# - Why are some HtmlHelper methods implemented as extension methods -

i'm creating custom helper classes, similar asp.net mvc's standard htmlhelper . when looked @ implementation of htmlhelper , noticed most/all of html generating methods (such actionlink() , beginform() , textbox() , , on) not implemented directly inside htmlhelper class, extension methods in separate classes (e.g. in class linkextensions ). apart nicer source-code organisation, there advantage when implementing such methods extension methods instead of normal methods? when creating own helper classes, should follow pattern? update : when wrote wanted create own helper class, did mean extend existing htmlhelper class. instead created custom base class views (derived viewpage) , want add there additional helper class similar html , url helper classes of viewpage. the reason is: wanted provide ability opt-out of built-in html helpers in case preferred write own or use other 3rd party helpers instead. if weren't extension methods in special namespace, wouldn...

c# - Why does FileStream feed FtpWebRequest but not MemoryStream? -

i'm using msdn example here: http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx i changed filestream memorystream , doesn't read bytes when change filestream works fine. any clue? thanks compressmemorystream(); stream requeststream = _request.endgetrequeststream(ar); const int bufferlength = 2048; byte[] buffer = new byte[bufferlength]; int count = 0; int readbytes = 0; { //memorystream _compressedoutstream //is created/filled 'compressmemorystream()' readbytes = _compressedoutstream.read(buffer, 0, bufferlength); requeststream.write(buffer, 0, readbytes); count += readbytes; } while (readbytes != 0); requeststream.close(); state.request.begingetresponse( new asynccallback(endgetresponsecallback), state ); what's value of readbytes on fi...

objective c - Core Data and NSTableView show content as title -

i'm working on menubar note-taking app simplenote syncing support, , it's been using separate title , content each note. shows title in nstableview , content in nstextview, show content title in table view in simplenote. problem show title until reaches newline, don't know how it. simplest way break apart string using -componentsseparatedbystring: , pass in \n return array components broken apart. grab zeroth element array.

html - Looking for a popular templating language that needs XSS protection -

i'd experiment popular html templating language see if can solve xss problems in it. popular, open-source, templating language try tackle. by templating language, mean language used generate output language combining static content in output language dynamic data source. e.g. php commonly used templating language html/css/js, , xslt templating language xml. the ideal template language be widely used open source not have solved xss the simpler syntax better the idea to parse each template end tree of chunks of raw html, expressions produce dynamic values need encoded, , conditional (switch/if) , loop constructs. walk tree inferring context. possible contexts might include (html_pcdata, in_js_dbl_quoted_str, etc.) if see chunk of raw html, <a href=" in html pcdata context, move context expecting part of url. when reach branch or loop, follow each branch independently, , join contexts afterwards. if language has templates, try determine static call ...

How to Change from Sql Server Windows mode to Mixed Mode *Using SQL* (SQL Server 2008) -

how change sql server windows mode mixed mode using sql through queryexpress or queryanalyser? mixed mode authentication not property within database, property read registry when sql server windows service starts. that means there no ddl modify authentication, can set registry entry controls it. if read blog post, http://eduzine.edujini-labs.com/archives/24-howto-configure-microsoft-sql-server-for-mixed-mode-authentication.html it shows registry key alter, , reminds restart sql server.

java - Is it me or is there a typo in this courseware entry? -

i took online mit courseware discussion (pdf warning): public class human { private string name; ... public human(string name) { this.name = name; } public string getname() { return string; } } public class student extends human { private string username; public student(string name, string username) { super(name); this.username = username; } public string getname() { return username; } public string getrealname() { return super.getname(); } } ... public class world { ... void somemethod() { student alice = new student("alice", "abc"); system.out.println(alice.getrealname()); // gets printed? why getrealname return anything. know returns alice because constructor called super(name) question about: return string; why doesn't getname in human class have be return name; it should be. it's typo. code have pasted not compile.

html - How can I programmatically disable IE compatibility mode? -

i have been stuck on 1 while - couldn't figure out why website renders differently in 2 identical versions of internet explorer. half hour ago came across compatibility mode button in ie made me angry. disabling compatibility mode has fixed problem. is there way disable programmatically, i.e. web page? edit: just came across blog https://blogs.msdn.com/b/askie/archive/2009/03/23/understanding-compatibility-modes-in-internet-explorer-8.aspx i'll post example code after reading article if want "old" rendering, , no button show on toolbar users can switch modes can use this: <head> <!-- mimic internet explorer 7 --> <meta http-equiv="x-ua-compatible" content="ie=emulateie7" > <title>my web page</title> </head> other options (old , new) include: ie=5 , ie=7 , ie=8 , or ie=edge (edge equals highest mode available)

Copy and paste problems with Word 2010 and Windows 7 -

i have program able exchange data ms office applications, via clipboard. this works fine in office 2007 , windows vista/xp, fails office 2010/windows 7 idataobject *d = null; hresult hr = ::olegetclipboard(&d); if (hr == s_ok) { formatetc formatetc; formatetc.cfformat = ::registerclipboardformat("native"); formatetc.ptd = null; formatetc.dwaspect = dvaspect_content; formatetc.lindex = -1; stgmedium stgmedium; hr = d->querygetdata(&formatetc); following call, returned error - 0x8004006a invalid clipboard format i have tried searching web, haven't found relevant information. advice/suggestions gratefully received. thanks. i have similar issue in office 2007 , windows-server-2008, guess problem not office rather windows 7/2008. running program service? or executable? i'm still waiting answer question on here: clipboard copy-paste doesn't work in service on wi...

Two forms of struct declaration in Go -

i've got 2 forms of struct declaration in function scope. far see bellow-listed snippet woks fine. question what's difference between 2 declaration ways? semantic question or there tricky under covers? package main import "fmt" func main() { type person1 struct { name string id int } person1 := &person1{name : "john smith", id : 10} fmt.printf("(%s, %d)\n", person1.name, person1.id) var person2 struct { name string id int } person2.name = "kenneth box" person2.id = 20 fmt.printf("(%s, %d)\n", person2.name, person2.id) } one named type - can create multiple variables of type, if need to, using type name. the other type has no name. cannot create more variables of type other using := operator.

c# - Creating a NUnit constraint meaning "{collection} does not contain {item}" -

i'm struggling make assertion absence of particular item in enumeration. specifically, test looks like: // take item queue of scheduled items... itemqueue pendingqueue = schedule.pendingitems; // pendingitems ienumerable<int> int item = pendingqueue.firstitem; // ...process item... processor.dosomethingwith(item); // ...and schedule must not contain item anymore: assert.that(schedule.pendingitems, does.not.contain(item)); of course, does.not.contain not valid nunit constraint. how can express in valid fluent syntax? assert.that(schedule.pendingitems, has.no.member(item)) only nunit 2.4 / 2.5

.net - Storing subcollections (filtered versions of the main collection) inside the collection as cache? -

is practice store sub-collections of item x inside parent collection of item x caching 'filter-queries' performed on parent collection? (they won't used (as in color , type).) or ok loop on collection , return correct entities in temporary collection? class itemcollection : inherits collection(of item) private _types new list(of itemcollection) //cache function filterbytype(type) itemcollection if not _types.keyexists(type) _types.add(type, new itemcollection()) each in me if i.type = type _types(type).add(i) next end if return _types(type) end function //same filterbycolor(color) end class class item public color = "blue" public [type] = "one" end class i recommend keeping simple start , add caching if testing shows regenerating filtered lists performance problem. besides that, filtering code can simplified using filtering methods buil...

.net - Strange section in web.config -

i noticed in web.config: <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="system.web.extensions" publickeytoken="31bf3856ad364e35"/> <bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="3.5.0.0"/> </dependentassembly> <dependentassembly> <assemblyidentity name="system.web.extensions.design" publickeytoken="31bf3856ad364e35"/> <bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="3.5.0.0"/> </dependentassembly> </assemblybinding> </runtime> what this? thanks this binding redirect , escape hatch .net's usual desire bind referenced assembly exact version built against. normally, if program built against version x of particular dll, .net try load v...

php - picture is not refreshing in my browser -

i trying upload new picture webpage, in browser showing old picture. when check in folder new image being saved, not showing in page. have tried refreshing, not help. still same after shutting down browser. have tested in different browser , still old image. need can now. i'm uploading picture using php coding ajax. i'm not sure understand trying accomplish, there caching of sorts going on. if you've uploaded image, same file name, , refuses refresh, or don't want depend on refresh of users cache, simple solution append random number end of image src after question-mark. i.e. <img src="/images/face.png?1234324"> ...which make browser believe image new image (which is), , thwart it's attempt use browsers cache.

android - Getting the Listview default clicked color, depending on the Device -

Image
in android application, use listview , linear layout on wich user can click. of course, had set background of linearlayout xml file stated pressed, selected defined: myview.setbackgrounddrawable( getdrawable(android.r.drawable.list_selector_background)); so no problem set drawable transparent when normal use , orange when clicked. my problem on galaxy s , other customized phone (sense ui) color of listview clicked blue or green! so need pick color set background of linearlayout. don't want mix orange , blue, or orange , green user! where can color??? woule helpfull! just found answer: android:background="@android:drawable/list_selector_background"

Change Django Form Data before it's processed -

i have form model wich has 2 fields: field_a , field_b. want to: when form rendered: field_a displayed when call form.save() field_b saved in model value field_a what i've tried: field_a = forms.charfield(required=true) field_b = forms.charfield(required=false) def save(self, *args, **kwargs): """ overriding save, call parent form save , return new_user object. """ self.data["field_b"] = self.data["field_a"] self.cleaned_data["username"] = self.cleaned_data["email"] super(myparentclass*, self).save(*args, **kwargs) *both fields inherited parentclass, required here solution worked me. # models.py class mymodel(models.model): field_a = models.charfield(max_length = 255) field_b = models.charfield(max_length = 255) def __unicode__(self): return "%s: %s, %s" % (self.pk, self.field_a, self.field_b) # forms.py class mymodelfo...

c# - NPOI set cell style -

c# or vb.net suggestion welcome. i have following code create excel file npoi. it's working fine. need apply cell style rows in loops. dim hssfworkbook new hssfworkbook() dim sheetone hssfsheet = hssfworkbook.createsheet("sheet1") hssfworkbook.createsheet("sheet2") hssfworkbook.createsheet("sheet3") hssfworkbook.createsheet("sheet4") dim cellstyle hssfcellstyle = hssfworkbook.createcellstyle cellstyle.alignment = hssfcellstyle.align_center = 0 9 step 1 'i want add cell style these cells sheetone.createrow(i).createcell(1).setcellvalue(i) sheetone.createrow(i).createcell(2).setcellvalue(i) next how can apply cell style rows in loop above? you need declare row , cell outside of loop sth this: dim datacell hssfcell dim datarow hssfrow then inside loop, assign value , style cell separately this: datarow = sheetone.createrow(i) datacell = dataro...

visual studio - Strange problem with VSS: VSS doesn't work after 5 p.m -

i have strange problem visual source safe. use vss add-on vs 2008 in corporate intranet 5 other colleagues. vs stops working after 5 p.m. of days complaining can not connect source safe. i'm running vs 2008 , vss 2005 on vista , no other 1 in corporate have such problem. what think cause? there log vss? you have logon restrictions on domain account. vss file based source control system , works via access net work share. account logon restrictions prevent gaining access share @ times. to test theory try this: get share vss lives in. should in form \\server\share . open command prompt type net use show connections if connected share type net use z: /delete (with z: being assigned drive letter share) type net use * \\server\share if theory correct, before 5 command completed sucessfully , after 5 access denied

website - A good list of Reserved words for username -

i building site , need restrict users using of more common words (e.g. support, help, search, admin, etc). does have list of words worth reserving ? extra points if got list of common trade-marks (e.g. cocacola, canon, etc). thanks try http://www.moehre.org/bruteforce.html#username though quite few of these not relevant (ex. common names of real people), it's still quite comprehensive , should cover cases. update: link appears dead. can try this link (which contains gzip-compressed text file 2013).

foreign keys - CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead: [Lead__c] -

i getting error message when try instert custom object exisiting lead object. list<lead> leads =[select id lead email =:lead.email ]; if(leads.size()>0) { lead existing_lead = new lead(id = leads[0].id); social_account.lead__c = existing_lead.id; //social_account custom object //has child relationship lead. //ie lead parent of social_accounts. update existing_lead; insert social_account; //if there existing lead same same email, //i'd insert new social_account exsiting lead. } i getting error: 554 system.dmlexception: update failed. first exception on row 0 id 00q3000000ww3isead; first error: cannot_update_converted_lead, cannot reference converted lead: [] class.processcontact.handleinboundemail: line 81, column 9 external entry point even if comment out 'update existing_lead', similar error message. 554 sys...