|
Donald Duck posted:The books listed were Code Complete and Practice of Programing, as well as the Art of Programming. Would all these books be useful for me? I imagine most of the Knuth book would be beyond me at this stage quote:Second question, pretty much everything we've done has been just in Java, with a tiny bit of C in one of my modules. I've picked up the K&R C book to help me learn C over the summer. Since I want to know more than just Java, what else is worth learning? I'd try to get some clue about concepts instead of programming languages. In my opinion every CS students needs to read this. Since this book introduces all kinds of programming language concepts you can also use it to find out what to learn next.
|
# ? Apr 26, 2008 07:29 |
|
|
# ? May 15, 2024 03:06 |
|
Alan Greenspan posted:Yes. And Probably. How much should that book on average be? The only shop around here with it sells it at 170euro? Edit: Checked amazon and its only 35 sterling, I know where I'll be getting it then. Donald Duck fucked around with this message at 14:55 on Apr 26, 2008 |
# ? Apr 26, 2008 14:49 |
|
Donald Duck posted:I was looking through this thread originally to find books to read, as a CS student. Found them on the first page, but just wanted to ask some questions. I'm just finishing my second year now. quote:Second question, pretty much everything we've done has been just in Java, with a tiny bit of C in one of my modules. I've picked up the K&R C book to help me learn C over the summer. Since I want to know more than just Java, what else is worth learning? quote:Edit: I was reading reviews on the Knuth books and saw they code in them is in MIX? This would make them pretty out dated would it not?
|
# ? Apr 26, 2008 18:01 |
|
ultrafilter posted:the section on sorting data that's stored on a tape drive A general algorithm for sorting a dataset that will not fit in RAM might still have some applications. Never say never
|
# ? Apr 26, 2008 18:07 |
|
ultrafilter posted:Code Complete is important for everyone, but I think it's hard to appreciate until you've been out of school and working on a large project. After that, it's obviously a great book. Save the Knuth until after you've had a course in algorithms.
|
# ? Apr 26, 2008 18:36 |
|
HB posted:A general algorithm for sorting a dataset that will not fit in RAM might still have some applications. Never say never
|
# ? Apr 26, 2008 19:40 |
|
Dumb question: in a bash shell, how do I echo the bottom-most directory? That is to say,code:
Narpas fucked around with this message at 00:25 on Apr 27, 2008 |
# ? Apr 27, 2008 00:06 |
|
I'm taking a data structures class and we designed and implemented our own linked list. Now I'm trying to use the actual integrated LinkedList function in Java and I must be blind but I can't find the basic Next function that goes to the next item in the list in constant time. There is a get(int) function but that runs through the list in linear time to find it.
|
# ? Apr 28, 2008 05:29 |
|
Sounds like you want LinkedList.iterator().next();
|
# ? Apr 28, 2008 06:03 |
|
gotly posted:I'm taking a data structures class and we designed and implemented our own linked list. Now I'm trying to use the actual integrated LinkedList function in Java and I must be blind but I can't find the basic Next function that goes to the next item in the list in constant time. Explanation: Your question assumes a composite list (or a C style linked list): that is, each LinkedList object represents one node (say, with a first and rest, or with a data and a next). Java's LinkedList is the whole list in one object. So Java collections, and for that matter C++ STL collections, use "iterators" to represent the idea of sequence. You get the iterator, then whatever sequence-dependent things you want to do you do to the iterator. (Or you use foreach, but foreach doesn't solve all your problems.)
|
# ? Apr 28, 2008 10:05 |
|
That did it, thanks!
|
# ? Apr 28, 2008 17:45 |
|
I am trying to write a program for a class, and I need to reverse a string in C++. I don't understand why the code below gives me a C3070 compiler error; the left and right side of the = sign are both string objects being accessed at a single point. I've googled around for other ways of reversing a string, but most involve a recursive method I don't really understand, and doubt I am meant to for the 5th assignment of a introductory C++ class at a community college. code:
This is part of a visual C++ .net GUI program. quickedit: Just to make sure its clear, the error occurs on line 4 of that code.
|
# ? Apr 29, 2008 02:30 |
|
Should work. Are you sure inputString isn't declared "const"? (And this isn't in a const method?) Googling C3070 turns up a C# error - are you using std::string or some Microsoft string class?
|
# ? Apr 29, 2008 02:34 |
|
I am using Visual C++ windows forms application, which from what I've been told, is a .NET implemented in C++. Most code I've used from the MSDN for .NET C++ has worked fine, but http://msdn2.microsoft.com/en-us/library/system.string.copyto.aspx and http://msdn2.microsoft.com/en-us/library/czx8s9ts.aspx both don't compile. Since making my first post I tried using .ToString(); after each array call, but the output was the string in forward order. Here is my complete code for this method, as of now:code:
Gumbos fucked around with this message at 04:41 on Apr 29, 2008 |
# ? Apr 29, 2008 04:13 |
|
Gumbos posted:I am using Visual C++ windows forms application, which from what I've been told, is a .NET implemented in C++. Most code I've used from the MSDN for .NET C++ has worked fine, but http://msdn2.microsoft.com/en-us/library/system.string.copyto.aspx and http://msdn2.microsoft.com/en-us/library/czx8s9ts.aspx both don't compile. Since making my first post I tried using .ToString(); after each array call, but the output was the string in forward order. Here is my complete code for this method, as of now: Ah, you can't reverse a System.String in place because they are immutable e.g. read-only. Apparently, the fastest way to reverse a .net string is to convert it to an array, reverse that, and convert back but you will have to make a new object each time you convert. EDIT: Also, C++/CLI in an introductory C++ course is retarded. Half of what you are learning is not even C++. Happy Forum Man fucked around with this message at 07:47 on Apr 30, 2008 |
# ? Apr 30, 2008 07:39 |
|
WTF does the ^ character mean? Is it supposed to be a better *?
|
# ? Apr 30, 2008 07:54 |
|
MEAT TREAT posted:WTF does the ^ character mean? Is it supposed to be a better *?
|
# ? Apr 30, 2008 08:21 |
|
I'm personally not entirely sure either, all I know is that the console string with lower case S does not compile, the only way I can store strings is by using String ^. I actually managed to figure out a solution using += to just feed the letters into the label backwards, one letter at a time. However, that is only part of this assignment, and the last part has been stumping me for many hours now. I am supposed to write out the inputted string in reverse word order, meaning "This is a string" would be returned as "string a is This". So far I have tried using nested for loops to count backwards and find a word, which I have defined as being anything between 2 spaces. I then use a third loop to count up from the position of the lower positioned space to the higher one, each time feeding the letter from that position of the string into the label. Unfortunately, this is not what happens. Instead I get no output at all, despite the program compiling and running without any runtime errors. I'm not sure what is wrong with my logic. code:
Also, this class is technically a console based introductory C++, it's online at the community college I go to, and the teacher offers writing these GUIs as an advanced option. I am trying to do it since I have some experience in java and C++ already, at least at the introductory loops and arrays level. Also, Happy Forum Man, I have another version of the above code that dumps the string to a char array one letter at a time, but when I try to read anything straight out of the array it gives me the code number equivalent instead of the letter. Thanks again for the help. Gumbos fucked around with this message at 18:16 on Apr 30, 2008 |
# ? Apr 30, 2008 18:08 |
|
Im gonna be doing a small project for uni on steganography (which is the hiding of data into other data - in my case, its messages in images). Ive been looking to find some spec sheets about the byte-level format of some popular image file formats (jpeg, bmp, gif etc). Inform me goons, expand my brain!
|
# ? Apr 30, 2008 19:16 |
|
Gumbos posted:I'm personally not entirely sure either, all I know is that the console string with lower case S does not compile, the only way I can store strings is by using String ^. I actually managed to figure out a solution using += to just feed the letters into the label backwards, one letter at a time. However, that is only part of this assignment, and the last part has been stumping me for many hours now. To put the strings in reverse word order, why not just store all the words in an array of strings, then simply concatenate them in reverse order? I think that would be much easier, especially with one of the *hint* built-in string functions.
|
# ? Apr 30, 2008 19:17 |
|
shodanjr_gr posted:Im gonna be doing a small project for uni on steganography (which is the hiding of data into other data - in my case, its messages in images). http://www.wotsit.org/
|
# ? Apr 30, 2008 20:03 |
|
6174 posted:http://www.wotsit.org/ This was the exact site I was thinking of to answer his question, but goddamn if I could remember the address and Googling wasn't helping
|
# ? Apr 30, 2008 20:07 |
|
csammis posted:This was the exact site I was thinking of to answer his question, but goddamn if I could remember the address and Googling wasn't helping I couldn't remember it offhand either, but it was #2 for "file specifications" at Google.
|
# ? Apr 30, 2008 20:10 |
|
6174 posted:I couldn't remember it offhand either, but it was #2 for "file specifications" at Google. Yeah yeah, I was looking for "image file formats"
|
# ? Apr 30, 2008 20:15 |
|
I'm Currently working on a Caller ID app in C# for Asterisk, and I'm trying to go the OOP route so I can get a good understanding of OOP and to refresh my coding abilities. Anyway, My question is this: I have a class that will be like "iskClient" and will take care of the connect() disconnect() Authenticate() functions; IE this object will be the one that is directly connected to the asterisk server via a TCP connection. My plan was to also have a iskMonitor() function in this class that will just basically forward anything asterisk sends to this TCP connection onto another class that will take care of parsing it and separating it. (to events / action-response classes) The idea was that the iskMonitor() function would be run within a separate thread, and just run endlessly until the application is closed or the connection is closed. and anytime it gets data from asterisk, it forwards it to whatever object is going to parse it (iskParseEng probably will be the name of the class) I am just basically trying to keep all the TCP / asterisk connection isolated to one class. suggestions? is it "bad programming" to do something like this?
|
# ? May 2, 2008 09:25 |
If I have a class with 3 members: id, name, parentId, and I want to print out the hierarchy like: something -here --there --every --where -zing --ding ---wing -test --this How would I go about doing it? It seems like recursion would be appropriate here, but I have very little experience with recursion.
|
|
# ? May 2, 2008 21:18 |
|
fletcher posted:If I have a class with 3 members: id, name, parentId, and I want to print out the hierarchy like:
|
# ? May 2, 2008 21:29 |
Incoherence posted:You're not being clear on your problem. I am guessing that you have a map of IDs to these structures somewhere, and that id and parentId are keys into that map, thus forming some sort of N-tree of IDs. The thing I can't guess is whether you want to print the tree from children up (so, "here" would be the parent of "something") or from the parents down (so, "something" would be the parent of "here"). The latter is somewhat more complicated, since if you want to do that, what you really want is to know all children of a given parent, at which point you do a preorder tree traversal. Sorry, I want to print the tree from the parents down parent -child1 --subchild1 --subchild2 -child2
|
|
# ? May 2, 2008 23:32 |
|
fletcher posted:Sorry, I want to print the tree from the parents down
|
# ? May 2, 2008 23:58 |
|
This is kind of a programming related question: Is there any way to identify the function called in a compiled module? Example, given this output from Process Monitor, can I find out what the functions are?
|
# ? May 3, 2008 03:24 |
|
Factor Mystic posted:This is kind of a programming related question: Is there any way to identify the function called in a compiled module? Example, given this output from Process Monitor, can I find out what the functions are? http://www.hex-rays.com/idapro/idadown.htm Download either the free version 4.9 or the 5.2 trial. Load the DLL you want into IDA. Make sure to say "Yes" if IDA asks you to download debug information from the Microsoft server (not sure if 4.9 does that, at least the full version of 5.2 does that). In IDA hit "g" to enter the address of the function (like 0x77A99523). If you're at the start of a function now that's probably the function you're looking for (you can double-check using the method I describe in the next paragraph). If you're not at the start of a function it's probably that the DLL file was loaded to another address in memory than suggested in its header. In that case scroll all the way up in IDA until you see the first offset of the file (say 77A90000). Add +0x9523 manually to that address. Now you should be at the function you're looking for. If not, ask back and describe your problems.
|
# ? May 3, 2008 05:51 |
|
Factor Mystic posted:This is kind of a programming related question: Is there any way to identify the function called in a compiled module? Example, given this output from Process Monitor, can I find out what the functions are? Not generally, but for most of those, you can use the Microsoft symbol server to resolve those. http://support.microsoft.com/kb/311503 Process Monitor doesn't use the _NT_SYMBOL_PATH environment variable, though, so you'll have to configure it through Options->Configure Symbols. "Symbol paths:" is the same format as you would put in the _NT_SYMBOL_PATH variable. Also, for whatever reason the dbghelp.dll in Windows\System32 wasn't working for it, so I had to point it to the DbgHelp.dll from my Debugging Tools for Windows folder.
|
# ? May 3, 2008 06:00 |
|
Factor Mystic posted:This is kind of a programming related question: Is there any way to identify the function called in a compiled module? Example, given this output from Process Monitor, can I find out what the functions are? Do you want to know which functions an application is using in a DLL? dumpbin (which comes with Visual Studio) will dump imports for you. If you don't have VS installed, periscope can do the same thing.
|
# ? May 3, 2008 12:37 |
|
fletcher posted:Sorry, I want to print the tree from the parents down I'm not really sure what you're asking here, but I think you just want to do a depth first search and print each node the first time you reach it.
|
# ? May 3, 2008 13:54 |
|
So any of you who have had experience using Hugs98 or at least WinHugs, what would be a "C stack overflow"? It's different from the standard overflow, that's all I know.
|
# ? May 3, 2008 19:38 |
|
Clock Explosion posted:So any of you who have had experience using Hugs98 or at least WinHugs, what would be a "C stack overflow"? It's different from the standard overflow, that's all I know. Chances are you have a really big foldl somewhere that's exploding and causing a whole lot of unevaluated thunks to wind up being created all at once. Replace it with a foldr if you don't need left-associativity, or foldl' if you do. I can't really give you much more help without seeing some code, though.
|
# ? May 3, 2008 19:51 |
|
My mistake.code:
Let's just say I'm going through this half blind.
|
# ? May 3, 2008 20:19 |
|
Can you also post your World datatype, please? Edit: It would also be useful to know an initial World, and if you get the stack overflow on the first call to this function, or if it only happens after a lot of iterations.
|
# ? May 4, 2008 03:20 |
|
limip posted:Not generally, but for most of those, you can use the Microsoft symbol server to resolve those. This is fantastic. Thank you. Notes for posterity: apparently, the symbol path must be lower case. Also, the c:\windows\system32\dbghelp.dll doesn't support symbol service which is why the debugging tools one is needed.
|
# ? May 4, 2008 04:15 |
|
|
# ? May 15, 2024 03:06 |
|
I have an 2d array set up like this in C:code:
|
# ? May 4, 2008 23:01 |