3,892 Posted Topics
Re: Vishesh, like Walter said, don't use EOF or you just end up writing an additonal condition to prevent the fetching of the last record, one too many times. Instead use, [inlinecode]while ( getline (file_stream, my_string ).good () )[/inlinecode] And as for [inlinecode]system ( "PAUSE" )[/inlinecode] read the article posted. | |
Re: > why i can't change the thread title? As already mentioned by Jim, you can only change/edit the thread title/contents within 30 mins of posting it. After that, it's a mod/admin only thing. One thing to note here is that if you for some reason need the thread title to … | |
Re: A word of caution though, even though the `System.exit` method accepts the entire gamut of integer values, there are certain restrictions imposed by the host systems (operating systems) on what kind of status codes are acceptable. Take a look here: http://en.wikipedia.org/wiki/Exit_status | |
Re: You might want to look at [NanoHTTPD](https://github.com/NanoHttpd/nanohttpd). Single file web server which supports static serving as per the home page. | |
Re: > it seems that there are shorthand key/value array constructors Actually it's called an 'object literal'. Encode the data you want to send by using a [URL="http://in.php.net/json"]PHP binding for JSON[/URL] at the server and decode the same using Douglas Crockfords' [URL="http://json.org/js.html"]Javascript library for JSON.[/URL] | |
Re: The code would be thread safe if the `dataSource.getConnection` method is thread-safe. Since the `DataSource` is just an interface, you'll need to check the specific implementation of the data source you are using (just print out the name of the class) or read the documentation. I'm assuming your datasource supports … | |
Re: Not sure I completely understand your question. Velocity is just a templating language which is concerned with rendering data based on your existing view/template. If you need HTML output, you'll have a create a template file which follow the HTML specification. Something like: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> … | |
Re: If you end up using `sleep` for inter-thread communication/co-ordination, you are doing it wrong. The entire point of `wait/notify/notifyAll` is to ensure that you coordinate activites based on some conditions and signal the threads accordingly. In your case it's pretty simple: `wait` till the shared resource (list in your case) … | |
Re: The error means that the version used to create the db file isn't the same as the derby JAR version you are using to access it. Take a look at [this thread](http://stackoverflow.com/questions/122468/how-do-i-configure-a-project-to-use-latest-derby-db-version-10-4) and see if updating the JAR file helps. Also, [this topic in the Netbeans forum](http://forums.netbeans.org/topic41848.html) if the previous … | |
Re: Post your attempt and we will definately help you out on topics on where you got stuck. Just giving out the source code would do you more harm than good. | |
Re: > I have given up with setting visualvm.IT just failed to read and communicate with my remote application. It doesn't happen automagically. You need to configure the server JVM or the target application such that it can accept incoming VisualVM JMX requests. Take a look at [this thread](http://stackoverflow.com/questions/856881/how-to-activate-jmx-on-my-jvm-for-access-with-jconsole) . | |
Re: > Can any one please let me know why Data loss happing while reading big files? Because your `readLine` call actually reads in a line and increments the file pointer. In your current code, you are basically discarding every other line. You need to assign the result of `readLine` to … | |
Re: YOur function is like [code] char* subArr(char array[65535], int length) { int i, j = 0; **** char temp[65535 - length + 1]; **** for (i = length - 1; i < 65535 - length - 1; i++) { temp[j] = array[i]; j++; } return temp; } [/code] To be … | |
Re: Look into a library called JAXB. It basically eases the task of XML <-> Java objects conversion. The steps would look something like this: 1. Analyze the XML file format and create a XSD out of it (this is the difficult part) 2. Autogenerate classes from XSD using xjc 3. … | |
Re: Welcome Jorge! Oh and don't believe deceptikun; he likes to scare the new mods away. ;) | |
Re: Minor comments: head = 0; tail = head + (size - 1); `head` is unnecessary in the second statement. > throw new java.lang.IllegalArgumentException `java.lang` is always imported; remove the full qualification. if (size == 0) throw new java.lang.NullPointerException("size = 0"); NPE is not the correct exception to throw here; maybe … | |
Re: Definitely a fresh feel as others have mentioned, good job. Few comments from my side: 1. The starting post of the thread or the OP's post should stand out a bit more. The first time I opened up a new thread, I was searching for the question since the original … ![]() | |
Re: Minor comments aside: > i get a lot of timeout exceptions (in alive pcs) even though my timeout limit is set to 10 seconds. You mean you get a TimeOutException before 10 secs on some live PCs? > If i force the list to contain a single working pc, i … | |
Re: Problem is that too many folks jump *directly* to patterns without understanding *how* the code looks without them or facing the problems first hand. The line of thinking goes something like this: "I'm now creating a class which might get used from a lot of other classes, flexibility is a … | |
Re: > .my tomcat server has around 128MB runtime memory Is that 128 MiB just for permagen space or total JVM memory? Unless you explicitly specify permagen size, a small number like I guess 64 MiB is picked up (depending on your exact JDK version, OS version/flavour etc.) which is certainly … | |
Re: That error means that your XML file doesn't conform to the XML schema specified for that particular file. So basically it's trying to say that `http:basicAuthSupplier` is not a valid child for the element `http:conduit`. I haven't worked on CXF but you should have a look at this [CXF wiki … | |
Re: You don't need to call any special function, this sort of functionality is taken care by the JDBC standard. The idea is to specify a special flag called `Statement.RETURN_GENERATED_KEYS` when creating statements. Look at [this](http://stackoverflow.com/a/202533/193906) answer for more details. | |
Re: > i don't know how to unescape that sequence into java string..could anyone please help me with this?? That's not how a normal HTML response looks like. If that service is in your control, the first action should be to investigate why you are getting hex encoded HTML entities as … | |
Re: You almost never push autogenerated class-files to your repository unless it's in the form of a JAR. Even JARs can be avoided by providing relevant ant files or maven files for that particular project in which case the user can just build the entire thing on his own. For your … | |
Re: > As such, I believe DW needs to keep it "in check" so to speak :) I have been there a couple of times now and the dicussion was pretty much in check. Do you have any specific instances where you think the discussion might have moved away from the … | |
Re: I get the feeling that these small irreproducible things are what are causing problem to the majority of the folks out there. I wish there was a simple flag to flip and bring back the old vBulletin board so that we could be sure that the new design is or … | |
Re: I have replied to James in the mod section and I'll reply here again. I'm favour of a new sticky thread as long as it stays on-topic and doesn't become a dumping ground for "plz halp me" posts. Someone will also need to ensure that "reponses" to the challenges/projects are … | |
Re: > incredibly usefull to have a language that was both dynamic AND statically typed Such languages are called optionally typed languages. I'm not a big fan of such languages since it seems like a half assed attempt though I'm sure many swear by it. The advantages being: * Writing dynamic … | |
Re: > Should've used a Dudette. Agreed. > @pritaeas, why not both a dude and dudette? That would drive away the dudes looking for a dudette... ;) | |
Re: `r` is an instance of `ResizingArrayQueue` whereas the `display` method is part of `ResizingCircularArray`? | |
Re: Strange indeed; have you tried deleting the Netbeans cache directory at `$userdir\.netbeans\[version]\var\cache\` or something along those lines? | |
Re: *EDIT*: The below explanation assumes `someboundmethod` is actually called instead of just storing the method reference in `d`. If `d` stores the method reference instead of the result of the method call, `foo` instance will surely hang around as long as `d` is reachable. > If there's a class called … | |
Re: > I'm going to leave it as is for now, but track its usage, and please let me know how often you guys find yourself using it. Dani, I would really suggest at least providing a tooltip for the green arrow, something like (Spellcheck + Preview) or provide a "Help" … | |
Re: I would personally start with [this](http://docs.oracle.com/javaee/6/tutorial/doc/gjbji.html) for a very high level view or maybe [this](http://www2008.org/papers/pdf/p805-pautassoA.pdf) if you are into whitepaper and stuff. [A more detailed tutorial of JAX-WS](http://docs.oracle.com/javaee/6/tutorial/doc/bnayl.html) [A more detailed tutorial of JAX-RS](http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html) In short: **JAX-WS\***: Enterprisy web service. Request and responses are in terms of XML payloads/envelopes. Not … | |
Re: > but lack of multiple inheritence is troublesome Lack of multiple inheritance is a problem if you don't have traits (Scala) or mixins (Ruby). If Nimrod has any of those, it should be fine IMO. | |
Re: The total memory occupied by those JDBC connection objects looks to be around 12 MiB. You have 40 connections as the max connection count per partition. Which observation leads you to the conclusion that those are not pooled connections but "jdbc leaks"? | |
Re: Just ensure that if you need to replace the literal `-`, it is always either at the start or at the end of the replacement set. For e.g. `txt.replaceAll("[- _?]", "*")` works, `txt.replaceAll("[ _?-]", "*")` also works but `txt.replaceAll("[ _-?]", "*")` doesn't. | |
Re: [quote]What is the problem with this code if i do like this: [/quote] Keep in mind one rule of thumb while using pointers in C and C++: [quote]"To modify the value of a variable using pointers in a function, you need to pass the address of that variable".[/quote] This rule … | |
Re: Firstly, read this: [checked v/s unchecked exceptions](http://www.javamex.com/tutorials/exceptions/exceptions_hierarchy.shtml) > in line 10 the method quotient throws an exception that will be caught by the catch statement Wrong phrasing; there is a *possibility* that the method `quotient` might throw an exception. When a method has a `throws` clause, it means that the … | |
Re: [Restlet](http://restlet.org/), [Jersey](http://jersey.java.net/) and [Resteasy](http://www.jboss.org/resteasy) are all good REST frameworks (useful for creating RESTful web services). Read the example code/docs on their website and pick up one which works out for you. | |
Re: Is it possible for your to copy the Access DB file from that computer and open in up on your computer? Does it still show `???` or does it display the data correctly? Since you say it works on your box, this seems like a case of missing font pack/regional … | |
Re: Your question isn't very clear; can you provide a sample input/output for the use case in consideration? | |
![]() | Re: The problem I believe is that special characters like `<` and `>` don't require conversion to their HTML entity counterpart when placed inside a `pre` since the rendering engine just "literally" evaluates them as opposed to recognizing the sequence and rendering it as the corresponding special char. Daniweb code snippet … |
Re: David, it seems that your `<` and `>` have been turned into `<` and `>` respectively. Did you post it that way? If not, I'll have to ask Dani to look into it. | |
Re: > I am trying to write a program which will help me find the number of objects eligible for garbage collection at any given point of time AFAICT, there is no mechanism exposed by the JVM to "count" the number of objects eligible for garbage collection since this would in … | |
Re: > It functions more like an IDE than a textbox. You can tab to indent, shift+tab to go back a tab, etc. It's all color-coded so you can easily see where a link is, what is considered code, etc. None of that is possible with a regular textbox. I believe … ![]() | |
Re: IIRC, this happens when Daniweb includes some content (javascript/images/widgets etc.) from an external domain which is not allowed or is blocked by your ISP. Corporate ISP's are notorious for blocking a lot of sites. So basically it starts loading some resource and perpetually hangs up because the host/domain is blocked … | |
Re: > I searched, but can not find the one I want. A simple [URL="http://www.google.co.in/search?hl=en&client=firefox-a&channel=s&rls=org.mozilla%3Aen-US%3Aofficial&hs=TU1&q=free+jsp+servlet++hosting&btnG=Search&meta="]google query [/URL]turns up a lot of interesting results. You can't be choosy when it comes to something which is given for *free*, so your argument of 'not finding the one you want' is kind of moot. | |
Re: Sticky created as per the request which was approved by Mr. Dragon.... Some links from my side: [LIST] [*][url]http://www.techtutorials.info/assembly.html[/url] [*][URL="http://savannah.nongnu.org/projects/pgubook/"]Programming from ground up in assembly[/URL]. [*][URL="http://goforit.unk.edu/asm/astart.htm"]Assembly language tutorial by Brian[/URL] [*][URL="http://webster.cs.ucr.edu/"]Win32 Assembly language programming[/URL]. [*][URL="http://web.cecs.pdx.edu/%7Ebjorn/CS200/linux_tutorial/"]Linux Assembly Tutorial[/URL] [*][URL="http://www.intelligentedu.com/newly_researched_free_training/Assembly.html"]Lots of Assembly tutorials[/URL] [*][URL="http://www.eg3.com/WebID/software/assembly/blank/tutorial/a-z.htm"]Embedded software tutorials[/URL] [*][URL="http://www.freeprogrammingresources.com/assembly.html"]Assembly resources (good one)[/URL][/LIST]Hope it helped, … |
The End.