Posts

Showing posts from August, 2013

How can I wrap content around a UL CSS Menu so content is seamless? -

thanks help here's finished code ie, firefox, safari , chrome: http://jsbin.com/eyoda4 i created simple css ul drop down menu, when user hovers on designated link, menu drop down user select option. the issue i'm having i'd content wrap around ul menu ul appears seamless/flush within content without breaks in content. this demo of issue , code. can see content doesn't wrap around ul. demo: http://jsbin.com/uzidu4/ this demo visual of how i'd content wrap around menu. note: example won't work, because no ul present in example - visual demo: http://jsbin.com/uzidu4/2/ thank help! (answering update here) to make work in ie7, can add this: <!--[if ie 7]> <style> .inline-list, ul.program-menu li { display: inline; zoom: 1 } </style> <![endif]--> i recommend adding stop annoying text jump when hover on drop down: ul.program-menu li { position : relative; border-top: 1px solid #fff; border-...

SQL Server performance tip -

possible duplicate: is sql clause short-circuit evaluated? i have following question regarding query: select * sometable 1=1 or (select count(*) table2 > 0) if first condition true ( 1=1 ), sql server still inner select? or stop when first condition true (like c) it stops when (1=1) true. can check using ctrl-m ctrl-e consider query select * master..spt_values 1=1 or (select count(*) master..sysobjects) > 0 the execution plan shows scan in master..spt_values , no activity in sysobjects . contrary c, not stop when leftmost condition true, instead query optimizer works out independently of order presented least cost evaluate. in case of constants 1 vs 1 winner clear.

asp.net - Reading characters from an unknown character encoding -

