Posts

Showing posts from February, 2011

c# - AutoCompleteExtender help needed -

i sure simple solution, @ end.. i have following aspx <asp:textbox id="textvendornamelookup" autopostback="true" runat="server" width="200px" onfocus="this.select()" text=''></asp:textbox> <ajaxtoolkit:autocompleteextender id="vendornameautocompleteextender" targetcontrolid="textvendornamelookup" firstrowselected="false" runat="server" servicemethod="getvendor" completioninterval="1" enablecaching="true" minimumprefixlength="1" usecontextkey="true" servicepath="vendorlookupwebservice.asmx"> </ajaxtoolkit:autocompleteextender> and following asmx using system; using system.collections.generic; using system.web; using system.web.services; using system.data; using system.data.sql

ruby - Rails Installation Error -

i've been getting error after installing rvm , rails rvm. can me out? /library/ruby/site/1.8/rubygems.rb:779:in report_activate_error': not find rubygem rails (>= 0) (gem::loaderror) /library/ruby/site/1.8/rubygems.rb:214:in activate' /library/ruby/site/1.8/rubygems.rb:1082:in `gem' /usr/bin/rails:18 thanks! couple of things at: make sure rails indeed installed. i'm bringing point because mentioned installed rails rvm, inaccurate. install rubies rvm install rails bundler (you can see bundler rvm gems rather rubies). ensure have line says gem 'rails' in gemfile , run bundle install . as pointed out other answers, make sure using right ruby , gemset (where installed rails gem). run rvm use <your_ruby>@<your_gemset> .

jQuery .ajax call returning undefined or null in the success function call -

