Posts

Showing posts from June, 2014

ASP.net session request queuing -

it seems me asp.net queues requests use same session id. let's you've got 3 pages. default.aspx protected void page_load(object sender, eventargs e) { session["asdf"] = "lolz"; } hitting page create new session if 1 doesn't exist. x-aspnet-version: 2.0.50727 set-cookie: asp.net_sessionid=ibjphuv0aiafqi453tyze345; path=/; httponly then hit hang.aspx protected void page_load(object sender, eventargs e) { thread.sleep(10000); } and after hit other page session id passed to, doesn't matter if anything, let's call test.aspx. the sequence loading so. request timeline "get /" |*| "get /hang.aspx" |******************************************| "get /test.aspx" |**************************************| i guess question how disable feature. understand it's useful have session state can more predictable, in case long running reports page load killing users&

iphone - UITableView (not using Navigation Template) getting specific data from plist -

i'm using example on page 210 of beginning iphone development (exploring iphone sdk) book , it's similar want specific example complicated using sections in tableview. have specific hierarchy in plist... root ---- dictionary rows ---- array item 0- dictionary fullname ---- string address ---- string item 1 ---- dictionary fullname ---- string address ---- string so have uitableview takes small portion of view on "screen" rest of view has other elements chose nut use navigation template. the code i'm using doesn't match because i'm not clear on calling fields. can show me simple example how list "firstnames" in table. if wrong plist please let me know change. in nutshell want loop through item # dictionaries list first names. design similar contact list, not contact list. right i'

list - jQuery UI: Drag Sortable from within Accordion to Outside -

