If you have time and you know C/C++ (Builder) and/or Delphi please help build this knowledge base:
http://www.brainybinary.com/cppbdelphi
You can post without needing to log-in. HTML is enabled.
http://www.brainybinary.com/cppbdelphi
You can post without needing to log-in. HTML is enabled.
a "foreach" macro, and stuff is temporary here:
www.ultranos.com/temp/ultrano.cpp
www.ultranos.com/temp/ultrano.h
VC++2k5
www.ultranos.com/temp/ultrano.cpp
www.ultranos.com/temp/ultrano.h
VC++2k5
Would it be okay to link to that source code there? Do you think you are going to be able to host it for a long time?
If you want to take a look at my own codebase (C++), it can be found at http://roticv.rantx.com/lib.txt I use it personally for training for ACM-ICPC and of course ACM-ICPC contests.
I will update it from time to time as I learn new stuff. There's a todo list, but I haven't gotten myself to work on the stuff on the todo list.
I will update it from time to time as I learn new stuff. There's a todo list, but I haven't gotten myself to work on the stuff on the todo list.
I can't host those files permanently.
If you want to take a look at my own codebase (C++), it can be found at http://roticv.rantx.com/lib.txt I use it personally for training for ACM-ICPC and of course ACM-ICPC contests.
I will update it from time to time as I learn new stuff. There's a todo list, but I haven't gotten myself to work on the stuff on the todo list.
Wow that's a big file. What can I do with that? lol
a "foreach" macro, and stuff is temporary here:
www.ultranos.com/temp/ultrano.cpp
www.ultranos.com/temp/ultrano.h
VC++2k5
I took the time to read ultrano.cpp. It's very nice. I saw that you don't include <stdio.h> and you just declare the extern "C" prototypes of the C library before you need them. Is this for compile speed ? :)
You wrote your own garbage collector, your own string functions and your own memory allocator. It's very nice of you to share this!
Wow that's a big file. What can I do with that? lol
You can kill the world with it. ;) Basically it contains various algorithms such as maximum flow, kruskal and data structures such as suffix array, fenwick trees, trie and so on.
I saw that you don't include <stdio.h> and you just declare the extern "C" prototypes of the C library before you need them. Is this for compile speed ? :)
You wrote your own garbage collector, your own string functions and your own memory allocator. It's very nice of you to share this!
I just didn't want to include whole files for one func.
The garbage "collector" is just a simple "heap", a list of objects that I allocate in some RAM-wasteful proc. On proc-exit, the garbage collection object is destroyed, and with it it frees all garbage.
The xmalloc/xfree stuff is mostly for convenience and sanity of standards: zero-allocated memory by default; resizing memory will allocate or free if old_ptr/new_size are null. Memory-append and get-memory-size, which are must-haves but miss from CRT standards (for fear of misbehavior on lack of RAM).
Debug-macros that use VKDebug.
Easier file access and VFile to write to a RAM file.
CRTInitializer trick to dynamically register callbacks/stuff on startup into an array (you only make the array public, the different objects reside hidden in different .cpp files)
ObjVector and its "foreach" macro for uber-convenience.
Overloads of new/new[] and delete/delete[], to zero-initialize, inspect and unify memory.
Hashtab and Uniquearray for collections.
It's a bunch of simple procs and wrappers with the sole purpose to make kick-starts as convenient and unified as possible. It's a partial port of my MASM runtime stuff.
Yes indeed, I saw that your memory allocator was nicer to use than malloc because it actually always returns zeroed memory. With malloc memory you don't always get zeroed memory! Actually, even with my 4gig of ram here, I get recycled memory a lot more than a zeroed page.
Why is VKDebug nice? Don't you use an IDE with a debugger? What's the difference between VKDebug and a log file.
Why is VKDebug nice? Don't you use an IDE with a debugger? What's the difference between VKDebug and a log file.
Yes indeed, I saw that your memory allocator was nicer to use than malloc because it actually always returns zeroed memory. With malloc memory you don't always get zeroed memory! Actually, even with my 4gig of ram here, I get recycled memory a lot more than a zeroed page.
calloc() ?
Ultrano and roticv, you have some really nice code there :thumbsup:
Why is VKDebug nice? Don't you use an IDE with a debugger? What's the difference between VKDebug and a log file.
I can just give the two executables to a beta-tester and receive the relevant parts of the debug log; Alt+tab or stay-on-top are a lot easier to manage than playing around with IDE-integrated windows; keeping logs between different runs is possible; the text is not read-only.
Anyway, at any time I can just route the logging to a file, IDE or null; I simply haven't needed that yet.
Why is VKDebug nice? Don't you use an IDE with a debugger? What's the difference between VKDebug and a log file.
I can just give the two executables to a beta-tester and receive the relevant parts of the debug log; Alt+tab or stay-on-top are a lot easier to manage than playing around with IDE-integrated windows; keeping logs between different runs is possible; the text is not read-only.
Anyway, at any time I can just route the logging to a file, IDE or null; I simply haven't needed that yet.
I agree that this type of debugging is so much easier. When I code with the iPhone SDK and XCode under Mac, there is an Output window which you can activate with CMD+Shift+R and in your GUI programs whenever you do printf() it will print it to that window so it's great for debugging and so much better than showing messages with MessageBox() under Windows for example.
Yeah both codes are great. I am going to have to go through them and extract parts of them and put them there on the knowledge base if you guys agree.
Go ahead. I'm not stopping you. ;)