Posts

Showing posts from March, 2010

.net - There's no @Html.Button ! -

this weird. see references out there @html.button() when type intellisense doesn't find such helper... there's dropdownlist, hidden, editors, et cetera, no button! what's that? public static class htmlbuttonextension { public static mvchtmlstring button(this htmlhelper helper, string innerhtml, object htmlattributes) { return button(helper, innerhtml, htmlhelper.anonymousobjecttohtmlattributes(htmlattributes) ); } public static mvchtmlstring button(this htmlhelper helper, string innerhtml, idictionary<string, object> htmlattributes) { var builder = new tagbuilder("button"); builder.innerhtml = innerhtml; builder.mergeattributes(htmlattributes); return mvchtmlstring.create(builder.tostring()); } }

jquery - How To Create A News Feed/Stream In Front-End Code -

i trying design primary news feed/stream our platform on "home" page. it, many others, aggregation of content unique user engage site. info pulled database, designing front end right now. i'd prefer html + css right now, , add jquery after make dynamic. know need have number of different div's accomodate different items in each post (entire content, photo, user's update, date, etc...) i'm wondering best way is? know basic structure, want make sure doing properly. can me div structure/corresponding css or has done useful tutorial? some examples of great streams; http://ted.com/conversations http://stackoverflow.com obviously facebook i know can dig in inspect element in chrome , take structure, css patchy , not easy access. thanks much! would jquery plugin looking for, http://www.baijs.nl/tinycarousel/ can customised pull in data database using php.

.net - How to get accurate CPU usage for a process on a multi-processor / multi-core system -

or maybe question more "what doing blatantly wrong here?" i have test app nothing watch own cpu usage. looks little this: protected performancetrace() { process currentprocess = process.getcurrentprocess(); this.cpucounter = new performancecounter("process", "% processor time", currentprocess.processname); this.corecount = environment.processorcount; } private int corecount; private datetime lastcpuread = datetime.minvalue; private float _cpuusage; private float cpuusage { { if ((datetime.now - this.lastcpuread) > timespan.fromseconds(1.0)) { this._cpuusage = this.cpucounter.nextvalue(); } return this._cpuusage / this.corecount; } } the cpuusage property read frequently. here's thing: on machine, environment.processorcount produces value of 2. however, value coming counter 800. assuming has multiple cores , hyperthreading. can actual value i'm looking for? (the total % process

inversion of control - Resolve dependencies with Castle Windsor using MEF in Visual Studio 2010 addin -

i wondering if there best practices using castle windsor visual studio 2010 addin, uses mef internally instantiate controls, such iwpftextview . all dependencies registered when vspackage created. how can later resolve dependencies when iwpftextviewcreationlistener created via mef, sometime later? should expose container singleton , access it, or there better way? edit here's i'm trying accomplish. when vspackage created, windsor wiring dependencies, is, of course, great. my addin "editor adornment" type of extensibility, after solution loaded , code file opened, callback class inherits iwpftextviewcreationlistener (and exported [export(typeof(iwpftextviewcreationlistener))] via mef (which done automatically visual studio). this happens in context, is, don't have access vspackage class, , dependencies need not initialized. @ point i'm not sure how can dependencies wired windsor. hope makes clearer. (you can try creating own extensibilty pr

inheritance - Problem removing objects in Java -

lets graphic world ,lets api of world , , actor , , built object new class name food inherent actor in situations need object disappeared world. should way ? i tried this: public void killfood () { getworld().removeobject(this); // >>>>>kill object inherate food , operate method. } but didn't killed kind of object class inherent food... why ? i wrapped (in food class) with: public void act() { if (canmove()) move(); else killfood(); } public boolean canmove() { world myworld = getworld(); int x = getx(); int y = gety(); y--; // test outside border if (x >= myworld.getwidth() || y >= myworld.getheight()) return false; else if (x < 0 || y < 0) // if out of 1st quarter return false; return true; // if inside 1st quarter & borders can move. } but object did not

blackberry - String text to long value -

well, thats it! need convert string text (like"hrd$457"), long value. blackberry ide has button it, need code. please note string alpha numeric. thx! note: sorry if question not clear. ide button im talkin converts entire string in long value makes string unique number. blackberry documentation says: "to create unique long key, in blackberry® integrated development environment, type string value. com.rim.samples.docs.userinfo right-click string , click convert ‘com.rim.samples.docs.userinfo’ long." so, need same code. i appreciate buddies, , trying help. if looking a number constant string can following. string str = "asdfasdf345asdfasdf"; int asint = str.hashcode(); long aslong = (long) asint;

Upload google docs with coldfusion -

i've built forum-like app in coldfusion , want add feature users can upload files google docs using google accounts , other users can edit files. i've been using cfc: http://cfgoogle.riaforge.org/ retrieve google docs, upload function missing. need upload function first upload of file , second part of editing it. hope makes sense. that's i'm asking for. i'm not experienced cffunctions , wondering if give me hand it. this have far: <cffunction name="upload" access="public" returntype="any" hint="i upload document." output="false"> <cfargument name="myfile" type="string" required="true" hint="file upload."> <cfset var result = ""> <cfset var service = variables.docservice> <cfset theurl = "https://docs.google.com/feeds/documents/private/full http/1.1"> <cfhttp url="#theurl#" method="post" res

svn - which version control is best suited for me? -

i know there lots of questions title find 1 me decide. i'm part game developing team, , usualy there 1 or 2 of each programmers, game designers, , artists envolved in project. main purpose keep team in sync ( , second important thing have history of thing we've done). since there non-programmers involved in project need version control software suggest have user-friendly gui keep others whining , make them shareevery thing they've produced through version control. while searching until think prefer use svn or git i'm wondering 1 suits our goals best, can suggest anything? (and know tortuissvn , tortoisgit) i think answer question need not subjective. use case of game development ( involving lots of changing binary files ) , involvement of non-programmers, suggest svn svn still has better handling of binary files ( through storage of diffs ) git , also, new comer, svn more friendly git. in fact, think mercurial fit well, feel tortoisehg not mark tortoisesvn

java - Search for all instances of foo(Bar.class) -

does eclipse have easy way search invocations of method based on type of argument(s)? example if a , b instance of foo , x , y instances of bar , want find foo(x) , foo(y) not foo(a) or foo(b) . you temporarily declare overloaded "fake" method foo specific types of parameters in interested. relevant invocations of real foo should resolved fake one. "find references" fake foo (before deleting it). [edit] this work provided constraints regarding subclassing hold. otherwise, superset of invocations in interested, may still narrow enough useful.

php - Apache and IIS 7 running together -

Image
i working on windows 7. iis 7 , xampp installed on same computer. have been playing win host file , apache configuration files understand server root , directory. i dont know messed up, know when type localhost shows me iis 7 screen , when localhost/xampp apache screen. how can iis , apache run @ port 80 ? confused. it doable. thing keep in mind no 2 services can share same port , ip address. unfortunately, iis takes on port 80 on magic 0.0.0.0 address. need re-bind apache , iis different ip addresses remove 0.0.0.0 binding. not sure how there on iis7 (presuming running given ie9 in screenies), last time pulled stunt iis6 hawt. a more sane option setup reverse proxy on 80 , have hand stuff out different web servers based on whatever rational criteria want use. edit: found magic juju, iis7 post #44 - iis7 , apache on same machine.

html - How do I change the jQuery UI content background to white? -

i tried modifying jquery-ui-1.8.11.custom.css there's still off white (almost grey) bar @ top. can please help? you have search whole css instances of ui-widget-content , delete de background-* tags them. or use css editor namuol pointed, choose cupertino > edit > go header or content , click square gradient , select flat square.

Naming your android app -

i have created app on android , reason unnamed when seen on phone manifest file is <application android:icon="@drawable/bampong" android:label="bam! pong" android:debuggable="true"> <activity android:label="@string/app_name" android:screenorientation="portrait" android:name=".start"><intent-filter><action android:name="android.intent.action.main"></action> i tried adding android:name="appname",but gives error you need add string resource "app_name." (the file res/values/string.xml.) see android hello world example more information. <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">hello, android! string resource!</string> <string name="app_name">hello, android</string> </resources>

SQLite inserts timing out in Android? -

during oncreate() i'm trying insert 20 rows sqlite database (these test values. final version i'll have insert 1000). using debugger appears when running oncreate() causes "activity pause timeout historyrecord", , seems log not rows inserted. is using asyncronous task way make work without timeout? thanks yes asyncronous task or in separate thread right way, additionally can tell db starting transaction speeds process large inserts, dh.getdb().begintransaction(); //insert statemetns dh.getdb().settransactionsuccessful(); dh.getdb().endtransaction();

Python: search global classes in a single module file -

i have python 2.x module.py file looks this: class a(object): keyword = 'class a' class b(a): keyword = 'class b' class c(object): pass def list_class_keywords(): name in globals(): print name, hasattr(name, 'keyword') if __name__ == '__main__': list_class_keywords() in list_class_keywords() , i'm looping through of objects of file module , testing if object has attribute keyword . isn't working, since name string. how should rewrite list_classes i'm looking for? update: ignacio hint. here updated code: def list_class_keywords(): global_dict = globals() name in global_dict: obj = global_dict[name] print name, hasattr(obj, 'keyword') class a(object): keyword = 'class a' class b(a): keyword = 'class b' class c(object): pass def list_class_keywords(): name, obj in globals().items(): print name, hasattr(obj, 'k

c# - Add property to non user defined classes -

we use controls time example button , may want add custom properties button. example numberoftimesclicked etc. working gridviewcolumnheader , add property columnindex class. know can keep track of columns other methods curios know if can add properties classes. example thinking inheritance. if create new class , inherit class want add new properties (in case gridviewcolumnheader) think should work reason errors in code whenever like: private class mygridviewcolumnheader : gridviewcolumnheader { public int propertythatiwanttoadd { get; set; } } from on if instantiate objects mygridviewcolumnheader class instead of gridviewcolumnheader class errors. wrong using inheritance achieve this? instead of casting sender object use e.originalsource mygridviewcolumnheader and work on object. if need know inside routedeventargs have on msdn

Android RelativeLayout and height of wrap_content? -

Image
i trying make selection listactivity, similar 1 used add shortcuts launcher screens. have rolled own header , footers, "sticky" @ top , bottom of view when on screen. in order this, using relativelayout header set dock top, footer set dock bottom, , list set go below header , above footer. in terms of overall layout of activity, rendering expect. header sticky top, footer sticky bottom, , list scrolls in between them. one odd thing though happened when switched relativelayout root. please see following screenshot: i want activity's height wrap_content , form high content displayed in it, once switched relativelayout, seems render activity fill_parent , taking whole screen, though content doesn't warrant it. notice there not enough list items fill screen, fill_parent style, leaving bunch of whitespace between end of list, , footer. setting height's via styles - worked fine linearlayout, seems ignored now. tried hard-coding height directly on relativelayo

iphone - Issue with newline in text - UITextView to sqlite, sqlite to JSON (via NSString), JSON to PHP -

i have uitextview ends sending text sqlite db on iphone. later on querying data sqlite, putting json string , sending server (php/mysql) iphone using asihttprequest (using asiformdatarequest class). there data condition send php fails decode (using json_decode ). data condition seems there's newline in text entered sqlite via uitextview. things i've tested: write out same json string i'm trying send server text file on iphone. take text, copy web form (that put troubleshooting) posts data same php script accepts json iphone. processes (e.g. decodes , writes mysql db). write out same json string i'm trying send server console (using nslog ). copy text console , copy web form posts data same php script accepts json iphone. processes (e.g. decodes , writes mysql db). remove newline in sqlite db, run app , send json server per design, no problem...it decodes , writes mysql db. i want keep newline in text user typed , expect when see information on s

Google search Python script, without using APIs -

most of google search python scripts use either www::mechanize or google apis. how write script without using these , json objects? you can construct url query yourself, if like, , make request using urllib2 or of like. urls google search queries explained here . of course, really, there's no shame in using apis.

objective c - iPhone :UITableView CellAccessory Checkmark -

in iphone app on click of table view cell want display table view cell accessory type check mark on didselectrowatindexpath writing code if(indexpath.row ==0) { [tableview cellforrowatindexpath:indexpath].accessorytype=uitableviewcellaccessorycheckmark; } and displaying check marks. but in case wnt allow user check on cell @ time means if user select other row row should checked , checked should unchecked how can achieve that? keep track, in instance variable, of row checked. when user selects new row, first uncheck checked row, check new row , update instance variable. here more detail. first add property keep track of checked row. it's easiest if nsindexpath . @interface rootviewcontroller : uitableviewcontroller { ... nsindexpath* checkedindexpath; ... } ... @property (nonatomic, retain) nsindexpath* checkedindexpath; ... @end in cellforrowatindexpath add following: if([self.checkedindexpath isequal:indexpath]) { cell.access

Indexing and searching with sphinx for words with signs like (++, #, .) -

hi have build index , need search words "c++", ".net" or "c#", there not result coming. here config: source = xxxx path = /usr/local/etc/sphinx/var/data/xxxx docinfo = extern charset_type = utf-8 min_word_len = 1 min_infix_len = 7 stopwords = /usr/local/etc/sphinx/var/stopwords/stop_words_en.txt i have try search sph_match_phrase , sph_match_all, there nothing useful coming. what can allow this? thanks nik you have configure charset_table include symbols +, #, ., ie index your_index { charset_table = 0..9, a..z->a..z, a..z, +, #, u+002e, you check how words tokenized via call keywords mysql call with config provided i'd such output mysql> call keywords ('c++ .net c# end_of_a_sentence.', 'your_index') tokenized normalized c c net net c c end end of of sentence sentence with addition config output tokenized normalized c++ c++ .net .net c#

perl - DBD::SQLite: Insert or Update - Question -

while writing question (howto: insert new entry , if exists already, update it) found answers in related questions : $sql = "insert or replace $table ( id, name, rating ) values( ?, ?, ? )"; $sth_rating = $dbh->prepare( $sql ); $sth_rating->execute( $id, $name, $rating ); . $sql = "insert or ignore $table ( id, name, rating ) values ( ?, ?, ? )"; $sth_rating = $dbh->prepare( $sql ); $sth_rating->execute( $id, $name, $rating ); $sql = "update $table set rating = ? id = ?"; $sth_rating = $dbh->prepare( $sql ); $sth_rating->execute( $rating, $id ); is second method more safe first one? the second method less safe because non-atomic. in other words, happens in more 1 step. consider 2 processes both updating same data. time moving down. process 1 process 2 insert or ignore... insert or ignore... update... update... process 1 starts

iphone - 1St value does not select in picker view -

hi iam having buttons when click 1 button picker view apper not select first value if scroll fist value selected plz me here code - (void)pickerview:(uipickerview *)thepickerview didselectrow:(nsinteger)row incomponent:(nsinteger)component { switch (tagvlaue) { case 0: { if(gender==yes) { nslog(@"selected color: %@. index of selected color: %i", [checkarray objectatindex:row], row); selectedgender=[checkarray objectatindex:row]; nslog(@"selected checkgender %@",selectedgender); genderlabel.text=selectedgender; // checkgender=no; } else { nslog(@"selected color: %@. index of selected color: %i", [genderarray objectatindex:row], row); selectedgender=[genderarray objectatindex:row]; nslog(@"selected gender %@",selectedgender); genderlabel.text=selectedgender; // check

android - Can not update contact using ContentProvoider -

uri name=null; string []whereargs={"sameer ahmad"}; name=uri.withappendedpath(people.content_uri,people.phones.content_directory); cv1.put(people.name,"tofeeq ahmad"); int i1=0; i1=getcontentresolver().update(name,cv1,"name=?",whereargs); } catch(exception e){ e.getmessage(); i trying update phone numder uri showing exception:cannot update//contacts/people/phone. same error in inserting. i want create shared data base accessible every application have declared necessary permission in manifest? <uses-permission android:name="android.permission.write_contacts" />

android - Seek bar's draggable thumb -

i want not able move draggable thumb of seek bar. progressbar.setclickable(false); not help. progressbar not clickable default can use instead of seekbar . if want disable seekbar thumb use progressbar.setenabled(false);

winforms - Check for null via BinaryOperator -

groupoperator groupapplyon = new groupoperator(); groupapplyon.operatortype = groupoperatortype.and; groupapplyon.operands.add(isb); groupapplyon.operands.add(isa); groupapplyon.operands.add(isc); where isx binaryoperator .. binaryoperator isb = new binaryoperator("validity", null, binaryoperatortype.equal); this code gives me error - how check public unaryoperator isnull() if "validity" null? use nulloperator instead.

visual studio - Question on Create Software Installation Package -

i have small c++ win forms project developed visual studio 2005. how can create installation package using visual studio 2005? and builds installer windows-based(no .net installed) application. i want these features below: install package on no .net environment computer. after installation completed successfully, application check update alert automatically. (like komodo editor on windows os) i googled , found this, http://support.microsoft.com/kb/307353 i not sure required .net environment install package or not. appreciated reading , replies. create msi installer using wix. integrates vs 2005/2008/2010. has heavy learning curve complex things manageable simple things. uses default installation engine provided every windows. http://wix.sourceforge.net/

flex - how to use mxml component in another actionscipt -

how use mxml component in mxml component actionscipt code for ex. in main mxml file private var warningmessage:warning;//this variable if (!_controller.flashvars.chatsession || _controller.flashvars.chatsession == "") { warningmessage.includeinlayout = true; warningmessage.visible = true; } else { _controller.flashvars.showwarningmessage = "2"; } private var warningmessage:warning; (warning external custom component) warningmessage.visible=true (and want use in actionscript code but getting error saying " type not found or not compile time constant:warning ") there 3 things jump out. if component in swc file, make sure reference in project settings import namespace or call directly (com.whatever.namespace.warning) make sure call new generate new object. in code above, warningmessage null. private var warningmessa

internet explorer 8 - Selenium 2 - IE8 differences between RemoteWebDriver and DefaultSelenium -

background: i've upgraded use selenium 2 , using remotewebdriver drive tests. problem when remotewebdriver instantiated launches browser (ie8) behaves differently browser selenium launches when use defaultselenium class drive tests. the browser remotewebdriver launches not load web page test - displays message 'downloading picture about:blank...' in status bar, test cannot proceed. my question this: difference between ie8 browser defaultselenium launches , 1 remotewebdriver launches? can configured? cheers. you may running protected mode issues in ie. ie using selenium webdriver api (that's using remotewebdriver), need configure browser first. correct settings ie detailed in selenium project wiki . also note if you're running tests on same machine ie, can skip using remotewebdriver altogether, , create instance of internetexplorerdriver.

php - Incompatible debugger version - error 2006040705 -

Image
how rid of following incompatible debugger version error : php.ini setting : xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote_port=10000 xdebug.remote_handler=dbgp xdebug.profiler_enable=1 xdebug.profiler_output_dir="c:\xampp\tmp" check @ below link in case too. click here seems bug in eclipse pdt , according report: bug 271071 - "incompatible debugger version" when not debugging, bug seems fix when close projects in workspace , reopen whichever need. personally have solved changing debug ports in "preferences -> php -> debug -> installed debuggers", these values: zend debugger (30000) xdebug (19000) that works me, maybe have try ports.

session - android persistent login -

how can handle persistent login android app? instance, app facebook requires initial credentials user login first time, on requires no additional actions user. how achieved client android app? should persistent data stored? can cookies or should write data database or internal storage? once login has been established, should rely on server sessions authenticate user or should send cookie and/or username , password every api call? you need use sharedpreferences achieve this. look here examples on how it.

perl - Quickest/most concise bash one-liner for extracting specified lines from a file -

i want extract lines specific line numbers file (i have 20-50 line numbers, file has 30,000 lines). far, concise way i've found e.g.: gawk 'begin {split("13193,15791,16891", a, ",")} nr in a' <file_name> but seems should able further reduce amount of typing involved. i've looked @ sed think need -n , -p each line number, thought cat -n grep it's more verbose above. know better way? sed can more concise: sed -n "13193p;15791p;16891p" file_name

sql - Visual Studio 2010 Database Project Installer / Install script -

i have been using database project in visual studio 2010 create database. visual studio makes process easy deploy database , deploy updates. issue have how can visual studio create script build database can use on qa or production system. i thought building project create sql file did not seem true. can please advise on how can or simple step missing. as strange may sound, visual studio not create sql file deploy database when perform build. instead, occurs @ deploy time. reason behind lies in way visual studio makes changes database you're deploying to: in order change database, must first compare project model (as defined in files contained within .dbproj) of existing database schema determine changes have made since database last deployed. you have choice of manually executing sql script produced using sqlcmd command-line utility (or through ssms in sqlcmd mode), or alternately can configure visual studio database project execute script if specify following de

CakePHP: Error when set Configure::write('Session.timeout', 0 ) -

i use both version on windows , ubuntu. met error on both. error http://i.stack.imgur.com/fcpfk.png . i can reproduce error when set session.timeout = 0 (session must save database ) refresh page 2 times , report cakephp lighthouse markstory don't happen same . http://cakephp.lighthouseapp.com/projects/42648/tickets/1173-cakesession-circular-dependancy-race-condition-or-infinite-loop i happy if can fix matter o_o. today, found out matter ^^. if save session in database , configure::write('session.timeout', '0'); , important, set public $cachequeries = true; in 'app\app_model.php'. refresh browser 2 times ,error happen.

math - Do not want scientific notation on plot axis -

i regularly kinds of scatter plots in r using plot command. sometimes both, 1 of plot axes labelled in scientific notation. not understand when r makes decision switch scientific notation. surprisingly, prints numbers no sane human write in scientific notation when labelling plot, example labels 5 5e+00. let's have log-axis going 1000, scientific notation unjustified such "small" numbers. i suppress behaviour, want r display integer values. possible? i tried options(scipen=10) starts writing 5.0 instead of 5, while on other axis 5 still 5 etc. how can have pure integer values in r plots? i using r 2.12.1 on windows 7. use options(scipen=5) or other high enough number. scipen option determines how r switch scientific notation, higher value less switch. set option before making plot, if still has scientific notation, set higher number.

php - French accented characters decode for SQL matching -

i'm having problem matching against french accented characters (note other different characters such chinese, japanese used). i've ran across error when input french street name check database , had error: incorrect string value: '\xe2teau' column 'street_name' @ row 1 for character in name: le château i've changed column utf8_general_ci , still throws me error. how can "decode" them match against column? are sending utf-8 data, or sending latin-1 encoded data? mysql may choking on âte because â being transmitted byte e2 , expects byte suitable value come next, sees 74 t instead. string not valid utf-8. try using utf8_encode() on string value before creating query?

html - CSS issue in IE7 -

i have simple web page , banner contains 3 images. want expand banner when different resolutions.my solution working on firefox , chrome not ie7. <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> #left{width:338px; height:103px; float:left; background-image:url('image/banner_left.jpg'); background-repeat:no-repeat; margin:0px; padding:0px;} .middle{float:left; background-image:url('image/banner_middle.jpg'); background-repeat:repeat-x; margin:0px; padding:0px; } #right{width:620px; height:103px; float:right; background-image:url('image/banner_right.jpg'); background-repeat:no-repeat;margin:0px; padding:0px; } </style> </head> <body style="margin:0px; padding:0px;"> <form id="form1" runat="server"> <div id="container" cla

c# - XmlSerializer property converter -

suppose have class can serialized/deserialized xmlserializer. so: [xmlroot("objectsummary")] public class summary { public string name {get;set;} public string isvalid {get;set;} } we have xml so: <objectsummary> <name>some name</name> <isvalid>y</isvalid> <objectsummary> using of boolean property isvalid instead of string property better decision, in case need add additional logic convert data string bool. the simple , direct way solve problem use additional property , put conversion logic isvalid getter. can suggest better decision? use type converter in attributes somehow or similar? treat node custom type: [xmlroot("objectsummary")] public class summary { public string name {get;set;} public boolyn isvalid {get;set;} } then implement ixmlserializable on custom type: public class boolyn : ixmlserializable { public bool value { get; set } #region ixmlserializable m

queue - Apache webserver - What happens to requests, when all worker threads are busy -

as far researched, scenario when worker threads busy serving requests, happens requests comes next. do wait? is related configurable parameters? can count of such requests ? adding please can explain or give link can clear picture of request processing strategy of apache webserver? thanks looking at!! additional post cbroughton: should have maximum of 500 request (this depends of servercapacity). here link further reading maxkeepaliverequests

android - Calling ArrayAdapter causes infinite loop? -

in app, have option save item favourites. save 2 id's in arraylist. when user calls favourites, loops through arraylist , each item, corresponding data database. information again stored in arraylist. want display list in listview. but last step doesn't seem work, i'm in infinite loop if call listviewadapter. don't quite understand why. stupid, can't find what's wrong. here loop through first arralist id's: public void getjobs(){ for(int = 0; i<vaca.size(); i++){ getvacatures(vaca.get(i), kantoor.get(i)); arrvacature.add(vacature); } } here call data database: private void getvacatures(string vacaid, string kantoorid){ try { log.e("in try", "try"); /* create url want load xml-data from. */ url url = new url("http://172.21.150.140:80/scripts/cgiip.exe/wservice=braccentbe/android/getfavorieten.p?vacaid="+vacaid+"&kantoorid=" + kant

sql - Automatically resolve primary key merge conflict -

could please suggest me way automatically resolve primary key conflicts during merge between publisher , subscriber. seems sql server doesn't out of box :(. conflict viewer shows me next message: a row insert @ '_publisher_server_' not propagated '_subscriber_server_'. failure can caused constraint violation. violation of primary key constraint 'pk_ partplan _fd9d7f927172c0b5'. cannot insert duplicate key in object '_table_name_'. thank you. this isn't easy solution (since you've presumably designed database auto-incrementing int keys), using guid ("uniqueidentifier") primary keys solve pk collision problem.

Can ManagementScope be used to send wbem queries to Linux / MacOS clients from Windows? C# -

i'm currenty using c# , managementscope connect , run wmi queries on windows machines on network, , got work. what wondering, , had trouble finding information about, if managementscope used run wbem queries on machines running linux / macos? if not, need connect linux / macos clients windows machine? mainly want query return machine's operating system , running processes. on windows, can found in wmi classes win32_operatingsystem , win32_process. equivalents in linux/macos? thanks. wouldn't need have server first on linux machine? e.g. 1 of listed here: http://en.wikipedia.org/wiki/web-based_enterprise_management#implementations

ios4 - How to have different build settings/phases for ad hoc and distribution build in Xcode 4 -

in xcode 3 made few build configurations, 1 being ad hoc, 1 being distribution. in each of them put whatever settings wanted have settings ( or pre build scripts) run ad hoc or distribution build. in xcode 4 stuck schemes, , there 1 "archive" entry have choose build config uses. if want archive both ad hoc , distribution builds both have different settings there no other way go , change build config "archive" uses in scheme, or create 2nd scheme that. is there easy way accomplish without using multiple schemes? xcode 4 still has build configurations, can set clicking on project , project again in list of targets. each configuration can have separate build settings. conveniently build each one, have use 2 different schemes.

Empty AdWhirl layout on android (no ads shown) -

i have strange problem integrating adwhirl android app. networks connected through adwhirl: * mileniall media * admob * inmobi (it gives invalid adapter error thats known issue , not main problem) i've downoaded , included adwhirl sdk 3.0.0, jars respective network , did steps included in manual (changes in manifest file, lib including etc) and i've put adwhirl code app. layout placeholder adwhirllayout. <linearlayout android:id="@+id/ads" android:layout_width="fill_parent" android:layout_height="52dip" android:layout_weight="0" android:background="#0f0"/> code ads layout: adlayout = (linearlayout) findviewbyid(r.id.ads); adwhirllayout adwhirllayout = new adwhirllayout(this, "ad whirl code"); relativelayout.layoutparams adwhirllayoutparams = new relativelayout.layoutparams(uiutils.dip(320), uiutils.dip(52)); adwhirllayout.setbackgroundcolor(color.dkgra

java - turn off unescaping in SAXParser -

i using saxparser in java. is there way turn off unescaping while parsing xml using saxparser? for example have following xml: <tag> &#8222;title&#8221; </tag> i obtain characters(char[] ch, int start, int length) message &#8222;title&#8221; but handler unescapes content of xml , gives: „title” i tried specifying custom entityresolver, seems resolveentity() method never gets called. the saxparser doing supposed if want preserve text node as-is need wrap in cdata section. can either preprocess step or perhaps there way wrapping while parsing (but don't know how).

.htaccess - friendly URL - two variables in the URL with htaccess -

i need me url rewriting using .htaccess . i use url: www.mydomain.com/page.php?var1=ny&var2=new york and convert to: www.mydomain.com/page1/new york that should done without losing first parameter of course. perhaps (with appropriate rewritebase): rewriterule ^page.php?var1=([^&]+)&var2=([^&])$ /page1/$2?var1=$1 [l,r]

c# - Validation a string length : either X or Y, not between X and Y? -

i use validation framework : [stringlength(10, minimumlength=5)] public string mystring{ get; set; } this allows me specify mystring length must between 5 , 10 characters long. now have check if string either 5 long, or 10 long. no other length allowed. i'm quite sure stringlength attribute inadequate, how ? have extend validation framework , how ? thx if can (i'm not familiar validation library in question) can use regular expression. the regular expression validate character, length 5 or 10, be: ^.{5}(.{5})?$ if have digits, can use: ^\d{5}(\d{5})?$

uiview - minimize window animation, but for iOS? -

i have overlay text in uiview animate button in navigationbar, in way similar minimize window animation on mac os x. i can basic animations of fading opacity , resizing windows, 1 difficult. any clues how kind of animation uiview? there 2 effects osx can set (if i'm understanding right), scale , genie effects. mimic scale one, need animate scale, opacity, , positions. example using implicit animation: view.layer.transform = catransform3dmakescale(0.2, 0.2, 1); view.layer.position = cgpointmake(yournavbarspot.x, yournavbarspot.y); view.layer.opacity = 0.0f; to genie effect, you'd same thing , alter shape of view animates. i'm not sure if can change geometry of uiview, closest thing can think of create mask alter geometry of using uibezierpaths.

flex4 - DropDownList selection behavior when using keyboard in Air/Flex -

let's have dropdownlist 50 states in it. type in letters " c + o + l " jump colorado, firefox , application do. right now, it's jumping california ohio end louisiana... know easy way that? thanks lot! you try create custom component extends dropdownlist , override offending function add own functionality want. it's way can think of changing default functionality.

Does django create a clean database? -

i building web interface database @ school. database hold our school's versions of academic standards. when build site using django, create clean database? example, wysiwyg website builders dreamweaver create ugly html , css code on backend. hate see similar degree of auto-generated cruft in database. should create database myself , build django site access database, or go ahead , let django create database? under simple moderately complex application, django fine job creating database you. i've yet run issues it's made. i suggest use south handle table migrations. , use virtualenv , pip set , maintain django environment.

git - Rails 3 and Heroku: automatically "rake db:migrate" on push? -

i have slight annoyance heroku push/deploy process, otherwise has been joy discover , use. if add new migration app, way can onto heroku server push heroku remote. uploads , restarts app. doesn't run migration, have heroku rake db:migrate --app myapp , heroku restart --app myapp . in meantime, app broken because hasn't run migrations , code referring fields/tables etc in migration. there must way change deployment process run rake db:migrate automatically part of deploy process can't work out. is set in heroku cpanel? option pass heroku command line? git hook? can set me straight? thanks, max here rake task wraps one-liner (and supports rollback): https://gist.github.com/362873 you still might wind deploying on top of boss's demo, @ least don't waste time typing between git push , rake db:migrate .

c# - Process html files with HttpModule to catch 404 errors on IIS7 -

i having problem httpmodule handles exceptions. (cfr. previous post: custom httpmodule iis 7 integrated ) all works well, aspx pages. the main reason wanted use httpmodule handle 404 exceptions occur when tries go html page doesn't exist. httpmodule works .aspx pages , isn't triggered when html file doesn't exist. this configuration have set in web.conf file: <system.webserver> <modules> <add name="aspexceptionhandler" type="company.exceptions.aspexceptionhandler, company.exceptions" precondition="managedhandler" /> </modules> </system.webserver> i have tried adding 'runallmanagedmodulesforallrequests="true"' module node, , 'precondition="managedhandler"' "add" node, didn't work. i have set application pool on web application running "integrated" mode, because found lot on google. is there way make httpmodule h

Relational database design:two 1 to many relations -

i have table users (id,name) , operations (id,date,id_user,id_target_user) if didn't have id_target_user column i'll make on relation users.id operations.id_user (every user can have multiple several operations) problem operation maybe related user how solve this? can't create 2 relations on same key can i? yes can. id_user foreign key users.id . id_target_user foreign key users.id . that's need.

webforms - ASP.NET site auto-login during development -

while developing asp.net site, way setup automatic login? for example, each time build site , run it, have login again. don't want disable security entirely, automate process of logging in while i'm working on site. just keep browser open , ctrl+f5 after modify and/or recompile in visual studio. keep authentication cookie. another possibility setup automatic login page in test whether in debug mode , force login using formsauthentication.redirectfromloginpage("someusername", false); . instruct visual studio run web site @ url: protected void page_load(object sender, eventargs e) { #if debug formsauthentication.redirectfromloginpage("someusername", false); #endif } ideally page should excluded build process , never shipped. as pointed out in comments section @mufasa if site uses session might need use out of process mode (stateserver or sqlserver) instead of inproc because when recompile application domain reloaded , st

Migrating MOSS 2007 to sharepoint 2010 giving the error "Site collection could not be restored" -

i trying migrate moss 2007 sharepoint 2010 , got error while restoring backup. steps followed are i have file , solution pakcages moss 2007. i have brand new server setup sharepoint 2010 , sql server 2008(64 bit) , windows server 2008 (64 bit). 3.i have created new web application , new site collection. 4.successfully deployed solution packages using powershell command. 5.trying restore backup , got error restore-spsite: site collection not restored, if problem persists please make sure content databases available , have sufficient free space. can me how resolve this. tried following suggestions got through google, nothing worked me. thanks you can't directly restore moss2007 backup sharepoint 2010. need restore sharepoint 2007 , migrate it. if have database backup of content database, follow steps given: take backup of content database sharepoint 2007 database server. restore database server of 2010 environment. run cmdlet test-spcontentdatabase –n

c# - Using .NET GZipStream Class with Mono -

i'm trying build example gzipstream class . command gmcs gzip.cs , got error messages. gzip.cs same source msdn. it seems need add reference when compiling. what's missing? gzip.cs(57,32): error cs1061: type `system.io.filestream' not contain definition `copyto' , no extension method `copyto' of type `system.io.filestream' found (are missing using directive or assembly reference?) /library/frameworks/mono.framework/versions/2.10.1/lib/mono/2.0/mscorlib.dll (location of symbol related previous error) gzip.cs(86,40): error cs1061: type `system.io.compression.gzipstream' not contain definition `copyto' , no extension method `copyto' of type `system.io.compression.gzipstream' found (are missing using directive or assembly reference?) /library/frameworks/mono.framework/versions/2.10.1/lib/mono/gac/system/2.0.0.0__b77a5c561934e089/system.dll (location of symbol related previous error) compilation failed: 2 error(s), 0 warnings solved i shou

objective c - Method implemented from delegate not triggered -

i have uiviewcontroller embedded in navigation controller , presented modally: //uiviewcontroller authenticationcontroller *auth = [[authenticationcontroller alloc] init]; //uinavigationcontroller authrootcontroller *navcontroller = [[authrootcontroller alloc] initwithrootviewcontroller:auth]; navcontroller.navigationbar.topitem.title = @"anmelden"; navcontroller.delegate = self; [self presentmodalviewcontroller:navcontroller animated:yes]; release_safely(navcontroller); however there wrong delegate created within authrootcontroller class: @protocol authrootcontrollerdelegate @required -(void)authrootcontrollerdidend:(uinavigationcontroller *)sender; @end @interface authrootcontroller : uinavigationcontroller { id<authrootcontrollerdelegate> delegate; } @property (nonatomic, assign) iboutlet id delegate; @end and implementation: @implementation authrootcontroller @synthesize delegate; -(void)userdidca

sql server - Why is this SQL statement hanging when group by, sum, or where clause is included? -

i have sql statement: select t3.item1, t3.item2, sum(t1.moneys) table t1 inner join table t2 on t1.key = t2.key inner join table t3 on t1.key2 = t3.key2 t2.type = 'thistype' , t3.type2 = 'thistype' group t3.item1, t3.item2 if remove group by , sum , or where clause runs fine - if add of hangs forever... ideas... on sql server management studio 2008 r2 thanks further testing so created view: select t3.item1, t3.item2, t1.moneys, t2.type, t3.type2 table t1 inner join table t2 on t1.key = t2.key inner join table t3 on t1.key2 = t3.key2 and can select top 1000 view fine , see type want @ in data, when add 'where type2 = 'thistype'' hangs again... your joining 3 tables millions of records, normal take bit run. to answer question statistics, indices utilize retrieve records faster tables. without accurate or date statistics, indices can slow queries down.

iphone - Failing to Release after Multiple Nib loads -

Image
i using nib template several buttons. seemed work fine, each have own independent state. when went release buttons crash in dealloc. here code... msoundbtns = new csoundbutton*[mnumsounds]; for(unsigned int = 0 ; < mnumsounds; ++i) { msoundbtns[i] = nil; } for(unsigned int s = 0; s < mnumsounds; ++s) { [[nsbundle mainbundle] loadnibnamed:@"instancesoundbutton" owner:self options:nil]; //auto loads via outlet 'soundnib' msoundbtns[s] = soundnib; soundnib = nil; uint32 count = msoundbtns[s].retaincount; nslog(@"last count: %d", count); } for(unsigned int j = 0; j < mnumsounds; ++j) { [msoundbtns[j] release]; //**** crash here on 7th (of 8) release msoundbtns[j] = nil; } header: @interface clocationcontext { ... csoundbutton** msoundbtns; iboutlet csoundbutton* soundnib; } @property (nonatomic, assign) iboutlet csoundbutton* soundnib; @end the nib simple, include parent view , child

version control - Ensuring a merge between branches happens in one direction -

this morning discovered co-worker had merged wrong way between 2 branches in mercurial --we have ver5 , ver6 branch, files in ver6. there way (a serverside hook probably) enforce children of ver5 node ver5? rather post twice, answer " mercurial: allow merge release branch default one, not vice versa " help? https://stackoverflow.com/a/19926324/1025457

Why is Facebook javascript SDK slowing down page load speed? -

we use javascript sdk login , sharing (iframes button). javascript loaded after page load. we're seeing 1.5 3 second slower full page loads facebook enabled. can identify cause , optimize perceived , real page load speed? make sure js includes after css includes rending remote javascript loads @ mercy of whoever hosting them. can locally host them, don't latest version, , js includes won't work if they're not included remotely. try putting facebook include last element in tag. actual facebook logic won't happen until rest of document loads however.

programming languages - What is the relationship between class and type? -

possible duplicate: what difference between type , class? what relationship between class , type? or relationships between class , type? if think defining concepts class , type clarifies answer, please include definitions. resuming: the basic relationship between 2 concepts class defines type. if define class car , you're defining new type: car .

string - PHP problem writing consecutive single quotes? -

i can't manage write consecutive single-quotes on server; simple script output's single quote file: <?php $handle = fopen('testwritedoublesinglequote.dat', 'wb'); fwrite($handle, "''"); // writes ' once! fclose($handle); ?> i've tried pack() function well, same result: <?php $handle = fopen('testwritedoublesinglequote.dat', 'wb'); fwrite($handle, pack('nnn', 0x6061, 0x6127, 0x2763)); // writes 0x27 once! fclose($handle); ?> is normal? magicquotes? did try four? fwrite($handle, "''''");

user interface in visual c++ using opencv -

i'm new opencv. have completed project i'm having difficulty gui. can provide me links can me out? i'm using c++ , opencv 2.1 , visual studio 2005. regards sidra shahbaz highgui.h handles gui functionality , more. high-level gui wiki entry describes function in detail.

photoshop - Dreamweaver scale a page down? -

in dreamweaver there way scale page down 1000px wide 800px without exporting new images? there not. can set size of each image in template, more data needs loaded required. example, set size 800px, web browser still downloads 1000px of data (image file), making theme slower should be. your best bet resize, (and optimize) images in adobe photoshop.

Cucumber step failing for Devise, connection refused? -

i'm trying cucumber tests working devise, , have following step definition: given /^(?:i am|i have|i) signed (?:as|with) "(.*)\/(.*)"$/ |email, password| factory(:user, :email => email, :password => password, :password_confirmation => password) end and user factory: factory.define :user |u| u.sequence(:email) { |n| "testing@example#{n}.com" } u.password "test_pass" u.password_confirmation "test_pass" u.sequence(:display_name) { |n| "user#{n}" } u.people { |i| [i.association(:person), i.association(:person)] } end and have these devise modules loaded (in app/models/user.rb ): # include devise modules devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable, :confirmable, :lockable, :timeoutable i run cucumber scenario above step, , fails with: given signed in "a_new_user@example.com/test_password" # features/step_def

combine jQuery statements -

i'm having brain dead kind of day , i'm trying figure out way make smaller , i've tried has not worked. know there has better way figured ask here. any tips on jquery caching great (i'm trying make 225 lines of jquery small possible can help! $(".tablemap td:nth-child(1)").attr("style","border-right:1px solid black; border-bottom:1px solid black;"); $(".tablemap td:nth-child(2)").css("text-align","center").attr("style","border-right:1px solid black; border-bottom:1px solid black;"); $(".tablemap td:nth-child(3)").attr("style","border-right:1px solid black; border-bottom:1px solid black;"); $(".tablemap td:nth-child(4)").attr("style","border-right:1px solid black; border-bottom:1px solid black;"); $(".tablemap td:nth-child(5)").attr("style","border-right:1px solid black; border-bottom:1px solid blac

asp.net mvc - How do I bind a model automatically in background without change action parameter? -

i have coded model binder return simple model. want bind model every controllers without change controller action parameters. there anyway it? thanks! a model binder associated given type. in application_start : modelbinders.binders.add(typeof(someviewmodel), new somemodelbinder()); this register somemodelbinder model binder controller actions take someviewmodel parameter. example: public actionresult foo(someviewmodel model) { ... }

facebook - Saving FB.api call's response to an array with a for loop with Javascript -

i'm trying code script 1) reads fb user ids text input fields & loops them array 2) calls fb.api each of ids first name , saves returned first name value array. problem: reason, first names received fb.api save same array index place 5. weird since loop should go indexes 1 4. <script type="text/javascript"> var ids = new array(); var names = new array(); var fields = 4; function firstnames() { var i; var k; (i=1;i<=fields;i++) { ids[i] = document.getelementbyid("field"+i).value; } (k=1; k<=fields; k++) { fb.api('/'+ids[k], function(response) { names[k] = response.first_name; alert(k+' test '+names[k]); }); } } </script> has ran similar? appreciated. thanks beforehand. read: javascript, node.js , loops see: experiment #7: closure new scope establishing new variable url: http://blog.mixu.net/2011/02/03/javascript-node-js-and-for-loo

.net - Display a dialogbox with a text input in C# -

possible duplicate: which control use quick text input (inputbox)? i need display dialog box contains input text let user type , press ok, can read typed text , other things. is there knows name of ? you can use inputbox vb6 referencing dll. here link on how in c#: http://www.codeproject.com/kb/edit/inputbox.aspx

android - Problem ending my game (UI Thread won't let me open a new Activity) -

i'm having trouble tying off program (ending up). have surfaceview in activity, , in surfaceview when lose 3 lives game supposed end. have tried opening new activity keydispatchingtimedout error. know has uithread. have been told create handler in activity , accessible surfaceview. can send message handler , can update ui(or launch new activity) in main ui thread. however...i have no idea how this! activity create handler in? 1 want launch new activity from? i'm lost here, , last piece need make program cohesive. if nothing else, how close activity? ui thread causing lot of problems :( surface view public class boardview extends surfaceview implements surfaceholder.callback{ context mcontext; // thread initialization private boardthread thread; thread timer; thread timer2; // box variables bitmap box = (bitmapfactory.decoderesource (getresources(), r.drawable.box)); private int box_x = 140; private int box_y = 378; private int boxwidth = box.getwidth(