i have 2 sortable lists connected. 1 on page, other within accordion. (i'm using accordion container other list) my goal such user can open accordion , pull items out of list , onto page. it works - except placeholder disappears upon leaving accordion. i've tried helper: 'clone' , increasing zindex. here simplified version of code: <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $( "#inside" ).accordion({ collapsible: true, fills

isbn - adding page number to barcodes -

i genealogy research. have books information on many pages. there way me use book isbn , associate particular page? may find many references different individuals in same book. copy page, able print isbn number of source , include page number. i think going have clarify question preferably code showing have far. barcodes serial numbers, there no reason can't combine isbn + page number barcode , print out.

java - Eclipse "Permission denied" error when trying to launch app -

i'm trying started creating apps android keep running eclipse error: nand: not read file...android-sdk_r07-windows\android-sdk-windows/platforms\android-7\images/system.img, permission denied. do think should delete package , re-install? i'm wondering whether corrupted file, although says "permission denied" makes me think not so. installed plugin eclipse , created emulator can't run because of error. i have googled searched , not find relevant answer. greatly appreciated. :) this looks file locking in windows. download unlocker windows , check processes have lock on folder mentioned. happens when run emulator in command line?

php - Is it possible to post values to external javascript file? -

hay, i wondering if it's possible execute php code in external javascript file? example need read user language , such. you can run php in js file if add php handler text/javscript . <files *.js> addtype application/x-httpd-php .js </files> be sure have javascript file identify with... header('content-type: text/javascript'); but... as can imagine, every javascript file running through php isn't idea. so i , use, this... <script type="text/javascript"> var lang = '<?php echo $lang; ?>'; </script> <script type="text/javascript" src="/js/common.js"></script> then inside of common.js , can access lang variable.

jQuery: $("#myid").html('<span id="inserted">inserted portion</span>') -

say doing following manipulation using jquery: $("#myid").html('<span id="inserted">inserted portion</span>') after doing operation, if view page source, inserted portion of html (the span tag id "inserted") not available there , further operation $("#inserted") fails! this becomes major issue when update (we use jquery html() method insert new parts) part of page ajax call , try more operations in updated part. please explain missing? whatever events binding id inserted ....use live , bind future html elements or html added @ runtime http://api.jquery.com/live/ $('#inserted ').live('click', function() { // live handler called. });

linux kernel - Can I printk in binary? -

i have bitmap need debug, , easier me printk number in binary rather decimal. can this? there function print binary value in arch/parisc/kernel/traps.c , called printbinary() . can copy code (or link if happen on parisc). better still move somewhere generic in kernel tree, eg. lib , , send patch lkml.

jquery - How to redirect on particular url in ajax -

i validating login form using ajax call. working great when enter wrong information. if enter right credentials nothing happens. confused do? sample code: $.ajax({ type: 'post', url: url +'/foo/', data: {'uname': name, 'password':pass}, success: function(data) { if (data["success"] === "false") { //show message $("#password").val(""); } else { // here want redirect url say, /bar/ confused how it. }, datatype: "json", }); return false you can use javascript. location.href="new url"; it take new url var querystringparam="sample"; var tempurl="http:

c# - Error: Deleted row information cannot be accessed through the row -

to whom may concern, have searched considerable amount of time, work way out of error "deleted row information cannot accessed through row" i understand once row has been deleted datatable cannot accessed in typical fashion , why getting error. big issue not sure desired result, outline below. basically when row in "dg1" deleted row beneath takes place of deleted row (obviously) , inherits deleted rows index. purpose of method replace , reset rows index (via grabbing corresponding value in dataset) took deleted rows place , such index value. right using label (lbltext) try , response process, crashes when last nested if statement trys compare values. here code: void dg1_click(object sender, eventargs e) { rowindex = dg1.currentrow.index; //gets current rows string value = convert.tostring(dg1.rows[rowindex].cells[0].value); if (ds.tables[0].rows[rowindex].rowstate.tostring() == "deleted") {

iphone - Restrict user from switching to video mode -

i have requirement in application in when choose take photo option,he should allowed capture photo , cannot switch video mode. , same choosing photo photolibrary should allowed choose available photos, should not allowed choose video.how can restrict user doing this? mode should set in source type it. take @ mediatypes property of uiimagepickercontroller . depending on media types assign property, picker displays dedicated interface still images or movies, or selection control lets user choose picker interface. before setting property, check media types available calling availablemediatypesforsourcetype: class method. if set property empty array, or array in none of media types available current source, system throws exception. when capturing media, value of property determines camera interface display. when browsing saved media, property determines types of media presented in interface. by default, property set single value kuttypeimage, designates

iphone - UIButtonType issue -

i have created uibutton passing integer value this. uibutton* custom_newbackbutton = [uibutton buttonwithtype:101]; [custom_newbackbutton addtarget:self action:@selector(backbuttonaction) forcontrolevents:uicontroleventtouchupinside]; [custom_newbackbutton settitle:@"back" forstate:uicontrolstatenormal]; uibarbuttonitem* newbackbutton = [[uibarbuttonitem alloc] initwithcustomview:custom_newbackbutton]; [[self navigationitem] setleftbarbuttonitem: newbackbutton]; in of classes works of classes fails "invalid conversion int uibuttontype". recommended way handle this. have use 101 button , feel. regards, dilshan the following button types officially documented in apple documentation material: typedef enum { uibuttontypecustom = 0, uibuttontyperoundedrect, uibuttontypedetaildisclosure, uibuttontypeinfolight, uibuttontypeinfodark, uibuttontypecontactadd, } uibuttontype; enjoy! please avoid using direct values. values of c

plist - UITableView (NOT using Navigation Template) or AppDelegate to DetailView -

i'd display details view select row event on uitableview sitting on regular view. somehow imagine selectedindex , detail view can have value passed in view. i'm thinking out loud , mindset of web era programmer. tableview gets it's data plist. code samples out there great doubt there any. i've search 3 days trying find one. thanks it's impossible. surrendered , started navigation template. smooth silk.

linux - python executable -

is possible create python executable targeted linux, mac os x? pyinstaller seems @ stage, , don't know else. thanks there tool can run on single os , make executables different oses. need compilation every os on (virtual)machine have installed. fox os x can check py2app in http://undefined.org/python/

c++ - Can't access vector element? -

Image
i have code vector <int> a[100001]; a[1].push_back(1); if( a[1][0] == 1) cout<<"ok!"; but when try access a 1 [0] says: cxx0058: error: overloaded operator not found full code: #include<stdio.h> #include<vector> using namespace std; file *f=fopen("chei.in","r"); file *g=fopen("chei.out","w"); int t[100001],n,x,nr,k,d; vector <int> a[100001]; int main(){ fscanf(f,"%d",&n); for(int i=1;i<=n;++i) { fscanf(f,"%d",&x); for(k=0;k<a[i].size();++k){ if( a[i][k]== x) break;} if(k==0 || ( k==a[x].size() && a[i][k] == x )){ t[i]=x; a[x].push_back(i); } } for(int i=1;i<=n;i++){ if(t[i]==i || t[i]==0) nr++;} fprintf(g,"%d",nr); return 0; } here's screenshot of watch: there doesn't seem wrong code. thought meant co

c# - Exception handling within a LINQ Expression -

i have simple linq-expression like: newdocs = (from doc in alldocs getdocument(doc.key) != null select doc).tolist(); the problem is, getdocument() throw exception. how can ignore doc-elements getdocument(doc.key) == null or throws exception? the same code in old school looks like: foreach (var doc in alldocs) { try { if (getdocument(doc.key) != null) newdocs.add(doc); } catch (exception) { //do nothing... } } alldocs.where(doc => { try { return getdocument(doc.key) != null; } catch { return false; } }).tolist(); i'm not sure it's possible using query comprehension syntax, except via baroque atrocity this: newdocs = (from doc in alldocs ((predicate<document>)(doc_ => { try { return getdocument(doc_.

c - storing characters in EEPROM & echoing back -

am trying write program avr stk600 board in cycling through leds. when switch pressed, appropriate leds turns on (upto point, goes well). adding functionality board, trying use usart (rs232 serial communication). -when user presses key, should echoed (on hyperterminal). -when crtl-z hit, data should recorded in eeprom (again hitting crtl-z should stop recording). -when crtl-y pressed, recorded data should played back. the problem here getting usart (i did check hardware settings, did loopback test...everything working well) there should problem code. upto toggling leds goes after eeprom, usart not going well. here code, using avr-gcc. not using "avrlib" because course taking doesn't allow so: #include "header.h" #define base_addr 0x20 #define read_atmega(addr) *((p_char)(base_addr + ((addr) * addr_multiplier))) #define write_atmega(addr, data) *((p_char)(base_addr + ((addr) * addr_multiplier))) = data #define led_delay 10 #define f_cpu

winforms - How can I scroll to a specified line number of a RichTextBox control using C#? -

how can scroll specified line number of richtextbox control using c#? it's winforms version. you can try this. void scrolltoline(int linenumber) { if (linenumber > richtextbox1.lines.count()) return; richtextbox1.selectionstart = richtextbox1.find(richtextbox1.lines[linenumber]); richtextbox1.scrolltocaret(); } this not work if have lots of repetition within richtextbox. hope might of use you.

junit - unit testing action classes -

how unit test action classes ? frmework mock runner allows test action class. action class calling service class , service class in turn calls dao class..how resolve issue ? you need stub/mock service classes used action class. let's have action class parses input, chooses appropriate service, makes call , give answer. need create dummy-service, inject action object , tests. mocking frameworks creating dummy services.

java - Ant target to move directories out of another directory -

how move directories 1 directory using ant task? my directory structure like: my/directory/root |-dir1/one/same/lib |-dir2/two/same/lib |-dir3/three/same/lib |-dir4/four/same/lib and move , scale folders "same/lib" , move "my/directory/root" (finally: my/directory/root/same/lib) something should work: <target name="movedirs"> <mkdir dir="my/directory/root/merged" failonerror="false"> <move todir="my/directory/root/merged"> <fileset dir="my/directory/root"> <include name="dir*/*"/> </fileset> <mapper> <regexpmapper from="^(.*?)dir[0-9]+.(.*)$" to="\1\2"/> </mapper> </move> </target> reference: <move> task mapper type

ios - Getting Again the Message To Allow or Not the User Location into the iPhone Simulator -

i testing iphone simulator , want message allow or not user location. problem have clicked once (to test it) no button not show message again checked. how can again? thanks reading. now have answer problem. ios simulator, have click under "ios simulator" window menu , choose "reset content , settings" options.

c# - How to validate if a collection contains all unique objects -

i have c# collection of objects not implement iequatable or icomparable. want check if collection contains duplicate objects. i.e. want know if object.referenceequals(x, y) false x , y in list. how efficiently? it nice both c# , linq method. non-linq, when collection implements icollection<t> or icollection : bool allitemsunique = new hashset<yourtype>(yourcollection).count == yourcollection.count; non-linq, when collection doesn't implement icollection<t> or icollection . (this version has better theoretical performance first because break out duplicate found.) bool allitemsunique = true; var tempset = new hashset<yourtype>(); foreach (yourtype obj in yourcollection) { if (!tempset.add(obj)) { allitemsunique = false; break; } } linq. (this version's best case performance -- when collection implements icollection<t> or icollection -- same first non-linq solution. if collection doesn'

How to mix different types of views in spring configuration? -

greetings using jsp view technology in web app <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix" value="/web-inf/views/"/> <property name="suffix" value=".jsp"/> </bean> and want use velocity view technology in sending emails , want configure in xml file, don't know how ? any ideas how ? if want use velocity construct emails, not "view", far spring mvc concerned. views , viewresolvers used render output browser. spring mvc provide support using velocity view layer, isn't relevant you're trying do. however, spring provides support classes make clunky velocity api bit less awkward use (see javadocs ). these have no relation spring mvc view layer, though. use them directly code, building emails , sending them.

javascript - how can i load an iframe using jquery? -

i have problem want load iframe, when insert iframe in page, browser still loads iframe i.e firefox still shows loading bar in top of browser. i.e. $('.data').html('<iframe src ="http://www.muna-abigail.com" width="100%" height="700" frameborder="0"></iframe>'); this still requires browser load, want load using jquery, gives feeling still instant, rather have own loading bar trigger 1 in browsers :)) you can't. browser show loading thing when accessing data external sources. way not show loading thing use ajax (the xmlhttprequest object or activexobject ie).

java - first 64 bits of the fractional part of the square root of 2 -

double i=math.sqrt(2); double fpart=i-(long)i; string s=string.valueof(fpart); s=s.substring(2, s.length()-1); long b=long.parselong(s); system.out.println(long.tobinarystring(b)); system.out.println(long.tobinarystring(b).substring(0, 63)); i'm getting stringindexoutofboundsexception strig 52 bits long. but, want first 64 bits of fractional part of square root of 2. unfortunately, forgot 1 important thing. a 64-bit double made 52 bits of fraction , exponent that why binary string long 52 bits. further reading: http://en.wikipedia.org/wiki/double_precision_floating-point_format in order first 64 bits, might try maths library performs multi-precision operations , result. don't worry. no -1 question, reasonable, shows didn't study homework :) (or asleep during class). bye.

Is it possible to enable TrafficStats on android emulator? -

i'm trying total number transmitted bytes device (using getmobiletxbytes() . the number i'm getting method call in emulator -1 (which means method not supported on device). there way make emulator return reasonable number here? best number increase i'm browsing web in emulator. from @ stock android source code (/frameworks/base/core/jni/android_net_trafficstats.cpp), class pretty dumb, has network device names hard-coded inside, , looking @ "rmnet0" , "ppp0" only, mobile device names. not going detect network traffic in emulator, unfortunately.

iphone - Selector of one item of UIToolbar doesn't work -

read following code: // creiamo la toolbar sotto uitoolbar *toolbar = [[uitoolbar alloc] initwithframe:cgrectmake(0, 372, 320, 44)]; toolbar.tintcolor = [uicolor blackcolor]; uiimageview *imageview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"imgimpostazionitoolbar.png"]]; uibarbuttonitem *pulsanteimpostazioni = [[uibarbuttonitem alloc] initwithcustomview:imageview]; [pulsanteimpostazioni settarget:self]; [pulsanteimpostazioni setaction:@selector(prova)]; [imageview release]; uibarbuttonitem *spaziatore = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemflexiblespace target:nil action:nil]; nsarray *buttons = [[nsarray alloc] initwithobjects:spaziatore, pulsanteimpostazioni, spaziatore, nil]; [toolbar setitems:buttons animated:no]; [self.view addsubview:toolbar]; [buttons release]; i can see correctly image when try touch nothing happen. didn't set correctly selector of "pulsanteimpostazioni"

c# - ASP.NET MVC3 Html.EditorFor() problem -

i try bind data model html.editorfor() helper , submit, model come controller null. here code of model: public class logonmodel { [localizedrequired] [localizeddisplayname("user name")] public string username { get; set; } [localizedrequired] [datatype(datatype.password)] [localizeddisplayname("password")] public string password { get; set; } [localizeddisplayname("remember me")] public bool rememberme { get; set; } } this cshtml: @model models.logonmodel { view.title = "log on"; } @using (html.beginform()) { @html.editorfor(m => m.username); @html.editorfor(m => m.password); <input type="submit" value="logon" /> } and html code generate this: <input id="username_username" name="username.username" type="text" value="qwerty" /> <input id="password_password" name="password.password&quo

java - JAX-RS: Resolve URI of Linked Resources on the Server -

is there standard way (jax-rs) resolve rest uris resources on server side? understand common practices, it's best provide full uri identifier resources. if want allow post/put document create/change product: <product> [...] <categories> <category>http://.../rest/categories/12</category> <category>http://.../rest/categories/35</category> </categories> </product> as can see, references categories resource uris. on server side have resolve these uris corresponding resources. simplest approach create client service on server , standard request on these uris. feel shouldn't necessary. is there standard way this? there cxf way this? better provide additional id well? thanks. dominik i think looking - http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/core/resourcecontext.html it not cxf or jax-rs jersey. used parse documents in example. inject using @context resou

(drupal 6) how to disable admin login by modify file in server? -

in drupal site, admin user name admin . im worried brute force account. i hope when logged out using admin user name, can temporarily disable admin user name modify file in server through ssh you rename admin account going " user/1/edit " (or using users list), , change "admin" else. still seen internally super-admin account, yet people won't able login using name "admin" if try brute-force it.

java - Use of Stanford Parser in Web Service -

i need use stanford parser in web service. sentenceparser loads big object, make sure singleton, in case, thread safe (no according http://nlp.stanford.edu/software/parser-faq.shtml ). how else done efficiently? 1 option locking object while being used. any idea how people @ stanford doing http://nlp.stanford.edu:8080/parser/ ? if contention not factor, locking (synchronization) 1 option mentioned, , might enough. if there contentions, however, see 3 general options. (1) instantiating every time just instantiate local variable every time perform parsing. local variables trivially safe. instantiation not free of course, may acceptable depending on specific situation. (2) using threadlocals if instantiation turns out costly, consider using threadlocals. each thread retain own copy of parser, , parser instance reused on given thread. threadlocals not without problems, however. threadlocals may not garbage collected without being set null or until holding thread g

silverlight - MyGroups not implemented in Communicator.UIAutomation -

i'm working on out of browser silverlight app provides ms office communicator 2007 controls. i'm using automation sdk . docs installed sdk state there's mygroups property in imessenger2 interface, return groups user has defined, when try use it, notimplementedexception . here's code i'm using: dynamic communicator = automationfactory.createobject("communicator.uiautomation"); communicator.autosignin(); foreach (dynamic g in communicator.mygroups) { //do group } if replace mygroups mycontacts, can contact list fine. have different access properties in imessenger2 interface? i've seen few things on web mygroups deprecated windows messenger, docs, seems should available ms office communicator. if can't use mygroups, there way groups user has created? the problem here mygroups property marked notscriptable, meaning can't call in way doing i.e. using automationfactory. security reasons, properties , methods in automation

asp.net - Why can't my app load MvcApplication? -

i having trouble running asp.net mvc 2 app. using vs2010 asp.net development server. error displayed in browser: server error in '/' application. parser error description: error occurred during parsing of resource required service request. please review following specific parse error details , modify source file appropriately. parser error message: not load type 'prototypeb.mvcapplication'. source error: line 1: <%@ application codebehind="global.asax.cs" inherits="prototypeb.mvcapplication" language="c#" %> source file: /global.asax line: 1 version information: microsoft .net framework version:4.0.30319; asp.net version:4.0.30319.1 global.aspx.cs: namespace prototypeb { public class mvcapplication : system.web.httpapplication { ... please copy paste namespace in global.asax file, right click on global.asax , choose 'view markup' see it https://forums.asp.net/t/1559469.asp

user interface - Resizing componenets on a c# form -

typically in java if have layout manager of somesort, when resize page components in panel resize accordingly. think app missing sort of layout manager control resizing @ moment static is there way make resize on changing of form size? user makes page bigger, componenets adjust , on. thanks .net has layout managers well. personally, prefer tablelayoutpanel winforms apps. once layout table (using combination of static/dynamic sized rows/columns) add child controls table cells. once add controls, can dock or anchor controls cell automatically adjusted when window re-sized.

WPF 2 Grid - hide 1 and the other should expand -

Image
i have following form. these rows reside in grid , darker blue areas, section 1 , section 2, grids themselves. how have grid 2 expand , fill row when grid 1 has been collapsed? attempted stackpanel moved grid 2 , left same size. i'd when grid 1 has been collapsed: any suggestions on how this? thanks again! you need make sure grid2 set fill available space. if have 1 grid contains grid1, grid2, , else, make sure rowheight row containing grid2 set * , else set auto: <grid name="maingrid"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> <rowdefinition height="auto"/> </grid.rowdefinitions> <grid name="grid1" grid.row="0"/> <grid name="grid2" grid.row="1"/> <grid name="everythingbelow" grid.row="2"/> <grid>

python - Solve this equation with fixed point iteration -

how can solve equation x 3 + x - 1 = 0 using fixed point iteration? is there fixed-point iteration code (especially in python) can find online? using scipy.optimize.fixed_point : import scipy.optimize optimize def func(x): return -x**3+1 # finds value of x such func(x) = x, is, # -x**3 + 1 = x print(optimize.fixed_point(func,0)) # 0.682327803828 the python code defining fixed_point in scipy/optimize/minpack.py. exact location depends on scipy installed. can find out typing in [63]: import scipy.optimize in [64]: scipy.optimize out[64]: <module 'scipy.optimize' '/usr/lib/python2.6/dist-packages/scipy/optimize/__init__.pyc'> here code in scipy 0.7.0: def fixed_point(func, x0, args=(), xtol=1e-8, maxiter=500): """find point func(x) == x given function of 1 or more variables , starting point, find fixed-point of function: i.e. func(x)=x. uses steffensen's method using aitken's del^2 c

xml - What is the most prevalent, stable and future ready B2B protocol (preferably open)? -

i have been asked tie in ariba's punchout client's supplier our procurement system. procurement module small part of java ee application running on jboss. poking around last couple days seem cxml punchout implementation pretty popular doesn't make correct. nervous implementing proprietary 'protocol' putting lightly. since 1 client's 1 vendor pushing this, still have lot of latitude. i've been kind of thrown space. considered industry b2b standard kind of thing? there existing or emerging more open standard b2b transactions? popular modern approach kind of problem? most legacy systems use edi on van , still used majority of vendors. standards body developed these standards developed xml dialect of edi .

wcf - Populating a combo box in Infopath from a webservice -

aim: create infopath form displays list of companies in combo box , displays additional information when company selected. the data served wcf webservice talking sql server backend. in theory should able use stored procedure (and associated methods in webservice) list of companies , associated ids, populate combo box in infopath, link selection of company name id , pass id on stored procedure return additional information. however, when try wire webservice method return companies, can't plug company name field single combo box data returned repeating. am doing wrong? should use single method returns company information (there's 700 or so) , create filter on company name field instead? the combobox returns 1 single company id. id can used search company name in company list returned webservice. can without coding: create rule 'companyidchanged' on combobox. create action 'set fields value' rule. set form field 'companyname' value &

Wpf - Edit Resource in run time -

i have xaml: <grid x:name="root"> <grid.resources> <style x:key="btnstyle"> <setter property="button.background" value="lightblue"/> </style> </grid.resources> <button style="{dynamicresource btnstyle}"></button> </grid> and question how can change btnstyle setter value red code behind? this direct answer question: var style = (style) this.root.findresource("btnstyle"); style.setters.item[0].value = brushes.red; but trying accomplish exactly?

winapi - Combine x86 and x64 executables in single executable (like Sysinternals tools) -

Image
i writing visual c++ program in pure win32 api. per understanding, need separately compile , generate executable x86 , x64 architecture. how combine them single executable , emit x64 @ runtime? have seen sysinternals tools doing same , don't know how done programmatically. do have include x64 version resource x86 , write filesystem , createprocess ? any pointers ? yes, embed operating specific driver resource. here's screenshot visual studio after using file + open + file open handle.exe utility: not sure looks cover windows 9x, 32-bit , 64-bit. next thing they'd use resource api functions (findresource, sizeofresource, lockresource) , writefile() resource content file in writable directory. load driver createservice , startservice. the main program x86 runs on version of windows. generating binaries @ runtime isn't customer friendly thing btw, (and virus scanner) know came where.

PHP MySQL insert not working -

sorry if it's quite simple problem. not experienced web languages. basically, doesn't work. $insert= ( "insert phpbb_members ". "(emailaddress, uid, valid, firstandlast, propic, membername) ". "values ($me['email'], $uid, 1, $me['name'], $propic, $newuser)" ); mysql_query($insert) or die('error, insert query failed'); i think problem may in way you've laid out information inserted. this should work: $insert=("insert phpbb_members (emailaddress, uid, valid, firstandlast, propic, membername) values ('$me[email]', '$uid', '1', '$me[name]', '$propic', '$newuser')"); mysql_query($insert) or die('error, insert query failed'); hope helps! edit: i'm pretty sure information inserted has inside ' ' .

php - Building web pages on the server-side or client-side? -

i've wondered how decide on choosing between using server-side code versus client-side code build html pages. i'll use simple php vs javascript/jquery example further explain question. advice , comment appreciated. say i'm present web page user select type of report in web page. makes more sense? for server-side creation, i'd this: <div id="reportchoices"> <?php // filename: reportscreen.php // sake of simplicity, database returns following rows // indicates type of reports available: $results = array( array("htmlid"=>"battingaverage", "htmllabel"=>"batting avg report"), array("htmlid"=>"homeruntotals", "htmllabel"=>"home run totals report"), ); foreach ($results $data) echo "<input type='radio' name='reporttype' value='{$data['htmlid']}'/>{$data['htmllabel']}"; ?> <

cross platform - How can I distribute my java applications for user ease? -

i'm confused - it's pretty wierd because know 2 programming langauges can't figure out simple this... i've been looking ages can't seem head around it. see, long time i've been writting in autoit , , i've written 2 programs in due go on sale soon! never meant out long time though (kind of windows vista), lately i've been learning java success. i've wrote few very simple applications in eclipse while going through java tutorials! i'm ready transfer programs java, gain me wider market due java's cross-platform ability, never anticipated distribution complex. first problem have come across ease of use on multiple os's: don't want customers have deal jre or multiple files, need double click solution work on mac, windows, linux, etc complete computer newbie's can launch software! secondly, not problem not sure how do. including files in software package need stay seperate program others compiled, suppose can worked around install

NServiceBus: How do I get a subscriber to start processing messing without using generic host? -

i modifying pubsub sample, , have been playing around configuration of nservicebus. currently, endpointconfig.cs file has configuration this: configure.with(new[] { typeof(ievent), typeof(nservicebus.unicast.transport.completionmessage) }) .customconfigurationsource(new userconfigurationsource() .register(() => new msmqtransportconfig { inputqueue = "subscriber2inputqueue", errorqueue = "error", numberofworkerthreads = 1, maxretries = 5 })) .defaultbuilder() .xmlserializer() .msmqtransport() .istransactional(true); now want change console app without generic host. here's changed: changed project output console app changed startup settings not invoke generic host moved configuration above main method this: configure.with(new[] { typeof(ievent), typeof(nservicebus.unicast.transport.completionmessage) }) .customconfigurationsource(new userconfiguration

javascript - How to hit the database on the function? -

i have quesion can hit database on view? i have function this.. function showhipaatab(url) { if ($("#bxflag").val() == "1") { $("#bv-1").attr('src', url); } else { return false; } }; on funcation need hit database bxflag value.how that? so being javascript running in browser not server, don't have direct access database. depending on situation there couple ways can value: if value known @ time render page can set javascript variable value in view. has advantage of being simple , not requiring additional call server. if value can not known until after render, or if can change during lifetime of page use jquery ajax gov points out.

html - How to position two divs side by side where the second width is 100%? -

i want achieve this: width=60px width = remaining space |------| |-----------------------------------| | div1 | | loren ipsun... | |------| | | | div2 | |-----------------------------------| sample html on jsfiddle. is possible place 2 divs side-by-side leaving second div remaining space? just float first div, , set margin-left of second div accommodate width of first div. this: div.one { width: 60px; float: left; } div.two { margin-left: 60px; } keep in mind width css property on div applies content, need set margin-left sum of width , border , margin , , padding properties of first div. here updated version of jsfiddle. let me know if have questions it.

Rails partials and Simplemodal jQuery plugin -

first of sorry title, couldn't think of real descriptive. so here's thing: i have site (kinda social-network) have list contact cards (little personal cards, info). there 2 versions of cards: small , full. when see list of 10 contacts (for example), you'll see 10 small cards , when click 1 of them, should open full card in modal popup (i've chosen simplemodal jquery plugin this). i've created 2 partials: card_small , card_full . both of them expect locals => :contact so how recommend doing this? would render 10 small cards along full version hidden , open modal via jquery on small-card click? would render small cards browser , make links_to_remote returns js code renders full card partial? any other solution or rails plugin welcome. i'm still starting ror =) generic form of question: need way have 2 partials (small , full) , when small clicked, full 1 needs displayed in modal dialog. thanks! this strictly performance tradeo

iphone - Edit Cell Text in UITableView -

in app have set number of cells in uitableview, 10, no more, no less, , user can't change that. however have if user naturally in ios fashion, swipe cell, or press edit button, cell text becomes editable simple tap on cell bringing keyboard. i wondering if there simple method this, or take quite of custom building? thoughts on how go together? thanks. this should work if add uitextfield table cell's contentview believe.

vba - Rendering STAR schema in Excel (a 2-Dimension table) -

please move appropriate forum if doesn't belong here. i've data feed represents multidimensional data in star schema. e.g. /products /salesyear /salescontact /region /salesdata now want render data in simple tabular view example 2005 2006 2007 product1 category1 27m$ 30m$ 35m$ category2 9m$ 1m$ 11m$ product2 category1 27m$ 30m$ 35m$ category2 9m$ 1m$ 11m$ are there standard algorithm or techniques can used display kind of data? [edit] what need efficient method build in-memory cube powerpivot @ smaller scale. i think use modified version of answer @dick kusleika: convert row columns of data column multiple rows in excel 2007 . note solution not nested rows under product1/product2 have above, guess pretty modify solution handle 2 row headings: column a contain product name , column b cont

email - How to setup a Webmail inside Wordpress -

i trying setup webmail login page wordpress nevertheless havent found way it, i've admit i'm wordpress rookie might thinking things wrong, have advice how proceed? is there plugin enables webmail login? i'm afraid easiest way write own plugin. it's easy make plugin adds optiosn page , edit options page reflect webmail login. http://codex.wordpress.org/writing_a_plugin

Outlook Anti-Spam plugin that allows deleting some and moving others to a SPAM folder -

i'm looking spam filtering solution, plugin outlook, allows me specify emails containing phrases know always indicate spam should deleted, rest should go spam or junk mail folder can review them false positives. first part outlook's rules, problem anti-spam software i've used (including microsoft's own junk mail filtering) operates first, before rules. know of software, free or otherwise, satisfy these requirements? p.s. please don't tell me use other outlook - com api extremely useful me, because tie in home-grown client database software processing things software registrations, payment notifications email , license key requests software sell. i found after quite bit of further searching, seems working well, , allows specify actions occur either before or after outlook rules, needed. it spam reader, www.spam-reader.com . it's commercial, quite inexpensive. it's based on bayseyian (sp?) approach.

c# - Clear Navigationservice Buffer - Or Reset App? (Windows Phone 7) -

i have app i'm working on user gets navigated 2 pages deep, meaning: select stuff, click next -> select stuff, click next -> results on results page, i'm doing navigationservice.navigate() mainpage.xaml user has ability hit button can break things in app. how can clear buffer of pages available? way navigationservice.cangoback return false if it's true? if buffer can't cleared, there method restart app user mainpage.xaml without having navigation history? thank you, nick here's few references solutions clearing stack. want "reset" app how deal backstack pages? removing page navigation stack can navigation history cleared alternatively, consider peter torr's suggestions on handling navigation scenarios. introducing concept of “places” redirecting initial navigation

c# - get word frequency (count) as property in Linq Object using Regex -

so i'm trying take this post , tweak own purposes can't figure out how. here starting query: string input = sb.tostring(); string[] keywords = new[] { "i","be", "with", "are", "there", "use", "still", "do","out", "so", "will", "but", "if", "can", "your", "what", "just", "from", "all", "get", "about", "this","t", "is","and", "the", "", "a", "to", "http" ,"you","my", "for", "in", "of", "ly" , "com", "it", "on","s", "that", "bit", "at", "have", "m", "rt", "an", "was", "as",

fancybox - One form, two submit buttons -

i have 1 form , 2 submit buttons. @ moment this: what first submit buttons open in nice popup window, http://fancybox.net/ any ideas? i set fancybox open window specific class: $("#fancybutton").fancybox({ autodimensions:true, titleposition:'inside' }); the first button this: <input type="button" id="fancybutton" value="button 1" /> then have second button actual submit button: <input type="submit" value="button 2" /> also, if wanted form data in fancy box, use jquery scrap relevant info , drop in box :) to scrape form: var formdata=new array(); $('input').each(function(index) { formdata[$(this).name] = $(this).value(); }); call above in $('#fancybutton').click() function.. then can reference each field going formdata[' insert field name here ']

linq to sql - Linq2SQL vs EF in .net Framework 4.0 -

so what's verdict on these 2 products now? can't seem find regarding issue vs2010/.net 4.0 back in .net 3.5 days, people believe linq2sql dead when .net 4.0 comes around, seems alive , well. on other hand, ef 4.0 seems have gotten significant improvement. for me, of work far small medium sized projects, , company migrating vs08 vs10 soonish. should looking at? or really, should spend time studying ef4.0 or time more spent looking @ nhibernate? (but on topic, i'm more interested in linq2sql - ef.) lastly, using entlib / unity, framework more friendly dependency/policy injection? thanks in advance. here reasons why entity framework (v4) better: 1 - l2sql obsolete 2 - l2sql not support poco mapping, ef does. 3 - ef has more flexibility (code first, model first, database first). l2sql has 1. 4 - ef has support sproc -> poco mapping 5 - ef has entity-sql, allowing go classic ado.net when required 6 - ef supports inheritance (tpt, tph) 7 -

php - Windows light stand-alone webserver that runs from USB stick -

i'm looking windows (xp/vista/7) stand-alone webserver small/light in size, can run php sqlite3, , has large userbase/online support. so far i've tried lighttpd , quickphp. lighttpd has large user base loads of support, encountered many errors when calling pdo functions, , doesn't support fast-cgi on windows. quickphp passed testing fine it's small project managed 1 person on free time small userbase. don't want risk finding problems half-way project no support author or access source code. any recommandations on try next? what xampp lite ?

multithreading - C++ UNIX threading -

i doing project threading in unix , c++. there producer thread, , 5 consumer threads. producer thread adds incrementing numbers queue @ random times, , consumer threads poll q trying remove it. reason q.size() keeps going negative , cant figure out why. #include <queue> #include <list> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <pthread.h> using namespace std; #define num_consumer_threads 5 #define num_producer_threads 1 #define buffer_size 20 void *c_thread_function(void *arg); void *p_thread_function(void *arg); queue<int> q; int produce(int cur) { int temp = cur + 1; return temp; } void append(int num) { if ( q.size() < buffer_size ) { q.push(num); } } int take() { int removed = q.front(); q.pop(); sleep(1); return removed; } void consume(int num, int thread) { printf("%d consumed %d \n", thread, num); } int m

java - Using one query in another in JDBC programming -

i understand how on paper in sql, having trouble implementing in java (this first time programming jdbc stuff) for example, database consists of: movie( code , title, publisher) customer( custno , name) borrowed( custno , code ) and want find name of customers borrowed every movie pubisher abc string no_of_abc_movies = "select count(publisher), publisher movie, movie.publisher = 'abc'"; string no_of_cust_abc_movies = "select count(name), name customer, borrowed, movie, customer.custno = borrowed.custno , borrowed.code = movie.code , movie.publisher = 'abc'"; string query = "select name" + " name customer, borrowed, movie" + " customer.custno = borrowed.custno and" + " borrowed.code = movie.code and" + " movie.publisher = 'abc' and" + " " no_of_cu

java - Apache HttpClient HttpRequestRetryHandler never invoked -

i'm using apache http commons defaulthttpclient , after construction, i'm setting retry handler: httpclient.sethttprequestretryhandler(new httprequestretryhandler() { @override public boolean retryrequest(final ioexception ioe, final int numretry, final httpcontext context) { log.d(tag, "retry handler received exception of type: " + ioe.getclass().getname() + ", num retries: " + numretry); if (numretry > 4) { // 3 retries return false; } // exceptions can retry without knowledge of methods being invoked if (ioe instanceof nohttpresponseexception || ioe instanceof unknownhostexception || ioe instanceof socketexception) { } return false; }

licensing - Question about the LGPL -

i wondering if legal/not frowned upon base enhancements 1 lgpl library off of functionality of lgpl library. note because of method of implementation, source code not directly built off of, general idea implement similar functionality in library based off of functionality in original library, without copying implementation or directly using other library. an example of i'm thinking of is: both libraries covered lgpl: library 1 has function a, , implement similar functionality library 1's function in library 2. would there legal issues if indirectly (however still possibly basing algorithms of of original library) implement similar functionality in manner? i intend on if not legal problem asking authors of original library permission before doing anything, want confirm if have in mind legal/kosher according licensing before asking. sorry if seems may little out of place, or little didn't comprehend lgpl, not @ understanding legal documents, , wondering if els