|
fret logic posted:What are some good resources/books on programming theory?
|
# ¿ Feb 25, 2008 00:51 |
|
|
# ¿ May 6, 2024 14:34 |
|
6174 posted:If the program posted is actually TI-Basic you should be able to open the file in just a text editor to view the source without a cable. Granted you'd have to reimplement the program yourself if you want it on your calculator, but it would tell you how it is done. No, the Ti-83 is too cool to do real tokenization, so it's essentially a binary format.
|
# ¿ Feb 27, 2008 23:42 |
|
Is there a name for the algorithm to convert a sorted list to a balanced binary search tree (something more efficient than iterating over the list and inserting items into an AVL tree)? I think I can do it in O(n), but Knuth probably already created a better algorithm 30 years ago or something. I have a crappy illustration of what I mean (the left hand side of the diagram, I've already figured out what f(x) is)
|
# ¿ Apr 4, 2008 03:15 |
|
Sorry, let me try to explain better. I don't need to modify this tree after I've created it. By balanced binary search tree, I mean a balanced left-heavy tree, that is, the number of nodes to the right is <= the number of nodes to the left. Basically, I want to flatten this binary tree in an array, where I know the position of the children nodes based only on the index of the parent node. In my example, I'm transforming {1,2,3,4,5,6} to {4,2,6,1,3,5}. The question is if this process has a name I can use to refer to it easily?
|
# ¿ Apr 4, 2008 04:17 |
|
ShoulderDaemon posted:If you don't want to construct the pointers, then obviously you can just iterate the index discovery expression used here. Never mind, I was just wondering if there was a name for it.
|
# ¿ Apr 4, 2008 05:15 |
|
two_beer_bishes posted:I want to put together a site that will allow me to track fuel economy and maintenance for my car. I would like it to have separate pages for fuel and maintenance and also a couple other car-related costs I want to track, but I want to keep the databases separate from each other (hopefully that makes it less complicated). I want the page to show the data in a spreadsheet type format and at the top of the page it'll have an entry form for the date/#of gal/$per gal/etc... Would PHP work best for something like this? Also, at some point I would like to be able to update this from my cellphone. If the site is lightweight enough I could just pull it up using the built in browser, so I don't think I'd need any extra coding. Have you looked at Google AppEngine? (Python/Django) Scaevolus fucked around with this message at 20:43 on Apr 12, 2008 |
# ¿ Apr 12, 2008 20:41 |
|
magicalblender posted:Whoops vv What you should be doing is while (fgets(foo,100,0) != NULL) {
|
# ¿ Apr 18, 2008 23:55 |
|
Vanadium posted:At least he does not instantly get a segfault from passing null pointers as streams. vv Yeah, I know. Difference between int fd and FILE *stream and all that. Scaevolus fucked around with this message at 02:40 on Apr 19, 2008 |
# ¿ Apr 19, 2008 00:52 |
|
Moof Strydar posted:Python example of mapping: code:
|
# ¿ May 28, 2008 06:12 |
|
tripwire posted:I've been trying to change a genetic algorithm which is normally done in serial to run in parallel. Python isn't really designed for fast number crunching.
|
# ¿ Jun 10, 2008 21:52 |
|
more falafel please posted:Yeah, that's it... they didn't post the tool though. Nevermind. I'd like to do that same thing with some work code. Looks like that was done by hand, not by a tool.
|
# ¿ Jun 13, 2008 01:05 |
|
Jo posted:Regex Request: grep -oP '(?<=distance=")[0-9]*\.[0-9]*' works.
|
# ¿ Jun 30, 2008 09:19 |
|
How is rxtv-unicode on OS X?
|
# ¿ Jul 10, 2008 06:17 |
|
Geno posted:this is probably a stupid question but what do you guys think are better for programming: macs or PCs? Macs, because OS X is Unix-derived, which is a much better programming environment than Windows.
|
# ¿ Jul 14, 2008 06:32 |
|
tef posted:Beyond that I think the answers are in the realms of personal preference. Silly tef, an open ended question is clearly a plea for personal opinions and anecdotal evidence.
|
# ¿ Jul 14, 2008 08:47 |
|
rugbert posted:I need something for webpages that lets you drag and drop supplied images onto an image with a predefined perimeter. Specifically, I wanna make something like
|
# ¿ Jul 20, 2008 06:49 |
|
Ugg boots posted:Why are you using a macro when you can just use the pusha and popa instructions? I knew there was an opcode for this! What use is CISC without register pushing?
|
# ¿ Jul 23, 2008 05:56 |
|
GT_Onizuka posted:There doesn't seem to be a general Ruby thread, so I figured I'd ask my question here.
|
# ¿ Jul 24, 2008 19:38 |
|
Jam2 posted:How good do ones math skills need to be to excel at programming? There's a strong correlation between being good at programming and being good at math, as they require similar types of thinking. However, you don't need to know the most obscure branches of mathematics to be a good programming. A solid grasp of Algebra is usually sufficient.
|
# ¿ Jul 28, 2008 22:28 |
|
Runaway Five posted:So, int a = 7; int b = 3; int c = 43; int d = 213; code:
Unless I missed something?
|
# ¿ Aug 23, 2008 22:16 |
|
bitprophet posted:For what it's worth, some languages let you do this on the fly, although I don't remember the technical term for it (I believe there was one).
|
# ¿ Aug 24, 2008 01:25 |
|
bitprophet posted:Sounds about right; also fits with how higher level languages usually do things that are syntactically simpler than their lower level counterparts, but not necessarily any faster or more efficiently. code:
Unless you're swapping megabytes of memory many times per second, swapping probably isn't anywhere close to a bottleneck.
|
# ¿ Aug 24, 2008 03:07 |
|
Milde posted:The objects aren't being "swapped", you're just changing what objects the names a, b, c, and d refer to. If you use a temporary variable for whatever reason, you're just creating an extra reference, not a copy of the object. (assigning references should about as expensive as assigning ints anyways)
|
# ¿ Aug 24, 2008 04:32 |
|
N.Z.'s Champion posted:This is probably a stupid question but lets say that I've got variables A and B... is there a way to swap their values without using a third variable (Eg, C = A, A = B, B = C) and without meddling with pointers? Do you guys go to the same school?
|
# ¿ Aug 25, 2008 23:15 |
|
Using a few extra bytes for a temporary variable is almost certainly going to be both clearer and faster than a "clever" xor trick.
|
# ¿ Aug 26, 2008 00:35 |
|
tef posted:He retaliated by making me explain it to the rest of the group.
|
# ¿ Aug 26, 2008 16:34 |
|
edit: so apparently it completely optimized out the variables it was swapping, because they never did anything
Scaevolus fucked around with this message at 22:18 on Aug 26, 2008 |
# ¿ Aug 26, 2008 21:54 |
|
more falafel please posted:edit: partially beaten, mine has the unoptimized assembly edit: gently caress Scaevolus fucked around with this message at 22:18 on Aug 26, 2008 |
# ¿ Aug 26, 2008 22:14 |
|
Arconom posted:Anyone here done any procedurally generated maps and the like? I want to write some code to procedurally generate a world from the depths of the ocean upward, and I'm looking for a mysterious code ninja to point me in the right direction. I have never done any procedurally generated coding.
|
# ¿ Aug 27, 2008 18:15 |
|
Jo posted:I believe the xor trick is vestigial. Moves use to cost a lot more CPU than exclusive or in the early Pentium/AMD days, so it was very neat at the time. xor eax, eax is still faster than mov eax, 0
|
# ¿ Aug 30, 2008 04:39 |
|
Jo posted:Correct me if I'm mistaken: #define or set_name or whatever for a compiled language makes its way into the executable code while constant final static makes its way into a register. Is there really any performance difference in the grand scheme of things?
|
# ¿ Sep 1, 2008 14:11 |
|
Jo posted:
AT&T syntax is gross
|
# ¿ Sep 2, 2008 03:26 |
|
Chuu posted:This code does not work for because of double's native representation that doesn't correspond well to Decimal, which are easier to gut check then explain (3.43 -> 3.43000000000001 -> 3430000000000001 * 10 -> +inf). I would do something like sprintf(buff, "%.8f", float) and parse the resulting string instead of manually converting a float.
|
# ¿ Oct 31, 2008 23:08 |
|
quadreb posted:So I received the following window on my screen: quote:Also, any idea why it would be referencing a "U" drive that is invisible to windows explorer both before, during, and after running the game?
|
# ¿ Dec 12, 2008 13:04 |
|
Mata posted:Alright, bear with me on this one.. I'm trying to generate an infinitely large height-map. I want it to resemble a landscape/map of some sort, so I don't want there to be any obviously recognizable patterns, but it can't be "too" random: Hills and mountains have slopes, not random jagged spikes, same with continents and oceans... So I figured, overlapping sine functions with random periods might look good: A huge sine curve would form continents, smaller ones would be mountain ranges, smaller still might make hills, etc: Plus, it "loops" so it doesn't matter wether you're looking at a region at (100000,70000) or at (0,0). Perlin noise sounds perfect for what you want to do. It's basically your like your idea of layering multiple sine functions. Here's a good tutorial on it. It's quite efficient as well. You can tweak the parameters to get various effects: (from here) e: simplex noise (also invented by Perlin) might be better quote:The advantages of simplex noise over Perlin noise: Perlin/simplex noise is much easier to generate in realtime than fractal noise. Scaevolus fucked around with this message at 07:51 on Jan 7, 2009 |
# ¿ Jan 7, 2009 07:21 |
|
csammis posted:I don't know about \b, but \r was used as the full newline character on pre-OS X Macs, so it wouldn't have the effect of moving the cursor back to the start of the current line.
|
# ¿ Jan 10, 2009 22:13 |
|
hexadecimal posted:I got one, dawg, its posted on my wall.
|
# ¿ Jan 11, 2009 22:03 |
|
Dijkstracula posted:One of the good things about Java is that it does force you to code in a certain way; with C++, your methology can range from "procedural programming with iostreams" to "C with classes" to "Java-style OOP where most everything is a class" to "template metaprogramming and C++0x draft standard wankery" and everything in between. For learning, maybe, but this guy is asking about Java because he sees lots of jobs for Java programmers.
|
# ¿ Jan 15, 2009 02:39 |
|
shodanjr_gr posted:Any suggestions on a good and extensive book about data structures? I'm finishing my bachelor in CS and looking to get a good revision (and expansion) on the field before I move on to graduate studies, and the textbook we got for our undergrad course was a bit crappy. Ideas? CLRS is a good choice. Of course, you can't discuss data structures without covering algorithms as well. Scaevolus fucked around with this message at 02:31 on Feb 4, 2009 |
# ¿ Feb 4, 2009 02:29 |
|
|
# ¿ May 6, 2024 14:34 |
|
Pweller posted:I have a small app that runs in a command prompt. I want to automate the running of this executable using a batch file, but the program prompts for user input twice. Is there any way I can pass the values for the two prompts from the batch file to the executable it calls? Two inputs are always the same. backup.txt: code:
code:
|
# ¿ Mar 12, 2009 04:35 |