• What are you working on? v16
    5,004 replies, posted
a++ means 'increment a and return the value that it was before' b = a++ is equal to b = a; a+=1; ++a just increments a.
Sorry guys, that's not what I've asked.
[QUOTE=Darwin226;29023475]If I for example did a=5 it would store 5 somewhere in the memory and make "a" reference it. Then if I set "b" to reference the same 5 and did a++, should it increment "b" too, or should it store 6 in memory, make "a" reference that 6 and leave "b" as it is?[/QUOTE]In a lot of languages I believe numbers are immutable, interpreted ones I mean. Which means b would still reference 5 and a a new 6.
[QUOTE=Darwin226;29024133]Sorry guys, that's not what I've asked.[/QUOTE] The answer is: it depends. Most languages(that I know of) handle primitive datatypes like ints and shit like so a= 5 b= a a++ which leaves b equaling 5 and a equaling 6. However, when you are dealing with "objects", there are different implementations, should you copy the object and make a new memory location, or just have both variables reference the same thing? Then there's of course pointers and shit which specifically reference a single memory location etc. I'm sure you know all this. Just do what you think works best for your language.
Ugh, 1 thing I hate about Mono is it does not support obfuscated assemblies at all. Which doesn't make sense because they are valid. Any obfuscation at all makes Mono flip its shit and break. I mean hell all I have it obfuscating is type names and mono still crashes :\. Anyways got my client/server code working. Surprisingly no unexpected errors either. [img]http://i53.tinypic.com/hwcqdy.png[/img] Logging courtesy the Encryption field :P [img_thumb]http://i56.tinypic.com/s5ila0.png[/img_thumb] Scrapping it for PreSend/PostRecv events.
I think incrementation shouldn't be defined with addition. 1 is such an arbitrary number to increment by, especially when there can be other numbers between 0 and 1 (as is the case with real numbers). Why not allow defining incrementation for other enumerables, such as days? You can get the next day when you know that the current day is Monday. But you can't add together Monday and Sunday. [editline]7th April 2011[/editline] I'm not obsessed with Haskell, I'm not even the one with the Haskell lambda as my avatar though I admit that my views about incrementation are affected by Haskell's succ and pred [editline]7th April 2011[/editline] As ZenX2 seems to think
I stole Knighty's title grabbin' idea. [img]http://dl.dropbox.com/u/5733962/batallion/batallionprogress20110406websnarf.png[/img] The bot now checks every word in a message, and if it's first seven characters are "http://", it retrieves the title (or puts in that placeholder title if needed), runs it through ln-s.net if the URL is longer than...I believe it's 40 characters...and sends that message to the channel. Planned features include YouTube support.
Yay, got my GUI working. And by working I mean that the GUI is now the only thing working.
I just started working on a "To-Do-List-Ish" application. Was going pretty well, until I had to make a checkbox image for it... [media]http://i225.photobucket.com/albums/dd159/samuka97/todothing.png[/media]
Ugh, [csharp]if (tcp.Poll(1, SelectMode.SelectRead) && tcp.Available == 0) { //Disconnected } [/csharp] is not working on linux :\
[QUOTE=Samuka97;29026191]I just started working on a "To-Do-List-Ish" application. Was going pretty well, until I had to make a checkbox image for it... [media]http://i225.photobucket.com/albums/dd159/samuka97/todothing.png[/media][/QUOTE] Please do not tell me you are skinning your program. Applications which do not follow the system theme are all terrible.
[QUOTE=Xera;29026375]Please do not tell me you are skinning your program. Applications which do not follow the system theme are all terrible.[/QUOTE] I don't know, then it just would be a bunch of checkboxes with text on the front. [editline]7th April 2011[/editline] you want the program to look like this, right? [img]http://tadalist.com/images/homeshot-chicago.png[/img]
[QUOTE=lavacano;29025152]I stole Knighty's title grabbin' idea. [img_thumb]http://dl.dropbox.com/u/5733962/batallion/batallionprogress20110406websnarf.png[/img_thumb] The bot now checks every word in a message, and if it's first seven characters are "http://", it retrieves the title (or puts in that placeholder title if needed), runs it through ln-s.net if the URL is longer than...I believe it's 40 characters...and sends that message to the channel. Planned features include YouTube support.[/QUOTE] There's actually a lot of bots support title grabbing. My idea was just the youtube data scraping :P I figure it would also be useful for other websites too (maybe linking to a wikipedia page gives a short description, I dunno).
[QUOTE=benjojo;29022867][media]http://www.youtube.com/watch?v=RUKSRct95aI[/media] Code: (For all, Public domain, I don't care what you do with it.) [url]http://pastebin.com/6XASysWA[/url] [highlight] WARNING WORST CODE YOU WILL EVER SEE [/highlight] Also if anyone was wondering the code compiles to around 8.1KB. Also, can someone give me pointers on how to do the whole java short to int?[/QUOTE] quick! Make it convert the Hex to a uint16_t, which is then used to locate a chinese glyph in a font. [b]INSTANT MATRIX[/b]
I need a model with an albedo, normal and specular textures, preferably in .x format. Anyone know a nice place to get some for free :)
[QUOTE=Xera;29026375]Please do not tell me you are skinning your program. Applications which do not follow the system theme are all terrible.[/QUOTE] I'm not sure about this. I can see exactly what you mean, but Winamp looks pretty damn awesome when it fills my second screen; it'd look extremely ugly with the Windows theme imo. I guess it depends on the application.
[QUOTE=Robert64;29021259]Langton's ant?[/QUOTE] I don't know. I think I may have done something wrong since, while cells die and whatnot, the entire thing continues to live. It fills the screen (not literally fills) and never dies out.
I think my engine is at a usable state now that I finished using entities.
[csharp]// Top left idx = ((cell.NW & 0x1) << 8) | // top left ((cell.N & 0xC) << 4) | // top side & top right ((cell.W & 0x200) >> 1) | // left side ((cell.W & 0x20) >> 3) | // bottom left ((cell.X & 0xC000) >> 11) | // center & right side ((cell.X & 0xC00) >> 10); // bottom side & bottom right result |= (ushort)(NeighborhoodMemory[(ushort)idx] << 15); // Top 1 idx = ((cell.N & 0xE) << 5) | // top row ((cell.X & 0xE00) >> 6) | // middle row ((cell.X & 0xE0) >> 5); // bottom row result |= (ushort)(NeighborhoodMemory[(ushort)idx] << 14); // Top 2 idx = ((cell.N & 0x7) << 6) | // top row ((cell.X & 0x7000) >> 9) | // middle row ((cell.X & 0x700) >> 4); // bottom row result |= (ushort)(NeighborhoodMemory[(ushort)idx] << 13); // Top right idx = ((cell.N & 0x3) << 7) | // top left & top side ((cell.NE & 0x8) << 3) | // top right ((cell.X & 0x3000) >> 8) | // left side & center ((cell.X & 0x300) >> 7) | // bottom left & bottom side ((cell.E & 0x8000) >> 12) | // right side ((cell.E & 0x800) >> 11); // bottom right result |= (ushort)(NeighborhoodMemory[(ushort)idx] << 12);[/csharp] holy jesus and mary too it's pretty heavy on my brain just figuring out which magic numbers go where. I think I'm going to explode if there are any bugs [editline]7th April 2011[/editline] That's the top row out of 4 rows.
[QUOTE=Darwin226;29024133]Sorry guys, that's not what I've asked.[/QUOTE] Okay, I'll answer it correctly then: [QUOTE=Darwin226;29023641]I guess my question is: Is a++ EXACTLY the same as a = a + 1? And for that matter, is a+=1 the same thing too?[/QUOTE] No and no. [editline]7th April 2011[/editline] [QUOTE=Xera;29026375]Applications which do not follow the system theme are all terrible.[/QUOTE] [img]http://upload.wikimedia.org/wikipedia/en/thumb/1/1d/Screenshot-Wikipedia%2C_the_free_encyclopedia_-_Google_Chrome.png/800px-Screenshot-Wikipedia%2C_the_free_encyclopedia_-_Google_Chrome.png[/img]
I modified Conway's game of life to have two "factions", red and blue. I added a single rule: -If three pixels of the opposite color surround a pixel, that pixel dies. [img]http://gyazo.com/99bdfce864bcc25f3a70d51bef4329cc.png[/img]
That's not Conway's Game of Life. [editline]7th April 2011[/editline] It just doesn't produce patterns like that. Big, full patterns explode and die out. There's something wrong with your rules.
None the less, it makes interesting patterns. Maybe call them geelbots?
managed to get an opengl application to compile... baby steps [media]http://dl.dropbox.com/u/1032139/imgout/opengl%202011-04-07%2005-34-00-42.jpg[/media]
Nice beige you have there :v:
[QUOTE=ZenX2;29029560]Nice beige you have there :v:[/QUOTE] is this any better [media]http://dl.dropbox.com/u/1032139/imgout/opengl%202011-04-07%2005-45-49-30.jpg[/media]
Holy cow, the JPEG is murdering your images
Just started extensively using the call stack for debugging and now I get a StackOverflow... It will be a fun ride determining the source of that one.
[QUOTE=Darwin226;29030637]Just started extensively using the call stack for debugging and now I get a StackOverflow... It will be a fun ride determining the source of that one.[/QUOTE] You mean you got a stack overflow not a "[url=http://stackoverflow.com/]StackOverflow[/url]" :v:
[QUOTE=a2h;29031326]You mean you got a stack overflow not a "[url=http://stackoverflow.com/]StackOverflow[/url]" :v:[/QUOTE] He might have gotten a StackOverflowException...
Sorry, you need to Log In to post a reply to this thread.