i have string came old database of unknown character encoding. having trouble encoding/filtering string show correct text. what data looks in database: marronnière à quatre pans what need string show as: marronnière à quatre pans specifically, having trouble parsing string can display character à ( &#224; ) this asp.net 2.0 site written in vb using sql server 2005 database. not sure if matters, data comes column collation: sql_latin1_general_cp1_ci_as i've tried encoding string various encodings in code no avail. i've passed string (encoded different ways) byte array find unique byte pattern bad characters without success. any ideas or leads appreciated, thanks. it sounds collation in sql server database doesn't match character encoding used :( it's common mistake careless developers. that's why sql server administration tools showing weird characters rather strings expecting. possibly utf-8? in utf-8 à represented bytes 0xc3 0x...

javascript - Stop link from sending referrer to destination -

i have page don't want outbound links send referrer destination site doesn't know came from. i'm guessing isn't possible want make sure there weren't hidden javascript magic , work (if not most) browsers. maybe clever http status code redirecting kung-fu? something perfect <a href="example.com" send_referrer="false">link</a> i looking same thing, , seems this feature of html5 . the tag looking rel="noreferrer" . it implemented in webkit (chrome, etc.) , as firefox , mileage may vary.

Is there a way to use just build command instead of ant build while using ant scripts? -

i using apache ant scripts building web application. have written targets in build.xml file , script running fine. remember using "build" command run ant build instead of "ant build". can tell me how achieved? bit curious on this. there's no built in "build" command. create simple script file called "build" in same directory launched ant build. create text file contents: ant build in windows save file called build.bat can type build command line start build. on unix or linux, save file build , make executable (with chmod +x build ). you'll need type ./build run. i don't think there's lot of value doing replace simple case of ant build , if have regularly run build has multiple targets, or need pass in system variables come in useful.

Run script before Bash exits -

i'd run script every time close bash session. i use xfce , terminal 0.4.5 (xfce terminal emulator), run script every time close tab in terminal including last 1 (when close terminal). something .bashrc running @ end of every session. .bash_logout doesn't work you use trap (see man bash ): trap /u1/myuser/on_exit_script.sh exit the command can added .profile/.login this works whether exit shell (e.g. via exit command) or kill terminal window/tab, since shell gets exit signal either way - tested exiting putty window.

visual studio - Load tests and content files -

can visual studio load test request css, javascripts, images , other files when run web performance tests? yes, visual studio requests these static files internally dependent requests main request .aspx, .html , on. in web test there property called "parsedepedentrequest" should set true. property responsible calling dependent requests.

xml - Namespace 'http://exslt.og/common' ERROR -

i have 2 servers test server "sever 1" online no firewall. server 2 (production) behind firewall. below code giving following error: namespace 'http://exslt.org/common' not contain functions error show on server 2. if try browsing http://exslt.org/common on either browser page not there. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ext="http://exslt.org/common" xmlns:my="my:my" extension-element-prefixes="ext my"> i got above code helpful person on stackoverflow , 95% working on serer2 i'm getting error. rest of code below: please pulling hair out haha. <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ext="http://exslt.org/common" xmlns:my="my:my" extension-element-prefixes="ext my"> ...

javascript - asp.net mvc json.net response -

i implementing, first time, json.net asp.net mvc2 site. my original code looked this: [httppost] public actionresult findme(string searchfirstname, string searchlastname) { this.searchfirstname = searchfirstname; this.searchlastname = searchlastname; ienumerable<homepageuser> results = dosearch(); bool success = (results.count() == 0) ? false : true; return json(new { success = success, results = results }); } the results problematic due fact 1 of items in results set enum , want text value, not numeric one. additionally, date format problem. so, found json.net , changed code this: [httppost] public jsonnetresult findme(string searchfirstname, string searchlastname) { this.searchfirstname = searchfirstname; this.searchlastname = searchlastname; ienumerable<homepageuser> results = dosearch(); bool success = (results.count() == 0) ? false : true; jsonnetresult jsonnetresult = new jsonnetresult()...

Is a recursive function in Scheme always tail-call optimized? -

i've read tail-call optimization in scheme. i'm not sure whether understand concept of tail calls. if have code this: (define (fac n) (if (= n 0) 1 (* n (fac (- n 1))))) can optimized, won't take stack memory? or can tail-call optimization applied function this: (define (factorial n) (let fact ([i n] [acc 1]) (if (zero? i) acc (fact (- 1) (* acc i))))) a useful way think tail calls ask "what must happen result of recursive procedure call?" the first function cannot tail-optimised, because result of internal call fac must used, , multiplied n produce result of overall call fac . in second case, however, result of 'outer' call fact is... result of inner call fact . nothing else has done it, , latter value can passed directly value of function. means no other function context has retained, can discarded. the r5rs standard defines 'tail call' using notion of tail context , i...

c# - casting a tiny int from SQL server -

i'm using linq sql populate list of objects. 1 of fields i'm interested in stored tinyint. how should declare property type in object definition? short? byte? int16? thanks. it byte. here complete list.

objective c - Retrieve Root URL - NSString -

i trying obtain root url of nsstring containing url. example, if url passed secure.twitter.com , want twitter.com returned. works in class did below. not work longer urls... here's method: - (nsstring *)getrootdomain:(nsstring *)domain { nsstring*output = [nsstring stringwithstring:domain]; if ([output rangeofstring:@"www."].location != nsnotfound) { //if www still there, rid of output = [domain stringbyreplacingoccurrencesofstring:@"www." withstring:@""]; } if ([output rangeofstring:@"http://"].location != nsnotfound) { //if http still there, rid of output = [domain stringbyreplacingoccurrencesofstring:@"http://" withstring:@""]; } if ([output rangeofstring:@"https://"].location != nsnotfound) { //if https still there, rid of output = [domain stringbyreplacingoccurrencesofstring:@"https://" withstring:@""]; } n...

c# - Windows form design advice -

i have built touch screen application using windows forms. works great still have design advice. my application consists of several different windows forms. my design have 1 mainform of other forms inherit from. in mainform have buttons user can choose form open. when user chooses 1 of options form opened. use following code: control control = this; // current form, open recording rec = recording.instance; // form user choose open if (control != rec) { rec.show(); // show recording form control.hide(); // hide previous form } is correct way work forms or should use other way? example, have 1 form , user controls in it. a few things noticed: recording.instance . looks me making these forms singleton. can work, i'd rather see them created/closed needed. rec.show(); nitpick, lot of time want pass current form owner: rec.show(this); or rec.show(control); . inheriting base form good. mak...

active directory - Why this powershell code returns whole objects insted of just selected properties? -

why powershell code returns whole objects insted of selected properties ? want name , sid each user not whole microsoft.activedirectory.management.adaccount object bounch of properties. ps c:\> get-aduser -filter * -searchbase "ou=mailonly,dc=test,dc=demo,dc=local" -server test.demo.local -properties sid,name best regards, primoz. it appears -property merely retrieves additional properties , tacks them onto returned object e.g.: properties specifies properties of output object retrieve server. use parameter retrieve properties not included in default set. you can pick off properties want using select-object so: get-aduser -filter * -searchbase "ou=mailonly,dc=test,dc=demo,dc=local" ` -server test.demo.local -properties sid,name | select sid,name

java - How can I access <tomcat>\bin\*.properties when running from inside eclipse? -

Image
does know if tomcat running inside of eclipse uses <tomcat>\bin\ directory when you've configured server use local tomcat install (server view) inside eclipse? for example: i'm using colleagues jar, subsequently requires x.properties file. i've been instructed place properties file in <tomcat>\bin\ directory. sort of odd me, line fails simply: inputstream in = new fileinputstream("x.properties"); anyhow, i'm pretty sure editing of server config files not me, though i'm open suggestions. or perhaps there's in launch configuration (below) can change? no matter what, following stack trace: java.io.filenotfoundexception: x.properties (the system cannot find file specified) @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.<init>(fileinputstream.java:106) @ java.io.fileinputstream.<init>(fileinputstream.java:66) @ com.mycompany.myteam.colleaguesproject.colleaguesservlet.ini...

iphone - Add Image and Caption Text to Three20 Table section using TTSectionedDataSource -

Image
i trying create table using tttableviewcontroller . want display image in section header along caption text, similar instagram , many other application does. tried using sample ttnavigatordemo display data ttsectioneddatasource , (i not sure if right way it, please suggest better way if know any). contains section name/headers regular strings , data tttableviewitem . tried implementing <uitableviewdelegate> protocol , achieved using viewforheaderinsection method, data separated section, there better way using three20 through can pass on header/section view , tableitemview along in datasource allow me implement tttableviewdragrefreshdelegate , not able implement when implementing <uitableviewdelegate> protocol in class. my class declaration right now, looks like @interface imagetable : tttableviewcontroller <uitableviewdelegate> { } i show section headers image , text like: : i using ttnavigatorcode populate data in table is: self.datasource =...

Facebook C# SDK : No connection could be made because the target machine actively refused it -

i've downloaded latest version of c# sdk - using windows 7, vs 2010 , .net 4. i've got website running on local iis 7. i have facebook developer account etc. , trying csaspnetfacebookapp sample working. when access app. facebook logon , border. i logon , get: no connection made because target machine actively refused 66.220.146.50:443 nslookup 66.220.147.38 shows name: api-read-12-04-snc4.facebook.com address: 66.220.147.38 any ideas? have set url's correctly in application settings page on facebook? "site url" set http://localhost:xxxx example?

map - How to put black borders in heatmap in R -

Image
hi created heatmap in r using "heatmap.plus" shown in link http://i.stack.imgur.com/hizbf.jpg but need heat map heatmap shown in below link created other gui software http://i.stack.imgur.com/y8faj.png how can put black borders in every heatmap element in r if follow tutorial learn r blog , change color in paragraph black, get: (p <- ggplot(nba.m, aes(variable, name)) + geom_tile(aes(fill = rescale), colour = "black") + scale_fill_gradient(low = "white",high = "steelblue"))

winforms - C# change location of controls inside FlowLayoutPanel -

i using flowlayoutpanel have relative location controls. change location of control inside flowlayoutpanel . when location, dont mean control1 before control2 or - mean if got 2 controls, lets label , combobox - combobox 's height 21, label 's height 13 , flowlayoutpanel 's height 21 also. want put label in vertical middle of flowlayoutpanel - ((21-13)/2) top. dont want specific vertical middle want general solution. you set top margin of label (containerheight-labelheight)/2

silverlight - Adding Entities and updating RIA domain service at runtime -

i have requirement deliver app built in silverlight. once app has been built , delivered, new modules user request should created separate apps/xap , user should able import new module application. adding new apps in iphone. now prism/mef allow kind of capability front end problem database end. can add logic create new tables new module how can update ria services , edmx file handle entities new module. is possible in ria? or there other technology out there supports kind of dynamic db update? thanks just update model , re-generate ria services... code write either ria services or entity framework should use partial class extensions code doesnt erased upon updating either.

ruby on rails - how to delete users on devise as an admin -

as admin want delete users database. in view list users database. when click button want user deleted. come far, wont give me right solution. thx time! this view @users.each |user| button_to 'delete user',"#", :controller => "users", :action => "delete_user", :id => user.id, :confirm => "are sure?", :method => :delete this controller: class userscontroller < devise::registrationscontroller def delete_user @deleted_user = user.find(params[:id]) @deleted_user.destroy end end you have create controller (or action in exsisting controller )to manage user model. try here , strip out cancan part. have nice day!

Applying a CSS border to an element with -webkit-border-image -

i want able apply gradient border without applying gradient element itself. webkit documentation doing this implies should possible, can't come way of creating black box, gradient border around it. far can tell, bug webkit. here's css: div { border-width: 10px 10px 10px 10px; width: 75px; height: 75px; background-color:#000; -webkit-border-image: -webkit-gradient(linear, left top, left bottom, from(#00abeb), to(#fff)) 21 30 30 21; } if try code , run in chrome or safari, youll see webkit applies border-image gradient entire element rather border. there way accomplish i'm looking css, without using images? thank you! the border-image implementation in webkit (and, believe, released browsers) based off 2008 draft of backgrounds , borders module. want currently specced behaviour fill keyword: the ‘fill’ keyword, if present, causes middle part of border-image preserved. (by default discarded, i.e., treated empty.) unfortun...

Should I add WCF to my ASP.NET MVC site to feed data to mobile apps? -

[i've never used wcf before. i've been googling couple days , haven't found info makes decision of whether or not use obvious me.] i've been developing website using asp.net mvc, linq sql, , sql server. now want develop mobile apps fed data site's db. it has been suggested me use wcf this. i know if have data facing public internet, can scraped if wants it, i'd minimize "scrapablility" of data. since mobile apps sending/receiving data in json format, benefits using wcf instead of restful json-returning uri's in mvc? and if implement wcf, should mvc site hitting services data instead of using linq in controllers? i've got asp.net mvc application hitting wcf. developed without wcf having controllers interact service layer hits repositories. requirement came during development required me physically separate ui service layer. adding wcf pain in rear. things worked without wcf no longer worked afterwards. example, s...

javascript - "unresolving" a deferred object -

in short, there way "unresolve" deferred object? for example: have list of data needs updated periodically, or when event triggered. great take deferred object created .ajax() , pass it's promise around gather callbacks. "fire" ajax request whenever want , have callbacks react. possible? cheers as of jquery 1.7, there progress() can used multi-fire situations.

sql server - No connection could be made because the target machine actively refused it 127.0.0.1:2382 -

i trying connect ssas engine(sql server denali) failing following error "no connection made because target machine actively refused 127.0.0.1:2382" ssas service running under network service account , sql browser service running on local system acc what os running? had similar problem , resolved issue changing sql server browser account built in account name account password. open sql server configuration management right click sql server browser , select properties. in log on tab select "this account:" radio button. can enter user , password or can press browser button. use admin log local machine sql server installed. if press browser button when select user or group page appear press advance button , select 1 of account. in bid may need impersonate data source. dirty solution work me in vista machine installed sql server r2 practicing. let me know if work you.

Problems retrieving Data using stored procedure in asp.net web service -

i have stored procedure in database: select somewhere id = @id , category in (select carid carcategory where..) when test stored procedure in visual studio execute works fine but when call web service function uses procedure doesn't give me results (the dataset retrieved empty) so had no choice rewrite stored procedure in this: select somthing somewhere id = @id , category = @category but isn't want want previous method function. more info on problem: i think remote server can't access carcategory table data,,, possible?? because when use stored procedure call function call procedure info carcategory doesn't work , send me error. why cant server find row,, there plenty of rows should retrieved annoying, cant figure out why can 1 help?????????????? this error is: system.web.services.protocols.soapexception: server unable process request. ---> system.indexoutofrangeexception: there no row @ position 0. @ system.data.rbtree`1.g...

cocos2d iphone - How to read a plist data and get int from it? -

currently using cocos2d. have plist data name myplist.plist. inside plist integers.. how read data , int in it? nsstring *path = [[nsbundle mainbundle] bundlepath]; nsstring *dictionarypath = [path stringbyappendingpathcomponent:@"myplist.plist"]; nsdictionary *integerdictionary = [[nsdictionary alloc] initwithcontentsoffile:dictionarypath]; int myinteger1 = [[integerdictionary objectforkey:@"integer1"] intvalue]; int myinteger2 = [[integerdictionary objectforkey:@"integer2"] intvalue]; // etc etc

visual studio 2010 - MSBuild pre clean customization -

i working visual studio 2010. have directed project output specific folder contain dlls , exes when built. when clean solution, folder not getting cleaned, , dlls still present in it. can tell me how handle clean solution command clear out folders want clean? tried working msbuild , handling beforeclean , afterclean targets, did not provide desired result. the answer sergio should work think cleaner override beforeclean/afterclean targets. these hooks build/clean process provided microsoft. when clean, vs call targets : beforeclean;clean;afterclean , default first , last nothing. in 1 of existing .csproj file can add following : <target name="beforeclean"> <!-- stuff here --> </target>

Reading only one column from SQL output as a numerical array in PHP -

i run following query: select tagid, count(*) totaloccurrences coupon_tags group tagid order totaloccurrences desc limit 10 it returns output this: tagid totaloccurrences ------------------------ 7 9 2 8 1 3 6 2 3 1 4 1 5 1 8 1 i can't mysql_fetch_array(mysql_query($thatquery); because has 2 columns of data , array pulled looks garbage. how can further streamline query single column of still-sorted data, it's easier work in array? or maybe using wrong php/mysql function (although looked through them all)? edit: i've found out query work fine in phpmyadmin fails when try query mysql_query() . my php code: $tagsql = mysql_query($selectorsql); if (!$tagsql) die("query failed"); //fails here while ($tsrow = mysql_fetch_assoc($tagsql)) { var_dump($tsrow); } you can "streamline query single column of still-sorted data". ...

Google check out notifications -

hi, i need serial number or unique value therefore if transaction process got on or cut between user , google checkout using html , python storing data database .i read api call iam getting error iam using digital goods please me in detail read google checkout notification steps comples me , didnt understand, not aware of xml or java script please me how it.. thanks in advance, nimmy... you can try google checkout digital delivery: http://code.google.com/apis/checkout/developer/google_checkout_digital_delivery.html there python wrapper library google checkout: http://code.google.com/p/gchecky/

git coding with IDE -

i'm new git. before using git, used subversion web project. 1 thing i'm wondering how code on ide when working git. svn, 1 version of code locally stored on computer have open , edit version directly before committing remote repo. git, have multiples revisions stored locally don't know how work using ide. must ide support git? currently, i'm managing code using integrated editor in terminal not convenient. i don't understand how ide relevant. commit whenever want normal, , when want push remote repository, so. it's bonus if ide supports git of course, don't need switch between console , ide, doesn't have to. ide should ignore git's repository have ignore .svn directories subversion. certainly working visual studio - without plugins - has given me no git-related problems.

how to make button in leftside of UItoolbar in iphone -

how can make button placed in left side of uitoolbar on iphone? as example, need this. uibarbuttonitem *fixedcenter = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemfixedspace target:nil action:nil]; fixedcenter.width = 80.0f; uibarbuttonitem *fixedleft = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemfixedspace target:nil action:nil]; fixedleft.width = 40.0f; uibarbuttonitem *left = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"left.png"] style:uibarbuttonitemstyleplain target:self action:@selector(moveback:)]; uibarbuttonitem *right = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"right.png"] style:uibarbuttonitemstyleplain target:self action:@selector(moveforward:)]; [self settoolbaritems:[nsarray arraywithobjects:fixedleft, flex, left, fixedcenter, right, flex, action, nil]];

