Posts

Showing posts from June, 2010

Creating signatures of a class in vim -

i have file filled text: class baz { void test() { } int sum (int) { } } and want create buffer text following: interface ibaz { void test(); int sum (int); } how can edit in vim. plugin or strokes on keyboard if file follows exact pattern posted, can solve 4 commands: :%s/^class\s*/interface :%s/^\s\+{\_[^}]*}// :g/^\s*$/d :%s/)\zs$/; change class interface i delete indented blocks remove blank lines add ; after ending ) if need use in more 1 file (though recommend if you're going use once) copy , paste text buffer write on file, /tmp/cs . then, while focused on buffer want change, run :so /tmp/cs .

c++ - boost::make_shared causes access violation -

i have visual studio 2008 c++ application armv4i windows mobile 6 i'm using boost::shared_ptr<> manage large object (4kb). unfortunately, boost::make_shared<> causes access violation exception. my code: struct foo { char a[ 4 * 1024 - 1 ]; }; int _tmain( int argc, _tchar* argv[] ) { boost::shared_ptr< foo > f = boost::make_shared< foo >(); // access violation return 0; } the exception callstack: test.exe!boost::detail::sp_ms_deleter<o>::sp_ms_deleter<o>(void) line: 60, byte offsets: 0x18 c++ test.exe!boost::make_shared<o>(void) line: 106, byte offsets: 0x5c c++ test.exe!wmain(int argc = 1, wchar_t** argv = 0x01b40060) line: 81, byte offsets: 0x18 c++ test.exe!mainwcrtstartup(hinstance__* hinstance = 0x00000003, hinstance__* hinstanceprev = 0x00000000, unsigned short* lpszcmdline = 0x00000003, int ncmdshow = 0) line: 188, byte offsets: 0x94 c++ the location of exception (boost\smart_ptr\make_shared.hpp):

android - Error Calling Intent -

there error when call intent startactivity (new intent (this, advogado1.class)) , how should proceed call intent alertdialog.builder alert = new alertdialog.builder(this); alert.settitle("atenção"); alert.setmessage("digite o numero da oab"); // set edittext view user input final edittext input = new edittext(this); alert.setview(input); alert.setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int whichbutton) { int oab = integer.parseint(input.gettext() .tostring()); // value! if (oab == 1) { startactivity(new intent(this, advogado1.class)); }

asp.net - Background-color style in FF/chrome -

Image
does know why 'container' div isn't showing white bg-color it's parent div s? i'm getting black (lime in example better description) bg-color css body setting. please excuse sloppy styling. did best reduce code , show relative stuff. btw, i've tried making 'container' div , it's child divs' style bg-color white; , still doesn't work. when give highest div large height attribute (say 1000px), shows white point, thought didn't have that. should dynamic: controls within div expand, divs height should expand well. have many pages that, don't have problem.. but pg attempt column divs. , happens right when 'container' div columns start (see pic). , yea, happens in ff , chrome. works fine in ie <head runat="server"> <title>loaner transfer</title> <link rel="stylesheet" type="text/css" href="../styles/bodylayout.css" /> <link rel="stylesheet"

objective c - Insert music with copyright -

i put song in game on itunes. song friend of mine gave me permission put it. put in credits: title, author , label, enough? or should send document apple? at app submittal, there entry in form fill out provide comments reviewers. can provide information here.

android - Filter Intent based on custom data -