i have following jquery ajax call: executeallajaxcalls:function() { if (walmart.jquery.ajaxcalls.length) { var datapassed = "ajaxcalls="+walmart.jquery.ajaxcalls; walmart.jquery.ajax({ url: walmart.jquery.ajaxframeworkurl , data: datapassed , datatype: walmart.jquery.jsonresponsetype , type: 'post' , success: walmart.jquery.ajaxobject_consolidated.processconsolidateddata }); } } the data coming in function call upon success undefined. here function called upon success of ajax call: processconsolidateddata:function(result) { alert("1234"+result); var responsedata = eval('(' + result.responsetext + ')'); if (typeof responsedata !== '') { (resp in responsedata) { almart.jquery(document).ready(responsedata[resp].callbackfunction); }

php - Way to verify if variable is a valid GD image resource? -

i have class accepts gd image resource 1 of arguments. far know, there no way type hint since resource , not object. there way validate whether supplied argument valid gd image resource (aside further functionality using resource failing)? ps: please not mention imagemagick in answer... the get_resource_type function should out. short of writing code , seeing return, i'm not sure it's going gd resource, you're on own there. should starting point, though!

javascript - Where is the onclick function in this HTML snippet defined? -

read code on htmlcodetutorial.com : <form> <table border cellpadding=3> <tr> <td><nobr>radius: <input name="circle_radius" size=4></nobr></td> <td><input type=button onclick="circle_calc(this.form);" value="calculate"></td> <td align=right bgcolor="#aaccff"> <nobr>circumference: <input name="circle_circumference" size=9></nobr><br> <nobr>area: <input name="circle_area" size=9></nobr></td> </tr> </table> </form> i can’t understand onclick="circle_calc(this.form);" circle_calc(this.form) isn't defined anywhere. how function work? built-in function in html? it's not built-in. if @ source code, it's defined as: <script type="text/javascript"> <!-- function circle_calc(geoform) { var circleradius = geoform.circle_radius.value; if (ci

internet explorer - Jquery Validator not working in IE 7 or 8 -

i have large multi-directional form validates fields jquery validator, including several custom function. works fine in firefox, chrome, safari, not ie 7 or 8. sure there trivial , going bald trying figure out! appreciated. staging site can viewed at: http://173.45.237.55/qrf/ jquery validator doesn't work jquery 1.6 in ie @ time. you're including jquery-latest.js, 1.6. include 1.5.2 , should work fine.

header - HTML5 Horizontal Image Placement -

i new html5 maybe seem simple question although haven't found information online. appears though cases people want use table (but understand not idea anymore) in header area need place several images side side. should justified there space between images , each image in right place. have appropriately sized header block in place life of me can't figure out how arrange images inside correctly. the images should layed out this: (http://imageshack.us/photo/my-images/339/tmpyg.jpg/) layout i have tried this: <header> <img src="icuwb.jpg" alt="icuwb" height="100" width="250"/> <img src="logo.jpg" alt="icuwb" height="250" width="250"/> </header> but not sure needs go in css region guess header { background: #3d3837; margin: 0 auto; } thanks help. understand want achieve "snapshot" (color borders on images see "pieces"

c++ - another mysqld process using the same InnoDB data or log files -

i have mysql server running on linux system. i'm running 1 c++ prog building data base current date , time stamp. i'm trying run process in c++ accessing different db i'm having error. error below: innodb: check not have mysqld process innodb: using same innodb data or log files innodb: unable lock /var/lib/mysql/ibdata1, error: 11 please can explain whats going wrong in here thanks this page: http://dev.mysql.com/doc/refman/5.0/en/external-locking.html talks "external locking" can turned on or off myisam databases support multiple servers on 1 set of data. not seem apply innodb however. , page: http://book.opensourceproject.org.cn/lamp/mysql/mysql5cert/opensource/0672328127/ch42lev1sec1.html says it's not possible innodb because can done on read-only filesystems, , innodb not work on those. so seems answer cannot it, 2 reasons: first because still populating db while wanting read it, , second because using innodb rather myisam.

iphone - using completion with animateWithDuration causes exc_bad_access -

i trying animate 2 uibuttons in uitableviewcell called addtoplaylist , removefromplaylist (they animate off right after being swiped on) , using block follows [uiview animatewithduration:0.25 animations:^{ self.addtoplaylist.center = cgpointmake(contentssize.width + (buttonsize.width / 2), (buttonsize.height / 2)); self.removefromplaylist.center = cgpointmake(contentssize.width + (buttonsize.width / 2), (buttonsize.height / 2)); myimage.alpha = 1.0; } completion:^ (bool finished) { if (finished) { // revert image view original. nslog(@"is completed"); self.addtoplaylist.hidden = yes; self.removefromplaylist.hidden = yes; self.hasswipeopen = no; } }]; on completion want hide buttons attempt lessen redraw on scroll etc. this code sits within '-(void) swipeoff' called in uitableviewcontrollers method scrollviewwillbegindragging so: - (void)scrollviewwillbegindra

disable href on content page from Master page in vb.net -

just title says. have code disables controls runat=server. follows dim c control each c in pc if c.hascontrols disableallcontrols(c.controls) if c.gettype.tostring.tolower.indexof("webcontrols.dropdownlist") > -1 directcast(c, dropdownlist).enabled = false elseif c.gettype.tostring.tolower.indexof("webcontrols.textbox") > -1 directcast(c, textbox).enabled = false elseif c.gettype.tostring.tolower.indexof("webcontrols.radiobuttonlist") > -1 directcast(c, radiobuttonlist).enabled = false elseif c.gettype.tostring.tolower.indexof("webcontrols.radiobutton") > -1 directcast(c, radiobutton).enabled = false elseif c.gettype.tostring.tolower.indexof("webcontrols.button") > -1 directcast(c, button).enabled = false end if next but have couple of href's in there want disable also. know dont runat server, how can catch these? you can add runat="server"

javascript - Manage firefox tabs in emacs with org-mode -

i find way manage firefox tab in emacs. sounds little crazy. use tree style tabs(firefox addon), moz repl, emacs, org-mode it. for 10-15 tabs, plan works fine. 20+ tabs, firefox hangs randomly. maybe javascript stack overflow or else? don't know what's wrong code. post import code here. somesone me find bugs? it's basic firefox chrome code below, can run in firefox without emacs , mozpepl. i use tree style tabs api tabs , set each tab cetain level. output used in emacs org-mode. tree style tabs api: http://piro.sakura.ne.jp/xul/_treestyletab.html.en#api the code can run in many ways. recommend "workspace addon". copy code, choose chrome context run it. https://addons.mozilla.org/en-us/firefox/addon/workspace/ // 2 helper function title , url of tab function gettitle(tab) { var brower = gbrowser.getbrowserfortab(tab) var url = brower.currenturi.spec var title = brower.contenttitle return title } function geturl(tab) { var brow

c# - Generating DataContracts with exact namespace as in XSD -

we have integrate our project end oracle platform. , integration via various webservices. have wsdls , xsds these integrations. , need generate datacontracts these wsdls & xsds. problem is, of these integration shares common data types. , want reuse them. e.g, integration1: oracle/common/commondatatypes.xsd oracle/integration1/somexsd.xsd oracle/ebo/basetypes.xsd integration2: oracle/common/commondatatypes.xsd oracle/integration2/somexsd.xsd oracle/ebo/basetypes.xsd integration3: oracle/commondatatypes.xsd oracle/integration2/somexsd.xsd oracle/ebo/basetypes.xsd in case, want reuse oracle.common.commondatatypes between integration1 & 2. far have tried wscf.blue & wscf. these tools generating code in single folder(and single namespace) , not following namespaces. want generate classes under namespaces oracle, oracle.commondata, oracle.integration1, oracle.ebo etc. way generat

mysql - Optimal Query for a problem -

i have news table following: create table `news` ( `title` varchar(255) not null, `hash` char(40) not null, primary key (`hash`) ) engine=innodb default charset=utf8; and, votes table following: create table `votes` ( `hash` char(40) not null, `user_id` varchar(255) not null, `vote_type` enum('up','down') default null, primary key (`hash`) ) engine=innodb default charset=utf8; now want when user logged in- this_is_a_title hash_12312312 null this_is_a_title hash_12312313 up this_is_a_title hash_12312314 null this_is_a_title hash_12312315 down can suggest optimal single query this? i think question not clear. sorry that. null field meant new doesn't has vote casted user or anybody. my version - select news.*, votes.vote_type news left outer join votes on votes.`hash` = news.`hash` , votes.`user_id` = # select * news join votes on news.hash = votes.hash votes.user_id = #; this select votes on

extjs: fieldset-change collapse icon -

how change expand/collapse icon of fieldset component? default it's inverted triangle arrow, want set "+"/"-"? use "itemcls"? thanks! modify css of collapse button (in here background-position ) here css : #plus-min.x-panel-collapsed .x-tool-toggle{ background-position: 0 -240px !important; /*the plus sign*/ } #plus-min .x-tool-toggle{ background-position: 0 -255px !important; /*the minus sign*/ } and fieldset : new ext.form.formpanel({ renderto : document.body, title : "asdasd", items :[{ xtype:'fieldset', title: 'plus minus', collapsible: true, id : "plus-min", html : "asd", height : 100 }] });

html - How to add a bar like "Congrats ... – learn more" of this site? -

i think floating bar saying "congrats, you've gained privilege – talk in chat learn more" looks cool, , neat reporting status. how add 1 own site please? without looking @ stackoverflow source, way imagine done follows: add div called notify (or whatever else want call it) top of page; this: #notify{ width: 100%; height: 30px; position: absolute; top: 0; display: none; z-index: 500; } then use jquery slideup , slidedown methods (or else want to) animate when new notification found via ajax. (you use mootools or javascript library if wanted to) ( http://api.jquery.com/slideup , http://api.jquery.com/slidedown , http://api.jquery.com/animate , , http://api.jquery.com/jquery.ajax/ )

c# - DetailsView Fields not Changing to Textboxes in Edit Mode -

i created detailsview programmatically , added button fire commands add, edit , delete. here's event handler commands: switch (e.commandname) { case "add": dvspotlightlistdetails.changemode(detailsviewmode.insert); break; case "edit": dvspotlightlistdetails.changemode(detailsviewmode.edit); break; default: break; } the add/insert commands changes fields on detailsview textboxes. when selecting edit command nothing happens. i'm not familiar process of detailsview when made through code-behind i'm not sure missing. see if helps: http://forums.asp.net/t/1249276.aspx/1 http://www.shotdev.com/aspnet/aspnet-vbnet-detailsview/aspnet-vbnet-detailsview-edit-update/

java - JS Date output into Hidden Text Field -

i using datejs (see www.datejs.com) work out date , time tomorrow (24 hours future) , output date hidden text box inserted db. this code: <script type="text/javascript"> // submitted var d1 = date.today().add(1).days(); document.write(d1.tostring('d mmmm yyyy')); //need change mysql format </script> <input name="referral_to_be_accepted_by" type="text" value="" id="referral_to_be_accepted_by"/> at moment date (need add time well) shown in doc, need put in text box? thank you. try document.getelementbyid("referral_to_be_accepted_by").value = d1.tostring('d mmmm yyyy'); edit: <input name="referral_to_be_accepted_by" type="text" value="" id="referral_to_be_accepted_by"/> <script type="text/javascript"> // submitted var d1 = date.today().add(1).days(); document.getelementbyid("referral_to_be_accepted_by&quo

c# - How to use reflection to get extension method on generic type -

from various sources on teh interwebs i've gleaned following function: public static nullable<t> tryparsenullable<t>(this nullable<t> t, string input) t : struct { if (string.isnullorempty(input)) return default(t); nullable<t> result = new nullable<t>(); try { iconvertible convertiblestring = (iconvertible)input; result = new nullable<t>((t)convertiblestring.totype(typeof(t), cultureinfo.currentculture)); } catch (invalidcastexception) { } catch (formatexception) { } return result; } i've made extension method, , works fine if call directly: int? input = new int?().tryparsenullable("12345"); my problem occurs when try call using reflection within context of generic function. full of answers describing how methodinfo of generic methods , static methods, can't seem put these in right way. i've correctly determined passed generic type generic type ( nullabl

special unicode symbol in javascript (AJAX) -

i'm having trouble special symbols in javascript, hope cal me : ) first, allow user send text through form, , insert text in euc-jp data base. the second part consists in display page text ajax, , show in simple alert when data arrives javascript code. the problem when use symbol ⑴ (is u+2474, unicode). in case, when text inserted in data base, inserted "& # 9 3 3 2 ;" (i wrote blank avoid conversion in ⑴) in second part, use js file , php file called in ajax part. in php file, return text gotten data base using utf-8 encoding, that. php file: echo mb_convert_encoding(row['text'], "utf-8","eucjp-win"); but when display text in javascript alert, displays "& # 9 3 3 2 ;" i tried lot of stuff, , couldn't make display & # 9 3 3 2;, can me please? thanks! : ) here difference: alert('\u2474'); => ⑴ alert('\\u2474'); => \u2474 you need escape leading backslash adding backsl

java - How to build an executable jar file with Ant -

i'm developing swing based application in java want executable jar file project. all external library files used in project should packaged in jar file. how can build runnable jar file using ant? but needs external library files used in project should along jar. of course, external jars should not bundled in executable jar. you need 3 things: create manifest executable jar specifies main-class. add classpath manifest spells out location of each , every dependent jar relative executable jar. create zip file contains executable jar , dependent jars, paths relative executable jar specified in manifest. you give clients zip. unpack , execute executable jar.

is there possibility to access the no of times we open the each application in device programmatically in android? -

as working on access applications in device in 1 application , clicking on each application showing date , time of install , package name version code.i want know if there possibility access how many times open each application install date till programmatically.please provide code available. thanks in advance, teja just have variable in application increment variable , store in database.. in iphone use nsuserdefaults

python - Django not found in Eclipse IDE on Windows -

Image
i'm trying create django project in eclipse says have no django installed, although i've run script imports django , print version , works fine, in eclipse not. see prints django version correctly , every module have. see eclipse says: try remove re-add python interpreter.

c# - Sorting List of Strings -

i'm having list<string> l_lsttemp , contains "a1" "a1_1" "a1_2" "1a" "b2_1" "b1_2" "b1_1_2" "a10" "b11" "a" "z" i need sort items based on character , numeric value. so sorted list like "1a" "a" "a1" "a1_1" "a1_2" "a10" "b1_1_2" "b1_2" "b2_1" "b11" "z" here code: l_lsttemp.sort(delegate(string one, string two) { match l_mone = regex.match(one, @"(\d*)(\d*)"); match l_mtwo = regex.match(two, @"(\d*)(\d*)"); int result; if (l_mone.success || l_mtwo.success) { string l_strx, l_stry; l_strx = l_mone.groups[1].value; l_stry = l_mtwo.groups[1].value; result = l_strx.compareto(l_stry); if (result != 0) return result; l_strx = l_mone.groups[2].value;

when added a zend form inside a table td decoators are not working -

Image
i have zend form , decorated , in phtml when did <?php echo $this->form ; ?> working but inside table td doing same thing decorators not working . < td><?php echo $this->form ; ?></td> not working this form <?php class admin_form_inventoryform extends zend_form { private $from; private $to; private $noofrooms; private $roomtype; private $cancel; private $save; function init() { $this->setname("frmaddinventory"); $attribs = array( "id" => "frmaddinventory", "name" => "frmaddinventory" ); $this->setattribs($attribs); $this->from = new zend_form_element_text("invdatefrom"); $this->from->setlabel("from"); $this->from->setdecorators( array( array('viewhelper',

Sinatra render a ruby file -

how render ruby file (which in case returns pdf document) example: "/pdf" @locals = {some_locals_hash} headers({'content-type' => 'application/pdf', 'content-description' => 'file transfer', 'content-transfer-encoding' => 'binary', 'content-disposition' => "attachment;filename=\"test.pdf\"", 'expires' => '0', 'pragma' => 'public'}) ruby :test, :layout => false, :locals => @locals end i know tilt not have ruby template. put content in *.haml file like: -# pdf file description :ruby pdf = prawn::document.new( ... docs settings) ... docs content end = pdf.render() and render haml :template ...etc... truth is, need syntax highlighting, editor not highlight embedded ruby code in haml files :(. if it's complicated don't bother... i managed tilt template module tilt class

logging - no flashlog.txt -

hey guys! i'm having troubles flashplayer logging. yes, have installed debugging version, mm.cfg file (content errorreportingenable=1 traceoutputfileenable=1) exists in profile folder, there no flashlog.txt. i'm using windows 7 (x64) , ie8 if that's important. a solution: install firebug add-on in firefox create log function in as3. the code: import flash.external.externalinterface; function log(msg:string):void { externalinterface.call("console.log", msg); } the above function calls javascript console.log function. when execute following command movieclip: log("i'm testing movieclip"); you see message in firebug console.

c++ - how to get memory used by any process programatically in vC++ in windows mobile -

i tried memory used individual process using bool winapi getprocessmemoryinfo( __in handle process, __out pprocess_memory_counters ppsmemcounters, __in dword cb ); but showing error saying undeclared identifier in process_memory_counters . have included header-file "psapi.h" . anyone please suggest api. thanks, m getprocessmemoryinfo not windows mobile or windows ce sdk function, it's desktop. you'll need use toolhelp api functions ( http://msdn.microsoft.com/en-us/library/aa915058.aspx ) process memory snapshot , undocumented cegetprocvminfo pkfuncs.h. more read here: http://www.codeproject.com/tips/123149/how-to-get-individual-process-memory-usage-statist.aspx http://social.msdn.microsoft.com/forums/en/vssmartdevicesnative/thread/e16a2a74-2181-4c73-bfce-37bd601717ff

Changing MongoDB data store directory -

until have not been specifying mongodb data directory , have had 1 30 gb primary partition. i ran out of space , added new hard disk. how can transfer data (that apparently in /var/lib/mongodb/ ) , configure mongodb runs off of new disk without affecting existing installation? the short answer --dbpath parameter in mongodb allow control directory mongodb reads , writes it's data from. mongod --dbpath /usr/local/mongodb-data would start mongodb , put files in /usr/local/mongodb-data . depending on distribution , mongodb installation, can configure mongod.conf file automatically: # store data in /usr/local/var/mongodb instead of default /data/db dbpath = /usr/local/var/mongodb the official 10gen linux packages ( ubuntu/debian or centos/fedora ) ship basic configuration file placed in /etc/mongodb.conf , , mongodb service reads when starts up. make change here.

c# - i have a problem with dropdownLists -

i have dictionary looks dictionary<string,string[]> i have 2 dropdownlist. want second dropdownlist present data depending on item first dropdropdownlist chosen. so added event second dropdownlist..here algorithm: protected void topicdropdownmenu_selectedindexchanged1(object sender, eventargs e) { string[] chosenitem; chosenitem = null; subtopicdropdownlist.clearselection(); chosenitem = topic[topicdropdownmenu.selecteditem.value]; foreach (string item in chosenitem) { subtopicdropdownlist.items.add(item); } } what happens, array of strings added second dropdownlist each time select item first dropdownlist.. but want second dropdownlist replace values depending on chosen in first dropdownlist, instead of adding values whatever placed in second drop down list // add line - it's different clearselection() subtopicdropdownlist.items.clear(); foreach (string item in chosenitem) { subtopicdropdownlist.items.add(ite

php - Adding attributes to customer entity -

my current goal add new customer attribute (with int type) should appear select predefined options (loaded model entries editable in backend, done). i'm struggling proper use of $installer->addattribute() method, specifying correct source option. other problem new attribute isn't saved eav_entity_attribute table i'm on magento ce 1.5.1.0 this code basic int attribute text renderer: $installer = $this; $installer->startsetup(); $setup = new mage_eav_model_entity_setup('core_setup'); $entitytypeid = $setup->getentitytypeid('customer'); $attributesetid = $setup->getdefaultattributesetid($entitytypeid); $attributegroupid = $setup->getdefaultattributegroupid($entitytypeid, $attributesetid); $setup->addattribute('customer', 'your_attribute_code_here', array( 'input' => 'text', 'type' => 'int', 'label' => 'some te

Wcf send object from Compact Framewok to Desktop WCF Service properties does not deserialize -

i have wcf service running on desktop pc. service has 2 methods [system.codedom.compiler.generatedcodeattribute("system.servicemodel", "3.0.0.0")] public interface imainmoduleservice { orderdto getorderbyid(int orderid); void processorder(orderdto order); } i used necfsvcutil , generated proxy , poco's. when use getorderbyid(int id) compact framework works, when use processorder(orderdto order) send order service although orderdto has properties values, when arrives on desktop service method, not deserialize properties of orderdto. orderdto.id==2050 before sending , arrives orderdto.id==0. noticed every int property value equals zero. thank you! i found problem, netcfsvcutil generates property name propertyname+specified every property in generated dto. ex. [system.xml.serialization.xmlelementattribute(isnullable=true, order=20)] public system.nullable<int> salespersonid { { return this.salespersonidf

c++ - How get smallest n, that 2 ^ n >= x for given integer x in O(1)? -

how given unsigned integer x find smallest n, 2 ^ n ≥ x in o(1)? in other words want find index of higher set bit in binary format of x (plus 1 if x not power of 2) in o(1) (not depended on size of integer , size of byte). if have no memory constraints, can use lookup table (one entry each possible value of x ) achieve o(1) time. if want practical solution, processors have kind of "find highest bit set" opcode. on x86, instance, it's bsr . compilers have mechanism write raw assembler.

database - Query that only includes objects that don't have a particular element empty - App Engine -

can make query includes objects don't have particular element empty in google app engine database? thanks! non_empty_profile= profile.all().filter('user !=',none)

ruby - Do jeweler and gemspec in Gemfile work together? -

i've got problem when using gemspec in gemfile , using jeweler: sudo gem install pkg/revertible_paper_trail-0.3.0.gem fetching: revertible_paper_trail-0.3.0.gem (100%) error: error installing pkg/revertible_paper_trail-0.3.0.gem: revertible_paper_trail requires revertible_paper_trail (>= 0) rake gemspec:debug shows got added: if gem::version.new(gem::version) >= gem::version.new('1.2.0') s.add_runtime_dependency(%q<revertible_paper_trail>, [">= 0"]) when dropping gemspec gemfile, runtime dependency vanishes , installing gem works. now, what's best practice when using jeweler , bundler? fyi: code gem @ https://github.com/cyteam/revertible_paper_trail gem install has nothing bundler or gemfile, question confusing. (btw, code link goes 404 page.)

android - java.lang.IllegalArgumentException: contains a path separator -

i have filename in code : string name_of_file="//sdcard//imageq.png"; fileinputstream fis =this.openfileinput(name_of_file); // 2nd line i error on 2nd line : 05-11 16:49:06.355: error/androidruntime(4570): caused by: java.lang.illegalargumentexception: file //sdcard//imageq.png contains path separator i tried format also: string name_of_file="/sdcard/imageq.png"; this method opens file in private data area of application. cannot open files in subdirectories in area or entirely other areas using method. use constructor of fileinputstream directly pass path directory in it.

Regex to extract keyword from tweet -

i'm trying match 'apple' in tweet data twitter. want able match hashtags too, match 'apple' either: 'apple' or '#apple'. edit: example tweet might be: "today going eat apple" or "today going eat #apple" i not want match: "today going eat lots of apples" i managed match hashtags using following \s#([^ ]*) , how make hashtag optional? eventually need create 2 variations, 1 case sensitive , 1 case insensitive. you can make hash optional appending question mark: \s#?([^ ]*)

titanium - i want to get selected row value from tableview and copy into textfiled for appcelerator -

hi want selected row value textfield how can copy value textfiled. how can this...my_combo textfiled code -: var tab_data = [ { title:'row 1', haschild:true }, { title:'row 2', haschild:true }, { title:'row 3', haschild:true }, { title:'row 4', haschild:true } ]; var tab = titanium.ui.createtableview({ top:43, data:tab_data }); tab.selectionindicator=true; tab.addeventlistener('click',function(e) { var ind = e.index; if(e.selectrow) { titanium.api.inof(' selected clicked'); my_combo.value = e.selectrow.title; } }); 1) create row , attach rowid it, or whatever other data want associate row. var row = ti.ui.createtableviewrow(); row.rowid = 1; row.mytext = "hello world"; 2) add click event listener table: tableview.addeventlistener('click', selectrow); 3) in selectrow function, data. function selectrow(e) { var rowid = e.r

debugging - detach one process from visual studio debugger -

my question similar "how stop debugging (or detach process) without stopping process?" but want detach 1 process. for instance, have windows form app attach windows service. want detach service (detach remove debugging executions , hence won't able debug other application). p.s: if possible please mention visual studio 2008 , 2010. in processes window (debug -> windows -> processes), right-click on name of process want detach, , on shortcut menu, click detach process.

java me - Neither float nor double works on Blackberry OS 4.5 -

as add float or double variable program, stops working on bb models 8100 , 8800, both running os 4.5. i have couple of newer phones os 5 , 6, respectively, , same binary works fine on those. why be? also, see " float or double on blackberry? " led question. when application started, before starts, shows error message effect of "modules bla blah can not verify blah". i'll update message real 1 when chance start broken app again. your quoted error message still "modules bla blah can not verify blah", kind of vague, sounds building against sdk newer blackberry os 4.5, , trying deploy app 4.5 device. it's possible float , double first references pull in modules don't exist on os 4.5, appears breaking app, when build issue.

sql - Access query: Group get latest -

i have query may return more 1 record, when happens need latest record according instance field (tinyint). trying create query executes first query , group query. way if returns 1 doesn’t alter result cause record latest. this on microsoft access 2003 query. use top: select top 1 field1, field2 mytable order instance desc . thats fastest way far.

Problem with increasing Java heap size in Eclipse -

i have problem error saying error: 'java heap space' . followed these instructions increase heap size eclipse, doesn't work. eclipse seems ignoring given values. eclipse.ini file looks this: -startup ../../../plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library ../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1.r36x_v20100810 -product org.eclipse.epp.package.java.product --launcher.defaultaction openfile -showsplash org.eclipse.platform --launcher.defaultaction openfile -vmargs -dosgi.requiredjavaversion=1.5 -xstartonfirstthread -dorg.eclipse.swt.internal.carbon.smallfonts -xx:maxpermsize=512m -xms512m -xmx1024m -xdock:icon=../resources/eclipse.icns -xstartonfirstthread -dorg.ecli pse.swt.internal.carbon.smallfonts the eclipse version 3.6.1 running on mac. any ideas might wrong? are sure configuring parameters application execution , not eclipse itself? i configure heap size in run | run configuration dialo

sql server 2008 - Using Update whilst using Select in SQL -

my sql programming limited why im having problem basic code. trying update record im retrieving it, know can update if split 2 procedures update records retreiving consistancy sake. anyway below code , show trying accomplish: update dbo.asns set sent = 'yes' asnnumber in ( select * dbo.asns sent = 'no' xml auto, elements, root('asns') ) i think mean this: update dbo.asns set sent = 'yes' output inserted.* sent = 'no' xml auto, elements, root('asns') see here

objective c - Importing 100MB XML file into iOS Core Data Model -

in app need import 100mb xml file core data model. so far, i've imported 100kb xml file , works fine. however, not sure how long takes import 100mb xml. run tonite, in while.. think approach ? thanks nsmanagedobjectcontext * context = [self managedobjectcontext]; // delete documents nsfetchrequest * fetch = [[[nsfetchrequest alloc] init] autorelease]; [fetch setentity:[nsentitydescription entityforname:@"document" inmanagedobjectcontext:context]]; nsarray * result = [context executefetchrequest:fetch error:nil]; (id basket in result) [context deleteobject:basket]; //insert documents tbxml * tbxml = [[tbxml tbxmlwithxmlfile:@"categ_small.xml"] retain]; tbxmlelement * root = tbxml.rootxmlelement; tbxmlelement * doc = [tbxml childelementnamed:@"doc" parentelement:root]; { tbxmlelement * iddoc = [tbxml childelementnamed:@"id" parentelement:doc]; tbxmlelement * titledoc

Perl - How do I count and print occurrences of domains in email address array? -

i have been struggling couple days , cannot seem figure out. i have array of email addresses created via push(@emails,$email) in while loop. i attempting create list of unique domains occurrence count of each in array. ordered number of occurrences. so, if array @emails has: john@yadoo.com ringo@geemail.net george@zoohoo.org paul@yadoo.com i can print: yadoo.com 2 geemail.net 1 zoohoo.org 1 i found example based on emails in file but, way on head. can me in more verbose code example can used array of email addresses? perl -e 'while(<>){chomp;/^[^@]+@([^@]+)$/;$h{$1}++;} foreach $k (sort { $h{$b} <=> $h{$a} } keys %h) {print $h{$k}." ".$k."\n";} infile i tried: (more level of lack of understanding) foreach $domain (sort keys %$domains) { print "$domain"."="; print $domains->{$domain}."\n"; }; and my %countdoms; $countdoms{$_}++ @domains; print "$_ $countdoms{$_}\n" keys

flex3 - conflict exists with definition friendlist in namespace internal flex error -

in variable getting error private var friendslist:vbox; "conflict exists definition friendlist in namespace internal" ? in advance i suppose have other definition name friendslist . rename 1 of them.

excel - View clipboard contents -

does out there know how can view what's being copied microsoft excel when select set of cells click "copy"? i see what, if any, styles, html, etc being copied product. extending dojo's rich text editor , need make sure when data pasted, pasted editor. thanks. i able quick java application. if interested in this, please reply answer.

android - How do I change the font color of the selection list in a spinner? -

Image
i've created spinner, user can select value. can change textcolor of spinner shown in picture: unfortunately when press spinner list of items, selected, shown, these have white font color on white background, , haven't been able change this: i've googled problem , others have experienced same problem. none of fixes suggested worked me. far understand have make custom list of kind, well.. i'm not able make work. suggestions? my code looks (array_spinner array of strings): arrayadapter adapter = new arrayadapter(this, r.layout.row, array_spinner); adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); and row.xml: <?xml version="1.0" encoding="utf-8"?> <textview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/spinnertext" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerho

import - PC-SAS reading variables in from another dataset -

good afternoon, a simple answer, sure - having not done dont know! i have dataset in pc sas made time ago , daily new version created ( trigger file). there two, or maybe 3 variables want pull in dataset new pc sas data set going create , want write code import rather use import wizard. could please give me example of how written? apologies if bit simple, have never wanted data previous datasets have made, proc sql data - although reasons economic reasons rather pull dataset on occasion. many thanks i think want following: data new_dataset; set existing_dataset(keep = variable1 variable2 variable3); run; this might overly simplified, can provide more detail if expound on issues run across.

Remove text enclosed in an div tag using C# Regex -

i have string follows: string chart = "<div id=\"divone\">label.</div>;" generated dynamically without control , remove text "label." enclosing div element. i tried following regex knowledge still limited working: system.text.regularexpressions.regex.replace(chart, @"/(<div[^>]+>)[^<]+(<\/div>)/i", ""); your regex looks me, (but don't specify '/.../i' delimiters , modifier). , use '$1$2' replacement string: var re = new system.text.regularexpressions.regex(@"(?i)(<div[^>]+>)[^<]+(<\/div>)"); var text = regex.replace(text, "$1$2");

Elegant Asp.Net MVC 3 custom membership wrapper class with extended (custom) methods and properties -

i attempting write custom membership class. seems work ok inhering membership class , providing functions included required items (validate user, create user, delete user, isapproved, etc). however, run problem when try add properties or methods. as other properties , methods public override classes in sealed class, additional properties not show up. say example (example only, not "real" code): public sealed class membership : membershipprovider { public override string applicationname { { return "myapp"; } } public string myvalue { get;set;} } now, understand why myvalue not show when try membership.myvalue membership.applicationname will. my question is, how extend membership show custom items? ditch membership.xxx entirely , write wrapper class? if so, how? can find documentation in world on how create custom membership class. i've got working custom membership works fine if use availa

Android: Socket connection not working in a specific phone -

socket connection = new socket("192.168.1.200", 6000); // 6000 standard port device connecting inputstream = connection.getinputstream(); socket connection implemented above not work on lgp500(android) works fine on htc desire(android). tell me wrong...and weird part used work fine in lg p500 before, stopped working of sudden...tried doing factory reset..but no use still... i socketexception: network unreachable.... would happy if me out on this.. that ip address local subnet (probably wifi) make 100% sure phone using wifi , not 3g networking.

xaml - Context-sensitive data binding in WPF -

it's convenient assign listbox.itemssource collection , tweak listbox.itemtemplate make date want. consider binding simple list of sorted strings. if collection large enough, eye-catching anchors come handy. here concept of want: wpf example of databinding http://bteffective.com/images/data_bindining_example.png basically want first letter of different style, if doesn't match letter of previous item. how can address previous item in datatemplate ? you need parse source list new list of objects have 3 properties: first letter of word, rest of word, , boolean indicates if entry "anchor". then, datatemplate textblock first letter followed textblock rest of word. style trigger on isanchor boolean change color of first letter.

c++ - Red Black Tree - deletion -

i've implemented delete function rbt (basing on cormen), looks works test deletion + printing tree in preorder gives me wrong answer. spent few hours looking may wrong couldn't find anything... here's func print tree in preorder: void print_out(rbt_node *root, rbt_node *nil) { if(root != nil) { printf("%d %s ", root->key, root->data.c_str()); if(root->color == black) printf("black "); else printf("red "); if(root->parent != nil) printf("%d ",root->parent->key); else printf("- "); if(root->left != nil) printf("%d ",root->left->key); else printf("- "); if(root->right != nil) printf("%d ",root->right->key); else printf("- "); printf("\n"); print_

javascript - How to get the span id which starts with a word -

actually have 2 span ids date_eform , time_eform . now have these ids.. , check if span id starts date_ have perform logic. , if span id starts time_ action. <span id='date_eform'></span><span id='time_eform'></span> please me in this. you need starts selector so $.each('span[id^="date_"]',function(){ //your code here }); and $.each('span[id^="time_"]',function(){ //your code here });

asp.net - Merge two object lists in C# with LINQ -

i have 2 list<t> s both same type. there easy way merge 2 sets without looping though both sets , merging them third? code var myobject= new list<core.myobject>(); var myobject2= new list<core.myobject>(); if(!string.isnullorempty(txb.text)) { var repository = servicelocator.current.getinstance<core.repositoryinterfaces.irepository>(); myobject= repository.getwherepostcodelike(txb.text).tolist(); } if(!string.isnullorwhitespace(ddl.selectedvalue)) { var repository = servicelocator.current.getinstance<core.repositoryinterfaces.irepository>(); myobject2= repository.getneartownx(ddllocations.selectedvalue).tolist(); } it have been nice able able use += on second, not allowed... ideas? call concat (keeps duplicates) or union (skips duplicates) linq methods ienumerable<myobject> third = list.concat(otherlist); to use union , you'll need override equals , gethashcode compare objects value. (or pass iequalit

types - Are there any good javascript currency or decimal classes? -

i trying deal javascript values such 23.45, want able mathematical operations on these values (addition, subtraction, multiplication, division) without running floating point issues. yes, might need round results sometimes, give reasonable answers. consider in javascript: 24.56 * .3 yields 7.36799999999 i come out 7.368. most languages have either decimal or currency data type deal this. has built class can handle sort of data effectively, or there other solution dealing these sorts of numbers without having adjust floating point errors? instead of using integers (which have own problems) i use bignumber.js library

jQuery tmpl plugin - Conditional templates? -

i'm generating list using jquery tmpl plugin : <script id="maintemplate" type="text/x-jquery-tmpl"> <li> <a class="page" href="#" rel="${link}" >${description}</a> </li> </script> is @ possible have things conditionally processed using jquery templates? tried: <script id="maintemplate" type="text/x-jquery-tmpl"> <li> {{if ${type} == "intlink" }} <a class="page" href="#" rel="${link}" >${description}</a> {{/if}} </li> </script> but didn't work. want able conditionally have different template output depending on data being passed (via json). there no need wrap type within if markup. should work <script id="maintemplate" type="text/x-jquery-tmpl"> <li> {{if type == "intlink" }} <a class="page"

javascript - jquery-ui datepicker with showOn: button showed even if source input is disabled -

i have input text field datepicker instance jquery-ui following parameters: 'buttonimageonly': true, 'showon': 'button', 'buttonimage': 'gfx/calendar.gif' it works well. when click "calendar.gif" datepicker image, calendar shown. however, when select date, input field (which disabled) changed. is bug or doing wrong? when @ instance object in firebug, disabled parameter set true . disabled mean can't manually write in it. still can javascript. the textbox saves date value. if don't want show, turn hidden field or hide css (easier). the buttonimageonly using button image type or image. i don't see bug nor error part. :)

Rails Mysql Installation on MacOS - CMake Error -

i've got issue installation of mysql ruby on rails on macos snow leopard. follow tutorial on website http://michaelfarmer.info/preferred-rails-3-and-mysql-installation-on-o . @ step of mysql installation (brew install mysql), terminal exposes error is: cmake error: parse error in cache file /tmp/homebrew-cmake-2.8.4-fyto/cmake-2.8.4/cmakecache.txt. offending entry: /sdks/macosx10.6.sdk i found out problem comes fact xcode not installed in default directory "/developer". explained here : https://github.com/mxcl/homebrew/issues/5182 at point, i'm lost, supposed ? here's brew --config homebrew_version: 0.8 head: (none) homebrew_prefix: /usr/local homebrew_cellar: /usr/local/cellar homebrew_repository: /usr/local homebrew_library_path: /usr/local/library/homebrew hardware: dual-core 64-bit core2 os x: 10.6.7 kernel architecture: i386 ruby: 1.8.7-174 /usr/bin/ruby => /system/library/frameworks/ruby.framework/ve

NHibernate: mapping bidirectional one-to-many with IList semantics -

here relevant pieces. parent object: public class article { public virtual ilist<articlerevision> revisions { get; set; } } <list name="revisions" cascade="all" inverse="true" table="articlerevision"> <cache usage="read-write" /> <key column="articleid" not-null="true" /> <index column="number" type="int32" /> <one-to-many class="articlerevision" /> </list> this child: public class articlerevision { public virtual article article { get; set; } } <many-to-one name="article" column="articleid" not-null="true" /> now, create instance of article , add 1 articlerevision article.revisions collection, set articlerevision.article reference article instance , shove database: insert articlerevision (content, keywords, createdat, siteid, articleid, createdbyuserid, id) values

c - Are socket options inherited across accept() from the listening socket? -

suppose listening socket passed accept has non-default options set on setsockopt . these options (some or of them?) inherited resulting file descriptors accepted connections? several of socket options handled @ lower levels of system. while of socket options set using setsockopt. reference: man setsockopt , since mentioning posix on linux, in general, scope. accept() (reference: man accept ) have amount of discretion on socket options should inherited , options reject listening fd. accept() not modify original socket passed argument. new socket returned accept() not inherit file status flags such o_nonblock,o_async listening socket. so, instead of relying on inheritance or non-inheritance of listening socket properties(which bound vary across implementations , licenses), accepted socket should explicitly set desired socket options.(best practice) man pages , implementation codes in machine relevant specification accept() behavior.there's no common or standard

java - How can I put a string containing html text to be displayed in a javascript function? -

how can put string containing html text displayed in javascript function? string test = "displaynext(\"string containing html tags\")"; string nextlink = "<br><a href='#' onclick="+test+"> next</a>"; javascript function: function displaynext(next){ alert(next); } i want pass html tags javscript function , display using alert box..how do ?? you'll need encode html tags. > becomes &gt; < becomes &lt; " becomes &quot; you'll need encode javascript. ' becomes \' then use single quotes quote javascript (so double quotes don't close onclick attribute prematurely): string test = "displaynext('" + encodedhtml + "')"; string nextlink = "<br /><a href="#" onclick=\"" + test + "\"> next</a>";

oracle - help on left outer join with parent-child relationship -

i have following table in database : id grp# code parent# -- ---- ---- ------- 0 10 null 0 30 sf 10 1 10 s null 1 30 sf 10 from this, given id , grp# need return list of children , code grp#. if children doesn't exist should return null. so example : id = 0, grp#= 10 should return us, 30 , id = 0, grp#=30 should return sf,null note : there should not duplicates in output. so here test data: sql> select * t42 2 / id grp# code parent# ---------- ---------- -------------------- ---------- 0 10 0 30 sf 10 1 10 s 1 30 sf 10 sql> and here query returns results want: sql> select p.code 2 , c.grp# child_grp# 3 t42 p 4 left outer join t42 c 5 on ( c.parent# = p.grp# ) 6 p.id = &id 7 , p.grp# =

Dynamic php vars in mysql, sql- vars get set, but result set is empty? -

i have following code created else, , though seems variables passed, nothing returning in results set; page: http://www.libraries.uc.edu/research/subject_resources/art/db/index.php ... search. here code on results page below (edited length). have feeling it's quotes , such, have been overlooking something! <?php if (!function_exists("getsqlvaluestring")) { function getsqlvaluestring($thevalue, $thetype, $thedefinedvalue = "", $thenotdefinedvalue = "") { if (php_version < 6) { $thevalue = get_magic_quotes_gpc() ? stripslashes($thevalue) : $thevalue; } $thevalue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($thevalue) : mysql_escape_string($thevalue); switch ($thetype) { case "text": $thevalue = ($thevalue != "") ? "'" . $thevalue . "'" : "null"; break; case "long": case "int": $th