|
Goodness the old one had been going a long time A Paradigm Shift: This thread is now for generic questions about coding, and language-neutral short programming questions (or languages for which there isn't already a megathread). If you've got a question about a specific language, and there's a megathread for it, better to post it there where the language-specific THE MEGATHREADS Apple App Development: iOS (iPhones and iPads), Mac OS X, Xcode, Cocoa C/C++ Programming Questions Not Worth Their Own Thread Cavern Reading List - Recommend and Request reading material Flash Questions Megathread Java questions which don't deserve their own thread, yet. Game Development Megathread Want to Learn Haskell? .Net (C#, VB.NET [VB 2003, 2005, and 2008]) Questions Megathread The Perl Short Questions Megathread: executable line noise <?PHP questions that don\\'t need their own thread ?> Python information and short questions megathread. Ruby on Rails Love-In Scientific/Math(s) Computing: numerical/statistical analysis tools and CASs - R, Matlab, etc. SELECT * FROM Questions WHERE Type = 'Stupid' Version Control Questions Megathread (SVN / git / whatever else) Web Design/Development Small Questions - Rev Holy Grail Small Excel Question Not Worth Its Own Thread If I missed one, or a new one appears, PM me to get it listed here HOT GOON ACTION Now you too can chat with real life nerds, 24/7 because we don't have lives or sleep! Join the CoCs at #cobol on irc.synirc.net, we are happy to answer your questions while mocking you and randomly replacing words with "butt." Don't like talking to or looking directly at nerds but want to gain their power, just like Highlander?! Check out http://sn.printf.net/, the CoC goon blog aggregator. Read more about it here, right here csammis fucked around with this message at 15:01 on Aug 16, 2016 |
# ¿ Feb 22, 2008 16:13 |
|
|
# ¿ Apr 29, 2024 01:50 |
|
Let's get this party started:Jose Cuervo posted:poopiehead, do you know of a good way to search for a particular key in a dictionary without actually knowing the key, but only a unique characteristic? I know that the key I am looking for is the one the has the longest string length (and there is a key with a longest string length in my dictionary). Right now I am useing the following loop to get the key: Note, this is a good example of a question that belongs in this thread because it's language-agnostic Iterating through the keys to find what you're looking for is the only way to do it at any given time, unless you want to use a "compiler solution" and throw another list at it that consists the keys sorted by the property you want, which you would add to whenever you insert a new key into the dictionary. I can't really imagine that there's a good reason to do this. But along those lines: Wherever you're adding an entry to the dictionary, how about you just add a check to see if the key that's being added satisfies the property you want, and save it?
|
# ¿ Feb 22, 2008 16:23 |
|
Professor Science posted:Oh that series that people have on their bookshelf so they can be like, "Oh, yes, I've read the Art of Computer Programming, yessssss, I am smoking a pipe now?" Has this man read TAOCP?
|
# ¿ Feb 24, 2008 16:37 |
|
Mister Biff posted:Edit: Er, this may be more appropriate for the C/C++ thread... if so, just tell me. Yes, either that or the .NET thread (as you're working with Visual Studio), but try the C/C++ thread first.
|
# ¿ Feb 27, 2008 00:56 |
|
Kaiju posted:I have a client at work that has two mirror sites translated into German and Spanish. All three sites are hosted on the same server. The translated sites are relatively new and since they launched, they've started having submissions to their contact forms that include non-english characters. When the form outputs the submission emails anything not english, say, letters with accents, umlauts or tilde (for spanish characters) they are replaced in the email body with strange approximations and not the correct characters. "Text encoding" is the keyword you'll be looking for, as that's the problem. The users are sending characters to the web server in a character set that your email can't contain, probably because your email is sending as ASCII. You'll have to send the emails using the correct text encoding, whatever that might be. I think it'll be whatever encoding the form's page is being sent in, but I'm not sure. The web development thread folks might know right off the bat.
|
# ¿ Feb 28, 2008 05:23 |
|
Dog Named Duke posted:A C# question For the future: .Net (C#, VB.NET) Questions Megathread
|
# ¿ Feb 29, 2008 14:59 |
|
Appa Time! posted:
An empty list isn't null in Java, it's just empty. size() == 0.
|
# ¿ Mar 2, 2008 03:32 |
|
dougdrums posted:So I was (not now, earlier) and programming and thinking about the finally statement. Is there any god drat reason for the finally statement? The only situation I see using finally in is if I didn't want to put a catch statement after a try which is a horrible practice anyways. And even if I did want to do that, couldn't I just use catch { } instead? This construct exists in Java too (does C++ have it?), and any introductory text on either language will tell you exactly what finally is for. It's not a replacement for a catch. http://neptune.netcomp.monash.edu.au/JavaHelp/howto/try_catch_finally.htm#whyFinally
|
# ¿ Mar 2, 2008 06:32 |
|
Milde posted:Newer versions of Python have a nicer syntax for that: For posterity, C# has this too in the using keyword: code:
|
# ¿ Mar 2, 2008 19:10 |
|
tef posted:Aside: I'm tempted to write a FAQ but really the only frequent question is "WHat Language should I learn?" And the answer is "don't bother asking because you won't listen anyway"
|
# ¿ Mar 4, 2008 15:50 |
|
karuna posted:Just did a quick search there and it seems control arrays are no longer supported, I'm using visual basic 2008 express edition.. VB 2008 is .NET, please refer to the .NET Questions Megathread. You may be able to use reflection to access the labels.
|
# ¿ Mar 4, 2008 20:16 |
|
Careful Drums posted:In Assembly, I need to print out the string What kind of assembly? What architecture? Are you using a library, or pure assembly code?
|
# ¿ Mar 6, 2008 03:45 |
|
Adding a link to the Cavern Reading List in the OP
|
# ¿ Mar 11, 2008 20:59 |
|
MEAT TREAT posted:What about something like Dominoes and we each have to create a client that has to beat the rest. Wrong thread
|
# ¿ Mar 12, 2008 15:33 |
|
astr0man posted:I've been looking into writing a vista sidebar IM client using libpurple (gaim/pidgin/finch libraries) but I wasn't sure if it would even be possible. The IM interface would be in C++. I know you can execute C++ code with a DHTML interface, but I don't have enough experience with DHTML to know if something of this magnitude would be possible. So any suggestions as far as the best way to go about doing this or a pointer to some good reference material would be appreciated. Or just shoot the idea down if it's not feasible. libpurple is probably ridiculously heavyweight for a sidebar IM application...it's basically an entire backend framework that implementors provide a frontend to (see: Adium). This is something of a design flaw with libpurple in my opinion, because using it isn't as simple as calling a function with a message and the screen name you want to send to. That said, I really have no idea how you could go about interfacing with libpurple from DHTML in the first place. If you're not set on C++, and you can use something like Script#, you could leverage .NET solutions for instant messaging libraries (such as OscarLib, MsnLib, and JabberLib ). Disclaimer: I have never tried to make a sidebar application, or used Script#, but I do know a lot about IM applications in general. If you'd like any information on that end please feel free to ask.
|
# ¿ Mar 17, 2008 19:46 |
|
Blacknose posted:When using Eclipse to code java I know there is a way to make it automaticaly insert stubs for javadoc comments, but I can't for the life of me find out how. Anyone know if it's an add-on or pre-installed, and how to use it? Can't find anything useful on google. When you're using the wizard to create a new object, there's a checkbox for "Generate Javadoc comments" or something like that. I didn't add any plugins to get that behavior. Also, you can put your cursor on the member in question and hit Shift-Alt-J to get Javadoc automatically inserted in the same manner Rheingold mentioned. And finally, you're looking for the Java megathread
|
# ¿ Mar 22, 2008 17:37 |
|
Presa Canario posted:It doesn't look like you're ever popping from leaves, is that correct? edit: It's been a while since I've done this, but wouldn't a stack-based DFS look more like this? A single stack, no leaves. code:
GT_Onizuka posted:It would probably be better to store the depth of nodes, along with the nodes themselves, so you don't have to handle any incrementing. This too, I think the depth calculation is where you're getting messed up. csammis fucked around with this message at 18:34 on Mar 28, 2008 |
# ¿ Mar 28, 2008 18:20 |
|
I mean seriously it's not like we have Perl or Python or Ruby threads so people can decide for themselves what they should use
|
# ¿ Apr 3, 2008 16:15 |
|
NotAok posted:I've been able to successfully load these by just using the assembly class, but I used the easier LoadFile method. This method may be what's tripping me up here. Yup. Read up on Fusion to understand the semantics of how and where the Framework will look for an assembly to load using the Load() methods vs. LoadFile(). Also, make sure that the DLL's you're loading are valid .NET Assemblies, because I seriously doubt twain_32.dll is .NET edit: Also, the .NET Megathread is where this question belongs
|
# ¿ Apr 9, 2008 18:21 |
|
The Web Development Megathread has some words about web development too. Maybe too many words?
|
# ¿ Apr 14, 2008 19:47 |
|
Check the book request / recommendation thread, or you can ask in the .NET Megathread for specific topics.
|
# ¿ Apr 16, 2008 03:01 |
|
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 |
|
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 |
|
darfur posted:I've searched the web for this, but can't really find a good answer. Hiding methods that consumers don't need to know about, for one. Here's a quick example of a really good reason to use an interface: code:
code:
Another good reason is being able to change implementations under the hood without the consumer having to be aware of it. Let's say you have a connection class. Could be a connection to a database, could be a connection to a network socket, could be a connection to some dank nugz from the kid your parents warn you away from all the time, but all your consumer cares about is that it's a connection to some resource. If you give them a DatabaseConnection, they have to write new code when you decide that databases are stupid and you'd rather have them use a NetworkConnection. If these connections implement a common interface, however, the consumer won't have to change anything in order to get your data from a new source. edit: continued, more formally and less contrived: Interfaces are contracts: they guarantee that a class has methods X, Y, and Z. It doesn't specify how that contract will be fulfilled, that's the job of the class that implements the interface. Interfaces allow a programmer to separate the design (the interface) from the implementation (the class). csammis fucked around with this message at 20:21 on May 7, 2008 |
# ¿ May 7, 2008 20:17 |
|
Incoherence posted:Another example: event handlers. All event handlers for a given event implement the same interface, but they may (and hopefully do) have different behavior, and you may have multiple different event handlers for a particular event. Huh? Event handlers (callbacks, whatever you call them in your language) are methods, not interfaces. The fact that you can have multiple event handlers for a single event has zilch to do with interfaces, it has to do with how events are implemented in your architecture.
|
# ¿ May 7, 2008 20:23 |
|
MEAT TREAT posted:e: csammis where those methods come from? You have to inherit them from some place and in languages that don't allow multiple inheritance you have to use interfaces so that you can have multiple even handlers for one object. I think Incoherence said it wrong, I'm sure he meant that one object can have multiple even't handlers like keyboard and mouse, not that many objects can share the keyboard event handler. Because in that case you are correct, interfaces have nothing to do with it. I know what Incoherence meant about one event having multiple handlers, but I'm not sure where you're coming from. Inheriting a method? Where are you inheriting the method from when you use a delegate in C#? How about registering a method callback in C++? Event handling is a concept that has absolutely nothing to do with interfaces. Interfaces only come into it as an implementation detail of Java's Listener pattern.
|
# ¿ May 7, 2008 21:31 |
|
Tomed2000 posted:I don't know if this thread is the best place to ask this but: Because every part of this industry uses the exact same tool for everything edit: Seriously what kind of question is that? In my last job, one tiny part of "the industry," we used three commercial IDEs and one proprietary, and then some people used other stuff if they wanted to / were allowed to. csammis fucked around with this message at 19:20 on May 30, 2008 |
# ¿ May 30, 2008 19:18 |
|
Zombywuf posted:Also, how do I stop smilies appearing in code blocks? Check the "Disable smilies" box in your post
|
# ¿ Jun 25, 2008 19:01 |
|
Kino posted:I've googled around a bit, but the only thing I can find is someone asking the question on experts-exchange where the usual google cache trick won't work. Does the "scroll down past the interstitial ads until you see the answer" method work on that page?
|
# ¿ Jul 1, 2008 18:18 |
|
Counter Punch posted:Any ideas? [on slowing down copy and paste speed] Sorry, but it's not possible. Clipboard data is read by the application in one large chunk, and it's up to the application to process it however it's going to do it.
|
# ¿ Jul 10, 2008 19:15 |
|
Avenging Dentist posted:Actually, it depends on the storage medium used by the clipboard data. For something like Excel data, it's probably stored in global memory, so you'd be out of luck there, but it's totally possible to pass an IStream interface as the storage medium, and you could put in arbitrary delays when reading from the stream. Yeah, sorry, I should've been more specific. There's no external way to slow down your basic inter-application clipboard reading or writing, like a registry setting or whatever. If you want to go completely nuts, you could do what AD suggested, but it's probably easier just to copy+paste smaller chunks.
|
# ¿ Jul 10, 2008 19:49 |
|
JoeNotCharles posted:I'm not familiar with NetTerm, but it might be easy to write a small app in Python or something which just watches for anything copied to the clipboard, reads it all, and then writes it back to the clipboard in smaller chunks with a pause between each chunk. I'd use PyQt for this because the Qt clipboard API's pretty easy to use, but that's because I'm already familiar with it and I have it set up - the Windows clipboard API is easy to use to so a small VB script might be just as good. You'd have to invoke Paste events on the NetTerm session as well.
|
# ¿ Jul 10, 2008 20:44 |
|
Daedalus256 posted:I'm completely loving new at this so bare with me. No. fake edit: probably, but we're not psychic. We'd need the code that is responsible for running the EXE at the very least.
|
# ¿ Jul 11, 2008 21:00 |
|
You assholes better not derail this thread, we've got like three dedicated to that already ~>
|
# ¿ Jul 14, 2008 14:06 |
|
Mr. Jive posted:So how can I build a practical skill set? I'm just assuming that most of you have been through a similar phase, how did you bridge the gap between theory and practice? I contributed to and managed open source projects. If you use any open source projects, try to find a feature that's irritating you and might be improved, or a new one that you'd like to see, and implement it. Most (many? some? only me?) OSS project managers would be happy to help you as long as you try to figure things out on your own. If you don't know of any projects you'd like to work on, look around on Sourceforge or ask CoC for their favorites.
|
# ¿ Jul 21, 2008 19:04 |
|
fletcher posted:Kinda off topic, but why is the message board software they use on sourceforge so horrible? Oh, who knows. I'm fairly sure it's all home-rolled and it's sucked as far back as I can remember, even after their revamp a couple years ago. My projects lasted about three weeks with Sourceforge before I got completely fed up with it and moved on to another project host.
|
# ¿ Jul 21, 2008 20:03 |
|
For an API reference, probably your best bet would be to google for "msdn [name of your function or class]" - but a straight up list of what classic ASP has available, that I don't know.
|
# ¿ Aug 5, 2008 21:08 |
|
mnd posted:What's the closest thing to Core Animation on Windows? In a quick look, it seems to be WPF, and some WPF-related links I've followed seem to indicate that WPF supports an implicit animation model like Core Animation (set start, end, and interval, and it figures out interpolation for you). It's probably less elegant than Core Animation, but is it functionally accurate? Yeah, Windows Presentation Foundation is as close to Core Animation as it gets for the Windows platform. I've never used Core Animation so I can't speak to elegance in comparison, but WPF is pretty slick, and there's a thread about it if you have any questions while you're learning. Keep in mind WPF is only supported on Windows XP SP2 and up.
|
# ¿ Aug 19, 2008 15:11 |
|
mnd posted:More simple .NET-related questions: We have a megathread for .NET, please use it
|
# ¿ Aug 27, 2008 02:02 |
|
|
# ¿ Apr 29, 2024 01:50 |
|
Evolutionary algorithms come up with extremely efficient solutions that often look batshit and inelegant compared to human designs. Take rotor's recently posted radio antenna, designed using an evolutionary algorithm. edit: The thread in which rotor posted this csammis fucked around with this message at 22:19 on Sep 3, 2008 |
# ¿ Sep 3, 2008 22:14 |