3,892 Posted Topics

Member Avatar for brittney_2

> 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 …

Member Avatar for ~s.o.s~
0
751
Member Avatar for dwel

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]

Member Avatar for Rajeev Kumar_1
0
472
Member Avatar for gagun

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)

Member Avatar for ~s.o.s~
0
2K
Member Avatar for iConqueror

Also something which others haven't mentioned; you can't earn rep in any sub-forum which falls under the "Community Center" category.

Member Avatar for happygeek
0
279
Member Avatar for iConqueror

It's branch prediction indeed; read [this](http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array).

Member Avatar for ~s.o.s~
1
371
Member Avatar for Vikram_2

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) ['इस', 'पृष्ठ', 'पर', 'इन्टरनेट', …

Member Avatar for Gribouillis
0
2K
Member Avatar for tubs1

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 …

Member Avatar for ~s.o.s~
0
266
Member Avatar for loulou.skr

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 …

Member Avatar for ~s.o.s~
0
216
Member Avatar for abaddon2031

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.

Member Avatar for ~s.o.s~
0
407
Member Avatar for Mya:)

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 …

Member Avatar for Dani
0
323
Member Avatar for john_hasan

[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 …

Member Avatar for aizam76
-1
3K
Member Avatar for anupam_smart
Member Avatar for ~s.o.s~

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 …

Member Avatar for world_weapon
0
328
Member Avatar for seankleyn

[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. ;) …

Member Avatar for keyboard_me
1
2K
Member Avatar for jazz_vill

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 …

Member Avatar for Reshma_2
0
2K
Member Avatar for debasisdas
Member Avatar for kiroyzki

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]

Member Avatar for stultuske
0
638
Member Avatar for aravind326

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)

Member Avatar for aravind326
0
391
Member Avatar for JamesCherrill

> 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! :)

Member Avatar for peter_budo
6
242
Member Avatar for nufftalon

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(?)...

Member Avatar for Mike_danvers
0
343
Member Avatar for king13

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 …

Member Avatar for radhakrishnan.akshai.3
0
24K
Member Avatar for abhishek.anand.37017794

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

Member Avatar for balaji.ghadage
0
1K
Member Avatar for serkan sendur

>i also tried firefox but i didnt like it because of its limited javascript and >css support Wha..? Oh, you are joking, right?

Member Avatar for Reverend Jim
0
333
Member Avatar for pspwxp fan

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 …

Member Avatar for iamthwee
0
595
Member Avatar for hariza

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 …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for MxDev

> 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 …

Member Avatar for takonewa
0
2K
Member Avatar for Dani

> 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 …

Member Avatar for Ancient Dragon
0
621
Member Avatar for syasya

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 …

Member Avatar for ~s.o.s~
0
188
Member Avatar for ~s.o.s~

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 …

Member Avatar for ~s.o.s~
1
365
Member Avatar for Twee Nguyen

You need to create a "Dynamic Web Project". This is assuming you have downloaded Eclipse for Java EE.

Member Avatar for peter_budo
0
249
Member Avatar for Doctor Inferno

[quote]I've asked the mods to update the score board for us.[/quote] Done and done. Enjoy! :-)

Member Avatar for cproger
9
46K
Member Avatar for tayspen
Member Avatar for ~s.o.s~

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 …

Member Avatar for <M/>
0
313
Member Avatar for Dani

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.

Member Avatar for happygeek
1
829
Member Avatar for <M/>

> 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 ...

Member Avatar for <M/>
0
226
Member Avatar for sciwizeh

> @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"...

Member Avatar for sciwizeh
2
858
Member Avatar for Tapan1

Is the database really running on the port 1521 of your machine? Are you able to connect to that SID using SQL Developer?

Member Avatar for stultuske
0
985
Member Avatar for mrnutty
Member Avatar for Reverend Jim
0
687
Member Avatar for TrustyTony

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.

Member Avatar for TrustyTony
5
2K
Member Avatar for <M/>

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("#.##"); …

Member Avatar for old_apache
0
4K
Member Avatar for Ancient Dragon

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.

Member Avatar for Ancient Dragon
0
218
Member Avatar for ObSys

> 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 …

Member Avatar for JamesCherrill
0
278
Member Avatar for RaniThomas

> 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. > …

Member Avatar for stultuske
0
2K
Member Avatar for newbie14

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?

Member Avatar for newbie14
0
911
Member Avatar for ~s.o.s~

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 …

Member Avatar for Dani
0
569
Member Avatar for aelajj

> 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 …

Member Avatar for JamesCherrill
0
1K
Member Avatar for murali2489

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...

Member Avatar for ~s.o.s~
0
148
Member Avatar for code2cplus

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.

Member Avatar for Assembly Guy
0
685
Member Avatar for ~s.o.s~

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 / …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for diafol
Member Avatar for Dani
2
360

The End.