module - Need some guidance on producing checksums in Perl -

i'm needing produce checksum bunch of data in perl, , came across digest::md5 module. looks fit bill, thought ask here see if has advise or possibly knows of better module use or maybe more suitable digest algorithm. what's being hashed 10 tables worth of data (one logical tuple @ time). first time make use of checksums, tips, tricks, gotchas appreciated. edit: far know, there's nothing wrong digest:md5, i've never used nor familiar hash algorithms. hoping experience able tell me if on right track or not. wanted little bit of confirmation before going far. yes, digest::md5 trick; it's written gisle aas (author of lwp among other excellent packages) , has good reviews & ratings on cpanratings , both of should reassure it's choice. using can simple as: my $checksum = digest::md5::md5_hex($data); if think may change chosen digest algorithm in future (for instance, using sha-1 instead), might want consider using digest instead - wri...

c++ - Error while compiling RInside code -

i want compile r code using rinside. getting errors while using function read.csv. code snippet given below: include "rinside.h" include <iomanip> include <iostream> include <fstream> include <string> include <vector> include <sstream> using namespace std; int main(int argc,char*argv[]) { rinside r(argc,argv); sexp ans; r.parseevalq("library(plotrix)"); r.parseevalq("filecontents<-read.csv("/home/nibha/manoj/test.csv")"); r.parseevalq("nr <-nrow (filecontents)"); r.parseevalq("nc <-ncol (filecontents)"); } i getting errors follows: : in function ‘int main(int, char**)’: prog3.cpp:14: error: ‘home’ not declared in scope prog3.cpp:14: error: ‘nibha’ not declared in scope prog3.cpp:14: error: ‘manoj’ not declared in scope prog3.cpp:14: error: ‘test’ not declared in scope prog3.cpp:20: error: ‘myfile’ not declared in scope ...

