• What Are You Working On? V13
    5,003 replies, posted
I think that now null has left people should just forget about him. He has caused enough arguments and trouble in this thread.
[QUOTE=Jallen;25042732]Agreed it's none of our business, so I can't comment on the job / payment stuff. On the topic of the programming forum though, I'm sad to see nullsquared go. He was a good poster most of the time with awesome content. Too many times people jumped on the hate wagon against him in some kind of group mentality attack. Alright his ego and potential to argue caused some of the problems but some of the times he was obviously provoked.[/QUOTE] Agreed on every point.
The problem with developing debug tools to help you develop your real work, is you spend more time debugging the debug tools than you do the real work. For example, I'm working on a Lua based TCP server, and I'm using a quick debug tool to test it which is basically a button and textbox allowing you to connect to a port and IP and send data. I recently upgraded the protocol my server uses. It took 30 minutes to apply the changes to the debug tool (including time spent fixing bugs), and only 15 to upgrade the actual server itself.
[QUOTE=thomasfn;25046317]I'm using a quick debug tool to test it which is basically a button and textbox allowing you to connect to a port and IP and send data.[/QUOTE] What's wrong with using Telnet?
[QUOTE=CarlBooth;25046343]What's wrong with using Telnet?[/QUOTE] Telnet is not versatile enough, you can only send individual ascii characters at a time (or entire files). I want to send/receive messages like this: [code]{5}{1}PING[/code] Where the characters inside {}s represent binary numbers. So that message would be an array of 6 bytes {5,1,80,49,78,47}. [editline]09:26PM[/editline] I could write the messages manually into a file and use telnet to send files, but it's much easier to just use my tool :v:
Jumped on the bandwagon, although with a slight twist :v: [IMG]http://cubeupload.com/files/1bb10buntitled.png[/IMG]
[img]http://dl.dropbox.com/u/286964/justworks.png[/img] Mmm, XML. [QUOTE=Dr Magnusson;25048179]Jumped on the bandwagon, although with a slight twist :v: [IMG_thumb]http://cubeupload.com/files/1bb10buntitled.png[/IMG_thumb][/QUOTE] Best one yet :D [b]Edit[/b] Cool, Added a feature to save to PNG: [img]http://dl.dropbox.com/u/286964/test.png[/img]
I have a small C dilemma. Or rather, I'm wondering how make the following pseudo-code work: [code] decoder = newDecoder(structContainingFunctions); decoder.decode(inputFile); [/code] The "decode" function does not change across all decoders, but it needs to use the functions specified in the struct given to "newDecoder". Like I said, I want this done in C. Any help is appreciated.
We'll have to keep an eye out for new posters in the LA.
[QUOTE=Dr Magnusson;25048179]Jumped on the bandwagon, although with a slight twist :v: [IMG]http://cubeupload.com/files/1bb10buntitled.png[/IMG][/QUOTE] I like yours the best.
Seems that malware thread has gone, what I was currently doing, was reversing that. Now got to find something new
[QUOTE=eXeC64;25050636]I like yours the best.[/QUOTE] Me too. [editline]10:06AM[/editline] Also, I can't believe I defended that fucktard. Quitting an epic job over something as stupid as "Not receiving a month pay for 4 days work" holy fuck.
[QUOTE=Dr Magnusson;25048179]Jumped on the bandwagon, although with a slight twist :v: [IMG]http://cubeupload.com/files/1bb10buntitled.png[/IMG][/QUOTE] Curses?
[QUOTE=Joshyy;25051183]Me too. [editline]10:06AM[/editline] Also, I can't believe I defended that fucktard. Quitting an epic job over something as stupid as "Not receiving a month pay for 4 days work" holy fuck.[/QUOTE] heh the link to that soon got removed
[QUOTE=thelinx;25050071]I have a small C dilemma. Or rather, I'm wondering how make the following pseudo-code work: [code] decoder = newDecoder(structContainingFunctions); decoder.decode(inputFile); [/code] The "decode" function does not change across all decoders, but it needs to use the functions specified in the struct given to "newDecoder". Like I said, I want this done in C. Any help is appreciated.[/QUOTE] pointers to functions: e.g (this is really the general idea) [code]decoder.h typedef struct decoder_t* Decoder; typedef void (*decode)(inputFile); [/code] [code] decoder.c struct decoder_t { decode decodeFunc; . . . }; Decoder newDecoder(structContainingFunctions) { <allocate memory here> decodeFunc=structContainingFunctions.decodeFunc . . . return newDecoder; }[/code] [code]main.c ... decoder = newDecoder(structContainingFunctions); decoder->decode(inputFile); ...[/code]
[QUOTE=thelinx;25050071]I have a small C dilemma. Or rather, I'm wondering how make the following pseudo-code work: [code] decoder = newDecoder(structContainingFunctions); decoder.decode(inputFile); [/code] The "decode" function does not change across all decoders, but it needs to use the functions specified in the struct given to "newDecoder". Like I said, I want this done in C. Any help is appreciated.[/QUOTE] What exactly do you need to know? I don't see a question mark anywhere in there. Do you know how function pointers work? [cpp] /* typedef the decode_cb function pointer */ typedef void (*decode_cb) (FILE*); /* "decode_cb" is now a type which represents a pointer to a function taking a single argument of type "FILE*" and returning void */ /* a decoder callback function */ void decoder_callback(FILE* file) { /* do whatever */ } /* a struct containing a decode_cb */ typedef struct decoder { /* stuff goes here */ decode_cb decode; } decoder_t; decoder_t* new_decoder() { decoder_t *decoder = malloc(sizeof(decoder_t)); decoder->decode = decoder_callback; return decoder; } /* usage: */ int main() { decoder_t *decoder = new_decoder(); FILE* file = fopen("/tmp/file.txt", "rb") decoder->decode(file); /* the above is shorthand for "(*decoder->decode)(file);" */ return 0; } [/cpp] Ninja'd! :argh:
[QUOTE=ROBO_DONUT;25051218]Curses?[/QUOTE] Foiled again? :ohdear: If he is using Curses, it'll be PDCurses, but there's a chance he's using the [url=http://msdn.microsoft.com/en-us/library/ms682087(VS.85).aspx]pure Win32 functions[/url]
If we're text editor band-wagoning: [img]http://ahb.me/wmJ[/img]
[QUOTE=turb_;25053971]If we're text editor band-wagoning: [img_thumb]http://ahb.me/wmJ[/img_thumb][/QUOTE] You get extra points because yours is an IDE.
[QUOTE=turb_;25053971]If we're text editor band-wagoning: -image snip-[/QUOTE] That "Close" icon is awful, you should just use a cross or something.
Glad to see I started something more purposeful than a religious argument today.
[QUOTE=VeryNiceGuy;25055078]Glad to see I started something more purposeful than a religious argument today.[/QUOTE] Repent before the lord comes to smite thee! Anyway, i'm going to learn Processing, can anyone offer any advice for it?
[QUOTE=turb_;25053971]If we're text editor band-wagoning: [img]http://ahb.me/wmJ[/img][/QUOTE] Looks cool put complicated.
[QUOTE=Mogadishu;25056378]Looks cool [b]put[/b] complicated.[/QUOTE] :rimshot:
[QUOTE=Joshyy;25056188]Repent before the lord comes to smite thee![/QUOTE] lol
[QUOTE=ROBO_DONUT;25051218]Curses?[/QUOTE] Negative, as Chandler said, I'm just using the built in Windows console functions. I made a small wrapper to easily write strings, attributes and colored squares as I wanted. It wouldn't be much fun if I just used libraries whenever something was slightly challenging :P The executable is 10kb, and it uses about 600kb of memory.
[QUOTE=Dr Magnusson;25060491]it uses about 600kb of memory.[/QUOTE] It is quite clearly in desperate need of optimization :colbert:
[QUOTE=RP.;25051672]pointers to functions: e.g (this is really the general idea)[/QUOTE] [QUOTE=ROBO_DONUT;25051676]What exactly do you need to know? I don't see a question mark anywhere in there. Do you know how function pointers work? Ninja'd! :argh:[/QUOTE] Thanks both of you, but you kind of missed the point. The newDecoder takes a struct that the decoder function uses when decoding.
[cpp]typedef struct DecoderFuncs { fpInit init; fpStart start; fpEnd end; } DecoderFuncs; typedef struct Decoder { DecoderFuncs funcs; } Decoder; Decoder* newDecoder(DecoderFuncs *funcs) { Decoder *decoder = malloc(sizeof(Decoder)); memcpy(&decoder->funcs, funcs, sizeof(DecoderFuncs)); return decoder; }[/cpp] ?
Actually, my C "teacher" friend just got online. I'll use another approach. Thanks anyway.
Sorry, you need to Log In to post a reply to this thread.