Posts

Showing posts from July, 2012

tfs2010 - TFS 2010 custom build step -

i playing tfs 2010, , trying setup build process have custom steps. these include things like, stopping/starting iis, search , replace files etc... across environments. i have tried examples online , have not found clear , meaningful on how run script or on source files. looking @ default build process template (defaulttemplate.xml) cant make sense of it. how go doing ? there tutorials on how build custom build templates ? for info on customising tfs2010 workflow build templates have @ ewald hoffman's series. start part 1 i should mention since looks you're doing deployment may want break deployment automation away build automation.

c++ - Will function pointers always initialize to NULL? -

i'm using msvc , seems code below not crash , function pointer initialized null compiler. int (*operate)(int a, int b); int add(int a, int b) { return + b; } int subtract(int a, int b) { return - b; } int main() { if(operate) //would crash here if not null { cout << operate(5,5); } operate = add; if(operate) { cout << operate(5,5); } operate = subtract; if(operate) { cout << operate(5,5); } return 0; } so seems msvc initializes function pointers null, if build on gcc in linux null? conventional or msvc specific, can rely on being null wherever go? thanks operate initialised null because global variable, not because function pointer. objects static storage duration (which includes global variables, file-level static variables , static variables in functions) initialised 0 or null if no initialiser given. [edit in response jim buck's comment:] in c++, ...

nsdecimalnumber - Examples of doing decimal math in iPhone -

