Posts

Showing posts from February, 2011

iphone - How can i upload Photo from imagePickerController using ASIFormDataRequest? -

iphone - How can i upload Photo from imagePickerController using ASIFormDataRequest? - i utilize delegate of uiimagepickercontroller choosing photo , set server problem don't know how can using asiformdatarequest , don't know key should utilize info parameter? - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { nsstring *str = [nsstring stringwithformat:@"http://www.siteweb.com/api/v2/businesses/%@/pics.xml",entry.permalink]; nsurl *url = [nsurl urlwithstring:str]; asiformdatarequest *request = [asiformdatarequest requestwithurl:url]; request.delegate = self; [request startasynchronous]; [self dismissmodalviewcontrolleranimated:yes]; } like this: [request addfile:(nsstring *)filepath forkey:(nsstring *)key]; get image beforehand: uiimage *image = (uiimage *) [info valueforkey:uiimagepickercontrolleroriginalimage]; [uiimagejpegrepresentation(image, 1.0) writetofi...

php - measure relevance of a search term returned matched against results -

php - measure relevance of a search term returned matched against results - is there php or mysql function check how relevant matching field is? review string , match against percentage of characters? for illustration doing basic search script pulling results how can create more relevant results appear @ top? a lot depends on info , type of searches expecting. basically, looking fuzzy search. soundex , levenshtein distance 2 of many functions can utilize string matches http://php.net/manual/en/function.levenshtein.php php mysql

iphone - Is couchDB mobile stable or good to use in ios production app? -

iphone - Is couchDB mobile stable or good to use in ios production app? - we developing social news feed ios app, , need store lot of news feed items (image,text) , chat history items (audio or text message) offline use. since couchdb document database questions are: are there ios apps (in apple store) using database (couchdb mobile)? is couchdb mobile stable plenty use? how performance in ios? i have never been fan of thought you'd have total piece of database software running on mobile device. maybe in few years when there's more capacity. instead i've been much bigger fan of using browser's pre-existing storage containers. pouchdb great illustration of how work, still in development. depending on sensitivity , amount of info have, store info in localstorage. at end of day it's question of whether requiring total queryability locally on device. ie., need have indexes beingness built on phone? or can instead work database close device p...

c# - Writing file paths into XML file with XmlWriter -

c# - Writing file paths into XML file with XmlWriter - i'm hoping can help me annoying little problem i'm having. i'm trying write file path xml settings file, nil happens. don't error messages or in time debugging windows, doesn't execute code block. the programme feature 1 setup user accounts, , select file each account. if leave file paths blank, xml file created no problems. however, if there 1 path written file never gets created. here sample of function: private void savesettings() { xmlwritersettings xml_settings = new xmlwritersettings(); xml_settings.indent = true; xml_settings.indentchars = (" "); using (xmlwriter xml_settings_file = xmlwriter.create("settings.xml", xml_settings)) { xml_settings_file.writestartelement("main_node"); xml_settings_file.writeelementstring("settinga", properties.settings.default.settinga.tostring()); ...

msbuild - TFS Build: Files being packaged for certain configurations but not others -

msbuild - TFS Build: Files being packaged for certain configurations but not others - when utilize tfs team build compile , create deployment packages each of configurations project (dev, test, uat, live) (to necessary transformed web.config each environement). in order include files outside of project deployment bundle have added next in csproj file: <content include="filestoincludefolder\**\*" /> this works 1 of configurations. ie files included in 1 of packages. the difference between configuration works , 1 doesn't name , fact have different web.config transform each. ideas why happening? in log file created msbuild configuration acts correctly has our files listed under section collectfilesfromcontent: gather files project items @(content). adding: when doesn't work aren't. seems files within @content become different different configurations. why should be, there nil in our build process or csproj file treats them different...

c# - Using generic func signature -

c# - Using generic func signature - i implement simple (testing purposes only) in memory repository below. interfaces implements generic. 1 of methods "delete" used in sample code below. the cast of predicate throws exception. how can implement deleted method correctly? public class inmemoryreportingrepository : ireportingrepository { private readonly list<idto> m_dtos; public inmemoryreportingrepository() { m_dtos = new list<idto>(); } // ommitted stuff public void delete<tentity>(expression<func<tentity, bool>> predicate) tentity : class, idto { var delete = m_dtos.firstordefault((func<idto, bool>) predicate.compile()); m_dtos.remove(delete); } } try following: public void delete<tentity>(expression<func<tentity, bool>> predicate) tentity : class, idto { var compiled = predicate.compile(); var todelete = m_dtos.firstordefault(dto =...

Calling a Class function without using $this->function_name() -- PHP -- -

Calling a Class function without using $this->function_name() -- PHP -- - so have class: class a{ public function do_a(){ homecoming 'a_done';}; public function do_b(){ homecoming 'b_done';}; } so require php file , create instance of class: require_once("a_class.php"); $system = new a(); require_once("user_calls.php"); //here import user file function calls. user_calls.php contents: echo 'this result of '.$system->do_a(); echo 'this result of '.$system->do_b(); so, work, don't want user have utilize $system->do_a(); , do_a(); . any solutions? edit: want limit functions user phone call in user_calls.php file, basic native php functions , in class a. disclaimer: while code works, , requested, doesn't mean advocate coding this. it's hard follow other developers (and maybe in future...), , makes utilize of eval() , bad thing(tm). said, here go: <?php cla...

php - How can I set custom meta tags with the pdflib library? -

php - How can I set custom meta tags with the pdflib library? - i using pdflib library generate pdf in php. able create pdf library yet not able generate custom meta tags pdf. can 1 help me out this, i'm able generate meta tags pdf. thanks! try utilize pdflib plop can found on http://www.pdflib.com/products/plop/ with help of can set meta tags pdf. thanks! php pdflib

ASP.NET Custom Role provider: Role depending on the context? -

ASP.NET Custom Role provider: Role depending on the context? - i'm starting new project, , i've question custom role provider asp.net mvc 3. i need have role verification several actions of constructor, said me, okay easy, can utilize role provider. the problem role depending of current "context": in fact users in database linked several "entities", , have role "a" entity x, , role b entity y. info displayed/edited "childrens" of entity it's strictly separated: when log in, have take entity want work, , then, until inquire alter of entity, have info of entity , rights of entity. the current "entity" stored in session. the goal have no unauthorized menu/action entity x, because right allowed user y. the problem in role provider, i've no way receive context, receive username. so think do?(if can help, membership custom membership provider). to block access specific pages implement rolema...

c++ - Segmentation Fault on std::string -

c++ - Segmentation Fault on std::string - i running application stops @ 1 point because of segmentation fault. seek enlist enviroment: - application has class (generator) contains std::string fellow member (data ) , fellow member duly intialized "helloworld". - pointer of object passed fellow member function(send1) of class (product). seek print value of info within function gives segmentation fault. if seek print value of info before calling send1 function gets correctly printed. here gdb output : (gdb) br generator::test breakpoint 1 @ 0x80499ef: file ../app/generator/src/generator.cpp, line 58. (gdb) br product::send1 breakpoint 2 @ 0x804a17e: file ../app/configurator/src/product.cpp, line 43. (gdb) run [thread debugging using libthread_db enabled] [new thread -1208071520 (lwp 18389)] [switching thread -1208071520 (lwp 18389)] breakpoint 1, generator::test (this=0x9917020) @ ../app/generator/src/generator.cpp:58 58 cout << ...

.htaccess query regrading a sub-directory in URL and 404 error -

.htaccess query regrading a sub-directory in URL and 404 error - i have site installed on domain www.mydomain.com/alpha/ [directory can not changed now] problem 1: redirect request www.mydomain.com www.mydomain.com/alpha/ (once redirection takes place other links should not show alpha in url) problem 2: other links on site have alpha in url. there way remove alpha before user clicks on link. problem 3: have site hosted @ www.mydomain.com/alpha2/ should not affected. set next .htaccess , site throwing 404 error. rewritecond $1 !^alpha/ rewriterule ^(.*)$ /alpha/$1 [l] changing directory on site have improve performance. if cannot that, can seek adding next .htaccess in root dir of site. it assumes each site (alpha , alpha2) self contained i.e. resources (css, js etc) in alpha , alpha2 directories respectively. if not true, rules may need adjusting rewriteengine on rewritebase / ### first 301 redirect /alpha requests without alpha rewritecond %{the_requ...

ios - Swapping of images in ScrollView In Iphone -

ios - Swapping of images in ScrollView In Iphone - hi new iphone programming have scrollview , images on ,and want swap images in scrollview ,please help me out. look @ uiscrollview class reference , download scrolling.zip there.. iphone ios

Gtk menu with icons -

Gtk menu with icons - this critical part of run-time created menu: gtkwidget *menu, *menu_item; menu = gtk_menu_new(); menu_item = gtk_image_menu_item_new_with_label("uredi..."); //approach1 - icon don't work //gtk_image_menu_item_set_image(gtk_image_menu_item(menu_item), gtk_image_new_from_stock(gtk_stock_edit, gtk_icon_size_menu)); //approach2 - icon don't work gtk_image_menu_item_set_image(gtk_image_menu_item(menu_item), gtk_widget(gtk_image_new_from_stock(gtk_stock_edit, gtk_icon_size_menu))); gtk_menu_shell_append(gtk_menu_shell(menu), menu_item); g_signal_connect(g_object(menu_item), "button-release-event", g_callback(menu_release), (gpointer)""); gtk_menu_attach_to_widget(gtk_menu(menu), button, null); gtk_widget_show_all(menu); menu works ok 1 "imagemenuitem" on see label don't see image. can wrong here? gtk2, ubuntu 11.10 i'm not 100% sure, believe icons in menus , buttons no longer enabled defaul...

objective c - Change color of custom drawn UIView using block animations -

objective c - Change color of custom drawn UIView using block animations - i have uiview draws via drawrect. utilize core graphics , draw bezier curve. have animation changes color of bezier curve drawn on occasions. having color property , changing in animation block doesn't work. need ensure redrawn correctly. way this? i'm quite new ios i don't think can trying do. scheme has special code knows how animate changes in it's animatable properties, not back upwards animating changes other properties. to animate color change, you're going need utilize cashapelayer drawing. strokecolor , fillcolor properties of shape layers animatable. objective-c ios uiviewanimation

vb.net - Business Layer vs SQL Server -

vb.net - Business Layer vs SQL Server - i have application complex calculations members. each fellow member can have multiple states linked profile. each state has got different calculations each course of study fellow member completes. as of have been performing calculations in db (sql server 2008) , sending info app layer can see history , download certificate each course. i have business logic layer not lot happens there. know has been asked lot think should perform these calculations: business layer or database? going , forth!! i in sql server that: does lot of summing, counting, averaging etc. of info , returns single value. there's no point in transferring big volumes of info middle tier, sum column does lot of row / set-based manipulation; if need copy, insert, update lots of data, again, there's no point in dragging info middle tier , sending server - on server right go. also: t-sql faster in dealing set-based operations (like shuffling ...

c# - Prevent a text box from lagging due to fast updates -

c# - Prevent a text box from lagging due to fast updates - given next illustration code: new thread(() => { for(int = 0; < 10000; i++) { invoke((methodinvoker)() => { mytextbox.text += datetime.now.tostring() + "\r\n"; mytextbox.selectedindex = mytextbox.text.length; mytextbox.scrolltocarat(); }); } }).start(); when run code, after loop , thread terminate, text box still updating (presumably because of buffered invokes). application uses similar logic fill text box, , i'm having same problem. my question is: how can fill text box fast possible, still scroll bottom every time, , yet reduce/eliminate lag? there few options can take here. first, can set double buffering on form, end drawing updates on underlying bitmap, displays newly drawn image (instead of individually drawing controls on graphics object). saw 50% speed increment method. throw constructor: this.setsty...

windows - How to build installer of some files? -

windows - How to build installer of some files? - i have files on laptop, need build program.exe installer or program.msi installer. purpose is: -when pressing program.exe, must release 1 file c: disk, , other file desktop. how can it? can find program? thanks much! i utilize inno setup built installers. installers generated scripts. imagine yours small, specify source file , want installed, nail "compile" , it'll build installer you. windows installer

Set a 'www' on a WordPress subdomain OR how to tell Facebook that I've removed the 'www' subdomain -

Set a 'www' on a WordPress subdomain OR how to tell Facebook that I've removed the 'www' subdomain - i moved website wordpress multi site. introduction: because i'm using wordpress multisite, doesn't allow using "www" sub-domain. problem: because of lost "likes". how can i: tell facebook it's same page won't lose "likes"? or get wordpress multisite utilize "www" subdomain i've looked everywhere on internet, couldn't find reply subject. yes, know can't move likes 1 page other, removing wwww ? or how wordpress multi-site show website subdomain of www ? i'm not sure if helps facebook problem, should definitly redirect www.whatever.com whatever.com if moved site, peoples bookmarks, , google moved. the easiest way propably edit .htaccess file in root directory, redirect. there tones of online recources that: seek adding above wordpress stuff like: rewriteengine ...

c# - Is it possible to to access sms counter in windows phone 7 apps? -

c# - Is it possible to to access sms counter in windows phone 7 apps? - i want create windows phone 7.1 application display messaging counter. possible access messaging counter through apps? currently there no api's access sms in wp7 or 7.5 in future if ms shows mercy may possible. you can check link , vote sms access api's. c# windows-phone-7

Problems with sorting in XSLT 1.0 -

Problems with sorting in XSLT 1.0 - playing around in order larn xslt, have next xml file , xslt stylesheet. want produce list of players ranked after score 3*goals + 2*assists . <?xml-stylesheet type="text/xsl" href="player_ranking.xsl"?> <soccer xmlns="http://mysoccer.it"> <players> <player> <name>pelé</name> <goals>21</goals> <assists>9</assists> </player> <player> <name>beckenbauer</name> <goals>7</goals> <assists>18</assists> </player> <player> <name>spiderman</name> <goals>27</goals> <assists>38</assists> </player> <player> <name>hagi</name> <goals>13</goals> <assists>14</assists> </player> <pla...

c# - How does the debugger get type information about an object initialized to null? -

c# - How does the debugger get type information about an object initialized to null? - if object initialized null, not possible type information because reference doesn't point anything. however, when debug , hover on variable, shows type information. static methods shown, still, seems know type. in release builds. does debugger utilize other info reflection of sort find out datatype? how come knows more i? , if knows this, why isn't capable of showing datatype in nullreferenceexception ? it seems you're confusing type of reference type of value points to. type of reference embedded dll metadata , readily accessible debugger. there aditional info stored in associated pdb debugger leverages provide improve experience. hence null references debugger can determine info type , name. as nullreferenceexception . tell type on querying field / method ... possibly. i'm not familiar internals of part of clr there doesn't seem inherent reason why c...

javascript - Showing data after being submitted with ajax -

javascript - Showing data after being submitted with ajax - i trying display info after beingness submitted ajax. ajax works far when submitting, have refresh see it. here's jquery: $('#submit-quote').live("submit", function(){ var formdata = $(this).serialize(); $.post("add.php", formdata, function(data) { console.log("success"); }); homecoming false; }); the php in add.php: require('includes/connect.php'); $quote = $_post['quote']; $quotes = mysql_real_escape_string($quote); echo $quotes . "added database"; mysql_query("insert entries (quote) values('$quotes')") or die(mysql_error()); here's html/php utilize fetch info , display it: <?php require("includes/connect.php"); $result = mysql_query("select * entries", $link); while($row = mysql_fetch_array($result)){ ?> <div class="quote-wr...

java - Buttons Don't Initially Draw -

java - Buttons Don't Initially Draw - i'm having issue applet buttons not draw until mouse on them. remain after that, 1 time click one, go away again. here code: checkpanel = new jpanel(); buttonpanel = new jpanel(); buttonpanel.setlayout( new gridlayout( 1, 7 ) ); openadvancedsettings = new jbutton( "advanced settings" ); openadvancedsettings.addactionlistener( ); checkpanel = new jpanel(); checkvolt = new checkbox( "voltage", true ); checkv = new checkbox( "v gate", false ); checkw = new checkbox( "w gate", false ); checks = new checkbox( "s gate", false ); checkvolt.additemlistener( ); checkv.additemlistener( ); checkw.additemlistener( ); checks.additemlistener( ); checkpanel.setlayout( new gridlayout( 20, 8 ) ); checkpanel.add( butp ); checkpanel.add( prompt0 ); checkpanel.add( checkvolt ); checkpanel.add( prompt1 ); butt = new j...

javascript - Table row redirect using onclick attr -

javascript - Table row redirect using onclick attr - is possible redirect using tr attr "onclick" able go other page? i tried im having page error. <tr onclick="window.location = 'http://ubuntu.com'"> <td>some text</td> </tr> javascript html

iphone 4 UIAlertView setAlertViewStyle unrecognized selector sent to instance -

iphone 4 UIAlertView setAlertViewStyle unrecognized selector sent to instance - i used below code add together textfield in uialertview. works fine in simulator(ios sdk 5.0) when install in device(ios 4.0.1) "unrecognized selector sent instance error" uialertview *alert = [[uialertview alloc] initwithtitle:@"enter name" message:nil delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:@"ok", nil]; alert.alertviewstyle = uialertviewstyleplaintextinput; alert.tag = 9001; [alert show]; [alert release]; uialertview *myalert = [[uialertview alloc] initwithtitle:@"my test alert" message:@"what want" delegate:nil cancelbuttontitle:@"tell me" otherbuttontitles:@"cancel", nil]; [myalert addtextfieldwithvalue:@"nothing" label:@"say something"]; uitextfield * atextfld = [myalert textfieldatindex: 0]; atextfld.clearbuttonmode = uitextfieldviewmodewhileed...

.net - EF Code First mapping an internal association -

.net - EF Code First mapping an internal association - i have issue has me stumped. have model assembly , repositories assembly. model layer contains classes mapped our database dbcontext derived repositories in repositories layer. far these have come along without hitch. in model have 1 many association question 1 - * reply (question.answers , answer.question mapped navigation properties). have requirement mark question.answers internal not create sense outside of model. when create alter from: public virtual ilist<answer> ... internal virtual ilist<answer> ... exception: a specified include path not valid. entitytype repositories.question not declare navigation property name answers . first of all, exception odd references type repositories.question , not exist! should model.question . the model assembly has internalsvisibleto set repositories: [assembly: internalsvisibleto("repositories")] which means not compile errors in mapping code...

asp.net - jQuery submit form on linkClick event -

asp.net - jQuery submit form on linkClick event - form @using (html.beginform(new { id="form"})) { //fields} link <div align="center" id="submitlink">@html.actionlink("next", "address", "pes", new { abc= "xyz" }, null)</div> script $(function () { $("#submitlink").click(function () { $("#form").submit(); }); }); form not submitting when click next linkwhat doing wrong?? try set id on link instead of div: <div align="center"> @html.actionlink("next", "address", "pes", new { abc= "xyz" }, new { id="submitlink" }) </div> you should consider setting action , if needed controller form: @using (html.beginform("actionname","controller",formmethod.post, new { id="form"})) { } the overload of beginform you're using set routevalues id="...

java - How to determine if anything has been entered into the console window? -

java - How to determine if anything has been entered into the console window? - in java, i'm looking method allow me wait user press key before continuing (or if 1 not exist, i'm looking implement bufferedreader, if possible). how determine if user has typed any key - not enter? this similar console.readkey() in c#. you may seek jcurses. sample: public class test{ public static void main(string []args){ jcurses.system.inputchar ch; ch=jcurses.system.toolkit.readcharacter(); system.out.println(ch.getcode()); } } java

objective c - Why does a static library have a class with an init method? -

objective c - Why does a static library have a class with an init method? - when create new shared ios library coreservices there class created coreservices has init method. does mean every library somehow instantiated through object? if not object for? no isn't, that's template class that's created library. delete implementation file , utilize header public header library (i.e. import externally visible classes in header file). objective-c ios xcode shared-libraries

hadoop - standalone HBase instance decompressing and untar error -

hadoop - standalone HBase instance decompressing and untar error - tring start standalone hbase instance hbase-0.92.0.tar.gz.after set command tar zxvf hbase-0.92.0.tar.gz terminal shows names of files , shows files not exist.here snippet. hbase-0.92.0/lib/jaxb-api-2.1.jar tar: hbase-0.92.0/lib/jaxb-api-2.1.jar: cannot open: no such file or directory hbase-0.92.0/lib/activation-1.1.jar tar: hbase-0.92.0/lib/activation-1.1.jar: cannot open: no such file or directory hbase-0.92.0/lib/jackson-jaxrs-1.5.5.jar tar: hbase-0.92.0/lib/jackson-jaxrs-1.5.5.jar: cannot open: no such file or directory hbase-0.92.0/lib/jackson-xc-1.5.5.jar tar: hbase-0.92.0/lib/jackson-xc-1.5.5.jar: cannot open: no such file or directory hbase-0.92.0/lib/jersey-server-1.4.jar tar: hbase-0.92.0/lib/jersey-server-1.4.jar: cannot open: no such file or directory i have java 1.6 installed , have tried command $ sudo chmod 777 /hbase/hbase-0.92.0.tar.gz give permissions execute.i using ubuntu 10.04 on oracle ...

phpexcel - Extracting dynamically changing data in excel via php -

phpexcel - Extracting dynamically changing data in excel via php - i have open excel sheet that's beingness updated programme via dde. wish have php script accesses of info in excel sheet. have tried using phpexcel , seems cannot have changes create (e.g. via setcellvalue) beingness reflected in open excel sheet. similarly, if alter value of cell (without saving sheet file system) new value of cell not available via getvalue(). is functionality supported phpexcel? if so, please point me documentation shows how can done? alternatively, there way (not using phpexcel, example) this? thanks. i able using method shown @ the rarified blog webpage this worked me, both "pushing" cell values php excel, getting modified values (without saving file) excel perl. site has nifty ajax-based function keeps auto-refreshing webpage latest values in excel. many author of blog. php phpexcel dde

Can DirectX cause WPF applications to render very slowly? -

Can DirectX cause WPF applications to render very slowly? - suppose have directx game running in total screen , wpf application running in background; in addition, cpu isn't @ high levels, , game's frame rate (i.e., 60 fps). there might cause wpf application render slowly? (i.e., @ 3-5 fps) wikipedia says: "rather relying on older gdi subsystem, wpf utilizes directx." therefore, conclusion that, if directx busy rendering game, , graphic card pipelines full, wpf application have poor performance. admittedly have no knowledge of prioritization goes on behind scenes, i'm guessing background (that is, non active) window have less priority. wpf directx

Schedule Cron/Quartz job immediately -

Schedule Cron/Quartz job immediately - i want schedule job run 1 time server up, run once. not able find valid values same. tried this: 0/1 ? ? ? ? ? , nil seems getting scheduled. assuming right cron format quartz i.e <secs> <mins> <hrs> <dayofmonth> <month> <dayofweek> can help me out ? cron trigger overkill here, utilize simpletrigger instead: simpletrigger trigger = (simpletrigger) newtrigger() .startat(new date()) //now .build(); cron quartz-scheduler

python - random.shuffle Randomness -

python - random.shuffle Randomness - i trying write genetic algorithm homework solve travelling salesman problem. one of mutation functions i'm trying utilize random.shuffle on tour. when read documentation random.shuffle , see: shuffle(self, x, random=none, int=<type 'int'>) method of random.random instance x, random=random.random -> shuffle list x in place; homecoming none. optional arg random 0-argument function returning random float in [0.0, 1.0); default, standard random.random. could please explain function of "random" parameter in function? have read this question, doesn't reply question. i utilize function if can somehow command how random shuffling (if makes sense) the random argument used specifying (another) random number generator. it's function expected homecoming uniform random numbers in range 0<=x<1 if same number returned twice random number generator, shuffle same. example, def mynonra...

c# - How do you refill a byte array using SqlDataReader? -

c# - How do you refill a byte array using SqlDataReader? - this in reference to: byte[] , efficiently passing reference and sqldatareader found in post: getting binary info using sqldatareader inside loop, i'm calling database , returning big object ( varbinary[max] ). currently, i'm running outofmemory exceptions, i'm trying cut down footprint in big object heap (loh). so, i'm creating byte array largest file i'd download , adding padding in case. instance: byte[] currentfile = new byte[largestfilesize * 1.1]; i pass currentfile database method. currently, utilize enterpriselibrary access database: dbcommand storedprocedure = medicaredatabase.db.getstoredproccommand(spname); storedprocedure.commandtimeout = 5000; if (parameters != null) { foreach (param parameter in parameters) { if (parameter != null) { medicaredatabase.db.addinparameter(storedprocedure, parameter.parametername, parameter.dbtype...

testing - AutoIt best practices / coding style -

testing - AutoIt best practices / coding style - i maintain autoit project used automated testing of swing app. tests have 70 files. it's pretty hard maintain code without next "best practices" i'm trying create much functions possible (because of duplicate code) , constants (frequent changes) bud doesn't seem enough. i have types of functions: some general functions (insert text logging, select or read combobox.. ) some screen specific functions (fill 1 form.. ) some data/logic function - testing of app logic , info processing test case functions - combines previous 3 implement test scenario autoit not have classes => no inheritance => oop principles hard aplicate ( :d clearly) does have experince larger applications written in autoit? sentiment is, autoit scripts < 500 lines , wasn't selection big project. it's shame, autoit doesn't have useful ide. autoit developers want create sure functions written in autoit p...

iphone - How to create a "0000001" type number format? -

iphone - How to create a "0000001" type number format? - i want generate incremental receipt numbers format "00000001". every time new transaction happen, receipt number should increment 1. 0000001 0000002 0000003 0000010 0000011 0000100 0000101 so, how implement type of number format. there special number formats in objective c? if numbers integers , output matters, can do: nsstring * output = [nsstring stringwithformat:@"%07d", integer]; to have number formatted 7 digits, leading zeroes. iphone objective-c ios ios4

html - How do I make an entire - element a link? -

html - How do I make an entire <li> element a link? - so have bunch of tabs within of list element. i'm using ruby on rails in view, looks this: <div id="top-nav"> <ul> <li> <%= link_to "home", user_root_path() %> </li> <li> <%= link_to "manage", manage_path() %> </li> </ul> </div> and on. how style in css can click on box around text go link, instead of having click on text itself? i looked @ answers , tried using display:block; within top-nav , li element, hasn't been working. thanks! do following: - <li> tag should have 0 padding - <a> tag should have 0 margin - <a> tag should have actual padding html css

ruby - How do I remove HTML encoded characters from a string? -

ruby - How do I remove HTML encoded characters from a string? - i have string contains html encoded characters , want remove them: "&lt;div&gt;hi all,&lt;/div&gt;&lt;div class=\"paragraph_break\"&gt;&lt; /&gt;&lt;/div&gt;&lt;div&gt;starting today initiating pols.&lt;/div&gt;&lt;div class=\"paragraph_break\"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;please utilize next communication protocols:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. task breakup , allocation - gravity&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. mail service communications - bc messages&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. reports on poc / spikes: writeboard&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. non story related tasks: bc to-do&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5. ui , html communicated through ...

c++ - Friend Function calling Static Members of Derived Classes. Not getting expected output -

c++ - Friend Function calling Static Members of Derived Classes. Not getting expected output - my first post here :) i having problem next c++ code. have abc class a, , 2 derived classes b , c. of them have static fellow member called id: using std::cout; class { private: friend int bar(a& a); static const int id = 1; virtual void foo() = 0; }; class b : public { private : friend int bar(a& a); static const int id = 2; void foo() { /*do something*/ } }; class c : public { private: friend int bar(a& a); static const int id = 3; void foo() { /*do something*/ } }; int bar(a& a) { homecoming a.id; } int main() { b b; c c; cout << bar(b) << "\n"; cout << bar(c) << "\n"; homecoming 0; } i expecting code print out 2 , 3 - rather prints out 1 , 1 (bar() using a::id). doing wrong? ideas? based on comments below, final code using. works, love hear...

python - How to find tag with particular text with Beautiful Soup? -

python - How to find tag with particular text with Beautiful Soup? - i have next html (line breaks marked \n): ... <tr> <td class="pos">\n "some text:"\n <br>\n <strong>some value</strong>\n </td> </tr> <tr> <td class="pos">\n "fixed text:"\n <br>\n <strong>text looking for</strong>\n </td> </tr> <tr> <td class="pos">\n "some other text:"\n <br>\n <strong>some other value</strong>\n </td> </tr> ... how find text looking for? code below returns first found value, need filter fixed text somehow. result = soup.find('td', {'class' :'pos'}).find('strong').text upd. if utilize next code: title = soup.find('td', text = re.compile(ur'fixed text:(.*)', re.dotall), attrs = {...

java - Granting permissions in Liferay Document library -

java - Granting permissions in Liferay Document library - i have simple requirement , want advice on implementing best way in liferay. i using liferay document library. requirement grouping users different departments. (a, b , c). usera --> dept a userb --> dept b userc --> dept c the usera should have access directories belonging a usera can grant files access 'userb' or users in 'b' how should grouping users best way can grant these permissions. ! to give pointers: you can create organizations (departments) org a, org b , org c. then can assign users accordingly organizations. to restrict usage of directories or folders, can create organization-level-roles , assign them users. now can assign permissions created organization-level-roles different directories. hope helps. java permissions document liferay

Count same string count out of massive string list - c# -

Count same string count out of massive string list - c# - i have got on 600k lines of string. want grouping same strings , larn counts. so example i go school music games music music games music so result be i go school , 1 games , 2 music , 4 how can fastest possible way. c# 4.0 give thanks you. the groupby method want. you'll need strings in list or implements ienumerable<string> . file.readlines suggested spender homecoming ienumerable<string> reads file line line. var stringgroups = file.readlines("filename.txt").groupby(s => s); foreach (var stringgroup in stringgroups) console.writeline("{0} , {1}", stringgroup.key, stringgroup.count()); if want them in order of to the lowest degree (as in example) add together orderby ... foreach (var stringgroup in stringgroups.orderby(g => g.count())) ... c# string list grouping group

c# - Handle the httpmodule in iis -

c# - Handle the httpmodule in iis - if see yahoo site, when come in www.yahoo.com, yahoo server gets ip, , redirects specific domain (yahoo.ca,yahoo.us,....) now, want this,not special site, want request send iis (www.1.com,www.2.com,www.3.com) , algorithm, redirect user new site example: request: www.1.com go -> www.yahoo.com request: www.2.com go -> www.google.com .... i want handle iis, no each webconfig's site. can help me? implementing ihttpmodule can this, i've done similar (not exactly) next guide: http://www.stardeveloper.com/articles/http-module-to-redirect-requests-from-root-domain-to-www-subdomain/ and using page can find source country of request another solution in page c# asp.net

linq - ASP.NET MVC - Return a List, grouped by a property in my Model -

linq - ASP.NET MVC - Return a List, grouped by a property in my Model - how homecoming list, grouped property? in action, homecoming view so: return view(context.lines.where(x=>x.enquiryid == id).tolist()); this works fine, need grouping these lines particular vehicle. in lines table, has column stores vehicle id particular line linked too. example, line 1 , 2, may have vehicle id of 1, line 3 , 4 may have vehicle id of 2. do want grouping or order? because if result list of items, you'll want order them properly. var result = context.lines .where(x => x.enquiryid == id) .orderby(x => x.vehicleid) .tolist(); groupby returns list of lists: var result = context.lines .where(x => x.enquiryid == id) .groupby(x => x.vehicleid); linq asp.net-mvc-3

javascript - jQuery: set height of to height of all its children? -

javascript - jQuery: set height of <section> to height of all its children? - i have … <section class="cat"> <article class="layer"></article> <article class="layer"></article> <article class="layer"></article> <article class="layer"></article> </section> <section class="cat"> <article class="layer"></article> <article class="layer"></article> <article class="layer"></article> </section> and want set height of each section.cat height of children. wanna jquery i'm compatible in browsers. seems there no way pure css article.layer s set display:table … article.layer { position: relative; display: table; height: 100%; width: 100%; } so articles 100% height of current viewport body , html set 100% height well. right section.cat...

regex - .htaccess redirection not working perhaps missing regular expression -

regex - .htaccess redirection not working perhaps missing regular expression - i using next regular look in .htaccess file rewriterule ^js_embed/([a-za-z0-9\-_]+)/[0-9]+ /users/$1/js_embed_$2.html [r=301,l] basically trying is, redirect /js_embed/platform/37482 /users/$1/js_embed_$2.html however getting blank $2 value, mean expecting $2=37482 i missing in regular expression? are missing braces around [0-9]+ ? rewriterule ^js_embed/([a-za-z0-9\-_]+)/([0-9]+) /users/$1/js_embed_$2.html [r=301,l] regex .htaccess

ajax - jquery datepicker addclass to specific day after datepicker is initialized -

ajax - jquery datepicker addclass to specific day after datepicker is initialized - after jquery's datepicker initialized add together class ('active-day' ) 1 of specific dates based on separate ajax return. the problem i'm having it's easy load dates datepicker before initialized , td element has active-day class added on it, have ajax input on success needs add together active-day class day , i'm having hard time trying figure out how since td elements not seem distinct. likewise, have ajax calls may need remove active-day class specific day after datepicker has been initialized. any help appreciated. jquery ajax datepicker

Can I utilise cores in GPU from c# WITHOUT change to code? -

Can I utilise cores in GPU from c# WITHOUT change to code? - i realise there several questions on subject believe angle unique. i have mature c# app utilize scientific number crunching. in code start 24 c# threads on 24 hyperthread (i.e. have 2 cpus each 6 cores/ 12 threads) workstation. run windows 7 , handles brilliantly - able utilize total processing powerfulness work done. i see gpus advertise "448 cores". if bought 1 of these c# app able utilise them? mean without rewriting code in major way. threads start taken gpu cores instead of cpu hyperthreads case now? follow on question hi, appreciate answers getting - if negative. is there other hardware should thinking (not expensive) give me big number of cores, able run c# code without rewrite? heh... no. no way no how. "cores" aren't same. take advantage of gpu computing, need write computations in specific way. seek opencl maybe. reply question no. as edit, possible thing few ...

Android 3.0 - How to retrieve ALL contacts via ContactsContract -

Android 3.0 - How to retrieve ALL contacts via ContactsContract - i working on android honeycomb (v3.0) application has requirement of displaying contacts stored within google business relationship registered on device. 1 of problems having can retrieve contacts available within "my contacts", "starred in android", , "other contacts". able retrieve contacts "directory". believe "directory" section feature provided google organizations , companies wish provide directory of members/employees within domains others. please see screenshot below: so far, have next line in manifest file: <uses-permission android:name="android.permission.read_contacts" /> i have tried using code: cursor cursor = getcontentresolver().query(contactscontract.contacts.content_uri, null, null, null, null); while (cursor.movetonext()) { string name = cursor.getstring(cursor.getcolumnindex(contactscontract.contacts.display_nam...

java - Getting jdbc4.communicationException from SQL -

java - Getting jdbc4.communicationException from SQL - we have jar running on different machines (all machines connected in lan)and jar populating info stored on individual (localhost) machine's db.... after hours machines getting next exception @ same time.... i'm not understand how deal it, please help me out of this... in advance.... com.mysql.jdbc.exceptions.jdbc4.communicatinsexception: lastly packet received server 43,223,652 milliseconds ago. lastly packet sent server 43,223,657 milliseconds ago. longer server configured value of 'wait_timeout'. should consider either expiring and/or testing connection validity before utilize in application, increasing server configured values client timeouts, or using connector/j connection property 'autoreconnect=true' avoid problem. @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl....

How can i get the status of a column using JQuery? -

How can i get the status of a column using JQuery? - i mean, there way know if column hidden? learned hide them $('#tableg td:nth-child('+(index+1)+'), #tableg th:nth-child('+(index+1)+')').hide(); but need status, there like: if($('#tableg th:nth-child('+(index+1)+')').show() == true) { ... } you want utilize kind of notation: $(element).is(":visible") so: if($('#tableg th:nth-child('+(index+1)+')').is(":visible")) {...} jquery

php - Prevent Cookies from being edited -

php - Prevent Cookies from being edited - there many ways users can edit content of cookies. on website, have cookie called "user" stores username user logged in with. however, noticed cookie can edited log in account. there code or parameter can add together setcookie() function, blocks users doing editing cookie? no, cookie stored on client's machine , client has access it. suggest storing hash instead of user's business relationship name. take hash cookie , retrieve username info storage, if hash has been manipulated won't proper username , know need them log in 1 time again , create valid hash in cookie. php cookies

c++ - What is the best way of project's organization? -

c++ - What is the best way of project's organization? - i need develop simple portable c++ programme billing_unit. reads parameters (telefone number, etc.) , returns cost of phone call , rest of free minutes. i decided info billing_unit standart input, , output result standart output. i developed 2 test units: test_unit_source , test_unit_destination. i decided organize consecutive performing of programme units: test_unit_source: reads info database , puts standart output; billing_unit: reads standart output previous unit, calculates phone call costs , rest of free minutes, outputs result. test_unit_destination: reads phone call costs , rest of free minutes, stores database. test_unit_source | billing_unit | test_unit_destination simplified test_unit_source: #include <stdio.h> #include <iostream> #include <fstream> #include <string> #define success_result 0 #define error_result 1 using namespace std; int ma...

Python card game error -

Python card game error - well script runs i'm not getting error's , it's not working right. more specificly, programme supposed deal out cards, create dictionary gives each card value depending on rank , suit. cards shuffled, dealt , sorted. ever has 3c starts first. how computer supossed pick card goes through list of cards , if finds 1 has higher value previous card, plays it. works if play card (usually t(10) or higher) doesn't work, computer plays card worth less. reading :d import random class player(): def __init__(self, hand, name): self.hand = hand self.passed = false self.name = name #computer ai playing def complay(player): if '3c' in player.hand: playcard(player, '3c') homecoming else: print previous[-1] in player.hand: if > previous[-1]: playcard(player, i) homecoming else: print ...

php - Are there no class aliases in Doctrine2? -

php - Are there no class aliases in Doctrine2? - something this: user: targetentity: user inversedby: posts joincolumn: name: user_id referencedcolumnname: id deleter: targetentity: user joincolumn: name: deleter_id referencedcolumnname: id above have 2 relationships class user, wondering if targetentity: deleter user so want deleters users? might go single table inheritance in case. you'll need add together discriminator column. another mutual approach modeling roles user may have in application have user_type table or similar. define many-to-many listing out roles each user has. times these tied privileges , have found hierarchical relationships between said roles, gross generalization. php orm doctrine2