|
fret logic posted:I'm just a CS freshman with little to no background in anything beyond basic Java/C syntax. Was just wanting to get some basic theory in my head while I'm learning these languages. If you want some "deep" theory, check out Knuth's "Art of Computer Programming" series (be warned, they are very, very math-heavy).
|
# ¿ Feb 24, 2008 09:41 |
|
|
# ¿ Apr 28, 2024 21:45 |
|
fletcher posted:Is it more common to write variables as someVariable or some_variable? I can't decide which to use. I like using someMethod() instead of some_method(), so I'm thinking it would make more sense to use some_variable. Generally, I think it's best to pick one style and use it for both variables and methods. It just makes things more consistent.
|
# ¿ Feb 27, 2008 01:17 |
|
csammis posted: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. C++ doesn't have "finally" because you should be using RAII instead.
|
# ¿ Mar 2, 2008 06:57 |
|
You need to surround the regex with slashes, like you would in Perl. Also why in god's name do you have a regex like that? I think when you have to worry about table breaking with a regex, you might want to look into writing a grammar to do whatever it is you're doing (possibly hard in Javascript unless there's a library for it). The benefit of a grammar is that it isn't write-only code.
|
# ¿ Mar 4, 2008 09:07 |
|
nbv4 posted:gah, I have a habit of calling either back slashes or front slashes "backslashes". I tried adding front slashes and it gave me the "unterminated regular expression literal" error. Backslashes gave me a syntax error. It works fine for me. You're doing the following right? code:
Avenging Dentist fucked around with this message at 20:59 on Mar 4, 2008 |
# ¿ Mar 4, 2008 20:35 |
|
Get rid of the newlines in the regex (obviously don't do this in the post ).
|
# ¿ Mar 4, 2008 20:56 |
|
Unless you want to use C++, the only way I can think of would be to use preprocessor macros. Something likecode:
|
# ¿ Mar 8, 2008 05:50 |
|
What's the easiest way to go about making a toolbar button for the Windows Explorer? Creating a new toolbar is also an option, but probably overkill since I only want to add a single button.
|
# ¿ Mar 11, 2008 22:34 |
|
FigBug posted:I don't think you can add a single button, you'll need to make a toolbar with only one button. Turns out that's a wrapper to an MFC object, but at least now I know what the MFC object is (and can do this in C++)!
|
# ¿ Mar 12, 2008 03:12 |
|
You should probably have something to delimit the fields of the struct. You're munging all the numbers together.
|
# ¿ Mar 13, 2008 06:53 |
|
Well, let's say you have a struct with two doubles: x and y. Using your method, here's what happens:code:
code:
|
# ¿ Mar 13, 2008 07:27 |
|
Generally speaking, exceptions should be for "exceptional" things. I'd say bad user input isn't all that exceptional, and it's probably better to validate explicitly. It really depends on your own preferences though.
|
# ¿ Mar 27, 2008 18:36 |
|
I don't know sed, but in Perl, the following should work:code:
|
# ¿ Mar 31, 2008 18:01 |
|
This should probably help you play around with styles to get something you like: http://www.somacon.com/p141.php
|
# ¿ Apr 7, 2008 06:02 |
|
Does anyone in the world actually do web development exclusively in UNIX? Also, have you seen http://www.code101.com/Code101/DisplayArticle.aspx?cid=67 ?
|
# ¿ Apr 14, 2008 19:43 |
|
nbv4 posted:I do all my programing in Ubuntu. Every few days I'll load my stuff onto my laptop which runs XP too see how it looks, which is kind of a pain. I pasted the wrong link originally. I edited my post above to the right one. I'm still confused as to why you think there should be a way to debug Javascript in Internet Explorer in Linux of all things, though... Why not just run a Windows VM?
|
# ¿ Apr 14, 2008 20:03 |
|
Sartak posted:Of course. Firebug is godly. That's fine if you're developing for a single browser.
|
# ¿ Apr 14, 2008 20:04 |
|
Zombywuf posted:ORLY That doesn't resolve the "IE Javascript debugging in Linux" issue, which is kinda the point. At the very least, you should be doing a pass of your site within Windows, and if there are problems, sometimes you have to suck it up and use Windows to have access to decent development tools for IE (unless you can get them working in WINE).
|
# ¿ Apr 14, 2008 20:12 |
|
When you pipe commands, the piped data comes in via STDIN.
|
# ¿ Apr 16, 2008 18:55 |
|
There is none. It's just an alternative syntax.
|
# ¿ Apr 26, 2008 07:26 |
|
This? http://thedailywtf.com/Articles/Coding-Like-the-Tour-de-France.aspx
|
# ¿ Jun 13, 2008 00:53 |
|
Scaevolus posted:Looks like that was done by hand, not by a tool. That still means it was done by a tool though.
|
# ¿ Jun 13, 2008 01:22 |
|
Jam2 posted:What is the best web scripting language/framework to have my website developed using? php, .net, cf, ruby? You can make a good website in any language, though PHP practically encourages insecure code, and ColdFusion has fallen out of style. Other languages to consider would be Perl and Python. Jam2 posted:What will be the easiest for a new programmer to interpret and add functionality to? Probably PHP, but chances are that the code will have security vulnerabilities. Most programmers should be able to adapt to any OO language, and if they can't, chances are the stuff they'd have written would have been trash anyway.
|
# ¿ Jun 23, 2008 06:21 |
|
That's because you're not able to do it in C#.
|
# ¿ Jul 9, 2008 18:44 |
|
csammis posted: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. 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. This would be a pretty complicated task and would require the terminal to support reading from an IStream interface, though.
|
# ¿ Jul 10, 2008 19:32 |
|
Waltzing Along posted:They favor the wiki because it is free. Management is learning of its limitations but likes the price. Well, you get what you pay for...
|
# ¿ Jul 17, 2008 02:10 |
|
Mr. Jive posted:The other day I scanned through rentacoder to see if I could apply my skills and earn some money, and realized how ridiculously small and inadequate my actual skill set is. I'm looking at an internship, but I'm hesitant to schedule an interview as I'm nervous about my ability to perform the job well. The list goes on. Rentacoder is the shittiest poo poo that was ever shat from a butt. Just make Tetris or something. It's better to try and fail than to sit around worrying whether you'll be able to finish a project. Honestly, I've learned the most from my aborted projects.
|
# ¿ Jul 21, 2008 18:52 |
|
Does SetCursor work?
|
# ¿ Aug 6, 2008 02:35 |
|
Magicmat posted:I'm pretty sure Greasemonkey stuff runs once the DOM is loaded (or later). Also, I've never been able to figure out how to use Greasemonkey to look at/modify regular Javascript.
|
# ¿ Aug 7, 2008 06:55 |
|
Also those aren't even arrays, they're objects.
|
# ¿ Aug 16, 2008 00:52 |
|
I don't think you quite understand how arrays work. If you have a 2-dimensional array in Javascript, printing my2DArray[0] is going to give you something like "(Object Array)". You're making this way harder on yourself than you need to, though. Here's how I'd do it (not tested):code:
Given the input I supplied, you'd get the following: code:
|
# ¿ Aug 17, 2008 20:03 |
|
N.Z.'s Champion posted:Nope, serious, and I'm sure it's a stupid question (I'm pretty tired). Is there a way of doing it in a single expression? Dude, someone showed how to do it like 5 posts up.
|
# ¿ Aug 25, 2008 23:12 |
|
Jsquared posted:
You're allowed to do all that in one statement. E.g. cout << foo << bar << baz << quux << endl;
|
# ¿ Sep 4, 2008 04:35 |
|
Plastic Jesus posted:You can't re-use a pointer passed to realloc (that's why it returns a pointer) and your call to sprintf() could still overflow buff. This is a troll, right?
|
# ¿ Sep 6, 2008 17:29 |
|
A student posted:Is python generally self-taught? In that universities don't usually teach it, yes. Most everyone in CoC was probably self-taught at one point or another anyway. A university degree is really helpful to being the best programmer you can be, but it's by no means necessary. To put things in perspective, a few of my friends are physicists, and when they need to learn a new language, someone just throws a reference manual at them and they figure it out.
|
# ¿ Sep 15, 2008 07:24 |
|
It's more math than computer science, but you might want to check out "Mathematical Models" by Richard Haberman. It's got a huge section on population dynamics, and it does a pretty good job of showing how you'd solve the differential equations using numerical (e.g. computer) methods.
|
# ¿ Sep 15, 2008 07:36 |
|
Also if your problem is that the Fortran program is clunky, using C++ to call out to it isn't exactly going to resolve that.
|
# ¿ Sep 21, 2008 05:14 |
|
I don't even know where to start. You're putting HTML in CSS files, using C-style comments in HTML, you're trying to import the CSS twice, and I'm not even sure what you're trying to do with the font styles. I have a theory, and that theory is that the book you got isn't worth the paper it's printed on. Just use http://www.w3schools.com/ and save yourself the headache.
|
# ¿ Sep 21, 2008 21:36 |
|
rjmccall posted:Generally, no. In a compiled language, local variables are mostly an abstraction for expressing how data flows through a function, and using "extra" variables will often make absolutely no difference in the final code. Sure it will. In most languages, local variables get pushed onto the call stack, so you'll be dealing with a (very) small but measurable cost to memory. Chances are you're not going to be losing much (if anything) in the way of speed, though.
|
# ¿ Sep 22, 2008 03:11 |
|
|
# ¿ Apr 28, 2024 21:45 |
|
I was referring to the more general case of non-POD types with (not quite) equivalent code (C++):code:
|
# ¿ Sep 22, 2008 07:35 |