Wednesday, October 10, 2007
First Java Program
I've also been working a lot with Ruby. It's an amazing little programming language that I think should replace the BASIC styled languages as a beginner's language. Its very easy to learn, I've mastered the basics in about five hours. I'm now just about as fluent with Ruby as I am with Java. I'm also just about as fluent in Java as I am in C++.
Both Java and Ruby are languages that I can't seem to hurt myself with.
This is the first Java program I have worth showing off:
It's called Date Verifier. It's actually for my Java class and is the first GUI program I've written in Java. The great thing is that you shouldn't have to download it in order to run it. This is a link to the webstart.
Here is a link to find the launch.
Also, I'm nut running entirely in linux anymore. In fact, I primarily use windows now. I would like to be using linux but it just doesn't want to work with my wireless card which is the only way I have to connect to the internet.
Oh I forgot. I have a new computer now. Specs:
HDD: 320 GB Western Digital 3gb/s SATA
RAM: 1 GB
MOBO: an Asus
VIDEO CARD: 512mb Gigabyte NVidia geforce 8
OS: Windows Vista
So far I have had no big problems with windows vista. I guess I'm one of the few people that Vista will cooperate with. A guy in my Java class said "at least it works for somebody". I guess I'm lucky.
I actually like Vista. It shouldn't have taken 5 years to develop, but it does have a lot of new little features. Yes, the features are pretty little. The difference between Vista and XP is like the difference between Ubuntu 7.10 and Ubuntu 6.10 (Which is only a year apart).
Tuesday, May 08, 2007
Maze Game Released!
ASCII Version (gold):
- Windows
- Linux - (Soon!)
- Windows
- Linux - Not Yet
IMPORTANT:
The Windows ASCII version uses special characters that may not be installed on your system, if you do not think things look like they should, let me know!
Update on May 9:
The Linux versions are not available yet because I haven't compiled the latest versions for those yet. They should be available soon. The graphical version for Linux may not be available for a little while longer as there are some serious bugs with it that cause memory problems and other weird things that I don't see on Windows. I plan on revisiting the source and rewriting it (once again) so that there aren't so many goofy things going on. The problem is that it's based on the ASCII version. Irrlicht should probably not be coded in the same way :). I may end up redoing the entire thing in 3D. I just haven't decided yet.
Phew, long time
Anyways, I have a new release that I consider to be one of the most important programs that I have ever written. It's most important because it's written in C++ and I actually understand the code that's in it! I have to say that this is a first. I've been trying to use C++ for a long time, it usually ended badly with me throwing my hands in the air and shouting "I GIVE UP ALREADY!". I guess it was just one of those things that is too difficult to teach yourself. It also uses a graphics engine to display some 'fancy' graphics. Please note that the graphics are fancy in the fact as they aren't ASCII characters and actual images. The images themselves are not that fancy.
This release is a game that I programmed for my C++ class at school. It was supposed to be a simple maze game that was played in a console window but I ended up going above and beyond and doing things graphically. I'll release two versions of the game, the ASCII console version and the graphical version. I consider the ASCII version to be stable and I will release it with a 'gold' label without any plans on further development. I will not open the code again unless there is some sort of major bug. The graphical version with be released as an 'alpha' meaning that there are some bugs but the game works anyways. I haven't decided if I'm going to do any more work on it or if I should just move to the next project. I plan to fix minor bugs if they are reported but I may never get to the major ones.
I should have the releases uploaded soon after I finish packaging them.
Tuesday, April 03, 2007
Firefox Tweaks!
I just copied and pasted it for ease. Enjoy!
Firefox Memory Cache
By default, Firefox does not use a fixed size memory cache - it uses a percentage of system memory. Setting a fixed size memory cache can often reduce memory usage - 4 or 8MB is sufficient in most instances. To set a fixed size memory cache, add the following pref using about:config:
browser.cache.memory.capacity
This is an integer pref, and can be set to the size you want the cache to be (in kilobytes).
There has been some debate about how Firefox sets the memory cache size. See bug 105344, bug 204164 and bug 296538 for various discussion about this issue.
You can also disable the Firefox memory cache completely, however this is not recommended. To do this set the following pref to false using about:config:
browser.cache.memory.enable
Memory Usage Upon Minimize
There is a pref that enables trimming Firefox memory usage when you minimize all Firefox windows. This pref is for Windows only. To enable it, set the following pref to true using about:config:
config.trim_on_minimize
Fast Back/Forward
Firefox 1.5 has a new fast back/forward feature (bfcache) that vastly reduces the amount of time taken to display pages when the back/forward buttons are used. This adds to memory usage. To disable this, set the following pref to 0 using about:config:
browser.sessionhistory.max_total_viewers
You can also control the number of pages stored instead of disabling it entirely, this is documented in the MozillaZine Knowledge Base. Note that the amount of memory used will vary according to the size and content of pages.
Browser History
Setting the browser history to extremely large values will increase memory usage. Keeping the history to a reasonable level is a good idea for this reason.
Download Manager
Clearing out the list of downloaded files every so often will reduce memory usage.
Other Issues
JavaScript
Pages with lots of (or bad) JavaScript can increase memory usage. Using NoScript to control when sites can use JavaScript can help in this situation.
Profile Corruption
Profile corruption can cause all sorts of strange behaviour, including increasing memory usage. If you suspect your profile is corrupted, or none of the other suggestions work, you can try creating a new profile.
Pirate Game Ready for Download!
Friday, March 30, 2007
So it's been awhile
I've done a couple projects but I finally have something worth talking about. My currently project is a simple game that is played in a console (like DOS) but it's still fun. You have a grid and you have to guess where some treasure is hidden on that grid. It's about done. I'll post it when it's finished.
It will be available for both Windows and Linux. If someone is interested in the source I'll give it to them as well. :)
Tuesday, January 30, 2007
Project 1, 100%
Warning, programmer talk ahead!
This is my learning experience, it may one day help someone else.
When using BASIC style languages like darkBASIC, Visual Basic, and Gambas, strings are real easy to deal with. I'm not saying strings are hard in C++, they just don't work quite the way you would think they would. I'm talking about assignment. It's real easy to put a string literal into a character array in C++ when you declare it.
Something like this:
char string[10] = "my string";
Works well, no problems at all. You can even assign it some user input with the cin command.
cin >> string;
The problem is when you want to assign it with something specific. Normally, variables can be assigned this way:
int number;
number = 1;
The variable 'number' now has the value of 1. I figured I could do the same with strings.
string = "new string";
Oh no. You get an error saying you converted a char constant to a char. Yeah. This kind of approach works just fine in my basic style languages.
Me, being the stubborn jerk I am, decided not to ask my teacher about any of this stuff and to just figure it out on my own. I'd list other way's I tried but they are wrong and are of no use to anybody. Anyways, I found a site that showed me how to do it the right way. Hurray the internet!
strcpy(string, "new string");
Oy. That is the proper way of doing it. Not any more difficult than an assignment, just a pain because I didn't know it.
END PROGRAMMER TALK.
My project is done, and is cross-platform. It runs on Linux and Windows.
Thursday, January 25, 2007
First project of the semester
It's done.
Well, almost done, I haven't quite gotten the extra credit worked out yet. I'm some what confused with how to use the 'or' operator in if statements yet. The code is all there, just the extra credit part is a bit buggy. It's commented out so it still runs fine.
The project itself is a simple console application (like msdos or the terminal if your not using windows). It takes your birthday and the current day and calculates "biorythms". Yeah, I don't understand what they are exactly. It works, that's all that's important, right? Anyways, project isn't due until next week, so I have plenty of time to fiddle around with it.
I forgot to mention. I had a genius idea for getting my laptops to work. I was going to install a live linux cd onto the harddrive and boot it like a live cd. Would have been lightweight and easy for them to handle. Only problem, one has a dead backup battery and the other has a bad cdrom. Soo, both are screwed...
Tuesday, January 23, 2007
Hardware
Anyways, I attempted to give life to a couple of old friends of mine. They are laptops. Ones that I obtained for free. Anyways, they both have about 300mhz processing speed with 128megs of ram. Pretty old. I thought I could install a nice linux distribution on them and that they would be useful to me once again. Alas, I cannot get the one I want to install. Pretty frustrating. I was able to get "Damn Small Linux" to install on one. But since it was meant to be run from a pen drive, it had crap for applications. So instead of manually going and installing all the apps I wanted and wasting a bunch of time I decided that I would install a flavor of my favorite distribution, Ubuntu. It's called Xubuntu and is meant to be run on older systems. I downloaded the alt cd (it doesn't boot as a live cd because that's how old these machines are) and burned it. I began to install it but it freezes half way. Oh well, I'll try again with the other laptop later.
Oh well. On a lighter note, I installed a C++ IDE on my pendrive so that I can develop applications on the go! Wasn't very difficult, but I felt clever in discovering a very easy way to do it. My teacher said that it would be difficult and a pain in the ass. A classmate tried it and said it was a pain in the ass. I tried it and thought it was a pain in the ass until my programmer's logic kicked in with a, "wait! it has to write out to a config file!". Long story short, I was able to simplify the pain in the ass process by simply opening the config file in a text editor and using the replace all command. Easy peasy lemon squeezy! Only a slight pain.
My computer is still running great too! Although I had to reinstall my OS again a few weeks ago. Worth it to go back to GNOME.