c# - AJAX ComboBox - dropdown button missing -

using ajax combobox inside of accordion control. in fact, accordion control nested inside accordion, if problem. anyway -- have 2 combo boxes - on first 1 seems on page postback drop down button see list of available items disappears. on second one, never there. here code: <asp:accordionpane id="pane1" runat="server" headercssclass="accordionheader" contentcssclass="accordioncontent" > <header> query view </header> <content> <asp:label id="lbl_chkone" cssclass="label" runat="server" text="by user" ></asp:label> <input id="chk_one" type="checkbox" onclick="changepane(0,this)" groupkey="query" /> <asp:label id="lbl_chktwo" cssclass="label" runat="server" text="all users" ></asp:label> <input id="chk_two" type=...

c# - Best Practice for IEnumerable in event arguments -

i have dll including class managing audio , midi ports , connections. whenever ports registered or deregistered or connections formed or released, class fires event, connectionchanged custom event arguments including properties enum changetype , ienumerable<connection> changedconnections now question is: should send changed connections or change property of event args connections , send ienumerable containing active connections? in opinion, event called "connectionchanged", should include connections apply event in event arguments. make active connections accessible using member on class. when firing event. send actual object raised event in member sender. if interested in active connections, can obtained through sender object.

Error 0x80004005 when reading dump file with WinDbg -

