Search Results

Search found 120 results on 5 pages for 'rakesh ranjan'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Myself throwing NullReferenceException... needs help

    - by Amit Ranjan
    I know it might be a weird question and its Title too, but i need your help. I am a .net dev , working on platform for the last 1.5 years. I am bit confused on the term usually we say " A Good Programmer ". I dont know ,what are the qualities of a good programmer ? Is the guy who writes a bug free code? or Can develop applications solely? or blah blah blah...lots of points. I dont know... But as far i am concerned , I know I am not a good programmer, still in learning phase an needs a lot to learn in coming days. So you guys are requested to please help me with this two problems of mine My first problem is regarding the proper Error Handling, which is a most debatable aspect of programming. We all know we use ` try { } catch { } finally { } ` in our code to manage exception. But even if I use try { } catch(exception ex) { throw ex } finally { } , different guys have different views. I still dont know the good way to handle errors. I can write code, use try-catch but still i feel I lacks something. When I saw the codes generated by .net fx tools even they uses throw ex or `throw new Exception("this is my exception")`.. I am just wondering what will be the best way to achieve the above. All means the same thing but why we avoid something. If it has some demerits then it must be made obselete.Anyways I still dont have one [how to handle errors efficiently?]. I generally follow the try-catch(execoption ex){throw ex}, and usually got stucked in debates with leads why you follow this why not that... 2.Converting your entire code blocks in modules using Design patterns of some OOPs concepts. How do you guys decide what architeture or pattern will be the best for my upcoming application based on its working, flow etc. I need to know what you guys can see that I can't. Since I know , I dont have that much experience but I can say, with my experience that experience doesnot comes either from degree/certificates or success you made instead it cames from failures you faced or got stucking situations. Pleas help me out.

    Read the article

  • How operator oveloading works

    - by Rasmi Ranjan Nayak
    I have below code class rectangle { ..... .....//Some code int operator+(rectangle r1) { return(r1.length+length); } }; In main fun. int main() { rectangle r1(10,20); rectangle r2(40,60); rectangle r3(30,60); int len = r1+r3; } Here if we will see in operator+(), we are doing r1.length + length. How the compiler comes to know that the 2nd length in return statement belong to object r3 not to r1 or r2? I think answer may be in main() we have writeen int len = r1+r3; If that is the case then why do we need to write in operator+(....) { r1.lenth + lenth; //Why not length + length? } Why not length + length? Bcause compiler already knows from main() that the first length belong to object r1 and 2nd to object r3.

    Read the article

  • What are the differences between these?

    - by Amit Ranjan
    What are the differences between the two queries? SELECT CountryMaster.Id FROM Districts INNER JOIN CountryMaster ON Districts.CountryId = CountryMaster.Id SELECT CountryMaster.Id FROM CountryMaster INNER JOIN Districts ON Districts.CountryId = CountryMaster.Id Please mind the i) Table positions and second ii) On Fields As I know, output will be same. But I want to know, is there any drastic effects of the same if I neglect positions of tables and columns in complex queries or tables having tons of data like thousands and lakhs of rows...

    Read the article

  • ModalPopupExtender not working in IE but working in FF

    - by GK Ranjan
    I am facing a critical problem i am using ajaxmodalpopupextender in my page. It's working fine in FireFox with a great view but it's not working fine that is it displays in a side in IE and background is also not looking as is set. I tried almost all things like Using CSS Having the panel in div and setting div style="position:absolute;left:140;top:100;" Doctype of page to xhtml But there is nothing to get it all. Please help.

    Read the article

  • java.lang.OutOfMemoryError: unable to create new native thread for multiple threads

    - by Kaustubh Ranjan Singh
    static class solver implements Runnable { static calculator(problem){ //Some code if(condition) {solver s = new solver(newproblem); new Thread(s).start();} } Public solver(int newproblem) { this.problem = newproblem ; } public void run() { // TODO Auto-generated method stub calculator(promblem); } } i am having a big array maze of 100x100 and i am trying to solve it and i am getting an error java.lang.OutOfMemoryError: unable to create new native thread(after running a code for some times). How can solve this , How can i use ExecutorService i think that will solve the problem or i want something like thisIf Number of generated threads4K then stop the first 100 threads

    Read the article

  • Difficulty understanding behavior of free()

    - by Rasmi Ranjan Nayak
    int main() { int *ptr, **ptr1; ptr = (int*)malloc(sizeof(int)); ptr1 = (int**)malloc(sizeof(int)); free(ptr); *ptr = 12345; ptr1 = &ptr; //free(ptr); //**ptr1 = 23456; printf("%d \n", **ptr1); system("pause"); return 0; } How does *ptr store the value 12345, when the memory has already been freed? So, now ptr should be pointing to garbage. Why is this happening?

    Read the article

  • Avoid extra xmlns:xsi while adding an attribute to XML root

    - by Rakesh kumar
    I am creating an xml file using this code: XmlDocument d = new XmlDocument(); XmlDeclaration xmlDeclaration = d.CreateXmlDeclaration("1.0", "utf-8", null); d.InsertBefore(xmlDeclaration,d.DocumentElement); XmlElement root = d.CreateElement("ITRETURN","ITR","http://incometaxindiaefiling.gov.in/ITR1"); XmlAttribute xsiNs = d.CreateAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"); xsiNs.Value = "http://incometaxindiaefiling.gov.in/main ITRMain10.xsd"; root.SetAttributeNode(xsiNs); //root.SetAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"); root.SetAttribute("xmlns:ITR1FORM", "http://incometaxindiaefiling.gov.in/ITR1"); root.SetAttribute("xmlns:ITR2FORM", "http://incometaxindiaefiling.gov.in/ITR2"); root.SetAttribute("xmlns:ITR3FORM", "http://incometaxindiaefiling.gov.in/ITR3"); root.SetAttribute("xmlns:ITR4FORM", "http://incometaxindiaefiling.gov.in/ITR4"); d.AppendChild(root); d.Save("c://myxml.xml"); and I am getting an output like this <?xml version="1.0" encoding="utf-8" ?> - <!-- Sample XML file generated by XMLSpy v2007 sp2 (http://www.altova.com) --> - <ITRETURN:ITR xsi:schemaLocation="http://incometaxindiaefiling.gov.in/main ITRMain10.xsd" xmlns:ITR1FORM="http://incometaxindiaefiling.gov.in/ITR1" xmlns:ITR2FORM="http://incometaxindiaefiling.gov.in/ITR2" xmlns:ITR3FORM="http://incometaxindiaefiling.gov.in/ITR3" xmlns:ITR4FORM="http://incometaxindiaefiling.gov.in/ITR4" xmlns:xsi="http://incometaxindiaefiling.gov.in/main ITRMain10.xsd" xmlns:ITRETURN="http://incometaxindiaefiling.gov.in/ITR1"> <ITR1FORM:ITR1>root node</ITR1FORM:ITR1> </ITRETURN:ITR> But my requirement is like <ITRETURN:ITR xsi:schemaLocation="http://incometaxindiaefiling.gov.in/main ITRMain10.xsd" xmlns:ITR1FORM="http://incometaxindiaefiling.gov.in/ITR1" xmlns:ITR2FORM="http://incometaxindiaefiling.gov.in/ITR2" xmlns:ITR3FORM="http://incometaxindiaefiling.gov.in/ITR3" xmlns:ITR4FORM="http://incometaxindiaefiling.gov.in/ITR4" xmlns:ITRETURN="http://incometaxindiaefiling.gov.in/main" xmlns:ITRForm="http://incometaxindiaefiling.gov.in/master" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <ITR1FORM:ITR1>any value </ITR1FORM:ITR1> </ITRETURN:ITR> What do I need to change in my code to get the desired output?

    Read the article

  • Google appengine authentication on iPhone web app on the home screen

    - by Rakesh Pai
    I'm using Google appengine for developing an web application that is meant to be used on both the browser and iphone. I have purchased a domain name for this application, so that I have a pretty URL. I've used the User API for authentication. This works just fine on desktop browsers and iPhone Safari. The user could add the application to the home screen (by tapping the "+" at the bottom toolbar). However when that's done, it seems like the cookies set by Google are not in affect within this "application", and the user is effectively logged out. To make matters worse, when the user clicks on the login link (as generated by GAE), the app closes and opens safari to complete the login. Since the session is apparently not shared between the two, the login process is futile, and the "home-screen" version of the app continues to be logged out. It seems that the cookies are not shared between a "home-screen" app and Safari. It also seems that the "home-screen" app will only work within it's own domain, and any redirect to any other domain will open Safari. Any idea how I can go about fixing this?

    Read the article

  • Unable to connect to mysql database using tomcat6 on ubuntu

    - by Rakesh
    I am able to deploy the application on my local system.... connecting to the same remote database... however when I deploy the same war file on the ubuntu server I get the following exception javax.servlet.ServletException: Could not connect to wikipedia database... org.wikipedia.miner.service.WikipediaMinerServlet.init(WikipediaMinerServlet.java:81) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:616) org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:537) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Thread.java:636) I have even placed the mysql connector jar under tomcat6 lib direcotry.... Please help

    Read the article

  • What does this javascript do?

    - by Rakesh Juyal
    I was adding recent videos gadget on my blog. In that widget i was supposed to add this line <script src="/feeds/posts/default?orderby=published&alt=json-in-script&callback=showrecentpostswiththumbs"> also, i added another script which was having the method showrecentpostswiththumbs [ used in callback ]. Please let me know what does above syntax do?

    Read the article

  • Is there any book on Google App Engine for java?

    - by Rakesh Juyal
    I would like to start using Google App Engine for java. But i don't know, where to start. Is the tutorial provided by google [ http://code.google.com/appengine/docs/java/overview.html ] enough ? Also, please mention some good books on GAE [ java ] so that i can download those from rapidshare or torrent buy those books and start reading them.

    Read the article

  • How do URL shortening service earn?

    - by Rakesh Juyal
    Yesterday i got to know about one more URL shortening service Saf.li. I think there are hundreds of websites offering such service. I always wonder how do such sites earn? After all they need money to host their data and code. Also, i really don't understand why techcrunch said this:- http://techcrunch.com/2009/03/30/if-bitly-is-worth-8-million-tinyurl-is-worth-at-least-46-million/ Is there any one who can explain me this?

    Read the article

  • How do URL shortening services make money?

    - by Rakesh Juyal
    Yesterday i got to know about one more URL shortening service Saf.li. I think there are hundreds of websites offering such service. I always wonder how do such sites make money? After all they need money to host their data and code. Also, i really don't understand why techcrunch said this:- http://techcrunch.com/2009/03/30/if-bitly-is-worth-8-million-tinyurl-is-worth-at-least-46-million/ Is there any one who can explain me this?

    Read the article

  • WaitForSingleObject( )

    - by Rakesh Agarwal
    I have got myself stuck into a really amazing issue here.The code is like as below. class A { public: A(){ m_event = CreateEvent(NULL, false, false, NULL); // create an event with initial value as non-signalled m_thread = _beginthread(StaticThreadEntry, 0, this); // create a thread } static void StaticThreadEntry(A * obj) { obj->ThreadEntry(); } void ThreadEntry(); }; void A::ThreadEntry() { WaitforSingleObject(m_event,INFINITE); } int main() { A a; SetEvent(m_event); // sets the event to signalled state which causes the running thread to terminate WaitForSingleObject(m_thread, INFINITE); // waits for the thread to terminate return 0; } Problem : When the above code is run,sometimes( 1 out of 5 ) it hangs and the control gets stuck in the call to WaitforSingleObject()( inside the main function ).The code always calls SetEvent() function to ensure that the thread would terminate before calling Wait() function. I do not see any reason why it should ever hang?

    Read the article

  • Number of ways to place kings on chess board

    - by Rakesh
    You have an N x N chessboard and you wish to place N kings on it. Each row and column should contain exactly one king, and no two kings should attack each other (two kings attack each other if they are present in squares which share a corner). The kings in the first K rows of the board have already been placed. You are given the positions of these kings as an array pos[ ]. pos[i] is the column in which the king in the ith row has already been placed. All indices are 0-indexed. In how many ways can the remaining kings be placed? Input: The first line contains the number of test cases T. T test cases follow. Each test case contains N and K on the first line, followed by a line having K integers, denoting the array pos[ ] as described above. Output: Output the number of ways to place kings in the remaining rows satisfying the above conditions. Output all numbers modulo 1000000007. Constraints: 1 <= T <= 20 1 <= N <= 16 0 <= K <= N 0 <= pos_i < N The kings specified in the input will be in different columns and not attack each other. Sample Input: 5 4 1 2 3 0 5 2 1 3 4 4 1 3 0 2 6 1 2 Sample Output: 1 0 2 1 18 Explanation: For the first example, there is a king already placed at row 0 and column 2. The king in the second row must belong to column 0. The king in the third row must belong to column 3, and the last king must beong to column 1. Thus there is only 1 valid placement. For the second example, there is no valid placement. How should i approach this problem

    Read the article

  • How to create a anonymous proxy?

    - by Rakesh Juyal
    I want to create a proxy server anonymous proxy . I googled it and even found some tutorial but those were in PHP. If somebody is having tutorial of proxy server anonymous proxy creation in java then please post it here Or simply let me know what approach should i follow to create a proxy server anonymous proxy. [ i will be using Tomcat { if that matters for your answer } ] Thanks Edit i guess i was not clear in stating what i require. Actually i am trying to develop a site like 'http://proxyug.com/' . If none of you were getting what i asked, then it certainly means such sites are not known as 'proxy server' they must be called something else. :)

    Read the article

  • Deployment error

    - by Rakesh
    Hi all i am getting deployment error when i try to run my app in the device. it says "no provisioning ios devices are connected". I have ios sdk 4.1 installed on my mac and in the device the version of ios is 4.2. I have conected my device to Mac. Can i run my app under these conditions or i need to update ios sdk to 4.2 in Mac also. if yes then is there any update available so that i can update my sdk from version 4.1 to 4.2 or i have to download the whole new version of 4.2 (almost 3.5 GB). Please help.

    Read the article

  • How to implement progressbar(to show progress) using threading concept in win 32?

    - by Rakesh
    I am trying to show a progress bar while my process is going on...in my application there will be a situation where I gotta read files and manipulate them(it will take some time to complete)..want to display a progress bar during this operation..the particular function I am calling is an win 32 ...so if you check my code below i am upto the point of creating the progress bar in a dialog window and creating a thread Now I dont know how to post the message and where to get the message and handle...Please help me..thanks in advance //my function int Myfunction(....) { HWND dialog = CreateWindowEx(0,WC_DIALOG,L"Proccessing...",WS_OVERLAPPEDWINDOW|WS_VISIBLE, 600,300,280,120,NULL,NULL,NULL,NULL); HWND pBar = CreateWindowEx(NULL,PROGRESS_CLASS,NULL,WS_CHILD|WS_VISIBLE,40,20,200, 20, dialog,(HMENU)IDD_PROGRESS,NULL,NULL); HANDLE getHandle = CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)SetFilesForOperation(...), NULL,NULL,0); } LPARAM SetFilesForOperation(...) { for(int index = 0;index < noOfFiles; index++) { *checkstate = *(checkState + index); if(*checkstate == -1) { *(getFiles+i) = new TCHAR[MAX_PATH]; wcscpy(*(getFiles+i),*(dataFiles +index)); i++; } else { (*tempDataFiles)->Add(*(dataFiles+index)); *(checkState + localIndex) = *(checkState + index); localIndex++; } //SendMessage(pBar,PBM_SETSTEP,1,0); } }

    Read the article

  • Not able to display the progress bar using threading concept?

    - by Rakesh
    I am trying to show a progress bar while my process is going on...in my application there will be a situation where I gotta read files and manipulate them(it will take some time to complete)..want to display a progress bar during this operation..the particular function I am calling is an win 32 ...so if you check my code below ...I am able to display the progressbar but it doesnt show any progress..actually its not doing any further process...Please help me..thanks in advance //my function int Myfunction(....) { MSG msg; HWND dialog = CreateWindowEx(0,WC_DIALOG,L"Proccessing...",WS_OVERLAPPEDWINDOW|WS_VISIBLE, 600,300,280,120,NULL,NULL,NULL,NULL); HWND pBar = CreateWindowEx(NULL,PROGRESS_CLASS,NULL,WS_CHILD|WS_VISIBLE,40,20,200, 20, dialog,(HMENU)IDD_PROGRESS,NULL,NULL); SendMessage(pBar,PBM_SETRANGE,0,MAKELPARAM(0,noOfFile)); while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); Dispatch(&message); } HANDLE getHandle = CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)SetFilesForOperation(...), NULL,NULL,0); } LPARAM SetFilesForOperation(...) { for(int index = 0;index < noOfFiles; index++) { *checkstate = *(checkState + index); if(*checkstate == -1) { *(getFiles+i) = new TCHAR[MAX_PATH]; wcscpy(*(getFiles+i),*(dataFiles +index)); i++; } else { (*tempDataFiles)->Add(*(dataFiles+index)); *(checkState + localIndex) = *(checkState + index); localIndex++; } PostMessage(pBar,PBM_SETPOS,(WPARAM)index,0); } }

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >