3,892 Posted Topics

Member Avatar for pritaeas

I was able to upvote it; you just have to do it real quick. ;) But jokes aside, I wasn't able to upvote once the rep comment box comes up after on-hover.

Member Avatar for deceptikon
0
198
Member Avatar for Reverend Jim

> Can someone please state, definitively, what is the preferred method for posting code? Fenced blocks were removed because as quoted by Dani, "they were incredibly buggy". The preferred way to post code is to indent the code by 4 spaces (or 1 tab) **or** if you are a clickety-click …

Member Avatar for Dani
0
195
Member Avatar for mehnihma

> Both are free as long you run it with public repos, as soon you want private repo you have to pay Bitbucket allows you to have unlimited private and public repositories for upto 5 colloborating users. I always recommend Bitbucket to folks since you can pretty much host all …

Member Avatar for ~s.o.s~
0
118
Member Avatar for Majestics

> Its just a simple question , but i m totally confused that why php and asp hosting are cheaper then jsp One reason might be the widespread use and acceptance of PHP and ASP by hobby programmers/beginner web developers. Java based applications have always been associated with an "enterprisy" …

Member Avatar for ~s.o.s~
0
99
Member Avatar for Dcurvez

> this is the second thread abt the same problem, will you please tell what was causing it.... Just out of curiosity.... Possibly old Javascript files/site resources given that the problem goes away after clearing the brower cache.

Member Avatar for ~s.o.s~
0
115
Member Avatar for jackbauer24

> Should he learn C++? This question is incomplete without the follow up answer for "for what purpose?". If for fun, C++ isn't fun to write, at least when compared to the newer breed of managed/scripting languages which make it a lot simpler to do stuff. If for curiosity and …

Member Avatar for Rashakil Fol
0
500
Member Avatar for JohnBoy2

Though I'm no Ruby expert, here are a few suggestions: [code]if (result.nil?) return Time.now end[/code] can also be written as:[code] return Time.now if result.nil?[/code] = Instead of using [icode]@@tcMillisecondMode = "false"[/icode], why not just use [icode]@@tcMillisecondMode = false[/icode]? = Your ASC state can be better represented using [URL="http://www.randomhacks.net/articles/2007/01/20/13-ways-of-looking-at-a-ruby-symbol"]Ruby Symbols[/URL]. = …

Member Avatar for kb9agt
0
187
Member Avatar for FC Jamison

Something like [URL="http://www.cprogramming.com/tutorial/computersciencetheory/merge.html"]this[/URL] ?

Member Avatar for Lylla
0
178
Member Avatar for michelleradu

The regular expression: [icode]([.,!?:;'\"-]|\\s)+[/icode] should do the trick. It is read as "for one or more occurrences of either a whitespace or punctuation". The important part here is to make sure that the '+' is kept outside the alternation, since we can have a mix of white-spaces and punctuations. The …

Member Avatar for ~s.o.s~
0
8K
Member Avatar for Dani

> Firstly, I made the font size for the live preview larger at I forget who's recommendation (sorry!) Hey, that was me! :) Ardav: Try force refreshing the page; I faced the same issues when trying out things in chrome but the refresh fixed it. BTW Dani, there is another …

Member Avatar for Airshow
3
278
Member Avatar for jbennet

I think the way it works is that if you have other "unread" PM in your mail box, those are pushed to the top. So if you move between pages in your inbox, maybe moving to the last page or moving to the first "read" PM, you might be able …

Member Avatar for Airshow
0
2K
Member Avatar for beanboy

The simplest way would be to configure a path[a directory] in your web.xml and use the same path to upload/download images based on the image name specified. In your web.xml:[code=xml] <web-app ...> <context-param> <param-name>RESOURCE-PATH</param-name> <param-value>d:/My-Uploads</param-value> </context-param> </web-app>[/code] In your Servlet when saving:[code=java] // TODO: Move the image writing code to …

Member Avatar for imdeadsoul
0
1K
Member Avatar for learned1
Member Avatar for Dani

Looks a lot more prominent now. Any way you can make the preview of the same size? BTW, not sure if you know this but fenced code blocks don't produce preview and work differently than native code tags. For e.g. fenced code blocks with Python/Py language looks different than the …

Member Avatar for Dani
0
211
Member Avatar for Sahil89

> All admins, moderators, team colleages are employees or some of them just contribute their time to site All moderators are voluntary contributors (not employees) to this forum who help out Daniweb with answering questions and forum maintenance in their free time. Except for me, all other co-admins are Daniweb …

Member Avatar for Sahil89
0
162
Member Avatar for WaltP

I think that's a known bug. I deleted posts made by "bedexchange" on this sub-forum since they were breaking the rules but the forum view still hows his name even though the post no longer exists. I thought this was just a problem for admins/moderators but seems that isn't the …

Member Avatar for Airshow
1
246
Member Avatar for silvercats
Member Avatar for coroll

> if your program has no I/O, and there's nothing else running on the machine at the same time, then for most purposes you can assume CPU time == real time If the program in multi-threaded, the CPU time gives the "total" time spent by each CPU/core. So even if …

Member Avatar for coroll
0
5K
Member Avatar for ~s.o.s~

Hi folks, Please join me welcoming our two new moderators: [ardav](http://www.daniweb.com/members/ardav/120589) and [pyTony](http://www.daniweb.com/members/pyTony/734700). @pyTony & @ardav Congratulations on your new role at Daniweb. Celebrations ahoy! :)

Member Avatar for Nick Evan
1
323
Member Avatar for ~s.o.s~

In case you are not not aware, Stanford has started offering free online courses (as in real courses and not just video lectures) for topics like Database design, analysis of algorithms, CS 101 etc. Classes like database class, AI class and machine learning class are already live and a host …

Member Avatar for Tofayel
3
541
Member Avatar for jamesr12

> since you here are explicitly saying you want a new Object, a new String will be created in the pool, and your second variable will point to that one This isn't correct AFAIK; instantiating new strings on demand doesn't send them to the "string pool" unless the newly created …

Member Avatar for jamesr12
0
146
Member Avatar for Dani

[quote]Therefore, you can post in the PHP forum with the tag MySQL and your thread will get double exposure[/quote] This is possible even now, except for the double exposure part. :) What exact measures do you have in mind to ensure wide adoption of tags to the point that they …

Member Avatar for diafol
0
279
Member Avatar for end3r

Any specific reason you want to load resource relative to a class and not relative to a classloader using `MyClass.class.getClassLoader().getResourceAsStream("my/pkg/file.txt")` ?

Member Avatar for end3r
0
313
Member Avatar for frivolous

Peter, zeroliken was actually replying to "frivolous". It seems that the order of the first two posts was reversed.

Member Avatar for zeroliken
0
298
Member Avatar for exinrex

So you need free game scripts..hmm...maybe something like [URL="http://www.scriptdungeon.com/free_php_scripts/games_and_entertainment/free_php_scripts.php"]this[/URL] ?

Member Avatar for bionutd
0
138
Member Avatar for arathy nair

If those string belong to a fixed set of values, consider using an enum instead of strings which have the added benefit of type safety. There might be other ways of achieving what you desire but difficult to suggest without more context.

Member Avatar for ~s.o.s~
0
162
Member Avatar for Vampiricx3

The simplest solution would be to introduce a new "command" like [icode]consoleWriteLn[/icode] (similar to [icode]print[/icode] v/s [icode]println[/icode] when using System.out). So if the user uses "consoleWrite" it would correspond to [icode]System.out.print[/icode] whereas if the user uses [icode]consoleWriteLn[/icode]. BTW, why not use shorter commands like [icode]print[/icode] and [icode]println[/icode] ?

Member Avatar for ~s.o.s~
0
95
Member Avatar for Zay

> i do not know these algorithms You would have to learn them to solve the problem at hand. Try the wikipedia. It should help you in getting started at least.

Member Avatar for Dmitry74
0
186
Member Avatar for Reverend Jim

Such a feature already exists; look for a "message like image" next to the feed icon at the top of your post.

Member Avatar for deceptikon
0
222
Member Avatar for ihatehippies

Here are my findings; `mmap` is wicked fast for large file sizes if they can completely fit in memory. Unfortunately, having a 32 bit machine limited by testing capabilities. My config:[code] Windows XP 32 bit 3GiB RAM Intel i3 3.07 GHz SATA-II 3 GiB/s; 7200 RPM Python 2.7.2[/code] My output: …

Member Avatar for ihatehippies
0
6K
Member Avatar for johndoe444

Ensure that the required JARs are on the runtime classpath. You can download the required JNDI JARs from [URL="http://java.sun.com/products/jndi/downloads/index.html"]here[/URL]. Also, paste the entire stacktrace along with the tutorial you are referring to for others reference.

Member Avatar for PoonamV
0
1K
Member Avatar for salinajohnson

This is not an issue but a concious site-wide decision. IIRC, this was put in place to ensure we don't end up getting members who post for the sole purpose of "exposing" their sig links to "teh internet". As a user, you have no control over this behaviour, so no, …

Member Avatar for Ancient Dragon
0
222
Member Avatar for Syrne
Member Avatar for hfx642
0
226
Member Avatar for manoj_93

What kind of file is it? What kind of "text" does it contain? If it contains ASCII encoded text, you'll always get the char count of a string same as the number of code-points. [URL="http://weblogs.java.net/blog/joconner/archive/2005/08/how_long_is_you.html"]Read this[/URL], try to understand it and get back in case of more queries.

Member Avatar for ~s.o.s~
0
121
Member Avatar for 1bung100

Try wrapping the `value` elements in a parent element called `values` and have a look at [URL="http://apache-commons.680414.n4.nabble.com/Commons-Digester-Mapping-an-ArrayList-td741993.html"]this thread[/URL].

Member Avatar for 1bung100
0
2K
Member Avatar for adil_bashir

In what way is the BigInteger constructor which accepts a string not working out for you?

Member Avatar for adil_bashir
0
1K
Member Avatar for freedomflyer

`clone` here is working as expected. It's cloning the "TreeMap" which is why "put" in the cloned one doesn't affect the "old" one. It's not cloning the key or value; so basically keys and values are "shared" across the two Map instances. This is only an issue if you are …

Member Avatar for ~s.o.s~
0
1K
Member Avatar for jackbauer24

I'd personally recommend a file/directory copy utility. This way, he'll get more acquainted with how the CLI clients work and get a taste of implementing a fun utility from scratch. The good thing is that this project can be beefed up if required by adding more options like the way …

Member Avatar for zeroliken
0
309
Member Avatar for riahc3

The format `dd/MM/yyyy - HH:mm:ss.S E` should do the trick. For future references, [URL="http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html"]look into the Javadoc of the SimpleDateFormat class[/URL].

Member Avatar for riahc3
0
439
Member Avatar for Alfy

[code]int count (char vector[],int nr) { int gasit=0,i; for(i=0;i<nr;i++) { [COLOR=DarkOrange] if(vector[i]>='a' && vector[i]<='z') gasit++; if(vector[i]>='A' && vector[i]<='Z') gasit++;[/COLOR] } return gasit; } [/code] I think there is a better way of doing this, just use the [search]isalpha( )[/search] function which checks whether the given character is an alphabet or …

Member Avatar for zeroliken
0
2K
Member Avatar for freedomflyer

Two ways of doing this: 1) NULL checks every time you add an element. If the "key" is not associated with any underlying set, create a new HashSet, and place it against the key.[code] Set<State> states = mapping.get(transitionStringToAdd); if (states == null) { states = new HashSet<State>(); mapping.put(transitionStringToAdd, states); } …

Member Avatar for freedomflyer
0
440
Member Avatar for sergent

Mentioning Emacs without mentioning Vim? Surely the world must be coming to an end. ;-)