i'm working on 32 bit application causes 64 bit windows 7 machine crash. i've generated dump file of crash using procdump utility sysinternals. (i used command "procdump -ma -h myapplication.exe".) now, when open dump file windbg, error: "failure when opening dump file 'mydumpfile.dmp', hresult 0x80004005. may corrupt or in format not understood debugger." this happens both when running windbg x86 on 32 bit windows xp machine, , when running windbg amd64 on 64 bit windows 7 machine. can explain this? edit - additional info: when running dumpchk on file, says: "minidump not have system info. not open dump file [mydumpfile.dmp], hresult 0x80004005 'unspecified error'". maybe dump file corrupt? seems not use procdump correctly. can try use adplus (which in debugging tools windows) capture crash dumps? http://support.microsoft.com/kb/286350

winforms - how to add radioButton & CheckBox in DataGridView? in C#.net -

how add radiobutton & checkbox in datagridview? , 1 checkbox should selected @ time , how add event oncheck or onselected event? se these: http://www.codeproject.com/kb/grid/control_datagrid.aspx http://msdn.microsoft.com/en-us/library/aa730882%28vs.80%29.aspx these rune time: http://www.c-sharpcorner.com/uploadfile/tameta/addingcontrolstoadatagridatruntime11262005041201am/addingcontrolstoadatagridatruntime.aspx

