[QUOTE=Icedshot;25511836]Ahaha, the problem is that i never really thought id show it to anyone, so i just did it all in my own style, and badly at that
Fix (hopefully?) is going up now, and loads IP from ip.txt. Youll need port 5543 forwarded for it to actually work[/QUOTE]
Have you learned C or something? You're using int instead of bool for some reason. And in Player.hpp I saw lots of memsets. No std::string, just char-arrays and lots of sprintf.
Even if so, you're missing - for example - header guards.
Your indention and empty lines are completely fucked up.
I saw a file named ~Player.hpp, containing only the definition of the destructor! What's up with that?
Why does the Player have a function called Delete? Should - whatever this function does - not be the job of the destructor?
The header files are somehow all over the place. Lol'd at the directory called 'H'.
I didn't see any implementation-files, seems you just use the ending hpp on every source file?
Just some stuff I wanted to mention, since you said it was 'fixed'?
[QUOTE=BlkDucky;25512666]So did I. :v:
[img_thumb]http://gyazo.com/78f122dcd21ef3cc0644dee915b9200e.png[/img_thumb][/QUOTE]
You can share your lists by going to the Sharing menu on the left, then "Enable public sharing". You'll get a link after that.
Just incase you'd want a friend or someone to check it out or something :v:
[QUOTE=ZeekyHBomb;25511104]If you wanna save it as wave file:
[url]https://ccrma.stanford.edu/courses/422/projects/WaveFormat/[/url][/QUOTE]
Something like OGG, or preferably MP3 would be better.
[IMG]http://gyazo.com/dfeffacdc9c1ea12f85fcec69c45ce42.png[/IMG]
[IMG]http://gyazo.com/fa01e088b537e5ff679faab89d1ba095.png[/IMG]
[IMG]http://image.spreadshirt.com/image-server/image/composition/16678280/view/1/producttypecolor/1/type/png/width/280/height/280/fuck-yea-man_design.png[/IMG]
It's quite satisfying ticking things off a list, I have to say.
[QUOTE=ZeekyHBomb;25512679]Have you learned C or something? You're using int instead of bool for some reason. And in Player.hpp I saw lots of memsets. No std::string, just char-arrays and lots of sprintf.
Even if so, you're missing - for example - header guards.
Your indention and empty lines are completely fucked up.
I saw a file named ~Player.hpp, containing only the definition of the destructor! What's up with that?
Why does the Player have a function called Delete? Should - whatever this function does - not be the job of the destructor?
The header files are somehow all over the place. Lol'd at the directory called 'H'.
I didn't see any implementation-files, seems you just use the ending hpp on every source file?
Just some stuff I wanted to mention, since you said it was 'fixed'?[/QUOTE]
Yes, i did learn C heh. I find using arrays makes more sense, as i know an array is a length of 100 bytes in memory, rather than something that you cant exactly pin down to being 100 1 byte characters. Oh, and im replacing the memsets gradually (you can see a lot of them are commented out), cause i realise that it isnt the best idea.
Header guards- as i said earlier, i never intended anyone to see or use my code, and seeing as i know exactly what is going on, i see not a huge need for them in the immediate future. Ill add them in at some point.
Indentation- set to linux in code::blocks? i use the auto styler every now and again, so if its particularly odd feel free to blame it. The spacing and \n s are to allow me to see the sections of code more easily, even if they are extremely non standard/odd
~Player Contains the definition of the destructor, so if in the future i decide to change it, its already set up
For player, i wanted two ways for it two "destruct", a correct way by me, and an inproper way (the default destructor). So at some point in the future i can add debugging into the destructor to find out if its ever called on its own, which would be a bug.
Header files - yeah. Ive been working on fixing them up (not long ago, Player was all simply stuffed into server). And for the moment, implementation files seem a bit excessive, even if it would be better coding practie to use them.
And i meant fixed as in "works" rather than good. :3
Oh and thanks for feedback!
Maybe I should write a todo-list script or something. Command line supremacy :v:
[QUOTE=BlkDucky;25513002][img_thumb]http://gyazo.com/dfeffacdc9c1ea12f85fcec69c45ce42.png[/img_thumb]
[img_thumb]http://gyazo.com/fa01e088b537e5ff679faab89d1ba095.png[/img_thumb]
[img_thumb]http://image.spreadshirt.com/image-server/image/composition/16678280/view/1/producttypecolor/1/type/png/width/280/height/280/fuck-yea-man_design.png[/img_thumb]
It's quite satisfying ticking things off a list, I have to say.[/QUOTE]
Do you find it tempting to add really pointless things so you can tick them off? Its pretty awesome
[QUOTE=Icedshot;25513009]Yes, i did learn C heh. I find using arrays makes more sense, as i know an array is a length of 100 bytes in memory, rather than something that you cant exactly pin down to being 100 1 byte characters. Oh, and im replacing the memsets gradually (you can see a lot of them are commented out), cause i realise that it isnt the best idea.
Header guards- as i said earlier, i never intended anyone to see or use my code, and seeing as i know exactly what is going on, i see not a huge need for them in the immediate future. Ill add them in at some point.
Indentation- set to linux in code::blocks? i use the auto styler every now and again, so if its particularly odd feel free to blame it. The spacing and \n s are to allow me to see the sections of code more easily, even if they are extremely non standard/odd
~Player Contains the definition of the destructor, so if in the future i decide to change it, its already set up
For player, i wanted two ways for it two "destruct", a correct way by me, and an inproper way (the default destructor). So at some point in the future i can add debugging into the destructor to find out if its ever called on its own, which would be a bug.
Header files - yeah. Ive been working on fixing them up (not long ago, Player was all simply stuffed into server). And for the moment, implementation files seem a bit excessive, even if it would be better coding practie to use them.
And i meant fixed as in "works" rather than good. :3[/QUOTE]
Oh right. I forgot about this. Anyway, I see you put the missing dll in each folder, but now they want libstdc++-6.dll. Heh.
[editline]19th October 2010[/editline]
[QUOTE=Icedshot;25513120]Do you find it tempting to add really pointless things so you can tick them off? Its pretty awesome[/QUOTE]
I'm trying not to. :3:
[QUOTE=Icedshot;25513009]Yes, i did learn C heh. I find using arrays makes more sense, as i know an array is a length of 100 bytes in memory, rather than something that you cant exactly pin down to being 100 1 byte characters. Oh, and im replacing the memsets gradually (you can see a lot of them are commented out), cause i realise that it isnt the best idea.
Header guards- as i said earlier, i never intended anyone to see or use my code, and seeing as i know exactly what is going on, i see not a huge need for them in the immediate future. Ill add them in at some point.
Indentation- set to linux in code::blocks? i use the auto styler every now and again, so if its particularly odd feel free to blame it. The spacing and \n s are to allow me to see the sections of code more easily, even if they are extremely non standard/odd
~Player Contains the definition of the destructor, so if in the future i decide to change it, its already set up
For player, i wanted two ways for it two "destruct", a correct way by me, and an inproper way (the default destructor). So at some point in the future i can add debugging into the destructor to find out if its ever called on its own, which would be a bug.
Header files - yeah. Ive been working on fixing them up (not long ago, Player was all simply stuffed into server). And for the moment, implementation files seem a bit excessive, even if it would be better coding practie to use them.
And i meant fixed as in "works" rather than good. :3[/QUOTE]
std::strings are variable in length and are easy to work with, for example if you want to append something, get substrings, etc.
Obtaining input into them from streams is also a bit easier and more flexible.
Header guards never hurt. They can only help.
Well, I saw somewhere stuff in an if not being indented. And somewhere else there was a bunch of code indented by another level for no apparent reason. I might have skimmed too quickly over the code though, maybe I am wrong.
I'm fine with classes having a manually defined destructor, I just don't understand why it's defined in a header-file and why that files only purpose is this destructor.
How is using your Delete-function more proper than the destructor?
Implementation files are excessive? They are just meant to host implementation, as opposed to header-files, which should mainly contain only declarations. Templates stuff and constants are the major exception, since these must be known in compile-time.
[QUOTE=ZeekyHBomb;25513274]std::strings are variable in length and are easy to work with, for example if you want to append something, get substrings, etc.
Obtaining input into them from streams is also a bit easier and more flexible.
Header guards never hurt. They can only help.
Well, I saw somewhere stuff in an if not being indented. And somewhere else there was a bunch of code indented by another level for no apparent reason. I might have skimmed too quickly over the code though, maybe I am wrong.
I'm fine with classes having a manually defined destructor, I just don't understand why it's defined in a header-file and why that files only purpose is this destructor.
How is using your Delete-function more proper than the destructor?
Implementation files are excessive? They are just meant to host implementation, as opposed to header-files, which should mainly contain only declarations. Templates stuff and constants are the major exception, since these must be known in compile-time.[/QUOTE]
True, but a lot of functions still work with arrays, and you have to mess around with converting them backwards and forwards? i can see why you would want to use std::strings rather than arrays though.
Yeah, work in progress.
I just astyled it (havent done it for a while), and it seems to have fixed all the crappy indenting i do :3
I like having each different function in a separate file (or at least im planning to), so i know where to look when im going for something, and what will be in there purely based on its name at a glance.
The player class is used for storing player information, and should only be destructed when i tell it to. If it destructs because of some other reason (eg scope) then that means something is going wrong. Currently im doing bugger all with that though hehe.
I know, i know, its bad programming practice and the like. In the future, ill make everything more properly organised, with their own proper cpps etc, but for the moment my disorganisation doesnt have much of an impact on the code itself.
[editline]19th October 2010[/editline]
[QUOTE=BlkDucky;25513136]Oh right. I forgot about this. Anyway, I see you put the missing dll in each folder, but now they want libstdc++-6.dll. Heh.
[editline]19th October 2010[/editline]
I'm trying not to. :3:[/QUOTE]
Aha, oh dear. You can never win with linking :3 Does anyone know of a big list of dlls that mingw compiled programs would like? (and if they are statically linkable?)
Hmm. I seem to have checked off "Feed cat" and "Reply to FP post". This might turn serious.
[QUOTE=BlkDucky;25512666]So did I. :v:
[img_thumb]http://gyazo.com/78f122dcd21ef3cc0644dee915b9200e.png[/img_thumb][/QUOTE]
What site / plugin is this... Seems useful.
[QUOTE=Dj-J3;25512143][url]www.toodledo.com[/url] - I highly recommend this todo list site, it's fucking awesome and i've never been so focused on my programming projects before.
(telling you this because i saw your TODO.txt :v:)[/QUOTE]
Todo Freely is awesome too.
[img]http://gyazo.com/1169ae8d93dd7843a5bdf72823c870a7.png[/img]
"I will do it in the future" is an incredibly bad attitude. For some reason, the future never becomes the present: do things properly, no matter how stupid, or slow, or tough it might seem, or you're going to have bad habits forever, which is both bad for your code, and incredibly bad if you ever come to coding in a group, which you almost certainly will if it ends up being your career.
[QUOTE=Overv;25513634]Todo Freely is awesome too.
[img_thumb]http://gyazo.com/1169ae8d93dd7843a5bdf72823c870a7.png[/img_thumb][/QUOTE]
That looks awesome aswell.
[QUOTE=Loli;25513622]What site / plugin is this... Seems useful.[/QUOTE]
[QUOTE=Dj-J3;25512143][URL="http://www.toodledo.com/"]www.toodledo.com[/URL] - I highly recommend this todo list site, it's fucking awesome and i've never been so focused on my programming projects before.
(telling you this because i saw your TODO.txt :v:)[/QUOTE]
[QUOTE=TheBoff;25513662]"I will do it in the future" is an incredibly bad attitude. For some reason, the future never becomes the present: do things properly, no matter how stupid, or slow, or tough it might seem, or you're going to have bad habits forever, which is both bad for your code, and incredibly bad if you ever come to coding in a group, which you almost certainly will if it ends up being your career.[/QUOTE]
I never really intended to show this code to anyone, if i was working with other people i know id be a lot more strict about what i do. Im aware when i do these things that i shouldnt, and sometimes i deliberately program certain things just to see what the consequences of them are. Though in this case its sheer lazyness :3
i seem to be spamming the thread a bit.
If it motivates someone into helping me, that code I need help with is part of a Spotify ripper.
Hey guys, minor problem. I have a file Content/Names/Last.txt but according to C# that file doesn't exist. I have stopped compiling and recompiled and checked it is in the precise destination. My code for loading it is...
[code]
int lineCount = File.ReadAllLines(@"Content/Names/Last").Length;
[/code]
I get the error
Could not find file 'C:\Users\Oli\Documents\Visual Studio 2010\Projects\Random Characters\Random Characters\Random Characters\bin\x86\Debug\Content\Names\Last'.
It doesn't work if I add the file extension either, any ideas?
[QUOTE=Icedshot;25513470]True, but a lot of functions still work with arrays, and you have to mess around with converting them backwards and forwards? i can see why you would want to use std::strings rather than arrays though.
Yeah, work in progress.
I just astyled it (havent done it for a while), and it seems to have fixed all the crappy indenting i do :3
I like having each different function in a separate file (or at least im planning to), so i know where to look when im going for something, and what will be in there purely based on its name at a glance.
The player class is used for storing player information, and should only be destructed when i tell it to. If it destructs because of some other reason (eg scope) then that means something is going wrong. Currently im doing bugger all with that though hehe.
I know, i know, its bad programming practice and the like. In the future, ill make everything more properly organised, with their own proper cpps etc, but for the moment my disorganisation doesnt have much of an impact on the code itself.[/QUOTE]
std::string::c_str() -> std::string to const null-terminated char array
std::string(const char*) -> null-terminated char-array to std::string
You should not modify the contents of a string by accessing the internal memory, so don't const_cast if you need a non-const c-string out of a c++-string for some function. Instead copy the c++-string into a mutable c-string, pass it on and then let the c++-string reinitialize.
Well, the normal approach is that you have some kind of ordering in the member-functions. Something like ctors and dtors, then static functions, then operators, then getters and setters, ...
The same ordering would then be used in the implementation file.
It doesn't really matter though, since you could always just ctrl+f your way through.
Well, if something leaves the scope it will be destructed no matter what. A custom Delete-function will not stop the compiler from inserting a call to the destructor.
If you want something to outlive the current scope, use heap-memory (new/delete) or static objects. You still will find no need to a custom Delete-function, since the call to operator delete will destruct the object, or for static objects termination of the program.
You said that you never intended this to be released to the public, that's a little bit better, but now that it is it will be better to apply some generally known idioms, such as operator delete instead of Foo::Delete.
It's also better to write code as though it is intended for release. Otherwise you might adopt some bad habits.
[QUOTE=Loli;25513882]Hey guys, minor problem. I have a file Content/Names/Last.txt but according to C# that file doesn't exist. I have stopped compiling and recompiled and checked it is in the precise destination. My code for loading it is...
[code]
int lineCount = File.ReadAllLines(@"Content/Names/Last").Length;
[/code]
I get the error
Could not find file 'C:\Users\Oli\Documents\Visual Studio 2010\Projects\Random Characters\Random Characters\Random Characters\bin\x86\Debug\Content\Names\Last'.
It doesn't work if I add the file extension either, any ideas?[/QUOTE]
You have 3 times "Random Characters/" in there, I'm fairly sure there should only be 2.
C:\Users\Oli\Documents\Visual Studio 2010\Projects\Random Characters\Random Characters\Random Characters\bin\x86\Debug\Content\Names
This is where my file path is... ctrl C'd
I'm working on an expanded brainfuck extension, which is going to be the 'compiled' form of my new language, called BASS (Brainfuck AbStraction System)
New opcodes:
{ - begin function block with the id of the function being the current cell. Anything between here and } is inserted into the tape where your are now as brainfuck instructions.
- -Call a function with a function id of the current cell
_ -Start a new thread with the specified function id
; -End thread or return number in cell, not sure how I'm going to do this.
\ - Set tape position to 0
/ - Set tape position to the function device
| - call a device call with the id of the current cell and the next cells as arguments (The device is just preprogrammed instructions, for IO and timing and stuff)
Some BASS things:
function(args)
becomes
/+...>+....>+....|\
Where the dots are adding more of that symbol
method method()
{stuff}
becomes
>.....(the function is stored in the tape so you want it away from your workspace)+.....{stuff}\
To call
+.....- (or _ for new thread)
Very simple stuff
[QUOTE=Loli;25513882]Hey guys, minor problem. I have a file Content/Names/Last.txt but according to C# that file doesn't exist. I have stopped compiling and recompiled and checked it is in the precise destination. My code for loading it is...
[code]
int lineCount = File.ReadAllLines(@"Content/Names/Last[u][b].txt[/b][/u]").Length;
[/code]
I get the error
Could not find file 'C:\Users\Oli\Documents\Visual Studio 2010\Projects\Random Characters\Random Characters\Random Characters\bin\x86\Debug\Content\Names\Last'.
It doesn't work if I add the file extension either, any ideas?[/QUOTE]
[QUOTE=Hexxeh;25512964]Something like OGG, or preferably MP3 would be better.[/QUOTE]
I myself would prefer FLAC, so if ya want [url]http://www.hydrogenaudio.org/forums/index.php?showtopic=50113[/url]
Though anyways, I couldn't find an Ogg or MP3 encoder for .NET, so maybe just resort to P/Invoke and use aoTuV or LAME.
[QUOTE=iNova][QUOTE=Loli;25513882]Hey guys, minor problem. I have a file Content/Names/Last.txt but according to C# that file doesn't exist. I have stopped compiling and recompiled and checked it is in the precise destination. My code for loading it is...
[code]
int lineCount = File.ReadAllLines(@"Content/Names/Last[U].txt[/U]").Length;
[/code]I get the error
Could not find file 'C:\Users\Oli\Documents\Visual Studio 2010\Projects\Random Characters\Random Characters\Random Characters\bin\x86\Debug\Content\Names\Last'.
[U]It doesn't work if I add the file extension either[/U], any ideas?[/QUOTE][/QUOTE]
Made a unifrog program: [url]http://f.braxupload.se/4886j9.zip[/url]
[img]http://highland-view.org/images/frog_unicycle_lg_clr.gif[/img]
Fixed it.. Aargh.
Wish I knew what the fuck was happening with it.
[QUOTE=Dr Magnusson;25514331]inova is a dumbass[/QUOTE]
hnghgn rated self box cause there's no more bad reading :saddowns:
[QUOTE=ZeekyHBomb;25513978]std::string::c_str() -> std::string to const null-terminated char array
std::string(const char*) -> null-terminated char-array to std::string
You should not modify the contents of a string by accessing the internal memory, so don't const_cast if you need a non-const c-string out of a c++-string for some function. Instead copy the c++-string into a mutable c-string, pass it on and then let the c++-string reinitialize.
Well, the normal approach is that you have some kind of ordering in the member-functions. Something like ctors and dtors, then static functions, then operators, then getters and setters, ...
The same ordering would then be used in the implementation file.
It doesn't really matter though, since you could always just ctrl+f your way through.
Well, if something leaves the scope it will be destructed no matter what. A custom Delete-function will not stop the compiler from inserting a call to the destructor.
If you want something to outlive the current scope, use heap-memory (new/delete) or static objects. You still will find no need to a custom Delete-function, since the call to operator delete will destruct the object, or for static objects termination of the program.
You said that you never intended this to be released to the public, that's a little bit better, but now that it is it will be better to apply some generally known idioms, such as operator delete instead of Foo::Delete.
It's also better to write code as though it is intended for release. Otherwise you might adopt some bad habits.[/QUOTE]
Its not a matter that i dont know how to use them, its that im purposefully not using them because then i would have to deal with pieces of code like:
std::string something("W/e");
char somethingelse[100]={0};
sprintf(somethingelse, "%s",something.c_str());
fprintf(somethingelse, number, stream);
whereas i could could just use an array. Its probably because im doing it all Cstyle, as opposed to using streams etc.
Yeah, ordering probably is the norm, with implementations etc etc, but this way its easier for me to find things. for me at least
True, but i can tell if i destructed it, or if it was destructed by me. If it wasnt destructed by me, there is a problem. Player is rarely used not on the heap, so is slightly irrelevant anyway. Half of my programming is purely to learn new things, and to come up with new concepts of things i could do, like this destructing-ness. Oh and also, if something goes wrong, delete whatever is called (which just deletes the memory, and ignores the invalid acc info), and if something doesnt, it saves the account, then deletes the memory. Thats mostly why i use both.
Yeah, i know what you mean.
[QUOTE=Icedshot;25514622]Its not a matter that i dont know how to use them, its that im purposefully not using them because then i would have to deal with pieces of code like:
std::string something("W/e");
char somethingelse[100]={0};
sprintf(somethingelse, "%s",something.c_str());
fprintf(somethingelse, number, stream);
[/QUOTE]
std::string something("Whatever");
sprintf(something.c_str());
Wouldn't that work?
Sorry, you need to Log In to post a reply to this thread.