i'm pulling decimal values sql table text field convert nsdecimalnumber (this because didnt know read/write decimal values sqllite). anyway, i've hit wall im trying simple math routines on these decimal variables. such as, sum = balance * interest_rate. idea im working money calculations. do know of samples/tutorials teaches how these operations using either nsdecimal, nsdecimalnumber, or both? thanks. to init: nsstring *number = @"123.4"; nsdecimalnumber *mydecimal = [[nsdecimalnumber alloc] initwithstring: number]; to want do: nsdecimalnumber *sum = [[nsdecimalnumber alloc] initwithdecimal:[balance decimalnumberbymultiplyingby: interest_rate]; how? well make nsdecimalnumber , alloc , initwithdecimal. decimal? balance multiplied (decimalnumberbymultiplyingby) interest_rate.

linux - Adjust Time to Daylight Saving for localtime C++ -

i have piece of optimized function gmt time. convert local time. want call localtime , gmtime function once adjust time localtime calling localtime , gmtime multiple times defeat purpose of using optimized function. however, problem how adjust localtime when there daylight saving? ideas on that? thanks. i've never noticed performance issues fetching time. problem in code? in case, simplest solution compute offset utc-to-local, , recompute if hour different when offset computed.

javascript - Setting up the Coordinates -

i facing problem in setting coordinates in javascript, have taken coordinates using pagex , pagey, problem this, want set image on coordinates have taken through pagex , pagey, please let me know asap, if knows solution....thanks in advance.... this might : http://api.jquery.com/offset/ or http://www.w3schools.com/css/css_positioning.asp

.net - fastest/performance approach to share large Bitmap object between managed and unmanaged functions -

while working on computer vision application having gui in wpf.net , being processed using native libraries (opencv , more), fastest way send , receive large size bitmaps between managed (c#.net) , un-managed (native c/c++ ) functions ? feel copying bitmap data managed unmanaged memory not fastest way , there should better alternative... i found out few approaches, if approve or suggest better alternatives: approach 1: using pin_ptr 'pin' memory, use pin_ptr instead of copying (marshalling) pixel data of bitmap object managed unmanaged increasing performance / speed approach 2: unmanaged wpf imaging component . approach 3: hbitmap::lockbits() it lock bitmap , makes available pixel data handle, have seen allocate memory.

asp.net - Asp Hyperlink's attribute cannot be changed using code behind -

i newbie in asp.net. trying load text , url hyperlink database. after debugging, found out value loaded hyperlink control, doesn't shows @ html code? knows how happened? sorry bad english. if myreader2.read dim temp_panel panel dim temp_hyperlink hyperlink temp_panel = findcontrolrecursive(me, "panel" & i.tostring()) temp_panel.cssclass = "accordionitem" temp_hyperlink = findcontrolrecursive(me, "hyperlink" & (i).tostring()) temp_hyperlink.text = myreader2("text") temp_hyperlink.navigateurl = myreader2("link") temp_hyperlink.cssclass = "accordionitem" temp_hyperlink.rendercontrol(o)...

how to change html image src by c# -

<img src ="~/usercontrols/vote/images/arrow up.png" id = "vote-up-off" runat = "server" alt ="vote up" class="voteupimage" style="height: 45px; width: 44px"/> here want change src of image condition like if ( a==4) { src url shuld ...... } else { src url should be... } first need give id name can used variable: <img src="~/usercontrols/vote/images/arrow up.png" id="voteupoff" runat="server" alt ="vote up" class="voteupimage" style="height: 45px; width: 44px" /> and in code behind use variable: if (somecondition) { voteupoff.attributes["src"] = resolveurl("~/usercontrols/foo.png"); }

javascript - set back the focus in GWT -

i have 4 text boxes , 1 listbox placed in flextable. make request server list of data populate listbox. when response comes back, populate listbox. stealing focus textbox giving input. what want after populating listbox, return focus exact location before. how in gwt or in java script? if need generic solution, create class, implements blurhandler or focushandler interface. assign object of class text boxes. in onfocus/onblur method remember last focused widget. after populating of listbox call restorefocus() call setfocus(true) on remebered object.

java - Get return value from new class with gui -

i have class extends jframe make orders. in middle have button opens new window used find article. what need is: when click btnnewarticle, after searching new article, , confirm in new window, return article code. click btnnewarticle --> (open new window find article) --> confirm selection -->as return article code. is possible? thanks for me principle has worked: public class articlesearchdialog extends jdialog { public static articleid execute(frame parent) { articlesearchdialog dialog = new articlesearchdialog(parent, true); dialog.setvisible(true); return dialog.getselectedarticle(); } private articleid getselectedarticle() { return selectedarticle; } private void jbcancelactionperformed(actionevent evt) { selectedarticle = null; setvisible(false); dispose(); } private void jbokactionperformed(actionevent evt) { selectedarticle = ...; //todo setv...

c# - Mapping data from 2 tables to 1 entity - Entity Framework 4 -

i stuck here. is possible map data 2 different tables 1 entity in entity framework 4. i have bunch of employees in 1 table, , in other have som project information. combine these 2 tables in 1 entity, , keep tracking features etc., possible? i not want use function import, solely through entity model. can - when try it, following error time: error 3024: problem in mapping fragments starting @ line 2354:must specify mapping key properties (myprojecttable.psinitials, myprojecttable.projectid) of entityset myprojecttable. both key mapped respective tables. new entity made myprojecttable basetable. the relation between 2 tables 1-* hope can help. /christian you cannot map 2 tables one-to-many relationship 1 entity. if don't want projecting results 1 object in code, consider creating view , mapping instead. according http://msdn.microsoft.com/en-us/library/bb896233.aspx you should map entity type multiple tables if following conditions true: ...

c# - How To Access One UserControl from Another Using ASP.NET -

i have created user control uservote has property find total vote on particular question. now want call aspx page. the control code-behind ( uservote.ascx.cs ) looks like: public partial class uservote : system.web.ui.usercontrol { protected void page_load(object sender, eventargs e) { datatable dtvoteinfo = showvotedetail(objecttype, objectid); if (dtvoteinfo != null) { if (dtvoteinfo.rows.count > 0) { int.tryparse(dtvoteinfo.rows[0]["total_vote"].tostring(), out currentvote); int.tryparse(dtvoteinfo.rows[0]["my_voting"].tostring(), out myvoting); } } ltrvotes.text = currentvote.tostring(); hfcurrentvote.value = currentvote.tostring(); hfmyvote.value = myvoting.tostring(); // ...snipped brevity... } } the control markup ( uservote.ascx ) looks like: <div class="vote-cell" style="width: 4...

winforms - Valdiation From To date -

greetings i developing windows form using vs2010 c# i have 2 datetime pickers 1 fromdatepicker , other todatepicker i want validate todate after date same day eg if from:30/8/2010...to:16/8/2010 an error message showed user thnx you can comparisons on `datetimes' if (todate < fromdate) { messagebox.show("to date before date"); } if you're not worried time portion use date property: if (todate.date < fromdate.date) { messagebox.show("to date before date"); }

How can I put a Twitter share button in my Android application? -

i using android 1.6. want integrate twitter button share songs on web-based application twitter followers. that, integrated jtwitter.jar file application. but not accepting username , password provide. i using following statement check authentication: twitter = new twitter(username, password); twitter has moved oauth can't log in username , password anymore. jtwitter supports oauth.

c++ - How to view symbols in object files? -

how can view symbols in .o file? nm not work me. use g++/linux. instead of nm , can use powerful objdump . see man page details. try objdump -t myfile or objdump -t myfile . -c flag can demangle c++ names, nm does.

c++ - num_get facet and stringstream conversion to boolean - fails with initialised boolean? -

i have inherited template convert string numerical value, , want apply convert boolean . not experienced stringstream , locale classes. seem getting odd behaviour, , wondering if please explain me? template<typename t> t convertfromstring( const string& str ) const { std::stringstream sstream( str ); t num = 0; sstream >> num; return num; } this works fine until try boolean conversion string str1("1"); int val1 = convertfromstring<int>(str1); // ok string str2("true"); bool val2 = convertfromstring<bool>(str2); // val2 _false_ i spent time tracking down problem. have confirmed locale's truename() returns "true". the problem seems initialisation of variable num . can change template , works: template<typename t> t convertfromstring( const string& str ) const { std::stringstream sstream( str ); t num; // <----------------------- changed here sstream >> num; return num; }...

SQL Server Pivot Table Help -

i'm trying turn following resultset meetings covers date typename 1 3 2010-10-14 breakfast 1 1 2010-10-14 lunchcooked 2 4 2010-10-15 breakfast 1 3 2010-10-18 breakfast 1 3 2010-10-19 breakfast 1 1 2010-10-19 lunchsandwich 1 3 2010-10-20 breakfast 1 3 2010-10-21 breakfast 1 3 2010-10-22 breakfast into format following fields date breakfastmeetings breakfastcovers lunchsandwichmeetings lunchsandwichcovers lunchcookedmeetings lunchcookedcovers am right in thinking can done pivot tables? pointers great otherwise i'm going end taking sort of hacky temp table route data format. thanks here's way it. needs , unpivot , pivot operation. unpivot combines meetings , covers single column , changes typename values desired column names. the pivot uses results of unpivot provide final format. select thedate, ...

iphone - Error when deploying on iPod -

i have created movie application. when run in simulator, runs without error , gives me output, when try deploy on ipod, gives me following error: the executable signed invalid entitlements. the entitlements specified in application’s code signing entitlements file not match specified in provisioning profile. (0xe8008016). please, can me how solve problem? try follow guide: link

Why would this php not work but would work this way? -

if ($sess_uid == $wallid) { // } else { run action } works but if (!$sess_uid == $wallid) { run action } wont work. why this? want code fire off if both ids don't match. this: if (!$sess_uid == $wallid) { run action } is equivalent this: if ( (!$sess_uid) == ($wallid)) { run action } while want: if (!($sess_uid == $wallid)) { run action }

sql - Versoning in relational database -

i have problem introduce versioning in database design. let's make easy example. little rental service. you have table person (p_id, name) , table computer (c_id, type) , table rent (r_id, p_id, c_id, fromdata, todata) . i want able change user name, create new version , still have old stuff @ hand if need it. my goal have kind of system on websites witch makes easy make versioning of records in table. more information: i have business logic demands can release record version. have able rollback old ones. reason want exports diffrente versions of data. you have made statement (that want versioning), not asked question (exactly problem is). without question, it's hard provide answer. in general, provide versioning by: identifying entity needs versioned. in case sounds may want versioning "deal" or "rental agreement". add pk column, version number column, , "originalid" column table @ top of model entity. to version...

php - How to preload a entire website like Gmail? -

how preload entire website gmail does? how show in progress bar? mechanisms used effect? i can use jquery, jquery ui, php. enought create this? i'm quite sure gmail built using google web toolkit , means whole application contained in javascript files.. in fact initial page source of gmail practically empty. post help: gmail file upload progress bar gwt?

php - I have an iframe which content I need Google to index. Is this possible? -

i have classifieds website. the index.html has form: <form action="php_page" target="iframe" etc...> the iframe displays results, , php_page builds results iframe. php_page builds table containing results mysql db, , outputs it. my problem doesn't indexed google. how can solve this? the reason used iframe in first place avoid page-reloading when hitting submit. ajax couldn't used due various reasons wont go here. any ideas do? thanks update: i have sitemap urls classifieds also, don't think guarantees google spider urls. trying make google spider crawl results of search form not right approach. assuming want google.com users find classifieds ads searching google, best approach create set of static html pages ads, , link them (not invisibly) elsewhere on site (probably best home page - such link can in footer or else unobtrusive) they can linked sitemap xml (you have sitemap xml file don't you?) not...

Recording Audio sound on Internet - C# ASP.NET -

i want build application on web records audio sound through mic. if 1 can provide appropriate approach or links helpful. also if can suggest third party control free. the technology implementation - asp.net , c# since looking use c#, check out silverlight 4 added microphone support silverlight. here tutorial on accessing microphone in silverlight 4. scratch audio great example of silverlight support microphone support.

c++ - Is there a version of the VC++ 2008 Redistributable Package with the DEBUG dlls? -

we have (mainly) c#/wpf application invokes c++ libraries via interop. for testing purposes (and because of inconsistencies in third party library), distribute debug version or our application on target machine, partially remote debugging. in case, when doing so, program barfs dreaded 0x800736b1 error loading c++ dll. appears (at least until find next stumbling block) caused not having debug version of vc++ runtime libraries installed on target machine. is there version of vc++ redistributable package debug libraries, or failing that, there "preferred" way of putting libraries on test machine? thanks, wts if target machine under control, may want install visual studio on it. deploy debug version of runtime. alternatively, copy side-by-side libraries development machine target machine. in %windir%\winsxs . on dev machine (vs 2008 sp1), reside in following folders: %windir%\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456 %...

jquery - JavaScript alert function behaviour -

in asp.net, preventing default postback action when user presses enter while textbox control has focus. see following piece of code $("#textbox1").keydown(function(e) { if(e.keycode == 13) { //alert("hello"); return false; } }); this code works fine. if uncomment alert function call page post not stop. my question why alert call creating problem? i missed using keydown . prevent form submission, i'd use submit handler instead, in case working keydown handler , blur handler (to reset flag): var cancelflag = false; $('#textbox1') .keydown(function(e) { cancelflag = e.keycode == 13; }) .blur(function() { cancelflag = false; }); $('#theform').submit(function() { if (cancelflag) { alert("hello!"); } return cancelflag; }); (or can call e.preventdefault(); instead of return...

java - Filter XML stream using SAX -

i have xml stream want parse using sax. want echo out xml stream output stream, optionally filter out of tags or alter of attributes. there convenient "echo" contenthandler can leverage this? yes. java trax/jaxp api's provide this. http://download.oracle.com/javaee/1.4/api/javax/xml/transform/package-summary.html http://download.oracle.com/javaee/1.4/api/javax/xml/transform/stream/streamsource.html http://download.oracle.com/javaee/1.4/api/javax/xml/transform/stream/streamresult.html so you'd architect pipe follows: sax input -> [ result | custom input] -> stream output where [ result | custom input ] can simple class bridges necessary sax interfaces make contenthandler able provide input sax input source.

EntLib Caching and SQLite -

i'm trying microsoft entlib caching block (5.0) working sqlite database , facing problems: when configured caching block ms sql database had run sql script created db , stored procedures. can not find information on how create procedures , db sqlite db. is possible use sqlite caching block? , if is, have , running? any appreciated! silvan as far know sqlite doesn't support stored procedures @ all.

asp.net mvc - MVC using Action Filter to check for parameters in URL. stop action from executing -

i want make following: when url doesn't have instid, want redirect "instelling" action in controller , every method needs instid. [requiredparameter(parametername="instid", controllertosend="instelling")] public actionresult index(int? instid) { //if (!instid.hasvalue) { // return redirecttoaction("index", "instelling"); //} var facts = _db.instellingens.first(q => q.inst_id == instid).facturatiegegevens; return view(facts); } so in controller. the actionfilter: namespace mvc2_nastest.controllers { public class requiredparameterattribute : actionfilterattribute { public string parametername { get; set; } public string actiontosend { get; set; } public string controllertosend { get; set; } public override void onactionexecuting(actionexecutingcontext filtercontext) { if (param...

ASP.NET MVC 2, Windows XP, and IIS 5.1 -

i'm getting headaches trying host mvc 2 on xp's iis! (this on vs 2008, applies vs 2010 well.) after struggling found way display mvc 2 site iis 5.1, problem there no styling! ideas on how should fix this? the problem path location. following suggestions link above, if change relative path of css link <link href="../../content/site.css" rel="stylesheet" type="text/css" /> <link href="%3c%=url.content%28" ~="" content="" site.css="" )="" %>="" rel="stylesheet" type="text/css" /> not conversions. when change <link href="<%=url.content(" ~="" content="" site.css="" )="" %>="" rel="stylesheet" type="text/css" /> error "newline in constant." edit: normal <link href="<%= url.content("~/content/site.css")%>" rel="s...

c# - asp.net ffmpeg video encoding hangs -

i have below methods encode videos uploaded web site ffmpeg. works fine videos 8-9 mb but, if video size larger 8-9 mb hangs web site. way recover restarting iis. when watch process can see ffmpeg encodes video , exits. resulted video fine. problem starts ffmpeg exists. application runs on win2003 x86 webserver iis6 anyone got experience encoding large files asp.net web app using ffmpeg? public encodedvideo encodevideo(videofile input, string encodingcommand, string outputfile) { encodedvideo encoded = new encodedvideo(); params = string.format("-i \"{0}\" {1} \"{2}\"", input.path, encodingcommand, outputfile); //string output = runprocess(params); string output = runprocesslargefile(params); encoded.encodinglog = output; encoded.encodedvideopath = outputfile; if (file.exists(outputfile)) { encoded.success = true; } else { encode...

jquery - Get the "alt" attribute from an image that resides inside an <a> tag -

this should simple reason, doesn't work. i want "alt" attribute image resides inside tag <div id="album-artwork"> <ul> <li><a href="link large image"><img src="thumbnail" alt="description of image" /></a></li> ... </ul> </div> $("#album-artwork a").click(function(e) { e.preventdefault(); var src = $(this).attr("href"); var alt = $(this).next("img").attr("alt"); alert(src); // ok! alert(alt); //output: undefined }); any ideas why next() doesn't work? there better solution out there? thanks in advance marco it's because image tag inside ul tag. next looks tags @ same level. you'll have use var alt = $(this).children("img").attr("alt"); edit: included additional " missing

ftp - Free alternative to RocketStream Station? -

i tried rocketstream station (www.rocketstream.com) alternative ftp transferring large files on long internet distances (relatively high latency) , blown away performance me on 125 times speed of ftp. uses udp data channel or protocol call "pdp". are there free (or cheaper) alternatives application? kurt, we use product company called data expedition, inc. expedat software high-speed file transfer product works (our avg. file size 4gb, 45mbps lines, between california , europe). udp-based , compared them couple of vendors, 18 months ago, when making our decision. rocketstream 1 of vendors data expedition beat out our situation. hope helps!

javascript - How to force ExtJS to consider value in grid cell changed after custom editing completes? -

i have extjs editorgridpanel several columns. 1 of columns bound complex data type (an array of objects), , uses custom editor modify values in pop-up window. part tested , works fine - jsonstore keeping complex values, setting custom editor's value when it's focused , editing begins, , picking final value when editing complete. the problem is, complex data type, javascript string value not appear include sub-attributes, instead represented "[object object]". therefore, if array contains 2 items when editing begins, , 2 items after editing complete, if of sub-attributes of 2 items have changed, grid editor doesn't know this, because (string)value === (string)startvalue (that is, '[object object],[object object]' === '[object object],[object object]' ). i'm problem, because if custom sub-editor increases number of items in list, string values are different ( '[object object],[object object],[object object]' !== '[object ...

php - Accessing class element - a variable or array element? -

how access 14.95 here? $object->{0} or $object[0] doesn't work simplexmlelement object ( [@attributes] => array ( [currencyid] => usd ) [0] => 14.95 ) interesting... if (int)$object->{0} works.... its bad practice have numbers properties of object. wouldn't named property easier maintain? edit : thought wasn't possible looks , instead leaves code little ambiguous.

actionscript 3 - TextField not appearing in Sprite -

i have sprite contains textfield. then, want create second sprite ("containersprite") same size textfield. that's not difficult , works fine. now want add third sprite ("innersprite") containersprite. need third sprite because i'm going use drag , drop purposes. add textfield it, , want textfield same width both containersprite , innersprite. depending on how text in textfield, need innersprite resize height accordingly. this should simple. isn't working. doing wrong? thanks, david package { import flash.display.sprite; import flash.text.textfield; import flash.text.textfieldautosize; import flash.text.textfieldtype; public class spriteandtextfield extends sprite { private var innertext:textfield; private var innersprite:sprite; private var containersprite:sprite public function spriteandtextfield() { var tf:textfield = new textfield(); tf.type = textfieldtype.input; tf.width = 300; tf....

Unicode string mess in perl -

i have external module, returning me strings. not sure how strings returned, exactly. don't know, how unicode strings work , why. the module should return, example, czech word "být", meaning "to be". (if cannot see second letter - should this .) if display string, returned module, data dumper, see b\x{fd}t . however, if try print print $s , got "wide character in print" warning, , ? instead of ý. if try encode::decode(whatever, $s); , resulting string cannot printed anyway (always "wide character" warning, mangled characters, right), no matter put in whatever . if try encode::encode("utf-8", $s); , resulting string can printed without problems or error message. if use use encoding 'utf8'; , printing works without need of encoding/decoding. however , if use io::captureoutput or capture::tiny module, starts shouting "wide character" again. i have few questions, happens. (i tried read perldocs, not w...

python - Why am I getting Name Error when importing a class? -

i starting learn python, have run errors. have made file called pythontest.py following contents: class fridge: """this class implements fridge ingredients can added , removed individually or in groups""" def __init__(self, items={}): """optionally pass in initial dictionary of items""" if type(items) != type({}): raise typeerror("fridge requires dictionary given %s" % type(items)) self.items = items return i want create new instance of class in interactive terminal, run following commands in terminal: python3 >> import pythontest >> f = fridge() i error: traceback (most recent call last): file "<stdin>", line 1, in <module> nameerror: name 'fridge' not defined the interactive console cannot find class made. import worked successfully, though. there no errors. you need do: >>> im...

jsf - Session map is null when printed -

i working on jsf1.1 jsp presentation technology. have managed bean arraylist , display list in rows. works fine. have session replication 2 server nodes , when replicate session, , put 1 of cluster down, app on second cluster session attributes lost. i tried print sessionmap using externalcontext see session attributes null too. what possible reason? the attributes not serializable . that's requirement them persist on disk and/or transfer bytes on network. to fix this, ensure session attributes (including session scoped managed beans) implement serializable this: public class somesessionclass implements serializable { // ... } don't forget make members serializable whenever applicable. e.g. public class somesessionclass implements serializable { private somenestedclass foo; // has implement serializable well! // ... }

Mysql/php - Query Question -

i have been trying figure out different way complete task on question on website, think maybe making difficult. here have: table with, , imageid, imagename, galleryid table comments, author, date, imageid what want do query find of images have galleryid=42. in addition, grab of comments associated each picture (via imageid) , concatenate them in single value. example: imageid: 1234, imagename: img425, galleryid: 42, comments: cool!|||john smith|||2010-09-06~~nice shot!|||richard clark|||2010-10-01~~i remember run.|||susan edwards|||2010-10-04 i need concatenate of results comments table each image , put them in single value, can parse them via php in body of page. group_concat() way go, , other answers close. kiss. select imageid, imagename, galleryid , group_concat( concat_ws('|||', comment.author, comment.date, comment.content) separator '~~' ) comments images join galleries using (galleryid) join comments using ...

Help with JQuery accordion? -

i'm having little trouble putting jquery accordion site. feel i'm doing right, not working properly. have put site up, simple lorem ipsum text in accordion. if can help, appreciated. here link: http://www.catanesedesign.com/test/events.html . i'm having trouble making code legible on site, can see source @ link. there divs without content @ bottom, because haven't finished page, , shouldn't affect accordion. thanks in advance help. first there seems problem jquery ui css file. says 404 - not found.

sockets - Performance considerations of a large number of connection on the same port -

what performance considerations 1 should take account when designing server application listens on 1 port? know possible many thousands of clients connect server on single port, performance negatively affected having server application accept incoming requests on single port? is understanding correct model (server listening on 1 port handles incoming connections, , responds on outbound connection created when client connection established) way databases/webservers etc work? regards, brian it not matter if server listens on 1 port or multiple ports. server still has establish full socket connection each client accepts. os still has route inbound packets correct socket endpoints, , sockets uniquely identified combination of ip/port pairs of both endpoints, there no performance issues if server endpoints use different ports. any performance issues going in way server's code handles socket connections. if listens on 1 port, , accepts clients on port using simple a...

sql server - How can I explore the data in a SQL database, including foreign tables? -

i want know if tools exist explore data in relational database, , drill through master-detail relationships. i know how view data in single table, , know how construct sql queries join tables. however, n-levels deep, have write sql statement, find id of item i'm interested in, , repeat n times. extremely tedious , hard visualize results. however, want know if there tool lets me @ data in table, , if there foreign keys, lets me expand data show foreign data. , hopefully, lets me drill through multiple levels of detail. do such tools exist? i'm using ms sql, , using sql server management studio execute sql. information regarding keys , table information accessed through sysobjects , other sys tables , have seen custom scripting capable of reading these tables provide of info you're looking here, though click drill down functionality out of scope. think toad (tool oracle app developers) might have options along route (though not in free version). it ...

vb.net - Linq join on parameterized distinct key CASE INSENSITIVE -

to revisit previous question further stipulation... anyone know how following, ignoring case? dim matches = mrows in linqmastertable join srows in linqsecondtable _ on mrows(theprimarykey) equals srows(theforignkey) _ order mrows(theprimarykey) _ select mrows, srows for details query , it's functions / usage, previous post here . edit: here's kind of tables we're querying: linqmastertable: ------------------------------------- |theprimarykey| description | ------------------------------------- |green | green apple | |green | green apple | |green | green apple | |red | red apple | |red | red apple | |red | red apple | ------------------------------------- linqsecondtable -------------------------- |theforignkey | appleprice | -------------------------- |green | $0.90 | |pink | $0.80 | |red | $0.85 | |yellow | ...

user interface - Android UI: what kind of layout options are mutually exclusive? -

after designing layouts in android while now, still cannot hang of it. results unpredictable. i think part of boils down layout options not working together. i.e. if using 1 way of specifying layout, you're not meant use other way. notably, me, changing layout_width fill_parent wrap_content changes world. let me give specific example: part of activity's layout linearlayout: <linearlayout android:id="@+id/ll2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <linearlayout android:id="@+id/ll2a" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="1"> <textview android:id="@+id/l_cover" android:layout_width="wrap_content" android:layout_height="wrap_c...

Android - Java / c# /c++ Speed -

i start writing first android application starting next week here @ work. curious video , results of found here: http://www.youtube.com/watch?v=it8xpqkkxis the submitter indicates c++/c# runs faster java on android platform though on android 1.5. at rate, can confirm there indeed increase in performance using c++ or c# on 2.2? our application need speed , batterylife can get. thanks in advance! edit: per woot4moo's comment, yes, implementation runs best? take factors account including runtimes, frameworks, compilers ... there obvious difference , want know if has experience writing c++/c# on android as c++: "native language" android written in. isn't interpreted java is. c# compiled too. and, usually, when language interpreted slower language (or maybe) if compiled.

file reading in C++ -

could me figure out c++ code got somewhere want understand it. have figured out of things cannot head around. here is: vector<double> prices; // vector of option prices vector<int> strikes; // vector of strikes char buffer[100]; // buffer line read char databuffer[100]; // stores current data string read char *str = null; // pointer data string const char *file = "optiondata.txt"; // file option chain info ifstream fin; // input file stream fin.clear(); fin.open(file); if (fin.good()) { while (!fin.eof()){ // read in 1 line @ time fin.getline(buffer,sizeof(buffer)/sizeof(buffer[0])); ifstream str1(buffer); // data str1 >> databuffer; // read data file while (!str1.eof()){ // read in contract maturity, strike, , price str1 >> databuffer; // read option maturity month ...

c# - What is the difference between Rank and specifying [,] in an array? -

in .net, there rank property arrays. what difference between , specifiying like: int[,] intarray = new int[3,3]; ? which of rank 2? thanks the rank property read-only. part of type of array , can set when array created. expression int[,] refers type of rank 2 integer arrays, , can create rank 2 array either new int[n,m] syntax or array.createinstance static method.

How to delay a shell command in delphi? -

i working delphi 2010 , shellapi. need little program building grows. here jest of application: checks see if condition exists if said condition exists begins execute 2 shell commands dependent on previous 1 executing uses shellapi; procedure renamedir(dirfrom, dirto: string); var shellinfo: tshfileopstruct; begin shellinfo begin wnd := 0; wfunc := fo_rename; pfrom := pchar(dirfrom); pto := pchar(dirto); fflags := fof_filesonly or fof_allowundo or fof_silent or fof_noconfirmation; end; shfileoperation(shellinfo); end; procedure tform1.button1click(sender: tobject); begin renamedir('c:\dir1', 'c:\dir2'); renamedir('c:\dir3', 'c:\dir'); end; i novice @ delphi can see issue, second command executing before previous command completes. how solve issue first command executes , finishes before second 1 called? update: added full pseudo code shows attempting do. if command us...

mysql - SQL GROUP BY CLAUSE -

i have table i'm trying pull trend analysis columns date(timestamp),riskcategory(text) , point(int). i'm trying return every date sum points , group riskcategory. can latest via following: select date,riskcategory,sum(point) total risktrend date(date) >= (select max(date(date)) risktrend) group riskcategory; but struggling returning same dates. using mysql. i should further elaborate, date can have multiple entries, riskcategory can administrative,availability, or capacity. so, every date should see sum of points latter three. example, 2010-10-06 capacity 508 2010-10-06 administrative 113 2010-10-06 availability 243 2010-10-07 capacity 493 2010-10-07 administrative 257 2010-10-07 availability 324 you need add date group clause: select date, riskcategory, sum(point) total risktrend date(date) >= (select max(date(date)) risktrend) group date, riskcategory;

scala - Is there a Lift cheatsheet / quickref? -

i found couple of blogs on how started lift, need quick reference. like: here define application map, how write snippets, etc. want start lift app not "hello world" , need tl;dr version :) maybe : http://wiki.liftweb.net/index.php/cheat_sheet

focus - How can I move the cursor to the end of the text (Delphi)? -

this code fill textbox using sendmessage function: c := 'hey there'; sendmessage(h1, wm_settext, 1, integer(pchar(c))); now, how can move cursor end of text? if want messages take at: em_setsel em_exsetsel also there have complete reference edit: http://msdn.microsoft.com/en-us/library/ff485923%28v=vs.85%29.aspx in code (no messages) this: edit1.sellength := 0; edit1.selstart := 0; // set caret before first character ... edit1.selstart := 1; // set caret before second character ... edit1.selstart := length(edit1.text) // set caret after last character with messages: sendmessage(h1, em_setsel, length(c), length(c));

javascript - This if statement should not detect 0; only null or empty strings -

using javascript, how not detect 0, otherwise detect null or empty strings? from question title: if( val === null || val == "" ) i can see forgot = when attempting strict-equality-compare val empty string: if( val === null || val === "" ) testing firebug: >>> 0 === null || 0 == "" true >>> 0 === null || 0 === "" false edit: see cms's comment instead explanation.

html - how to display a symbol next to the textboxes after sucessfull validation using jquery plugins -

i have following code perform validation of submitform shown below on click of button form validated correctly changes textboxes red color , displays error message symbol.but problem how display other symbol example right tick mark symbol or text message on user entering correct details text boxes using following plugin validation http://jquery.bassistance.de/validate/jquery.validate.js example.html <fieldset id="fieldset1"> <legend>registration details:</legend> <form id="submitform"> name of business:<br/> <input size="30" type="text" id="businessname" class="required" name="businessname"/><br/> zipcode:<br> <input size="30" type="text" id="zipcode" class="required zipcode" name="zipcode"/><br> telephone:<br/> ...

php - is there any view page caching for codeigniter -

i using codeigniter db query caching , cache view pages codeigniter ci caching instead of cache whole page different pages logged in users , not logged in users please tell me there view page caching system codeigniter or db query caching best above all. check out mp_cache library ci, it's way cache parts of pages. compared db caching: reusable. parts (like site menu’s) same on every page , doesn't need cached each individual page. you have delete once after change made part of , not cache every page uses changed information. compared output cache: caching portions of page isn’t problem. different cache different uses of function aren’t problem can add variable in cache “name” you can read more on ci wiki page . other libraries include: fragment caching library , sparks (un-supported).

caching - Google chrome same url cache -

i'm testing servlet using google chrome. when tried load same url twice, say, localhost/myserver/servlet chrome sent out 1 request server. however, if modified second url be: localhost/myserver/servlet?id=2 it sent 2 different requests. i've enabled incognito mode, seems chrome shares cache , urls between incognito tabs. caching control part of http specification, read it. using http headers cache-control: no-cache or expires: ... should you.

iphone - Edit a boolean value on click on a button at customised table view cell -

i have table view customized cell. each cell contains button added contentview addsubview. want update boolean value in database table regarding row of button clicked. how should index of row button clicked when click on button not select row on button exist . maybe set tag of uibutton row of tableview ? [ cell settag:<#(nsinteger)#> ]; then when tap occured, tag (from sender cast uibutton*), transform in nsinteger , can change bool in database ^^ if have more 1 section, trick doing tag = section * 100 + row. good luck !

Object name from String in Objective-C -

i want set name of object uibutton string. nsstring *buttonname = [[nsstring alloc] initwithstring:@"somestring"]; my goal is: uibutton *somestring = [[uibutton buttonwithtype:uibuttontypecustom]retain]; how can solve this? you can't - variable names resolved compiler before objective-c code executed. can maintain map of strings objects buttons etc. using nsmutabledictionary : nsstring *string = @"somestring"; [buttonmap setobject: [uibutton buttonwithtype:uibuttontypecustom] forkey: string]; //...time passes... [[buttonmap objectforkey: @"somestring"] setenabled: yes];

Can Java web applets do the same as offline ones? -

i looking start java web applet, need doesn't need downloaded (saved computer) , part work windows , osx. i have never done java, question can can normal java jar file on web? more specifically, can write web applet detect window titles (like title of active window), running processes, in windows registry, or find hard drive serial numbers? the applet needs special permissions these type of actions. needs signed , trusted user. have considered using java web start ? if communication browser applet run crucial, applets way go. otherwise java web start preferred you'll face less compatibility problems browsers' java plugins , different jvm versions.

android - unable to get auth token in flickr -

i trying access flickr services android , to full permissions , first of fetched forbs using flickr.auth.getfrob method integrating & converting in md5 secret + 'api_key' + [api_key] + 'method' + 'flickr.auth.getfrob' i got frob , problem came when request authorized token integrating & converting in md5 secret + 'api_key' + [api_key] + 'frob' + [frob] + 'method' + 'flickr.auth.gettoken' but unfortunately getting invalid frob , don't why whats problem. this auth stuff tricky flickr. in code, got callback after user authenticated, , given different frob response getfrob (something pnbhd://auth?frob=xxxxx). when used frob, worked. imagine problem, since you're getting "invalid frob" , not error having api_sig.