3,892 Posted Topics
Re: > However, I do get extra points if I can do it one line of code. Just to be clear I would have to replace two different words with two different new words that are in one long line of text. Is using regex a requirement here? You can do … | |
Re: Never recommend Roseindia; it hosts bad code examples and genuinely sucks. On top of that those guys are content thieves who snag articles from other reputable sites without proper attribution. [url]http://forums.oracle.com/forums/thread.jspa?threadID=1139242&tstart=148[/url] [url]http://balusc.blogspot.com/2008/06/what-is-it-with-roseindia.html[/url] | |
Re: Try replacing the backslashes with forward slashes or double backslashes. Also, you need to specify the appender names in the rootlogger. Something like: log4j.rootLogger=DEBUG, default.out, default.file Take a look at [this post.](http://stackoverflow.com/a/6358941/99463) | |
Re: Also something which others haven't mentioned; you can't earn rep in any sub-forum which falls under the "Community Center" category. | |
Re: It's branch prediction indeed; read [this](http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array). | |
Re: The encoding is `UTF-8`. Also as already mentioned, use the `codecs.open` function call to open and read the hindi text file. Something like: import codecs with codecs.open('hindi.txt', encoding='utf-8') as f: txt = f.read() >>> txt.count('सूची') 2 >>> parts = txt.split(' ') >>> len(parts) 48 >>> print(parts) ['इस', 'पृष्ठ', 'पर', 'इन्टरनेट', … | |
Re: While griswolf's advice is spot on, I would like to add few more details to help you out. Broadly speaking, there are two types of "web services"; RESTful services and SOAP based ones. I would recommend skipping over SOAP services because they are enterprisey, complicated and "not so hot" these … | |
Re: This GFF library is most probably loading the entire file in memory which is a big "no-no" when dealing with large files. Assuming you are using [this library](http://biopython.org/wiki/GFF_Parsing), give that page a read and if the suggestions there don't work, join the GFF forums and ask them a way to … | |
Re: You will have to use a recursive algorithm to compute the size of a folder *including* all the files and sub-directories (and again all the files in that sub-directory). Use suggestions from [this thread](http://stackoverflow.com/a/1392549/99463) for that recursive function. Also, don't use string concatenation for path creation, use [os.path.join](https://docs.python.org/2/library/os.path.html#os.path.join) for that. | |
Re: I see the following in your profile right now so you should be good: > tapananand has contributed enough for us to gauge topics of interest. However, no one has endorsed any skills yet. Why don't you be the first? Very strange that it was showing "hasn't contributed enough" a … | |
Re: [quote=portege] Why do you care about the speed anyways? [/quote] If the developers didnt care for speed then u wouldn't be conviniently using your favourite OS u are usign right now without atlest swearing atleast 100 times a day regarding the slow loading times. Dont forget that this is a … | |
Re: Lord of the Rings : Return of the king | |
Howdy folks, Winter 2014 anime is stale news now with Spring 2014 lineup just around the corner (time sure flies fast!). You can view the preview chart [here](http://i1.minus.com/igcbxHFvbhPpC.jpg) and follow the discussion on MAL [here](http://myanimelist.net/clubs.php?cid=57921). Things look pretty grim this season. All my favorite anime series are coming to an … | |
Re: [quote=seankleyn;232763]I want to start programming PC Games that use lots of graphics. Which Programming language or languages are best suited for computer graphics programming and WHY?[/quote] PC games actually use a lot of graphics, what you might have wanted to say was that how to make cool commercial games. ;) … | |
Re: Write String data to your DataOutputStream using the writeUTF method and read the same at the server using the readUTF method of the DataInputStream. Another option would be to write to the OutputStream by wrapping it in a PrintWriter and then at the client using the BufferedReader to read the … | |
Re: You don't specify the .java extension when executing Java programs since you are no longer concerned with .java files [the javac command compiles your Java files to the bytecode which is placed in .class files). Read the documentation of the `java' command for more details. [I][B]Edit:[/B] D'oh, beaten.[/I] | |
Re: The simplest (in terms of effort) solution would be to use the `CacheBuilder` class [provided by Guava (also known as Google collections)](http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/cache/CacheBuilder.html) | |
Re: > I'm really looking forward to continuing working with, debating with, and learning from all you guys. Congratulations James and thanks for your kind words. I honestly feel that this Java forum/community owes a lot to your love for Daniweb, Java and desire to help folks! :) | |
Re: When you say hosting, are you talking about shared hosting, a VPS or dedicated hosting? Also, how much are you paying right now per month/what kind of plans? AFAIK, Dreamhost has been going downhill for the past few months/years(?)... | |
Re: Hmmm how about something like: [code=c] int hours = 0 ; for( int i = 0; i < 3; ++i ) { cout << "Enter the hours parked: " ; cin >> hours ; // call your function and display the output in the format you want. // do whatever … | |
Re: Your code won't work because `Local` is a inner class. You can't create instances of inner classes without an instance of parent/enclosing class. Make `Local` a nested class (by adding static) to make the error go away. http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html | |
Re: >i also tried firefox but i didnt like it because of its limited javascript and >css support Wha..? Oh, you are joking, right? | |
Re: You have 4 loops in your algorithm which means if we do a naive Big-O analysis the time complexity becomes `O(n^3)`/`O(n^4)` [which doesn't scale well as the input size keeps growing](http://i.stack.imgur.com/8nXvk.jpg). Not sure why the algorithm has to be so complicated. How about something like: 1. Accept user input and … ![]() | |
Re: But still given that the worst sorting time for "Quicksort" equals the time complexity of bubble sort, so it does no harm in using the fastest algorithm out there, just to keep the algo common independent of the data fed into it. The below link is interesting to look at … | |
Re: > i need to know why this problem occured and how to solve it??? Post the relevant code snippets. Are you sure you are releasing the database resources after performing the read/write? Are you working with the database using the sqlite console and at the same time trying to query/insert … | |
Re: > At leat it gives you an easy way to read content and, you might not be able to evaluate long code snippets, but you can still consume the majority of content and follow along Assuming you have set aside a separate email account for Daniweb because given the rate … | |
Re: In addition, you can run both 32/64 bit Java on 64 bit OS. The most important property of 64-bit JVM's is that it allows you to have large heaps (4+ GB's) which is not possible with 32-bit JVMs. There are a lot of [articles floating around which say that 64 … | |
Howdy folks, Apologies for missing out on the previous season (Summer 2013). Summer wasn't really good enough so it completely slipped through the cracks. But now that Fall 2013 is here and the line-up seems to be pretty awesome (I would say one of the best so far, at least … | |
Re: You need to create a "Dynamic Web Project". This is assuming you have downloaded Eclipse for Java EE. | |
Re: [quote]I've asked the mods to update the score board for us.[/quote] Done and done. Enjoy! :-) | |
Howdy-ho folks! It's that time of the year again; Winter 2014 anime starts airing in a few days. The latest chart can be found at [ATX Pieces site](http://atxpieces.files.wordpress.com/2013/12/winterv6.jpg). Fall 2013 looked really promising but turned out to be not so good. The good thing is that all the "better" fall … | |
Re: No tab for News/Tutorials on the main page? Also, do you maintain a list of "popular" threads (based on view count, upvotes etc.). I think those threads with a lot of info which the community likes would be a good candidate for home page. | |
Re: > the proper answer the program is expecting is 514.03. What did i miss? You missed gathering the correct co-ordinates. sqrt(2^2 + 2^2) is indeed sqrt(8) => 2.828427 ... | |
Re: > @sciwizeh, i don't know if it is me, but i think "a" is trying to make a game like tetris? Did you see the screenshot? It specifically says "mines"... | |
Re: Is the database really running on the port 1521 of your machine? Are you able to connect to that SID using SQL Developer? | |
Re: "Saviour Of Sanity" for those crying out help ("sos") in these forums. ;-) | |
Re: I've updated the code snippet as per the request. Also, it would be nice if you could mention all the references you used when creating this since the linked Wikipedia page isn't very helpful in regards to specification, instruction set etc. | |
Re: Use the `printf` method of the `PrintStream` class. For e.g. something like: double yourNum = 5192.237545685454687; System.out.printf("%.2f", yourNum); // 5192.24 Notice that it has automatically done the rounding for you (`.24` instead of `.23`). If you need to control the rounding, use the `DecimalFormat` class. DecimalFormat df = new DecimalFormat("#.##"); … | |
Re: At the bottom of every forum/sub-forum page there is a button which says "Mark Forum Read" (right next to Start New Discussion). That should do the trick. | |
Re: > Currently, I am writing it to a .TXT file for ease and convenience. Ideally, I would like to output some of the information so that it is formatted with Italics. I'm thinking that using a RTF file would be simplest but i'm not entirely sure as I have never … | |
Re: > Please Explain. Where i have to change the code? Try changing your markup; your HTML page doesn't understand your *servlet project* and hence you need to specify the extra "/test" before your servlet name. > So where i have to include DB Connection code? In your [URL="http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html"]DAO [/URL]classes. > … | |
Re: Two important points: 1. What is the time interval between taking the `jmap` dump and closing the sockets? Your close calls don't immediately take effect since there is a certain teardown time 2. Did you also monitor the log file? Were there any exceptions in the logs? | |
Hi Dani, AFAIK OAuth 2.0 supports 3 flavours: Server side apps, client side apps and installed apps. Does Daniweb Oauth allow OOB in the redirect_uri which is part of the support for installed/standalone apps? If no, are you expecting desktop app writers to spawn a local web server and use … | |
Re: > I have have found online says it is impossible to remove elements from an array without creating a new array, so any help would be much appreciated. It's possible if you are OK with the old allocated array sticking around. But this might be much more problematic than just … | |
Re: AFAIK, not possible without code modifications. The simplest thing would be to just create a script (.bat or .sh file) and run the script everytime instead of typing out the entire command... | |
Re: Please my friend try ur code before posting it on the forum so that other ppl are not misled. THe code u have posted doesnt work. | |
Here is a simple implementation of implementing a simple Left trim (ltrim) and Right trim(rtim) of unwanted characters from a C style string. (null terminated strings). Doesn't suffer the overheads of the memmove implementation in which the worst case scenario (a string containing all junk characters) is approx. N^2 / … | |
![]() | |
The End.