Posts

Showing posts from July, 2011

php - Contact page MVC workflow -

all previous projects have had workflow on contact pages user submits form controller gets $_post details controller validates details (and sets error messages if necessary) controller sends email controller redirects thanks page is standard workflow? i used validate in controllers, , did more reading , recommended against it. therefore, should send $_post details helper type object , let work (validation/sending)? in controller should check validation. main validation should on model before operations db.

c# - fetch selected row from DataGrid -

i'm using wpf grid. first column checkbox column, , there 1 save button on page. when button clicked, i'd checkboxes row set checked, insert in datatable. how can done? would help? it uses decorator pattern wrap class (that's come out of orm linq2sql) enable databind "selected" value. can upon saving selected items in list of decorated items , save those. (simple example, not mvvm compliant) xaml: <window x:class="checktest.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <datagrid autogeneratecolumns="false" itemssource="{binding path=foos}" name="gridfoos" margin="0,0,0,34"> <datagrid.columns> <datagridcheckboxcolumn ...

qt - QtScript: how to reload current script? -

qscriptengine has evaluate() method can used load script, execute , run specified function loaded script. how clear current script , load new one? example, use evaluate() load script file , evaluate() script functions , call them. can clear current script , load new 1 different file? deleting , creating qscriptengine seems solution, likes created in gui thread (due qscriptenginedebugger) while script operations performed in separate thread. way clear current script without re-creating qscriptengine object? i ran problem, , improve eye of hell's answer (thanks, way!), leaves out important detail. i'll use cut down version of problem, reusing qscriptengine object , wanted ensure nothing left behind between evaluations. in particular, wanted ensure onequipped function not called "rc helicopter controller" entity, doesn't change sprite when equipped , hence doesn't define onequipped function in script file. using pushcontext() , popcontext() r...

web analytics - Track visits/origin asp.net mvc website -

i not sure possible, i've never tried doing before have customer wants able know came when visited site. google, bing, link website, etc. more importantly want know if visit product of normal sso or if paid add adwords? i appreciate anyone's thoughts on , if it's possible? many thanks why not use google analytics. should tell pretty information.

rubygems - Is it possible to show ruby gem updates without actually updating? -

i have checked docs, didn't find way check gems updates available. i wondering if knew how this? turns out find answer minutes later: gem outdated

apache - How to serve a gziped font using .htaccess? (no mod gzip or deflate) -

here's list of stuff tried in random order: addhandler application/x-httpd-php .otf addtype default_mimetype auto_prepend_file = "otf.php" zlib.output_compression = on output_handler = ob_gzhandler header("content-type: application/octet-stream"); even though php files of server gzipped using zlib, replacing .otf extension .php didn't work either. with .htaccess, this, assuming font file fontfile.otf.gz , browser request fontfile.otf rewriteengine on #check browser's accept-encoding, remove force return gzipped 1 rewritecond "%{http:accept-encoding}" "gzip.*deflate|deflate.*gzip" #check file name endswith otf rewritecond %{request_filename} "\.(otf)$" #check existance of .gz file name rewritecond %{request_filename}.gz -s #rewrite .otf.gz rewriterule ^.*$ %{request_uri}.gz [l] #update response header <filesmatch "\.otf\.gz$"> addencoding gzip .gz forcetype "text/plain...

c# - How does SqlGeography.Reduce method works? -

how api works? i using complex geography ~2000 points (geometry of river). while reducing tolerance 2048, works fine. while reducing tolerance factor 4096, throws exception "24205: specified input not represent valid geography instance because exceeds single hemisphere. each geography instance must fit inside single hemisphere. common reason error polygon has wrong ring orientation." does mean have 2 geometry of different orientation (these points located in single hemisphere only) in geography object , tolerance 4096 tries merge these 2 geometries of different orientation , fails? there anyway avoid such scenarios? when sql server sees geography instance computes bounding cap it. if cap angle exceeds 90 degrees throws exception 24205 "geography instance must fit inside single hemisphere". can true if none of points cross equator. for in depth answer see the geography hemisphere limitation .

How to set this kind of breakpoint in ollydbg? -

i want break on executable module x called, i've no idea function called. is possible set kind of matching-all breakpoint? set memory breakpoint on code section.

linux - send a file using c in an adhoc network -

i want send file using c in adhoc network in mt linux platform...plz me header files , functions need use you use system() call invoke scp , e.g. system("scp file.dat user@remote-host:path/to/directory/"); $ man system $ man scp

SQL Server 2005, Replicating between timezones -

how sql server handle transfer of datetime columns when replicating between timezones? sql server isn't timezone aware. if store 2:36 pm in east coast data ceneter, replicate data west coast data center, still 2:36 pm. to around type of problem, of our servers set utc time. way know date/time in database correct utc, , if need adjust client display or reporting, can add/subtract offset date/time values regardless of server(s) data came from.

php - Get DOM data with referring URL -

suppose have page following structure: <li id="a"> <span class="some class">some content <a href="http://www.example.com">http://www.example.com</a> </span> </li> <li id="b"> <span class="some class">some content <a href="http://www.example.com">http://www.example.com</a> </span> </li> <li id="c"> <span class="some class">some content <a href="http://www.example.com">http://www.example.com</a> </span> </li> is possible, php or js, grab list id (a,b,c) , append along referring url when person clicks on 1 of 3 links? need know 1 of 3 list tags click originated from i don't have write access originating page update in light of revelation have no access original page, you've got no chance of finding out specific link clicked arrive @ page. can referrer document....

Extending .NET 2.0 class library for WCF use -

we publish class library must remain compatible .net 2.0. however, use class library internally wcf-based projects. reading e.g. expose-object-from-class-library-using-wcf brings approach using 2.0 class libraries creating datacontractsurrogate objects map 2.0 classes. however, our object hierarchy rich , deep, , tedious , difficult maintain. since control source code, i'm looking easier approach. one thought add dataconract attribute source code, , provide "empty" implementation of datacontractattribute when solution built targeting 2.0 runtime, , using system.runtime.serialization implementation when solution built targeting 3.0 , newer runtimes. accomplished manually tweaking references between builds. is there better way implement approach? is there better approach? an alternative approach add wcf attributes (datacontractattribute etc), , build .net 3.0 assemblies. when run application under .net 2.0, having attributes assembly not avai...

c# - Need a Better Way Than Reflection -

i'm reading csv file , records recorded string[]. want take each record , convert custom object. t getmyobject<t>(); currently i'm doing through reflection slow. i'm testing 515 meg file several million records. takes under 10 seconds parse. takes under 20 seconds create custom objects using manual conversions convert.tosometype around 4 minutes conversion objects through reflection. what way handle automatically? it seems lot of time spent in propertyinfo.setvalue method. tried caching properties methodinfo setter , using instead, slower. i have tried converting delegate great jon skeet suggested here: improving performance reflection , alternatives should consider , problem don't know property type ahead of time. i'm able delegate var myobject = activator.createinstance<t>(); foreach( var property in typeof( t ).getproperties() ) { var d = delegate.createdelegate( typeof( action<,> ) .makegenerictype( typeof( t ), prope...

c# - Discover associated files of a certain process through WMI? -

is possible determine process (id), files associated (i.e. executable file files accessed process)? i have use wmi unless there no other option avoid ntquerysysteminformation. have piece of code can determine file, processes using it. need efficient way opposite direction. thank much. i cannot find wmi if process local, can use modules of system.diagnostics.process class. process[] processesbyname = process.getprocessesbyname("myexe.exe"); foreach (processmodule module in processesbyname[0].modules) { console.writeline(module.filename); }

c - Winsock: How to stop sending/receiving without closing the connection -

i develop client/server application share camera images. general cycle is: the client captures camera image , compress binary image. after sends server the server knows how large buffer (640*480/8 bytes) able receive hole image 1 recv-call. next recv-call second image , on after receiving image server works image , send image client. here problem: image jpeg compressed , client doesn't know filesize , can't receive image server fixed bufferlength. i think wouldn't problem if server close connection after sending image. don't want close connection because in next cycle send next image on same connection. my question is: how can tell client server send hole image without closing connection? here's code: (the client sends binary image server) void sendtoserver(char* sendbuf, int sendbuflen) { int iresult = send(connectsocket, sendbuf, sendbuflen, 0); if (iresult == socket_error) { (*errcallbackfunc)("sending image error", -1...

css - Cross-browser support of `page-break-inside: avoid;` -

i have lot of div s on page variable amounts of content in them. trying use page-break-inside: avoid; each div section not broken on 2 pages. it working in firefox not ie8. i have in css print file .page-break-inside-avoid { page-break-inside: avoid; } and divs carry class in <div class="page-break-inside-avoid"> ie8 supposed support now. isn't it? am doing wrong? solved issue? or had experience it? any great. thanks lot richard webdevout.net great place check browser css compatibility. for page-break-inside ie8 , opera 8+ shown support it

active directory - getting started with Single Sign On / Windows Authentication -

first off, problem: we have web app flash front-end talks our asp.net web service via soap deals of our server side code (c#). right now, implement simple user sign on in our application, storing info in our mssql db. a client has requested understand windows authentication through our application using logged in user. so, have been tasked investigating this. nobody, including myself, has experience in area. i have been reading on basic active directory information, , simple tutorials. understand how access directory using adsi through code. i'm interested in seeing how entire thing should architected. don't want throw hacky solution. does know of tutorial kind of thing or have advice on getting started? more importantly, sound viable? i know haven't given information, feel free ask , provide answers. thanks. edit: will, give idea of scope of this, network include every computer in large hospital. yes, huge. need start small. come work @ office fir...

joomla - implementing a site wrapper in php -

i saw joomla's built in component, wrapper (or module, can't recall). page can show website(while being in site). logic behind this? suggestions on how implement in php (i don't know start)? i'm pretty sure don't need php this, <iframe> : <iframe src="http://google.com/"></iframe>

c# - How to Remove or Revert DataContext.DataLoadOptions? -

first let me start explaining use case: say there database "cars". in database, each row might have make, model, enginetype, etc. have page view of single "car" record, displaying various stats. in page, have user control calculates , displys various mpg stats based on "car" record. user control passed "car" record via property, uses internally calculations. inside user control, happens: private void databindgrid() { gridview.datasource = this.carrecord.getmpgstats(); } internal "carrecord", linq-to-sql query, using data context of carrecord. purpose of calculation, more efficient this: private void databindgrid() { dataloadoptions dlo = new dataloadoptions(); dlo.loadwith<car>(c => c.engine); this.carrecord.datacontext.loadoptions = dlo; gridview.datasource = this.carrecord.getmpgstats(); } for purpose of example, ignore whether or not may bad design user control passing in record & d...

c++ - Intersection of two STL maps -

given have 2 stl maps, say: map<int, double> a; map<int, double> b; i'd intersection of 2 maps, of form: map<int, pair<double,double> > c; where keys values in both , b , value pair of values , b respectively. there clean stl-like way go this? template<typename keytype, typename leftvalue, typename rightvalue> map<keytype, pair<leftvalue, rightvalue> > intersectmaps(const map<keytype, leftvalue> & left, const map<keytype, rightvalue> & right) { map<keytype, pair<leftvalue, rightvalue> > result; typename map<keytype, leftvalue>::const_iterator il = left.begin(); typename map<keytype, rightvalue>::const_iterator ir = right.begin(); while (il != left.end() && ir != right.end()) { if (il->first < ir->first) ++il; else if (ir->first < il->first) ++ir; else { result.ins...

ms word - Correlate Range.Text to Range.Start and Range.End -

i'm using regular expressions search against plain text returned following property: namespace microsoft.office.interop.word { public class range { ... public string text { get; set; } ... } } based upon matches want make changes formatted text corresponds plain text. problem have indices of characters in .text property not match .start , .end properties of range object. know way match these indices up? (i can't use word wildcard find capabilities (as replacement .net regular expressions) because aren't powerful enough patterns i'm searching (non-greedy operators etc.)) i can move correct number of characters starting document.range().collapse(wdcollapsestart) and range.movestart(wdunitchar, match.index) since moving characters matches formatted text position matches in plain text. my problem i'm 4 characters far along in formatted text...so maybe has other story ranges? i'm not sure... apparen...

database - What kind of index on dates for a emp duty table? -

i have query gets employee duties start date , end date against database. table like emp duty startdate enddate should give indexing dates? kind etc? make things easier on db level (orm level me attribute set).there huge data depending on number of employees off course (expected) , better safe sorry? please advice. assuming have primary key on table, use non clustered indices on date fields if need search them oftenly - more important more data have in table. adding 2 more indexes on table shouldn't hurt (though wouldn't index fields - asking trouble!).