Member Avatar for hystaspes
0
331
Member Avatar for bhallarahul

"make" is a standard "build automation" utility which is pretty much available on *nix like platforms. For more info, [URL="http://en.wikipedia.org/wiki/Make_(software)"]read this[/URL]. The core concept is that instead of firing the commands required to "build" a project again and again, you stuff them in a "makefile" and distribute them to the …

Member Avatar for ~s.o.s~
0
155
Member Avatar for frogboy77

[quote]Would i be allowed to make a comment in those threads or would that be "reviving the dead"?[/quote] Thread bumping rule isn't an absolute. It's just that 99.99% of the times the bump is irrelevant/off-topic/spam/homework kid, making us a bit strict/wary when it comes to bumping threads. If you feel …

Member Avatar for diafol
1
233
Member Avatar for jackbauer24

I'll try to explain this with an example. Let's talk about a simple templating system which is based on a single Template interface. Every different template implementation has a different way of interpolating variables, convention used for representing data etc. But all templates also share a common piece of logic: …

Member Avatar for JamesCherrill
0
173
Member Avatar for Mr.BunyRabit

[quote]It still displays the old one!? Whyy??[/quote] Apart from answering the questions posed above, make sure that you do a clean build and then run the application. It's quite possible that the old image still resides in the build directory of Netbeans. Also, check where exactly is this application run …

Member Avatar for Mr.BunyRabit
0
143
Member Avatar for jhamill

[quote]hey I just realized I was not supposed to post this code online could someone either delete the thread or my username/personal info[/quote] There is no personal information in that thread. The only possible incriminating piece of info would have been the package name which I have removed from the …

Member Avatar for diafol
-1
282
Member Avatar for jackbauer24

Al Sweigart has an entire site and a book dedicated for game programming for kids. You might find [URL="http://inventwithpython.com/blog/"]this [/URL]and [URL="http://inventwithpython.com/chapters/"]this [/URL]worthwhile. As someone who has mentored both colleagues, junior developers and "want to be programmers", I'd recommend against "industrial strength" languages like C#, Java, C++, C etc. unless the …

Member Avatar for jbennet
0
553
Member Avatar for emclondon

> I have an interface with a function, and 3 classes implementing interface...each class doing its own work. now I have to call up interface by making an object of it. then I utilize the function in my frame to call up different class via interface. thats what im assuming.. …

Member Avatar for ~s.o.s~
0
638
Member Avatar for sha11e

@sha11e: Strive for correctness, readability and performance; in that order. :-) [quote]BufferedReader ins = null; static PrintStream ios = null; Do neither use up memory at this point?[/quote] They are simply fields of the given object i.e. names. They don't consume memory in the sense that they don't point to …

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

The End.