i want broadcast intent custom-data , receiver have custom data should receive intent, how done ? this how broadcast intent : intent intent = new intent(); intent.setaction("com.example"); context.sendbroadcast(intent); and define broadcast receiver following : <receiver android:name="com.test.myreceiver" android:enabled="true"> <intent-filter> <action android:name="com.example"></action> </intent-filter> </receiver> setup myreceiver class how anmustangs posted. public class myreceiver extends broadcastreceiver{ @override public void onreceive(context arg0, intent intent) { //do } } you shouldn't have check intent action because you've filtered based on you've included in manifest, @ least in simple case. have other actions , filters in case you'd need have kind of check on received intent. if want filter filter o

javascript - jQuery UI, iFrame, Blue Image Border In IE(9) -

right now, have jquery ui pop-up dialog reads external page. page reads external has video via flowplayer. i'm using iframe embed video in first: <iframe id="iframedonkey" width="100%" height="496" src="../../../../video/donkey-2009-02-23.html" frameborder="0"></iframe> to control border, css: iframe { border: 0px; } html (all aforementioned pages): <style> img { border:0 } </style> but still see blue border around video preview picture in internet explorer. any suggestions please? i can't test this, had similar problem in earlier versions of ie , fixed it: img { border-style:none; }

Best font to use with Ubuntu Intellij Idea -

intellij idea poorly renders editor fonts on ubuntu. have found lot of questions , blog posts problem, nothing satisfies me. developer font renders in idea on ubuntu? i'm using liberation mono looks ubuntu 12.04 , idea 11. others i've liked envy code r , dejavu sans mono .

android - Looping frame by frame animation -

i'm trying animation run 6 times, set oneshot="true" , tried loop animation doesn't work, animation still runs once. any appreciated. here code <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true"> <item android:drawable="@drawable/image" android:duration="100" /> <item android:drawable="@drawable/image1" android:duration="100" /> <item android:drawable="@drawable/image2" android:duration="100" /> <item android:drawable="@drawable/image3" android:duration="100" /> <item android:drawable="@drawable/image4" android:duration="100" /> </animation-list> . (int = 0; < 5; i++){ img.setbackgroundresource(r.anim.anime); animationdrawable frameanimation = (animationdrawable)img.getbackground(); frameanimation.setcallb

php - Does this function even exist or is it deprecated? -

i have being trying figure out, in vain, whether controller function exists: $controller->field . have looked around internet , haven't been able find documentation on function. deprecated or exist? can shed light on it? $event = new eventscontroller; $event->constructclasses(); $data = $event->field('title', "title = '".mysql_real_escape_string($this->params['form']['newtitle'])."'"); this model function, not controller one. http://book.cakephp.org/view/1028/field

How do I start multiple main programs in a Java executable .jar? -

i'm writing program contains multiple packages in it. each package has own main program want launch simultaneously when .jar executed interpreter. seems simple question, when looked around, seems people using ants (which i've never used before) , other methods. there simpler way in eclipse compile .jar multiple launch configurations, better yet, there way hard code in? if best way launch through ant. kind of ant script write if want launch... main programs in packets com.myapp.package1.main, com.myapp.package2.main, , com.myapp.package3.main. in advance! the jar manifest allows optionally specify no more 1 main class. invoked when execute java -jar flag. java -jar myapp.jar you may include multiple main classes in single jar, each (except optional 1 above) must invoked using -classpath flag , qualified name of main class specified. java -classpath myapp.jar com.mypackage.app.main01 && \ java -classpath myapp.jar com.mypackage.app.main02 &&a

"Exception in thread "main" java.lang.NullPointerException" -

i'm trying run program will, if goes well, able take year , return title of album released in year. i've given 6 albums , i'm trying print title. i've fixed few pretty frustrating errors, 1 i've not seen before. error appears @ line 21, i'm not sure means. can help? package songselector; import java.util.scanner; public class main { public class album { int year; string title; public album () { this.year = 0; this.title = null; } public album (int year, string title) { this.year = year; this.title = title; } } class cake { album[] albums; public cake () { albums = new album[6]; albums[0].year = 1994; albums[0].title = "motorcade of generosity"; albums[1].year = 1996; albums[1].title = "fashion nugget"; albums[2].year = 1998; albums[2].title = "prolonging magic"; albums[3].year = 2001; albums[3].title = "comfort eagle"; albums[4].year = 2004; albums[4].title = "pressure chief";

asp.net mvc 3 - Is it okay to include markup after the closing </html> tag? -

since closing html tag optional , okay include markup after closing </html> tag? an example of exists phil haack's routedebugger library . sample output looks this: <!doctype html> <html> <head> <title>index</title> <link href="/content/site.css" rel="stylesheet" type="text/css" /> <script src="/scripts/jquery-1.4.4.min.js" type="text/javascript"></script> </head> <body> <h2>index</h2> </body> </html> <!-- content after closing html tag! --> <html> <div id="haackroutedebugger" style="background-color: #fff;"> <style> #haackroutedebugger, #haackroutedebugger td, #haackroutedebugger th {background-color: #fff; font-family: verdana, helvetica, san-serif; font-size: small;} #haackroutedebugger tr.header td, #haackroutedebugger tr.header th {background-color: #ff

c - Closing a pipe causes the wrong line to be read from a file (that's independent of the pipe) -

i'm writing program has number of child processes. parent has 2 pipes write child, each pipe dup2ed separate file descriptor in child. parent reads through script file number of commands work needs do. seems work fine except i've noticed if try close pipe parent child if next line in script file blank read in weirdly. if print out comes out ���< program (understandably) doesn't know with. there seemingly no link @ between file pointer i'm reading in , pipe i'm closing. my code reading in lines in below. works normally, in case doesn't work , can't work out why. char *get_script_line(file *script) { char *line; char charread; int placeinstr = 0; int currentsizeofstr = 80; int maxstrlength = 64; /* initialize line */ line = (char *)malloc(sizeof(char)*currentsizeofstr); while ((charread = fgetc(script)) != eof && charread != '\n') { /* read each char input , put in array */ line[p

ruby - testing methods wrapped in blocks with RSpec -

in simplified example of i'm doing, let's have 2 calls database: repo.add( something_stringy ) repo.remove( something_floaty ) and want use mocks database calls, real calls tested elsewhere: let(:repo){ repo = double("repo") repo.should_receive(:add).with(instance_of(string)) repo.should_receive(:remove).with(instance_of(float)) repo } before { fakeklass.const_set :repo, repo } that's fine , dandy, if wrap calls in transaction i'm bit stumped: repo.transaction # ... error checking in here somewhere... repo.add( something_stringy ) repo.remove( something_floaty ) end because if write mock receives transaction receive call, in block won't called, , get: expected: 1 time received: 0 times for of other mocks. able show me how should writing spec deal this? i've tried reading relevant page in rspec book on around(:each) clear mud me. any appreciated. you can use #and_yield yield expectation chain: rep

java - Remove duplicate chars from a String recursively -

i need figure how can remove duplicates chars string. has done recursively real problem.. public class feq2 { /** * @param args */ public static void removedups(string s, int firstchar, int secondchar) { if (s.length() == 1) { system.out.println(s); } char = s.charat(firstchar); if (a == s.charat(secondchar)) { s = + s.substring(secondchar + 1); } system.out.println(s); removedups(s, firstchar + 1, secondchar + 1); //return s; } public static void main(string[] args) { //system.out.println(removedups("aaaabbarrrcc", 1)); removedups("aaaabbarrrcc", 0 , 1); } } you can this: public static string removedups(string s) { if ( s.length() <= 1 ) return s; if( s.substring(1,2).equals(s.substring(0,1)) ) return removedups(s.substring(1)); else return s.substring(0,1) + removedups(s.substring(1)

string - Validation for a cell number in Android -

i have ui user enters cell number , number stored in string variable , stored database. i want validate string check whether string not contain characters. how do that? below string code. edittext edittext3 = (edittext) this.findviewbyid(r.id.edittext2); setnum = edittext3.gettext().tostring(); //setnum contain link 8081124589 to validate string, use if (setnum.matches(regexstr)) where regexstr can be: //matches numbers string regexstr = "^[0-9]*$" //matches 10-digit numbers string regexstr = "^[0-9]{10}$" //matches numbers , dashes, order really. string regexstr = "^[0-9\\-]*$" //matches 9999999999, 1-999-999-9999 , 999-999-9999 string regexstr = "^(1\\-)?[0-9]{3}\\-?[0-9]{3}\\-?[0-9]{4}$" there's long regex validate phones in (7 10 digits, extensions allowed, etc.). source answer: a comprehensive regex phone number validation string regexstr = "^(?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:\\(\\s*([2-9]1[02-9]|[

iphone - Building with xcodebuild Timed out waiting for <IDEWorkspace, 0x2004cebc0>/"runContextManager.runContexts" -

i setting iphone project run hudson, build script works fine locally, when executing following command on snow leopard server mac xcodebuild -sdk iphoneos4.3 -workspace moments.xcworkspace/ -scheme moments -configuration distributiontest i following error messages. build settings command line: sdkroot = iphoneos4.3 2011-05-11 10:32:17.729 xcodebuild[4151:903] warning: timed out waiting /"runcontextmanager.runcontexts" (10.010780 seconds elapsed) xcodebuild: error: workspace 'moments.xcworkspace/' not contain scheme named 'moments'. what's timeout about?! , why can't find scheme named moments when it's definitly there. if open workspace in xcode on build server, can see scheme. checking "shared" box in "manage schemes" dialog moves schemes project.xcodeproj/xcshareddata/xcschemes/scheme.xcscheme so if have clean checkout has never been opened via xcode ui, work. use buildbot can build our

Using SVN with Rational Application Developer(RAD) 7.0 or with Rational Software Architect(RSA) 7.0 -

we using version 7 of ibm rad/rsa (rational application developer/ibm rational software architect). there options connect same cvs there no options to connect svn. need install plugins same? can please suggest procedure. on further googling, found following link on ibm website: https://www-304.ibm.com/support/docview.wss?rs=0&uid=swg21255671 which points plugin eclipse: http://www.eclipse.org/projects/project_summary.php?projectid=technology.subversive

How to check logical and physical file size on disk using C# file API -

Image
how read logical , physical file size using c# api. (new fileinfo(path).length) is actual size. size on disk, don't think there's api it, can using actual size, , cluster size. there's info on calculation required here: http://social.msdn.microsoft.com/forums/en-us/vsexpressvcs/thread/85bf76ac-a254-41d4-a3d7-e7803c8d9bc3

mobile - Bluetooth dial with 32feet.net and c# -

i trying provide "click dial" solution bluetooth device such mobile phone. have been trying using 32feet.net bluetooth api. i haven't done bluetooth (since days of @ commands via bluetooth serial port) have paired device in question, supports handsfree service pc. have following code attempt connect , send dial command. string deviceaddr = "11:11:11:11:11:11"; bluetoothaddress addr = bluetoothaddress.parse(deviceaddr); bluetoothendpoint rep = new bluetoothendpoint(addr, bluetoothservice.handsfree); bluetoothclient cli = new bluetoothclient(); cli.connect(rep); stream peerstream = cli.getstream(); string dialcmd = "atd 0000000000\r\n"; byte[] dcb = system.text.encoding.ascii.getbytes(dialcmd); peerstream.write(dcb, 0, dcb.length); // begin edit ------------------------------------------------------------ byte[] sresponse = new byte[100]; peerstream.read(sresponse, 0, 99); textbox1.text = system.text.encoding.ascii.getstring(sresponse); // end

security - What are good and safe keylength for El-Gamal? -

what keylength el-gamal? this open-ended question , depends on platform want use, performance constraints, enemies et.c. the outdated gnupg faq sums nicely on length of elgamal keys - notice gpg creates 2048 bit elgamal keys default. [...] after all, if key large enough resist brute-force attack, eavesdropper merely switch other method obtaining plaintext data. examples of other methods include robbing home or office , mugging you. 1024 bits recommended key size . if genuinely need larger key size know , should consulting expert in data security. xkcd #538 of relevance here. :-)

javascript - Tool Tip problem in Internet Explorer -

css code /*********************/ /* tooltip */ /*********************/ a.tooltip, a.tooltip:link, a.tooltip:visited, a.tooltip:active { position: relative; text-decoration: none; cursor: pointer; font-style: italic; } a.tooltip:hover { font-weight: bold; background: transparent; visibility:visible; } a.tooltip span { display: none; text-decoration: none; } a.tooltip:hover span { display: block; position: absolute; top: 20px; left: 0; z-index: 2000; color: #000000; border:1px solid #000000; background: #efefef; font-family : verdana, arial,helvetica,sans-serif; font-size: 11px; text-align: left; } a.tooltip span b { display: block; margin: 0; padding: 2 2 2 2; font-family : verdana, arial,helvetica,sans-serif; font-size: 12px; font-weight: bold; font-style: normal; color: #ffffff; background-color: #000000; border-bottom: 1px solid black; } .analyzerguistatistics .queriesperdaytable{

stl - Using C++ vector::insert() to add to end of vector -

i'm writing little piece of code i'll have insert values c++ stl vector @ place depending on values in vector elements. i'm using insert() function accomplish this. realize when want add new element end of vector, use push_back() . keep code looking nice, i'd exclusively use insert() , takes input iterator pointing element after desired insertion point , value inserted. if value of iterator passed in argument v.end() , v vector, work same push_back() ? thanks lot! a.push_back(x) defined have identical semantics (void)a.insert(a.end(),x) sequence containers support it. see table 68 in iso/iec 14882:2003 23.1.1/12 [lib.sequence.reqmts].

asp.net - Unexpected HTTP Status Codes using WCAT with NTLM -

does know how avoid wcat recording unexpected "401 unauthorized" http status codes when testing web application uses ntlm authentication? example of code using request below: request { url = "http://server"; authentication = ntlm; username = "user"; password = "xxxx"; statuscode = 200; } to clarify, script works fine , manage retrieve content when ran against iis7 server ntlm negotiation (i believe) means initial 401 code recorded final 200 code. this means after test report shows same amount of 401 codes 200 codes, , unfortunately 401s recorded unexpected codes/errors. i realise similar question 1 asked earlier, 1 asking if there way avoid unexpected status codes. thanks! what need (i think) transaction { ... } number of request { ... } elements inside, of expect 401 statuscode: transaction { id = "home"; weight = 1000; request { url = "/";

.net - Possible bug in C# JIT optimizer? -

working on sqlhelper class automate stored procedures calls in similar way done in xmlrpc.net library , have hit strange problem when running method generated manually il code. i've narrowed down simple generated method (probably simplified more). create new assembly , type, containing 2 methods comply public interface itestdecimal { void testok(ref decimal value); void testwrong(ref decimal value); } the test methods loading decimal argument stack, boxing it, checking if it's null, , if not, unboxing it. the generation of testok() method follows: static void buildmethodok(typebuilder tb) { /* create method builder */ methodbuilder mthdbldr = tb.definemethod( "testok", methodattributes.public | methodattributes.virtual, typeof(void), new type[] {typeof(decimal).makebyreftype() }); parameterbuilder parambldr = mthdbldr.defineparameter(1, parameterattributes.in | parameterattributes.out, "value"); // generate il

blackberry - Crical Call Io Exception:Critical tunnel Failure problem in black berry -

in app connecting web,it not showing error when installed app in phone shows critical call io exception:critical tunnel failure. why error occurs.please me. thank follow link can solve problem:http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/what_is_-_different_ways_to_make_an_http_or_socket_connection.html?nodeid=826935&vernum=0 and can use following sample code: private static string getconnectionstring(){ string connectionstring=""; if(wlaninfo.getwlanstate()==wlaninfo.wlan_state_connected){ connectionstring=";interface=wifi"; } else if((coverageinfo.getcoveragestatus() & coverageinfo.coverage_mds) == coverageinfo.coverage_mds){ connectionstring = ";deviceside=false"; } else if((coverageinfo.getcoveragestatus() & coverageinfo.coverage_direct)==coverageinfo.coverage_direct){ string carrieruid=getcarrierbibsuid(); if(carrieruid == nul

C++ templates and header allocations -

i encountered problems memory allocations made in 1 dll (or *.so - portable code) , deallocation done in dll. errors encountered far are: it doesn't work - fails assert() on debug. it doesn't work if 1 dll statically linked standard c library , other dll dynamically linked it. it doesn't work if 1 dll allocation dll unloaded , dll tries deallocate memory. basically rule decided should follow not make allocations in 1 dll , release in (and preferably keep within 1 cpp file). means shouldn't allocations in header file may shared more 1 dlls. means i shouldn't allocations in tempaltes (since in header) , quite big limitation. when need create new object in template allocate memory cpp file , run c'tor placement new operator. // header class mybase { public: static void* allocate(std::size_t i_size); }; template <typename t> class myclass: mybase { public: t* createt(); }; temlpate <typename t> t* myclass<t>::createt() { vo

libreoffice - Why does git warn me that my branch has diverged from master? -

i'm contributing libreoffice , have started learning git. i've cloned libreoffice repository , got successful build. libreoffice has 19 git repositories 1 named bootstrap , remaining @ 1 level lower named writer, calc, postprocess, base etc. has got script maned g running git commands simultaneously in repositories instead of running individually. after cloning created patch pushed in remote repository. @ moment changes have been committed(i.e. git diff outputs nothing) , status i'm commit ahead of master branch. now when run ./g pull -r output: victor@victor-laptop:~/git/libo$ ./g pull -r ===== main repo ===== current branch master date. ===== artwork ===== current branch master date. ===== base ===== current branch master date. ===== calc ===== current branch master date. ===== components ===== current branch master date. ===== extensions ===== current branch master date. ===== extras ===== current branch master date. ===== filters ===== current branch master

ios4 - UIButton Background Change on click -

can tell me how change uibutton background image?i have customtableview holding 4 buttons.it's quiz app.i want show if ans correct or not loading 2 background image.if correct green image , if wrong red image. and when question loaded.reset them.it should happen in click.i done loading functionality , logical task of score counting.i need change button background image.can tell me how this? you should able calling [button setimage:[uiimage imagenamed:@"green.png"] forstate:uicontrolstatenormal]; or alternatively [button setbackgroundimage:[uiimage imagenamed:@"green.png"] forstate:uicontrolstatenormal]; documentation reference: setimage:forstate: setbackgroundimage:forstate:

php - ctype_digit - strange behaviour -

i have array , , first 13 values integer . now, if : array_push($pos1, 100); i'll aspect value 14 integer . in fact, doing : echo ctype_digit($pos1[12])." - ".ctype_digit($pos1[13]); the output 1 - this print_r, requested : array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [10] => 10 [11] => 11 [12] => 12 [13] => 100 ) why? this (in fact) little bit strange, ctype_digit() strictly requires string echo ctype_digit((string) $pos1[12])." - ".ctype_digit((string) $pos1[13]); // "1 - 1" i dont know, why php doesnt cast string. however, 1 in output comes type-cast, because ctype_digit() returns boolean echo true; // "1" echo false; // ""

wpf - Fill color from property via XAML -

i learning wpf , have simple question. how set fill color property vi xaml? <rectangle fill="{binding path=backgroundcolorf}" height="112" margin="0,84,0,0" verticalalignment="top" width="116"/> public partial class mainwindow : window { /// <summary> /// gets or sets backgroundcolor. /// </summary> public solidcolorbrush backgroundcolorf { get; set; } public mainwindow() { this.initializecomponent(); backgroundcolorf = new solidcolorbrush(colors.red); } } set datacontext this public mainwindow() { this.datacontext = this; this.initializecomponent(); backgroundcolorf = new solidcolorbrush(colors.red); } this should work.but there little more done making wpf app scalable notifications,dependency properties etc.i recommend go through basics of wpf databinding arc

ubuntu - How to find out or change url for Git Repository server -

i've installed git , gitosis on ubuntu server has 3 domain names parked. how know, of these domain names used git construct git access url, example, this: git@xxxxxxxx/repository.git can set xxxxxxx value? thank in advance, git looks great. (1) domain names - long resolve server ip, shouldn't matter. git connects on ssh, in case gitosis server. if can connect via ssh machine via of parked domains, can use git url. i don't believe git allows list multiple urls per remote, if want have 3 listed (worst case scenario perhaps) setup 3 remotes, each different domain server. (2) that's simple. check out .git/config file inside project directory. [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "origin"] url = git@github.com:my_awesome_app fetch = +refs/heads/*:refs/remotes/origin/* you need update url; example, i'm using github :) can add other r

javascript - safari and fileupload form doesnt work -

i'm trying add attachment upload typo3 extension, , since normal file-input doesn't work design. decided add text-input, display value, , button-input, fire file-inputs click event. works ff , ie without problems, when try on safari file-inputs click event doesn't work (others do!!!). <form action="" name="attachmentpostform" method="post" onsubmit="createattachmentpostaction(${uid});" enctype="multipart/form-data" target="attachementupload_target"> <input type=file name="leadimagefile" accept="image/gif,image/jpeg" onchange="document.getelementbyid('imagefakefile').value = this.value" id=imagetruefile style="display:none"> <input type=text id=imagefakefile readonly> <input type = button value="browse" onclick="document.getelementbyid('imaget

visual studio - How to use Crystal Report in ASP.Net -

i have installed crystal report sap vs 2010, body know way how call crystal report aspx page, , how can work on crystal report, new it. thanks atif no body got time reply, link, http://www.codeproject.com/kb/aspnet/crstalreportusingvs2010.aspx

java me - Float or double on Blackberry? -

can use double or float on blackberry? if so, in os version or hardware model? edit: believe answers here, something else must problem . apparently floating point doesn't work on versions of blackberry; see comments. bow, if j2me device implements cldc 1.0 profile, manufacturer not required include support floating point arithmetic in platform: see http://cmer.cis.uoguelph.ca/cs1cs3/slides.ppt in cldc 1.1, floating point support mandatory. in comments on other questions, blackberry cldc 1.1. if blackberry's floating point support doesn't work , claims implement cldc 1.1, that's either bug in execution platform or build tool-chain, or problem way using tool-chain. (i don't develop j2me stuff, can't more specific.)

regex - pattern for matching a filepath -

can please tell me grep pattern matching following filepath: ../any_directoryname/filename.txt i know filename. any_directoryname keeps on changing. thanks in advance, regards john try this: \.\./[^/]+/filename.txt this assumes 1 directory. if can more that, try \.\./[^\r\n]+/filename.txt

opencv - Optical flow in Android -

we have been dealing opencv 2 weeks make work on android. know can find android implementation of optical flow? nice if it's implemented using opencv. you can find implementation here: http://www.cs.cornell.edu/courses/cs4670/2010fa/projects/final/results/group_of_acc269_ty244_yc563/cs4670_final.html best -ali

authentication - Facebook C# sdk - simple Login - Where to start? -

i hope can me. think, solve problem easy, not able find tutorial me. i have .net web application, not mvc. application written in c#, framework 3.5, , uses sql 2008 db. has login-functionality. try first steps facebook c# sdk. my first target allow users login facebook account. should not canvas page. think should easy. should other method login application. want button near 'old' login button allows "login facebook account" i think in background, after successful facebook-login, have map facebook-userid db-user-id , should done. strategy ok? did forgot something? now not sure how start. think prerequirements ok now, not understand setps have do. the facebook sdk has lot of classes. right 1 me? i have in click-event: string appid = "xxx"; string[] extendedpermissions = new[] { "user_about_me", "offline_access" }; if (components.securitymanager.active.dologinoverfacebook(appid, extendedpermissions)) { // cod

c++ - arm-eabi-addr2line don't show line number -

i running arm-eabi-addr2line android project, command /applications/android-sdk-mac_86/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/darwin-x86/bin/arm-eabi-addr2line -c -f -e {my file} {address} and found return function name don't show line number, e.g, xxx::xxx::xxx() ??:0 any idea? do have debugging symbols in .so? should disable optimization (-o0) , inline functions (-fno-inline)

jQuery: caseless selector search? -

for example searching $('[name=whatever]') should find $('[name=whatever]') , $('[name=whatever]') thanks ;) any possible solution going inefficient, because cannot work browser's native selector engine. better use class identify elements. however, if you're insistent on approach, can use filter() : $('[name]').filter(function () { return this.name.tolowercase() == "whatever"; });

java - send parameter from request through json -

how can resend parameter received servlet servlet using json. here's mean, using way pass parameters servlet <a href="studentmanagementservlet?page=${page}&isactivated=${isactivated}" > but now, wanna make using json, how can reach ${page} , ${isactivated} json? jsp parses page before sends client, can use ${variables} anywhere in code, including inline in javascript. to store them javascript object: var obj = { page: ${page}, isactivated: ${isactivated} }; to store them json object: var jsonobject = { "page" : "${page}", "isactivated": "${isactivated}" }; now, if want send different servlet, you'll need attach json objectto post request servlet. unfortunately can't post requests anchor tag, you'll need either ajax call or form submit jsonobject 1 of values.

python - Sort queryset by values in list -

is possible sort django queryset list of elements provided in query? example, if m.objects.filter(id__in=[3,1,8]) i wan't order of queryset element of id 3, element of id 1 , element of id 8. thanks no. there no way want short of contrived mechanism like: qs = m.objects.filter(id__in=[3,1,8]) qs_sorted = list() id in [3,1,8]: qs_sorted.append(qs.get(id=id)) you'd need throw exception handling in there well, in case 1 of specified ids wasn't returned. the negatives negate lazy loading of queryset. in fact, it's generate multiple db queries (haven't tested though). also, end normal python list instead of queryset, no more filtering possible.

Moving menus in Wordpress -

i make own theme wordpress, problem can't move pages vertical menu horizontal menu. how can move pages vertical menu horizontal menu in wordpress, image? http://imageshack.us/photo/my-images/852/questionq.gif/ here example of horizontal menu: <div id="navmenu"> <ul> <li><a href="<?php echo get_settings('home'); ?>">home</a></li> <?php wp_list_pages('orderby=name&include=1,3,4,5'); ?> <li><a href="http://www.wordpress.org">wordpress</a></li> </ul> </div>

iphone - objectiveC/CMTime - convert AVPlayer.duration to milliseconds -

i'm creating app playing ringtone , i'd want know current time in milliseconds of played ringtone every time. cmtime ctime = player_.currenttime; float currenttime = ctime.value / ctime.timescale; that currenttime here gets value in seconds. how can exact currenttime value in milliseconds? there way current times in seconds, can take 1000 times , ther have miliseconds: float64 dur = cmtimegetseconds([player currenttime]); float64 durinmilisec = 1000*dur; sadly have use float or float64 can't use result cmtime

asp.net - Why encrypt a web config file? -

as far can tell, section in web.config file can encrypted & decrypted using aspnet_regiis.exe. if aspnet_regiis can used decrypt web.config file, what's point of encrypting it? keep passwords & sensitive information being stored plain text? if file , exe can decrypt it, protect sensitive config info? update thanks answered regarding machine key. reason asked question because have open source project hosted @ codeplex.com. however, deploy project windows azure. trying find best approach keep sensitive passwords out of source control, keep them accessible part of project when deploy azure. currently, using web config transforms store azure connection strings (as gmail passwords system.net). i've created web.publishtoazure.config transform file, , kept file out of source control. found this article may better option. again. simplistic answer: won't have access key i believe default key stored in machine's certificate store, malicious user ne

Django inserting the string "(NULL)" to MySQL fields for Null instead of NULL -

i'm trying use 2 character field nullable address table in mysql. when run manage.py syncdb command, loads data mysql table, yields error: file "c:\python27\lib\site-packages\mysqldb\connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue databaseerror: (1406, "data long column 'state_province' @ row 1") i found issue django inserting table string "(null)" instead of null value sql. the field in question "state_province" null=true, blank=true in model definition, length of 2. here sample set of data: - model: myapp.address pk: 53 fields: street_address: "71 south st" city: cityname state_province: zip_code: 25455 countryid: 199 time_zone: -6 - model: myapp.address pk: 54 fields: street_address: "123 lake street" city: townname state_province: nh zip_code: 12345 countryid: 199

javascript - What does this JS Syntax do? -

why put brackets around true here.... doesn't make array? else? $e.trigger("onlyshowifchange", [true]); .trigger( eventtype, extraparameters ) eventtype: string containing javascript event type, such click or submit. extraparameters: array of additional parameters pass along event handler. the second parameter has array $e.trigger("onlyshowifchange", [true, false]); $e.bind("onlyshowifchange", function(ev, truebool, falsebool) { ... }); this means if want pass parameters event binding functions have pass in array of parameters trigger second argument.

html - Absolute URLs omitting the protocol (scheme) in order to preserve the one of the current page -

i saw //somepage.com/resource url format. example: <img src="//remotesite.com/image1.jpg" /> the point of if current page (the page defining img tag) using http , request remote site made via http. if https - it's https. eliminates browser warnings of not encrypted pages. my question - url format safe use browsers. , standard? is url format safe use browsers. i can't sure, should able test in different browsers. and standard? technically, called "network path reference" according rfc 3986 . here scheme it: relative-ref = relative-part [ "?" query ] [ "#" fragment ] relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty there problem though, when used on <link> or @import , ie7 , ie8 download file. here post written paul irish on subject: the protocol-relative url

c - What does "lp" stand for in execlp command -

i google it, says it's line printer. don't think make sense... the l list , p path. check out other variants , e.g. execl, execlp, execle, execv, execvp.

sql - How can I compare the trimmed and untrimmed lengths of fields without retyping the field name? -

basically, want check if there spaces right of text in varchar field. so, want compare datalength(fieldname) datalength(rtrim(fieldname)) . this isn’t hard. only thing is, need varchar fields in 5 tables. comes out 250 fields need compare way. there way can put field names 1 query without typing each one’s name 2x? i'm using query names of fields need at. select name sys.columns object_id = (select object_id sys.tables name='tablename') , system_type_id = 167 (using sql server 2005) thanks! i let sql server generate code me if it's typing problem: select 'select * ' + o.name + ' datalength(' + c.name + ') > datalength(rtrim(' + c.name + '))' sys.objects o inner join sys.columns c on c.object_id = o.object_id , c.system_type_id = 167 o.name = 'tablename' are sure type 167 need check though?

search engine - Why do queries with shorter inverted lists perform better on CPU's when compared to GPU's -

moreover, why queries longer inverted list perform better on gpu's? i read result in paper called using graphics processors high performance ir querying. queries longer lists work better on gpus, because gpus highly parallel, , search parallel problem. however, gpus (and other massively parallel computers) don't process things same way few-core cpus do. other problem, there non-negligible work done set problem gpu. small problem sizes, overhead swamps out speedup provided gpus.

Magento API Error: aborted: error parsing headers: duplicate header 'Content-Type' -

i upgraded server php 5.3 , fast cgi. unfortunately caused magento api return strange error aborted: error parsing headers: duplicate header 'content-type' i've tried various suggestions magento fourms no avail. i'm running 1.4.0.1. suggestions how reconcile problem? from http://www.magentocommerce.com/boards/v/viewthread/229253/ edit app/code/core/mage/core/controller/response/http.php and replace sendheaders() function following code (you're not supposed override core classes, working. using app/code/local/mage/... doesn't work because controller) /** * transport object observers perform * * @var varien_object */ protected static $_transportobject = null; public function sendheaders() { if (!$this->cansendheaders()) { mage::log('headers sent: '.magedebugbacktrace(true, true, true)); return $this; } if (in_array(substr(php_sapi_name(), 0, 3), array('cgi', 'fpm'))) {

javascript - log into ColdFusion site from JS-based AIR app? -

i have following coldfusion code on server (which i'm not able change) : <cfquery name="getlogin" datasource="#application.dsn#"> select * tbl_useraccount username = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.username#"/> , password = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.password#"/> , siteid = <cfqueryparam cfsqltype="cf_sql_integer" value="#application.siteid#"/> </cfquery> and i'm trying build javascript window logging adobe air app. specifically, want send user credentials (uname , pword), , bring account id (which included in 'select *' statement). can me started this? a quick dirty way started drop query method in cfc. that method take 2 parameters username , password. replace form variables in cfqueryparms appropriate arguments on method. on method should set return type num

iphone - Objective C best practices when using Interface Builder for controller communication? -

according what's best way communicate between view controllers? best practices communication between viewcontrollers inject dependencies stack. , not use delegate. how do when using interface builder? example have *navcontroller variable in appdelegate. i'd work variable in tableview down line. how access *navcontroller variable tableview class? there way inject it? (i know can use [self.navigationcontroller] in particular case i'm asking general point of view.) think of delegates nanny. have tell nanny if done playing, eating, watching tv etc. concept in mind, can communicate other controllers in terms of notifying "nanny" can it. if wanting communicate controller, typically import controller class in question , cast pointer. depends if want delegate or not.

database - How do large sites do pagination? -

how large sites handle pagination on search results nth page loads first? example, google, youtube, hulu, etc. youtube: sorry, youtube not serve more 1000 results query so caches first 1k results in similar memcached blob. hulu: limits 3000 results. cached well. google: it's pure black magic. keep in mind uses lot of distributed computing (and not simple db lookup), , caches first n results query, , "html ready" results each result page, , intermediate results (see dynamic programming ). to summarize: first query page might take more time since can cause engine start db/distributed search, however, it's results (much more amount showed) kept while in fast cache serving page same query without stressing db again.

java - What does the following Oracle error mean: invalid column index -

i got following error while testing code: sqlexception: invalid column index what mean? is there online document explaining oracle error codes , statements? if that's sqlexception thrown java, it's because trying or set value resultset, index using isn't within range. for example, might trying column @ index 3 result set, have 2 columns being returned sql query.

c++ - Cannot open include file: 'graphics.h': No such file or directory -

i using #include "graphics.h" in c++. using visual studio 2008 ide. problem can't build code. don't know how solve error , do. stuck! please help! here code... #include<stdio.h> #include<conio.h> #include "graphics.h" #include<stdlib.h> #include<dos.h> char game[3][3]; void screen(void); void introducing(void); void input(void); void circle(int,int); void cross(int,int); void main(void) { int gd=detect, gm, errorcode; /* request auto detection */ char msg[80]; initgraph(&gd,&gm,"\\tc\\bgi"); /* initialize graphics */ errorcode = graphresult(); /* read result of initialization */ if(errorcode != grok) { printf("graphics error: %s\n", grapherrormsg(errorcode)); printf("press key halt:"); getch(); exit(1); } cleardevice(); introducing(); getche(); cleardevice(); screen(); getche(); closegraph(); } void introducing(void) /*introduction of project*/ { setbkc