c# - Unit test multi thread environment with breakpoints in Visual Studio 2008 -

Image
i having problem while debugging unit test in visual studio 2008. unit test uses system.timers.timer (within business logic) handle delay (1'000 miliseconds). thread running test put sleep 5'000 miliseconds. when running test on own, passes. when running tests (>120) passes , fails ( not deterministic ). tried setting breakpoint in mock object, set flag asserted in unit test. when debug test on own, phenomenon, assert.istrue() fails quick watch tells me, true: public class objectmanageraccessmock : iobjectmanageraccess { public bool executecommandwascalled { get; set; } public void executecommand() { executecommandwascalled = true; //set breakpoint here } } does thread running test continue run, when thread stopped (through breakpoint)? i suspect you're seeing while debugging side-effect. assertion fails because false, due threading concerns value true time view in debugger. increasing timeout in test should solve probl...

google play - upload android application to android market -

i have developed android game application , want upload android market. procedure this? first, read manual, it's not complicated. basically: make android market account (it cost 25 dollars think) go market. make sure apk signed described in manual. fill in details of apk, upload it, etc press publish .... profit!

javascript - Node.js modules vs Objects -

i have been playing around node.js, , coming java background, struggling differentiate between modules , typical concept of objects in javascript. when implementing modules, doing way: // somemodule.js var privatevariable; this.samplefunction = function() { // ... } now, way using module in place is: var modulename = require('./somemodule'); var foo = modulename.samplefunction(); i don't know if right way modular development in node.js - because realized not using objects, using new() - need when want have collections etc. right way proceed here if want collection of person objects - how module , it's definition like? // somemodule.js var privatevariable; this.person = function(firstname, lastname) { this.firstname = '...'; } and then: var modulename = require('./somemodule'); var foo = new modulename.person('foo', 'bar');

jsp - What is wrong with this struts-config.xml? -

getting following error : java.lang.nullpointerexception: module 'null' not found. <?xml version="1.0" encoding="utf-8" ?> <struts-config> <form-beans> <form-bean name="registrationform" type="com.testapp.actionform.registrationform" /> </form-beans> <global-exceptions> </global-exceptions> <global-forwards> </global-forwards> <action-mappings> <action path="/registration" type="com.testapp.action.registrationaction" name="registrationform" scope="request" validate="false" input="index.jsp" > <forward name="success" path="/pages/registrationsuccess.jsp" /> </action> </action-mappings> <message-resources parameter="resources...

ffmpeg to transcode streaming video and storage -

examples of ffmpeg i've seen far seem accept file on disk storage input, transcode file in disk storage output. i've come accross ffserver can used stream-out video. however, yet find tutorial or example of ffmpeg used transcode streaming video/audio, constrained parameters running-time or no. of frames or other event, , save transcoded media on disk. any pointers, tips or hints help. after significant research, i've come conclusion gstreamer ideal mechanism (a framework tools & libraries) this. allows me pretty want "transcoding" activities (framerate control, re-encode, framesize modifications etc.), , allows me restream , store disk. while framework expects done programmaticly set of command line tools allows 1 create transformation pipelines, quite intuitive. there decent documentation, although there scope improvement. best part is, allows 1 invoke several 3rd party libraries plugins, instance ffmpeg , effects plugins audio & video. ...

xna - randomness from spritemap in spritebatch -

im sure fixed, , have searched both high , low, traversed net both east, west, north , south no prevail... my problem this. im in middle of trying make bejeweled clone, me started in xna. im stuck on random plotting of gems/icons/pictures. this have. first generated list of positions, random , rectangle: list<vector2> platser = new list<vector2>(); random slump = new random(); rectangle bildsourcen; protected override void initialize() { (int j = 0; j < 5; j++) { (int = 0; < 5; i++) { platser.add(new vector2((i*100),(j*100))); } } base.initialize(); } pretty straight-forward. i have loaded texture, 5 icons/gems/pictures -> 5*100px = width of 500px. allimage = content.load<texture2d>("icons/all"); then comes "error". protected override void draw(gametime gametime) { graphicsdevice.clear(color.cornflowerblue); spritebatch.begin(); ...

jQuery recursive image loading and IE -

i'm trying load bunch of images recursively , works in browsers except god-forsaken ie because of restriction of 13 recursions. now can fix on own, want follow "best practice", speak, since i'm still learning jquery. , i'm guessing gurus around here give helpful pointer. how suggest fixing it? my code snippet: $(document).ready(function(){ loadthumbs(["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg","8.jpg", "9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","15.jpg", "16.jpg","17.jpg","18.jpg","19.jpg","20.jpg"], 0); }); function loadthumbs(files, index){ if(index == files.length) return; var file = files[index]; var image = new image(); $(image) .load(function(){ $("#conta...

c# - How to invoke an executable desktop application from within an ASP.NET MVC application? -

i have finished developing executable desktop application generate fractal image based on passed-in arguments. output type jpeg. now developing site under asp.net mvc 3. want use executable within site. is possible use without converting class library , recompiling? if mean "to run on user's machine", not "as is" - might want @ silverlight that. if mean "to use @ server", of course depend on how operates (whether prompts input etc), , how works (does use gdi+, example? isn't recommended use on web servers). but sure; can shell exe process.start , or if .net exe can either add reference directly exe , use as library (if has appropriate code) there way run in-process via appdomain.executeassembly - not sure latter idea on web-server, though... if exe talks stdout . for getting image client, want processing happen (perhaps caching) in route uses return file(...); mvc simulate image stream.

c# - How to tell a GridView to open a HyperLink on a CellClick? -

i have gridview several columns. 1 of columns templatefield containing hyperlink. i want hyperlink "clicked" if user clicks anywhere in respective row. if user clicks in column2 of row1, want page behave if user clicked on link in column1 of row1. how can realise such feature? just add javascript onclick event handler row. can in onitemdatabound event can @ url in first column

Is there an OCR library that outputs coordinates of words found within an image? -

in experience, ocr libraries tend merely output text found within image not where text found. there ocr library outputs both words found within image as as coordinates ( x, y, width, height ) words found? most commercial ocr engines return word , character coordinate positions have work sdk's extract information. tesseract ocr return position information has been not easy to. version 3.01 make easier dll interface still being worked on. unfortunately free ocr programs use tesseract ocr in basic , report raw ascii results. www.transym.com - transym tocr - outputs coordinates. www.rerecognition.com - kasmos engine returns coordinates. also caere omnipage, mitek, abbyy, charactell return character positions.

ruby on rails - Nested Model Form - dynamically adding/removing fields -

i have been following railscasts 'nested model form parts 1 & 2' survey form containing questions in turn contain answers. thing when survey form displayed, question field, along 1 answer field displayed. when user clicks on 'add question' field, question field displayed. no answer field displayed until user clicks on 'add answer'. i both question field , answer field displayed when user clicks on 'add question'. currently code this: # helpers/application_helper.rb module applicationhelper def link_to_add_fields(name, f, association) new_object = f.object.class.reflect_on_association(association).klass.new fields = f.fields_for(association, new_object, :child_index => "new_#{association}") |builder| render(association.to_s.singularize + "_fields", :f => builder) end link_to_function(name, h("add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\")...

c# - Replacing _x with string.empty using Regex.Replace -

i have string "region_2>0" want replace _2 string.empty using regex. my expression ((_)[^_]*)\w(?=[\s=!><]) in both regulator , expresso gives me _2. however, code(c#): regex.match(legacyexpression, "((_)[^_]*)\\w(?=[\\s=!><])").value gives me "_2>0", causes replace wrong (it returns "region" since removing whole "_2>0" instead of "_2". result want "region>0". shouldn't code , regex programs give same results? , how can work? (note string not static, in many different forms, rule want replace last _x in string string.empty. thanks! i copied code new project: static void main(string[] args) { var legacyexpression = "region_2>0"; var rex = regex.match(legacyexpression, "((_)[^_]*)\\w(?=[\\s=!><])").value; console.writeline(rex); console.readkey(); } the output _2 .

windows - What combination of MINIDUMP_TYPE enumeration values will give me the most 'complete' mini dump? -

i want app create mini dump debug unhanded exceptions. i may not know type of mini dump want until after dump has been created, combinations of minidump_type flags should use give me complete dump possible? i came following list of debuginfo.com link (thanks david) , msdn page. not flags covered in debuginfo.com link. using these flags should create comprehensive, big mini dump. include: minidumpwithfullmemory - contents of every readable page in process address space included in dump. minidumpwithhandledata - includes info handles in process handle table. minidumpwiththreadinfo - includes thread times, start address , affinity. minidumpwithprocessthreaddata - includes contents of process , thread environment blocks. minidumpwithfullmemoryinfo - includes info on virtual memory layout. minidumpwithunloadedmodules - includes info unloa...

c# - Representing heirarchical enumeration -

i have set of enumeration values (fault codes precise). code 16 bit unsigned integer. looking data structure represent such enumeration. similar question has been asked here: what's best c# pattern implementing hierarchy enum? . hierarchy deeper. sample enumeration values current = 0x2000, current_deviceinputside = 0x2100, shorttoearth = 0x2120, shorttoearthinphase1 = 0x2121, shorttoearthinphase2 = 0x2122, shorttoearthinphase3 = 0x2123 use case when user provides code ui has display equivalent meaning of code hierarchy. example, if user provides value 0x2121 ui has display short earth in phase 1 in current @ device input side . best way represent using hierarchical notation: current : deviceinputside : shorttoearth : shorttoearthinphase1 . competing approaches have 3 competing approaches represent enumeration: create enumeration @ each level of hierarchy. use controller class resolve name. store enumeration values in xml , use linq generate meaning of code. st...

rails custom validation on action -

i know if there's way use rails validations on custom action. for example this: validates_presence_of :description, :on => :publish, :message => "can't blank" i basic validations create , save, there great many things don't want require front. ie, should able save barebones record without validating fields, have custom "publish" action , state in controller , model when used should validate make sure record 100% the above example didn't work, ideas? update: my state machine looks this: include activerecord::transitions state_machine state :draft state :active state :offline event :publish transitions :to => :active, :from => :draft, :on_transition => :do_submit_to_user, :guard => :validates_a_lot? end end i found can add guards, still i'd able use rails validations instead of doing on custom method. that looks more business logic rather model validation me. in pro...

web parts - Which is the full url for file types' icons in SharePoint 2010 -

i'm building webpart in visual studio 2010 , show files' icons next name. thought myfile.iconurl return full url, filename along extension. thanks in advance! most file type icons kept in 14 hive under /_layouts/images. ie: /_layouts/images/icbmp.gif

wpftoolkit - Overriding DataPointStyle in a WPF Toolkit Chart -

i'd override datapointstyle of lineseries in wpf toolkit chart : <chart:lineseries> <chart:datapointseries.datapointstyle> <style basedon="{staticresource {x:type chart:linedatapoint}}" targettype="{x:type chart:linedatapoint}"> <setter property="width" value="20" /> <setter property="height" value="20" /> </style> </chart:datapointseries.datapointstyle> </chart:lineseries> however when lose automatic palette coloring each series has different color. applying datapointstyle causes them turn orange. until suggests better method, i've manually set colors. guess won't using automatic palette now. <style x:key="simpledatapointstyle" basedon="{staticresource {x:type charting:linedatapoint}}" targettype="{x:type charting:linedatapoint}"...

c# - calculate average function of several functions -

Image
i have several ordered list of x/y pairs , want calculate ordered list of x/y pairs representing average of these lists. all these lists (including "average list") drawn onto chart (see example picture below). i have several problems: the different lists don't have same amount of values the x , y values can increase , decrease , increase (and on) (see example picture below) i need implement in c#, altought guess that's not important algorithm itself. sorry, can't explain problem in more formal or mathematical way. edit: replaced term "function" "list of x/y pairs" less confusing. i use method justin proposes, 1 adjustment. suggests using mappingtable fractional indices, though suggest integer indices. might sound little mathematical, it's no shame have read following twice(i'd have too). suppose point @ index in list of pairs has searched closest points in list b, , closest point @ index j. find closest poi...

java - LazyList.decorate - InstantiateFactory: The constructor must exist and be public exception -

i have code: public class user ... private list<country> countries = lazylist.decorate(new arraylist(), factoryutils.instantiatefactory(country.class)); private string country; ... public void setcountries(list<country> countries) { this.countries = countries; } public list<country> getcountries() { return countries; } ... in country class: public class country { private int countryid; private string countryname; public country(int countryid, string countryname) { this.countryid = countryid; this.countryname = countryname; } public int getcountryid() { return countryid; } public void setcountryid(int countryid) { this.countryid = countryid; } public string getcountryname() { return countryname; } public void setcountryname(string countryname) { this.countryname = countryname; } } when create new user object give ex...