- Strength to Increase Rep
- +10
- Strength to Decrease Rep
- -2
- Upvotes Received
- 52
- Posts with Upvotes
- 44
- Upvoting Members
- 35
- Downvotes Received
- 8
- Posts with Downvotes
- 7
- Downvoting Members
- 6
I'm an addict of gaming..
Love software development.. Love C++, hate Java [mods please let me say that here at least :)]..
A fast driver (as much as Bangalore traffic will permit)..
Mmmm what else.. yeah photography.. See my blogs..
- Interests
- Photography Gaming: - AOE (TC usually) - Q3 Chess Last but not the least by far: Programming :)
- PC Specs
- Fujitsu Siemens Lifebook 7110 S -------------------------------------- Home made: Gigabyte GA-P35-DS3L…
506 Posted Topics
| |
Re: Politics is the art of preventing people from taking part in affairs which [I]properly[/I] concern them. | |
Re: Just to add the fact that this is type independent (i.e. not specific to char*): operator == is overloaded/implemented for all basic types in C++. A pointer is also a basic type. The implementation of operator == that compares pointers is NOT to compare what they to point to but … | |
Re: How exactly did you manage your first 6 sems.. ?! Try [URL="http://java.sun.com/docs/books/tutorial/"]Sun's Java Tutorial[/URL].. | |
Re: Some for graphics ppl: [LIST] [*]Write a program to draw a rectangle, ellipse, square, circle, point and line based on user input. (Beginner) [*]Write a program to emulate Microsoft Paint. It should be possible to switch between different tools (circle, rectangle, eraser...) using pre-defined key strocks. - Intermediate [*]Write a … | |
Re: hey.. guess this is going to be an unhelpful and late answer, but given the format of input you have, there is no fixed formula to parse it using `awk` or `sed` that I can see. You have gotta write code specific to each section in your input, to get … | |
Re: [quote=Aia;369444]>how to complile and execute a c pro in editplus Editplus is a full featured text editor. Only to produce the source code. [/quote] Although it's just an editor, it would be supporting configuring user tools (I use Textpad which does). Also it's easy to suggest a new IDE but … | |
Re: Honey you chose THE wrong site/forum for posting this... :)) Completely agree with joeprogrammer. | |
Re: Nothing's Gonna Change My [B]Love[/B] For You - Glenn Medeiros | |
Re: Here is something they claim is shown in classrooms (of IIM-A - Indian Institute of Mgmt - Ahmedabad).. I think it's a joke.. It's good none-the-less.. | |
Re: Couldn't help but notice that unless there is some bug in daniweb.com this is most read thread I've seen so far.. ! 17,751 times.. :) | |
Re: [quote=Ancient Dragon;393474]>>i saw this code in a particular book..... what an awful algorithm to put in a book! I thought books were supposed to teach the language not how to obfuscate it. I think you should trash-can that book and get a different one.[/quote] Unless the book is this :) … | |
Re: [LIST=1] [*]You throw your back out on the toilet. [*]You shave your ears. [*]Your second wife calls your first wife “ma’am” [*]You're genuinely excited when your prescriptions arrive in the mail. [*]You read the obits in the newspaper to check the ages of the dead people. [*]You read a newspaper. … | |
Re: Look at the call stack and see which d'tor (destructor) is being called, that should tell you where the problem is.. | |
Re: >> but for some reasons is not working for me Unable to guess the reasons. Is there ANY output produced when you run this script? I'm not a batch file expert, but do you REALLY need to use batch file only? If not I highly recommend using something like Cygwin … | |
Re: Problem is exactly what you pointed out. A recursive function without a "break condition". In this case if [iCODE]getLeft()[/iCODE] or/and [iCODE]getRight()[/iCODE] is NULL then you shouldn't call [iCODE].iPathLength()[/iCODE] on it, thus breaking the recursion. Theoretically it might still be possible to make this code itself work (using specialized derived classes … | |
Re: Try [ICODE]dos2unix [/ICODE]on your script.. looks like there are [ICODE]^M[/ICODE] chars.. you must've edited the script using some Windows' app instead of `vi` or some unix app.. Not that you can't use Windows app.. just be careful in setting up the preferences in the editor to ensure it saves in … | |
Re: Refer to the famous [URL="http://www.google.com/search?q=sed+one+liners"]sed one liners[/URL], I understand they're [URL="http://sed.sourceforge.net/sed1line.txt"]even maintained[/URL] now. | |
Re: To find out what's happening in the program, you can apply a simple technique called "[URL="http://en.wikipedia.org/wiki/Debugging"]debugging[/URL]". In this case: * Add some traces, to print out all variables at all steps, to your code so you know what's happening with each input. * use a debugger. | |
Re: You can of course "return" a string like this.. which is not really returning and it forces you to ensure that there are no unwanted `echo`s in the function.. but it works.. :) [CODE]#!/bin/bash function gimme_string() { echo "returned string" } my_string=`gimme_string` echo "String I got is: $my_string"[/CODE] | |
Re: Can you post your code and point to where the problem is? Or is it that you don't understand Huffman coding? | |
Re: Can you post the full log and exception stack? | |
Re: Are these arraya your keys to the map/list? Can there be any repetition? If there is repetition, is it needed to hold all instances (e.g. like in a std::multimap) or only one key should be there (like in std::map)? What's the max number of entries per array? How abt picking … | |
Re: Which shell? What's the loop break condition? How to loop: [url]http://www.freeos.com/guides/lsst/ch03sec06.html[/url] How to call a script: It's just a command give full path. E.g. a.sh wants to call b.sh then [CODE]#!/bin/bash #a.sh PATH_TO_B=/tmp/b.sh echo Calling b.sh $PATH_TO_B echo $PATH_TO_B exited with $? #if b.sh is not executable then: /bin/bash $PATH_TO_B … | |
Re: Try [URL="http://en.wikipedia.org/wiki/DTrace"]Dtrace[/URL]. You shoudl be able to add some hook into kernel to monitor directory access and log if the directory in question == xyz. Only port for linux I saw was from [URL="http://www.crisp.demon.co.uk/tools.html"]CRiSP[/URL] available [URL="ftp://crisp.dyndns-server.com/pub/release/website/dtrace"]here[/URL]. Check status.txt for compatibility with your OS/version. If you can make it run, then … | |
Re: [QUOTE=mcconnell_34;1646837]didn't work[/QUOTE] Ppl need more than "didn't work" to understand a problem. [QUOTE=mcconnell_34;1646837]my man[/QUOTE] See [U]her[/U] avatar? Read: "Code Goddess"? | |
Re: What you're looking for is called [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#cg"]capturing group[/URL] in java regex. e.g. for this input: "world cup, football, asia, 2011" - when you apply this regEx: "^world cup, football, ([^,]*), 2011$" - then matcher.group(1) is set to "asia" - when you apply "^world cup, ([^,]*), ([^,]*), 2011$" - then matcher.group(1) … | |
Re: Although your confidence in abilities of us at daniweb is overwhelming, we have not yet mastered the art of telepathy or remote desktop viewing. So we are unable to see what the errors are. Read [URL="http://electrosofts.com/cgraphics/"]this [/URL]. It tells you which lib, bgi you need and so on. Also note … | |
Re: Line 47: if (mainmenu == "New" || "new" || "New Game" || "new game" || "New game" || "new Game" || "newgame" || "Newgame") - mainmenu == "New" <-- is a condition - "new" <-- is NOT a condition - "New Game" || "new game" || "New game" || "new … | |
Re: How abt rsh? Is that enabled? ssh is just a secure-rsh, so whatever you can do with ssh can also be done with rsh. | |
Re: [QUOTE=smrati.katiyar;1540474]cat filename | grep word | echo "$?" if the result of above oneliner is 0 it means the word is there in the file . if it's non zero it means word is not there.(echo "$?" tells us whether the previous command was successful or not) let say your … | |
Re: May be there is an easier way, but here is what I can think of.. [CODE]total_params=`echo $* | sed 's/ */\n/g' | sort | sed '/^$/d' | wc -l` unique_params=`echo $* | sed 's/ */\n/g' | sort -u | sed '/^$/d' | wc -l` [ $total_params -ne $unique_params ] && … | |
Re: Why don't you simplify your code? It's looking too complex to understand really. [CODE]for myfile in `find . -name "R*VER" -mtime +1` do echo "Processing $myfile" # did you mean to use -l instead of -H by any chance? # Two conditions on RHS and LHS do not produce similar … | |
Re: That's how it works! :) What do you want to do? To process the file line by line you should directly pipe the output of cat to next command like: [CODE]cat orders.0613 | awk ... cat orders.0613 | sed ... cat orders.0613 | cut ... # Of course all of … | |
Re: There are 2 simple options: 1. If the number of params are not too many just pass them on command line: [CODE]#/bin/bash APPLICATION=$1 LOCALHOST=`hostname -s` REMOTEHOST=$2 WEBDATA=$3 SQLUSER=$4 SQLPASS=$5 SQLDB=$6 # --------------------------------------------- #run like this: backup.sh appName remotehost webdataLocation usr pswd db[/CODE] You name make them named params [URL="http://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options"]using the … | |
Re: I would guess he means "formatted I/O" instead of buffered I/O. Which would be fprintf/fscanf. Basically the functions that try to interpret the data that's read to some specific type. I never tried in C/C++ but in Java it was quite clear that ObjectInputStream.readInt() is much slower than FileInputStream.read(). If … | |
Re: [QUOTE=Narue;1577057]...answer is no...[/QUOTE] Technically correct is to say that: Yes, but it doesn't make sense. As the templates are "compiler feature", definition of a template must be in the same compilation unit as the user. So if you do this all users would have to [ICODE]#include[/ICODE] the "implementation source file". | |
Re: Static members are init'd when teh class is loaded. Classloader's [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Class.html#forName%28java.lang.String%29"]forName()[/URL] method is the one that is supposed to do it. Exception is when you explicitly ask classloader NOT to init the class but just load it by passing false as second argument to the [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Class.html#forName%28java.lang.String,%20boolean,%20java.lang.ClassLoader%29"]overloaded forName()[/URL]. | |
Re: Yeah, it looks like some class path issue and not exactly a compilation error. Answer NormR's question.. [QUOTE]java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory [/QUOTE] Where is the class that is referred to in this error message? | |
Re: You write code for [URL="http://en.wikipedia.org/wiki/Selection_sort#Algorithm"]selection sort[/URL]! Might help to see [URL="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Comparable.html"]Comparable[/URL] as well, you can make your implementation a bit generic. | |
Re: "shell is uninitialized" means that the files (scripts) listed there (/etc/profile, ...) are NOT executed. So whatever env variables you're setting/updating in those files are not set/updated. | |
Re: In short try implementing some OS kernel services. - I would recommend you take a look at anything that describes the kernel functions/algorithms. ---- [URL="http://en.wikipedia.org/wiki/Kernel_%28computing%29"]A starting point[/URL]. ---- Another one: Just implement a part of [URL="http://en.wikipedia.org/wiki/POSIX"]POSIX[/URL]'s [URL="http://pubs.opengroup.org/onlinepubs/9699919799/"]specification[/URL]. :) - You can always get more info on how say RHEL implements … | |
Re: Mike already gave an excellent example. Just to point out in different words. In a good design you want abstraction. And that's provided by inheritance (among other options) primarily. As long as users use abstractions (Shape in this case) they're shielded from implementation details. A good example from "Java" is: … | |
Re: Put enough info in the question.. POSIX/Windows? What's the problem? | |
| |
Re: If your question is purely on GUI (how to take an expression as input): - Make a list of functions supported by your code and build a GUI such that user can only use one of those. - Fix the number of variables supported in an expression (1, 2, ...) … | |
Re: Yes. There are 2 ways to look at it: 1. You do all your operations by reading / writing to file from your code. Instead of memory. I.e. you take care in your code to access file. 2. You overload all required operators (new, delete, *, [], ., ->, ...) … | |
Re: well, what you've written is a pure C++ class, without using templates. Unless you use the template type inside declaration/definition of the class it's not a template class. In your case you're not using the tyep elemType anywhere. So it has no effect. It's like an idiot wearing the wise-guys' … | |
Re: What do you wnat to validate? I.e what's the validation? Perhaps match() takes a long time due to the generic nature of the regEx you're using. Pattern.compile() however shouldn't take any longer/shorter as it's not connected to the input at all. Can you enhance the code you've posted so that … | |
Re: [QUOTE=firstPerson;1562010]It might be possible but it would be a lot of work, and might not be worth it. Is this just for curiosity or a project or something else?[/QUOTE] Can you give at least an outline how can you do this? My understanding is that templates are a compiler feature, … |
The End.