What do you guys use for a settings storage library? I am curious because INI isn't cutting it out anymore and I need to implement something else. Was thinking of just finding a lightweight xml library.
Thoughts? I know xml isn't great but I don't really know of any other formats that have a light weight library besides JSON and INI.
[QUOTE=high;19699845]What do you guys use for a settings storage library? I am curious because INI isn't cutting it out anymore and I need to implement something else. Was thinking of just finding a lightweight xml library.
Thoughts? I know xml isn't great but I don't really know of any other formats that have a light weight library besides JSON and INI.[/QUOTE]
YAML isn't too bad.
XML cannot be lightweight. It's a physical impossibility.
JSON or YAML are good choices. Or you can just embed a scripting language of choice and use that as your data descriptor.
[QUOTE=Hexxeh;19694685][url]http://chromeos.hexxeh.net[/url]
Just launched the updater beta for it, went very well.
[url]http://tech.slashdot.org/story/10/01/18/0020203/ChromeOS-Zero-Released[/url]
[url]http://www.downloadsquad.com/2010/01/11/hexxeh-releases-chromium-os-zero/[/url]
[url]http://lifehacker.com/5445356/chromiumos-zero-boots-faster-offers-automatic-updates[/url][/QUOTE]
Uhm, I'm not really into the chrome os topic but, do I get this right?
You downloaded the chrome os from google, and started coding yourself on it to build an os?
Hello guys! I went to my first programming class and now I can make buttons that change the color of the programs window with VisualBasic, so if nayone needs buttons just contact me.
I also got my first Java book. Do I count as a real programmer now? :buddy:
[QUOTE=CommanderPT;19702153]Hello guys! I went to my first programming class and now I can make buttons that change the color of the programs window with VisualBasic, so if nayone needs buttons just contact me.
I also got my first Java book. Do I count as a real programmer now? :buddy:[/QUOTE]
Nope
Oh alright then, yes :buddy:
Also I demand a screenshot of this button.
[QUOTE=Jallen;19702194]Nope
Oh alright then, yes :buddy:
Also I demand a screenshot of this button.[/QUOTE]
:buddy:!
Also can somebody help me out real quick. At my school they got this program for Java that is called something like jsGRAB. I kinda forgot the name but it's apparently free and I can't seem to find it when I search. Anyone know the actual name?
:science:[B][U]Show us: THE BUTTON![/U][/B]:science:
[QUOTE=CommanderPT;19702278]:buddy:!
Also can somebody help me out real quick. At my school they got this program for Java that is called something like jsGRAB. I kinda forgot the name but it's apparently free and I can't seem to find it when I search. Anyone know the actual name?[/QUOTE]
What does it, you know, like actually do? That might be helpful
Quick question about Java:
From what I learned in C++, an enum is used to link a meaningful work to an integer, for example:
[code]
enum Color { green, red, yellow, orange, white, blue};
[/code]
Would mean that Color.red would return the integer 1. But when I do this in java, it returns me a string.
Java:
[code]
public enum Color { green, red, yellow, orange, white, blue};
// and in a method..
System.out.println("Green = " + Color.green);
[/code]
it prints out: "Green = green";
How am I meant to use enums properly in java to represent integers?
Java enums don't represent integers. In fact, they are full-fledged objects.
To represent them as integers, the easiest way is to use the ordinal method. This returns the numerical position of each enum constant, starting at zero. It's not a good strategy for several reasons though. (Item 31 of Effective Java for more on this.)
Anyway, here's the "right" way to do it:
[code]
public enum Color
{
GREEN(0), RED(1), YELLOW(2), etc...
private final int number;
Color( int number ) { this.number = number; }
public int getNumber() { return number; }
}[/code]
Then you can do
[code]
Color.GREEN.getNumber();
[/code]
[QUOTE=s0ul0r;19702295]:science:[B][U]Show us: THE BUTTON![/U][/B]:science:[/QUOTE]
I can't, I don't have the Visual Basic editor on this pc. :saddowns:
[QUOTE=tjl;19702316]What does it, you know, like actually do? That might be helpful[/QUOTE]
Well, we never got to use it today but it was for Java, C++ etc. Well, I can just ask my teacher later I suppose since it doesn't seem like anyone is using it.
[editline]03:59PM[/editline]
Also I found the program, it was jGrasp that I was looking for. Luckily it was mentioned in my book.
[editline]04:49PM[/editline]
I managed to compile some java that I got from the book, I compiled it and then managed to run it!
[IMG]http://filesmelt.com/dl/omgs.PNG[/IMG]
Proof of my great endeavour!
Hej means, hello in Swedish btw.
[QUOTE=Mattz333;19702319]Quick question about Java:
From what I learned in C++, an enum is used to link a meaningful work to an integer, for example:
[code]
enum Color { green, red, yellow, orange, white, blue};
[/code]
Would mean that Color.red would return the integer 1. But when I do this in java, it returns me a string.
Java:
[code]
public enum Color { green, red, yellow, orange, white, blue};
// and in a method..
System.out.println("Green = " + Color.green);
[/code]
it prints out: "Green = green";
How am I meant to use enums properly in java to represent integers?[/QUOTE]
You don't have to represent them as integers in most cases.
[cpp]public enum ColorEnum { green, red, yellow, orange, white, blue};
Color makeColor(ColorEnum ce) {
switch(ce) {
case green:
return Color.GREEN;
break;
//etc
}
//you can also do ifs
if (ce == ColorEnum.blue) {
return Color.BLUE;
}
}[/cpp]
[QUOTE=Mattz333;19702319]How am I meant to use enums properly in java to represent integers?[/QUOTE]
Can you just do:
[code]
System.out.println("Green = " + (int)Color.green);
[/code]
that works in C#, although like people have said I dunno why you'd want to use ints in this case.
Or better yet, don't use enums for the colors and just make static Color objects inside the Color class (Color.RED would be Color(1, 0, 0) for example)
[QUOTE=NovembrDobby;19703838]Can you just do:
[code]
System.out.println("Green = " + (int)Color.green);
[/code]
that works in C#, although like people have said I dunno why you'd want to use ints in this case.[/QUOTE]
I'm pretty sure you can't cast an object to int.
[QUOTE=nullsquared;19703869]Or better yet, don't use enums for the colors and just make static Color objects inside the Color class (Color.RED would be Color(1, 0, 0) for example)[/QUOTE]
Or even better, use the already existing Color class with already existing static Color objects.
[QUOTE=Robber;19703891]
Or even better, use the already existing Color class with already existing static Color objects.[/QUOTE]
That's actually a really good point that I failed to mention :v:
[QUOTE=CommanderPT;19702453]
[IMG]http://filesmelt.com/dl/omgs.PNG[/IMG]
Hej means, hello in Swedish btw.[/QUOTE]
Volbeat huh :smug:
I have been hard at work developing a software for the everyday pc user. A program that checks your OS! That's right! No longer will you have to struggle in the depths of your pc's rihgt click menues and confusing folders. With a simple click the OsChecker 3000 will check your OS and tell you. With a simple and easy to understand interface, you are one click away from finding out!
OsChecker 3000 is currently in the bugfixing stages and will be released soon for 9.99$!
[QUOTE=s0ul0r;19704256]Volbeat huh :smug:[/QUOTE]
They own!
[editline]06:09PM[/editline]
I need to stop posting here or people will think I'm a troll or just mocking programming in general. I am actually reading my book and I'm loving it so far, so don't get me wrong.
[QUOTE=CommanderPT;19704536]I need to stop posting here or people will think I'm a troll or just mocking programming in general. I am actually reading my book and I'm loving it so far, so don't get me wrong.[/QUOTE]
If you want to learn about how OOP works (Java), BlueJ is good.
[QUOTE=CarlBooth;19704948]If you want to learn about how OOP works (Java), BlueJ is good.[/QUOTE]
O-O-P? :v:
Not there yet. But things are coming along nicely and it's more fun than I thought so far.
[QUOTE=s0ul0r;19701101]Uhm, I'm not really into the chrome os topic but, do I get this right?
You downloaded the chrome os from google, and started coding yourself on it to build an os?[/QUOTE]
Near enough. :)
I'm trying to get projectiles working and I'm currently using:
[code]
X = StartX - ((Power * Cos(Angle))* Time) - ((Cos(Angle)) * Time)
Y = StartY - (Power * Sin(Angle))* Time - (g * Time^2)/2
(g = -9.8)
[/code]
...which works nicely (A-Level physics FTW).
Now I want to go to the next step and achieve this effect though when there is wind:
[img]http://i46.tinypic.com/10q9pva.png[/img]
Any ideas?
[URL="http://filesmelt.com/"][IMG]http://filesmelt.com/dl/cave5.png[/IMG][/URL]
[URL="http://filesmelt.com/"][IMG]http://filesmelt.com/dl/screenie12.png[/IMG][/URL]
Working on a game about Percy Pig for my mums birthday, turning out to be quite fun. Above is the little map editor I made and map loading in the game.
No one loves me :saddowns:
-snip-
Well, I fixed up my robot, and completely dominated the competition in today's matches. No videos/pictures yet since I don't have a camera to bring to school, but the teacher has been recording everything, and I'll try getting the footage from him once he's done.
My robot kind of exploits the design of every other bot. In order to detect whether they are driving out of the ring, we program them to drive backwards if they detect a white line. This works to my advantage, since I have little flaps of paper on the sides of my bot. In one round, as I drove towards the enemy, their bot saw the white, assumed it was the border, and drove backwards off the table :D
[QUOTE=CommanderPT;19705369].. and it's more fun than I thought so far.[/QUOTE]
Enjoy it while it's still about fun. :buddy:
[QUOTE=CarlBooth;19707963]I'm trying to get projectiles working and I'm currently using:
[code]
X = StartX - ((Power * Cos(Angle))* Time) - ((Cos(Angle)) * Time)
Y = StartY - (Power * Sin(Angle))* Time - (g * Time^2)/2
(g = -9.8)
[/code]
...which works nicely (A-Level physics FTW).
Now I want to go to the next step and achieve this effect though when there is wind:
[img_thumb]http://i46.tinypic.com/10q9pva.png[/img_thumb]
Any ideas?[/QUOTE]
Why are you substracting Cos(Angle)*Time from X? Try this (not tested): X = StartX - ((Power * Cos(Angle))* Time) - (Wind * (Cos(Angle)) * Time)
[QUOTE=CarlBooth;19707963]I'm trying to get projectiles working and I'm currently using:
[code]
X = StartX - ((Power * Cos(Angle))* Time) - ((Cos(Angle)) * Time)
Y = StartY - (Power * Sin(Angle))* Time - (g * Time^2)/2
(g = -9.8)
[/code]
...which works nicely (A-Level physics FTW).
Now I want to go to the next step and achieve this effect though when there is wind:
Any ideas?[/QUOTE]
I would say you're doing it wrong.
If I were you, I would have a projectile entity.
Have a force on it. Each frame, calculate an acceleration, based on the force, a new velocity based on the acceleration and a new position based on the velocity and the acceleration.
Launch it with a certain force. Have a force acting downwards based on 9.8 * the weight, and another for wind.
Sorry, you need to Log In to post a reply to this thread.