c# - Getting records from between Date X and Date Y from my Access database? -

i have table called recharge in access database. some of fields rechargedate, account, number, etc. i wanted retrieve records between 2 dates wrote following query: string query = "select * recharge account='" + combobox1.text + "' , rechargedate between '"+datetimepicker1.value.date.toshortdatestring()+"' , '"+datetimepicker2.value.date.toshortdatestring()+"'" the query runs fine problem i've run in able retrieve dates single month. if request records span encompasses more single month, not proper result. any help? the query executes nice problem can able details between dates in single month, if starting month , ending month differs cant proper result plzz me maybe you're running string date format issue; try code: oledbcommand command = new oledbcommand( "select * recharge " + "where account=@account , " + "rechargedate between @rechargedatesta...

asp classic - Session Timeout: Can I Perform Any Actions on Timeout? -

in classic asp application, if set session.timeout = 10 (or similar), can execute piece of code when session expires? i clear out values stored in application object when user session ends. yes, can execute code when session ends. global.asa for. in it, can define actions events, among when session ends. these events can use: application_onstart session_onstart session_onend application_onend you'll want use session_onend. name of sub in global.asa. source, , more information: http://www.w3schools.com/asp/asp_globalasa.asp

django - Highcharts SVG Export from Python Server Side Code -

i using reportlab in python render pdf server side. i of highcharts graphs. building pdf server side needs include graphs. server side graphing ( reportlab , matplotlib ) not have choices formatting / design. is there way can run client side javascript graphing solution ( highcharts ) server side? here post request , said: feed java tool url, fires internal webkit browser, executes javascript code , dumps rendered page pdf. i looking resources on how accomplished in python. open web browser on server. point web browser @ pre-made page loads highcharts , renders chart. grab output of browser. send client. which of steps seems confusing? note slower using matplotlib , because need start full web browser render graph. had quick @ highcharts page linked , think reproduce in matplotlib.

xml - Removing node using XQuery Update -

i trying remove child node parent node using xquery. say, have entry shown below in xml: <entry> <id>36</id> <title>engineering village author tool</title> <updated>2009-09-30t12:55:42z</updated> <libx:libapp> <libx:entry xmlns:libx="http://libx.org/xml/libx2" src="37"/> </libx:libapp> </entry> how delete child node <libx:entry xmlns:libx="http://libx.org/xml/libx2" src="37"/> i using following xquery code: declare namespace libx='http://libx.org/xml/libx2'; declare namespace atom='http://www.w3.org/2005/atom'; declare variable $child_id xs:string external; declare variable $parent_id xs:string external; declare variable $doc_name xs:string external; declare variable $feed xs:anyatomictype := doc($doc_name)/atom:feed; let $parent_entry := $feed/atom:entry[atom:id=$parent_id] return d...

iis 7 - IIS Subdomain Host Headers Not Working -

using iis 7, have existing website, example.com, , have added website i'd url, sub.example.com point. i've set host headers this, not work. trying ping subdomain url give message "ping request not find host sub.example.com. please check name , try again." should dns setting perhaps set? the subdomain must set in dns or not resolve ip address. having defined in iis not enough. client computer must able translate name meaningful server address.

c# - WSE3 Destination vs URL -

i have vendor telling me soap header should not have https in it, can still communicate via ssl. our concern want communicate via ssl , sample code causing not happen. in sample program, provide code: if (valservice.url.startswith("https")) { valservice.destination = new microsoft.web.services3.addressing.endpointreference( new uri(valservice.url.replace("https:", "http:"))); } from breaking down smaller steps, , adding debug, seems when change destination, url automatically changes. if (valservice.url.startswith("https")) { // fix endpoint in case (usually not necessary) //original code next line //valservice.destination = new microsoft.web.services3.addressing.endpointreference( // new uri(valservice.url.replace("https:", "http:"))); //test code string holdoriginalurl = valservice.url; response.writeline("1 url=" + valservice.url); ...

java - Need to implement custom Fitnesse responders -

i believe in need of implementing custom fitnesse responders client have not found success in research/attempts make work. idea client have suites of tests written in fitnesse results published database via web service on local intranet. either call test via url in restful manner and/or invoke custom responder via button on fitnesse page. ideally run test, gather , parse results, publish via web service. hoping might ideas/hints how make happen because i'm @ wits end. @_@ appreciated! thanks! i've been investigating same thing, , believe case... you can invoke fitnesse test in restful manor. e.g. execute test , results in xml: http://myhost:myport/mywikipage?responder=test&format=xml . see fitnesse page fitnesse.userguide.restfulservices more information interacting restfully fitnesse. the problem restful approach, want do, requires wrap execution of fitnesse; means if want users able run tests through normal go-to-the-wiki-and-press-the-test-button, no...

.net - Can an ASP.NET 2.0 Web site reference WCF Web Services? -

our company has web site deployed in windows 2000 os, means install .net 2.0 on machine. upgrading webserver os out of question, since web server hosts other web applications in our country. part of our it's policy, security reasons web sites not allowed directly access data our database. 's why comply restrictions, have server web services deployed. "app server" has .net 3.5 sp1 installed, hence wcf services possible. my question if possible add web reference on wcf web services through our asp.net web site hosts .net 2.0. of course can. if wcf service uses basichttpbinding binding, compatible soap 1.1 clients, including "add web reference".

SharePoint 2010: feature receiver code executed from UI, not from PowerShell or stdadm -

i have wsp containing web scope feature following code: using system; using system.runtime.interopservices; using system.security.permissions; using microsoft.sharepoint; using microsoft.sharepoint.security; namespace macaw.duallayout.samples.features.duallayoutsampleempty_web { [guid("8b558382-5566-43a4-85fa-ca86845b04b0")] public class duallayoutsampleempty_webeventreceiver : spfeaturereceiver { public override void featureactivated(spfeaturereceiverproperties properties) { using (spweb web = (spweb)properties.feature.parent) { using (spsite site = (spsite)web.site) { uri uri = new uri(site.url + "/_catalogs/masterpage/dlsampleempty.master"); web.custommasterurl = uri.absolutepath; // master publishing pages web.update(); } } } public override void featuredeactivating(spf...

beyondcompare - Git Diff with Beyond Compare -

i have succeeded in getting git start beyond compare 3 diff tool however, when diff, file comparing against not being loaded. latest version of file loaded , nothing else, there nothing in right pane of beyond compare. i running git 1.6.3.1 cygwin beyond compare 3. have set beyond compare suggest in support part of website script such: #!/bin/sh # diff called git 7 parameters: # path old-file old-hex old-mode new-file new-hex new-mode "path_to_bc3_executable" "$2" "$5" | cat has else encountered problem , know solution this? edit: have followed suggestions vonc still having same problem before. kinda new git perhaps not using diff correctly. for example, trying see diff on file command such: git diff main.css beyond compare open , display current main.css in left pane, there nothing in right pane. see current main.css in left pane compared head, have last committed. my git-diff-wrapper.sh looks this: #!/bin/sh # di...

php - Features/functions that make your app more professional? Coding hobbyhorses -

what features implement (how) in php web applications because deem " more professional " in way? or have personal nitpicks , code hobbyhorses, small things might count? unsavoured code or minor functionality spend inordinate amount of time on right ? . example coding hobbyhorses q&a illustration: configuration data not in database : application data != configuration data, matter of necessity , efficiency. url fixing : normalize web addresses appending trailing slash, if it's technically not required. human-readable cookies : data privacy try avoid opaque session/database handles (for user options, not authorization usage). content negotiation : makes sense simple variations between e.g. rss , atom formats. see infrequently used. no database ids in ui : avoid leaking database internal surrogate keys urls. , orms db-internal keys don't had leak business logic. . hints (not rules) so, functionality believe puts w...

.htaccess - http://example.com/foo/bar loading http://example.com/foo.php -

i thought problem .htaccess files, after disabling mod_rewrite problem persisted. http://example.com/foo/bar loading http://example.com/foo.php true file foo being in folder on server. know causing behaviour , how can stop this, want load http://example.com/foo.php?text=bar . running normal lamp setup, ubuntu os. also, happens on testing server, not live vps this due multiviews . can disable with: options -multiviews

How to store duplicate data from xml file in C# -

i'm having xml file like <root> <child val1="1" val2="0"/> <child val1="1" val2="2"/> <child val1="1" val2="3"/> <child val1="1" val2="4"/> <child val1="1" val2="5"/> <child val1="6" val2="0"/> <child val1="7" val2="0"/> </root> i need store data in temporary storage ( namely dictionary ) sort of manipulations . cannot use dictionary here because dictionary not support same keys. can 1 suggest me better way store data? well, use dictionary<int, list<int>> - or storage (no changes) use linq's tolookup method build multi-valued map easily. (using linq xml): var lookup = doc.descendants("child") .tolookup(x => (int) x.attribute("val1"), x => (int) x.attribute("val2")); // ...

language agnostic - Accessing system resources through a web page -

is possible access system resources via web page? specifically interested in accessing system calls in order put computer standby or sleep. at point, language-independent. imagine sort of special access need granted before of nature occurs. searches haven't returned help, suggestions great. yes, possible. see example online antiviruses. i haven't done such thing java applets can achieve that, kind of activex controls. of course user permission required.

protecting files with asp.net (mvc) -

i want protect files in specific directory people cannot link them - still need program capable of rendering them, password protecting actual folder won't work. there way facilitate in asp.net mvc? it's more asp.net, not mvc - can't make use of things session state , postback , such... you put directory outside of web app's root directory (so can't accessed using copied url) or directory deny read access using web.config file. then access files through action requires current user authorized, e.g: public class filecontroller : controller { [authorize] public actionresult get(string file) { return new file(path.combine(_rootpath, file); } } then can access files through action url, e.g. http://server/app/file/get/test.txt .

Silverlight fluidLayout fail -

so going bit difficult explain, i'll give go recognize i'm talking about. so have stackpanel in there 3 buttons , 3 lists there 3 visualstates represent "open" state of each list (it's accordion). default each element's height set 0, , within it's respective state it's height set auto. fluid layout turned on, can go 0 -> auto... tl;dr = made accordion fluidlayout. inside 1 of accordion panes, there itemscontrol created generated items template , in there 'expander' control click button , more content shown. done visualstates , fluidlayout turned on. when try expand expanding control, doesn't go smoothly 0 height -> auto height should, instead appears. anyone run similar problems? so ended reflecting code, , done explicitly. i guess it's 1 of microsoft's undocumented "features". i wish away writing crap software , calling doesn't work "feature".

php - AMFPHP: Serializing Flash Objects over HTTP without the gateway -

flash + amfphp great combination. there cases, when flash remoting netconnection isn't right tool, various reasons. rob had great post on time ago: http://www.roboncode.com/articles/144 he has nice example on how deliver amf http request, without post , amf-request package call function netconnection sends, using zend_amf. // include zend loader include_once 'zend/loader.php'; // tell zend loader autoload classes need // zend framework amf package zend_loader::registerautoload(); // create simple data structure $data = array('message' => 'hello, world!'); // create instance of amf output stream $out = new zend_amf_parse_outputstream(); // serialize our content amf3 example // alternatively serialize amf0 legacy // flash applications. $s = new zend_amf_parse_amf3_serializer($out); $s->writeobject($data); // return content (we have found newline needed // in order process data correctly on client side) echo "\n" . $out->getstream()...

sqlite - Best practices for exposing multiple tables using content providers in Android -

i'm building app have table events , table venues. want able grant other applications access data. have few questions related best practices kind of problem. how should structure database classes? have classes eventsdbadapter , venuesdbadapter, provide logic querying each table, while having separate dbmanager (extends sqliteopenhelper) managing database versions, creating/upgrading databases, giving access database (getwriteable/readeabledatabase). recommended solution, or better off either consolidating 1 class (ie. dbmanager) or separation , letting each adapter extends sqliteopenhelper? how should design content providers multiple tables? extending previous question, should use 1 content provider whole app, or should create separate providers events , venues? most examples find deal single table apps, appreciate pointers here. it's bit late you, others may find useful. first need create multiple content_uris public static final uri content_uri1 = ...

windows - Determining maximum memory use of a process -

i want run command and, when it's complete, have record of maximum memory use of resulting process. instance, want analogous 'time' command on linux, 'time foo' run 'foo' and, when 'foo' exits, print out amount of cpu time 'foo' took. for present application need run on windows, if know of linux-only program let me know too. (at least it'd interesting, may give me lead find windows equivalent.) i don't know of program this, there apis. if you're using .net, use process.totalprocessortime property. if you're using native code, use getprocesstimes() function.

objective c - Twitter-oAuth-library for iPhone development -

i'm looking oauth/xauth-twitter-library iphone/objective-c. found mgtwitterengine , didn't work, don't link external libraries needed work (heck, example download doesn't work out-of-the-box!). so, know alternative libraries this, or how can make mgtwitterengine work? thank you. why still use oauth twitter? twitter recommends use xauth alternative oauth in iphone if want use oauth, can suggest this library . used before oauth, changed xauth already

soap - C# WSDL proxy methods -

Image
i need consume soap web service c# .net 4.0 client. i've added wsdl service reference in vs 2008 , can see xml types classes can construct soap message. the wsdl port defined interface , 2 operations defined in wsdl (uploadmessage , validatemessage) visible methods. how use these methods? thought port available class directly call methods , vs have created relevant code sending soap message, looks have write code go in these methods. correct? i have googled can't find simple example using .net 4.0 ;-( when add service using add service reference , should have new namespace (which defined in add service reference dialog box - bottom left corner). inside namespace, there ought class called (yourservicename)client . if can't find it, open service references node in visual studio solution explorer, , find show files button in solution explorer's little toolbar - click on see files. under service reference, several nodes deep, should fin...

firefox: bit.ly links in the sidebar of a customised wordpress blog gives a 404 error -

i have twitter status updates showing on sidebar of blog has bit.ly or ow.ly links well. everytime click on in firefox browser gives me 404 error because tries following url: www.domain.com/blog/" http://bit.ly/uniquenumber " instead of bit.ly/uniquenumber. i checked , seems work on google chrome on mac not on firefox on mac os x. else have similar problems. below code of receiving twitter status updates: /* these prefixes , suffixes display before , after entire block of tweets. */ $prefix = ""; // prefix - text want displayed before tweets. $suffix = ""; // suffix - text want displayed after tweets. $tweetprefix = ""; // tweet prefix - text want displayed before each tweet. $tweetsuffix = "<br \><br \>"; // tweet suffix - text want displayed after each tweet. $feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1" . $limit; funct...

git - How do I merge a binary file? -

i have binary file in my_branch, , when need make changes it, git of course not merge it. so is: git checkout my_branch # make change gui.bin mv gui.bin ~/ git commit -a mv ~/gui.bin . git commit -a # git rebase 1 commit git checkout master git merge my_branch but there easier way? i'm not quite sure test case driving at. seem moving gui.bin out of way , putting way was... often, binary files don't need merged, want chose definitive version 1 place or another. genuinely have merged either need custom merge tool, or use sort of editor , lots of manual intervention. i notice use commit -a in example. 1 first step avoid unnecessary conflicts not commit binaries might touched incidentally unless want commit them. if git add files need commit , commit without -a help. alternatively, if there 1 file don't want commit add -u , reset before making commit. git add -u git reset -- dontcommit.dat git commit when merge branches have both change binary may...

MVC: Are Models and Entity objects separate concepts? -

i asked here while ago in understanding mvc, since i'm new topic. thought had decent understanding of it, , documented in blog post wrote on subject. understanding boils down this: controller: determines needs done fulfill request, , utilizes whatever models needs collect/modify needed. it's manager given process. views: presentation only. once controller collects needs, creates specific type of view, hands information, , says "show user it." models: behavior of application. when controller asks extract or modify something, knows how it. knows trigger other models related tasks (in understanding, when model tries "vote something" on stackoverflow, model knows ask if badge should granted because of it. controller doesn't need care that). my question, assuming of more or less accurate, entity objects come in? models , entities same thing, each object knowing how persist own data, or entities separate concept exist on own , used throughout app...

website containing forum and chat should be developed in Java or Python or PHP? -

i want develop website contains forum , live chat , chatrooms. now, should develop using java or python? have experience in java , php, jsp webpages slower compared others? web application contain live chat , chat rooms. now, there load on server, , don't want break down or go slowly, what's advice me? please don't advise me develop in language familiar with. website important me, open learning new technologies. the live chat/chat rooms present in website. find open source implementation of site close need, , modify necessary. don't disappointed if written in language know!

php - How change de eregi to preg_match in this code? -

if (preg_match('^'.preg_quote($this->config_document_root), $filename)) { $absolutefilename = $filename; $this->debugmessage('resolvefilenametoabsolute() not prepending $this->config_document_root ('.$this->config_document_root.') $filename ('.$filename.') resulting in ($absolutefilename = "'.$absolutefilename.'")', __file__, __line__); } else { $absolutefilename = $this->config_document_root.$filename; $this->debugmessage('resolvefilenametoabsolute() prepending $this->config_document_root ('.$this->config_document_root.') $filename ('.$filename.') resulting in ($absolutefilename = "'.$absolutefilename.'")', __file__, __line__); } } this code has been resolved instructions of first answer, how can fix code too? if (!$this->config_allow_src_above_docroot && !preg_match('^'.preg_quote(str_replace(directory_separat...

Drupal: how can I avoid this form item being collapsed? -

Image
i don't why not working. want avoid specific form item being collapsed. this element want modify (after change code below): [taxonomy] => array ( [tags] => array ( [1] => array ( [#type] => textfield [#title] => tags [#description] => comma-separated list of terms describing content. example: funny, bungee jumping, "company, inc.". [#required] => 0 [#default_value] => [#autocomplete_path] => taxonomy/autocomplete/1 [#weight] => 0 [#maxlength] => 1024 [#collapsed] => 0 [#collapsible] => 0 ) [#collapsed] => 0 ...

tsql - SQL Server 2008: Fill multiple T-SQL variables from one SELECT query? -

to fill 1 variable value query can write following: set @targetid = (select top 1 id @bigdataset order date desc) to fill multiple variables query, eg. like: set (@targetid, @targetname) = ....(select top 1 id, [name] @bigdataset order date desc) what can write? select top (1) @targetid=id, @targetname=name @bigdataset order date desc

passing list item in javascript -

can please tell me how can pass list item 1 page in javascript? thanks you can use json. perhaps querystring. http://www.json.org/js.html and http://www.webmasterworld.com/forum91/216.htm

c# - implicit operator on generic types -

is there wrong using implicit operator following: //linqpad c# program example void main() { var testobject = new myclass<int>() { value = 1 }; var add = 10 + testobject; //implicit conversion int here add.dump(); // 11 } class myclass<t> { public t value { get; set; } public static implicit operator t (myclass<t> myclasstoconvert) { return myclasstoconvert.value; } } i thinking treat instance of object value type way, seeing i've never seen example of thought maybe there reason not point out? in actual code thinking of doing part of data abstraction layer, return objects information describing underlying data, allow logic code treat value type when needs know value, , @ same time keep nice , type safe generics. if of following true: all possible values of myclass<t> type (including null if it’s not value type!) map valid value of t the implicit operator never throws (not null !) the implicit ...

jquery - Explorer and FADING IMAGES IN OVERLAYING DIV'S problem -

why isn't overlaying image (in nested div) fading along parent div? problem in explorer.. see 'recent' labels on portfolio items: my website switch category's in navigation see 'recent' labels don't fade in internet-explorer this html: <div class="art recent"> <div class="recentlabel"><img src="images/recent-label.png" /></div> <a href="images/art/1.jpg" rel="lightbox" title=""> <img border="0" src="images/art/1tn.jpg" width="190" height="263" /></a><p>artist<br /> artwork</p> </div> this css: .art { width: 190px; padding: 0px; margin: 5px; float: left; background:#2c313b; display: inline; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } .recentlabel { position:absolute; margin-top:-2px; margin-left:97px; wid...

php - mysql - get results at mysql prompt, but not through script? -

i'm using php fetch records db , keeps returning "no results found". but, when print query screen , copy , paste @ mysql prompt, 1 row. granted, it's monster query, shouldn't same results? causes happen? suggestions on check? don't know if it's helpful, here's query: $q = db_query("select node.nid nid, gallery.field_attach_gallery_value gallery, node.type type, node.vid vid, ce.field_brochure_link_url ce_brochure_url, ce.field_brochure_link_title ce_brochure_title, ce.field_brochure_link_attributes ce_brochure_attributes, location.field_location_value location_field_location_value, ce.field_ongoing_value ce_field_ongoing_value, ce.field_poster_link_url ce_poster_url, ce.field_poster_link_title ce_poster_title, ce.field_poster_link_attributes ce_poster_attributes, ce.field_press_release_link_url ce_press_release_url, ce.field_press_release_link_title ce_press_release_title, ce.field_press_release_link_attributes ce_press_rel...

c++ - istream parse EVENT_TYPE(param1;param2; ...) -

i'm trying find elegant way parse string like: event_type(param1;param2; ...) event_type 1 of many string constants, each has 0 or more parameters. far thought given sting "s" contains event_type(param1;param2) i'd write: if (boost::istarts_with(s, "event_type")) { std::istringstream iss(s); int param1, param2; iss >> "event_type(" >> param1 >> ";" >> param2 >> ")"; } that nice give const string& , tell way "skip these characters". well, that's not case. how there go this? :-) thanks advice! this looks complicated enough warrant "real" parser. since you're using boost, try first: http://boost-spirit.com/home/

Can a Web Service also receive data, or is a "Web Service" only something that serves data? -

i'm confused terms. when make php application that 1) can called url or httprequest, parameters (i.e. country id), , returns data (xml or else) 2) can called in order store data (i.e. user wants store contacts online on server) is still ok call thing "web service", , whole activity ranging fetching data , submitting data "web service call"? that's absolutely web service. if can think of web service methods analogous api calls, can call web service; cf. obligatory wikipedia reference .

Drupal 6 and YUI Editor 2.8, cannot get upload image working -

okay, have installed wysiwyg module drupal 6 site. installed yui module v2.8.0r4 i cannot image upload work. when click image, option insert url etc, no upload form. i searched , searched days trying find issue nothing seems work. have seen issue many others well. has had problem? or can me out it? appreciated. imce wysiwyg bridge works tinymce , fckeditor yui editor wysiwyg module no allow image importing yui. however yui , yui_editor modules allow uploading imce (checkbox yui edit profile configuration screen): allow users browse images directly editor insertion editor. note: imce module must installed , configured work. works yui 2.5.x @ present. so looks can http://drupal.org/project/yui , http://drupal.org/project/yui_editor modules want (with imce). hopefully helps , luck!