A while ago I finished playing through Blue Dragon on the XBOX360. I've told myself that I should write something about each game I finish to improve on my writing skills.
Now Blue Dragon is a fun game that unfortunately suffers from some faults. It has a very typical story, typical main-character and of course the trademark look and feel from Akira Toriyama, creator of Dragonball.
Being from Akira Toriyama it is fun to walk around the world and see all the different species of creatures living together and co-operating with each other.
The battle system is old. It is unfortunately very repetitive and can get on your nerves from time to time. The thing that really bugged me is that none of the characters in the game have any real weapons or armor, so nothing changed on them through the entire game.
Monster fights are fun though, but they are (to me at least) too much of a hassle to get together all the time.
Balance is a little out of whack though, mostly Disc 1 is easy and you don't really have any trouble with anything or anyone, then Disc 2 becomes slightly annoying since there are a lot of fights and they take a few turns, and though the battles have ok animations they take a while to execute and you start falling asleep after a while, this is the point where I left my XBOX on for 2 weeks without playing.
Story is fun, but nothing spectacular. Boy and friends want to save village, they get lost, they get back, they leave for a big 'ol adventure.
I don't really have much else to say. I liked playing it, I loved getting through it (finally) and that's about it, it's not very remarkable in any respect (other then it's made by Akira Toriyama).
Tuesday, June 2, 2009
Monday, June 1, 2009
C++: Reading from and writing to a file
Me being the idiot that I am, I am not satisfied that I have just recently finally really gotten my random wallpaper script working with Python. Nooo, now I feel like a sell-out since I'd already written it in C++ once and unfortunately lost that somehow.
So now that it works in Python, of course I just had to decide to write it in C++ again too.
I found, though, that I am severely lacking in C++ knowledge. All the tutorials I followed almost a year ago now (I think it was at least 3) have all been next to lost from my mind.
Fortunately I had decided on completing a very simple task for today, since it was already 10pm when I started on this: Read all lines from a file and be able to write a line to a file, the rest will come later.
I started out with creating a header file that looked like this:
Now for the simplest of implementations of these functions we're going to read a file with read() and add a line with write()
first we have to include
to keep it simple we'll also be
then the functions:
We use the line variable as a temporary variable to store each line we read in so that we can write it to the console (or do something else with it). We use myfile.is_open() to check if the file could be opened, if not then it'll tell us and we use myfile.eof() to check if we have anything left to work with.
If the currently read line does not equal "" (an empty string).
When we're done we close the file.
Then we write our parameter string to the myfile object like we write a lot of other things to cout and we add an endline character (endl)
Finally we close the file, this way we don't keep things in memory we don't need to.
Now I hope I have explained enough in this post, I don't often write things like this (in case you don't get it this is my version of a tutorial, but even I can't really call it that because it is writting in about 30 minutes) so if you see room for improvement please let me know. I will try to write more things like this in the future and hope to get better at writing, C++ and software development in general.
So now that it works in Python, of course I just had to decide to write it in C++ again too.
I found, though, that I am severely lacking in C++ knowledge. All the tutorials I followed almost a year ago now (I think it was at least 3) have all been next to lost from my mind.
Fortunately I had decided on completing a very simple task for today, since it was already 10pm when I started on this: Read all lines from a file and be able to write a line to a file, the rest will come later.
I started out with creating a header file that looked like this:
#include <string>Declaring a class called FileRW and 2 public functions: add, read
class FileRW {
public:
void add(std::string filename);
void read();
};
Now for the simplest of implementations of these functions we're going to read a file with read() and add a line with write()
first we have to include
#include <iostream>That last one is, of course, to include the header file I wrote before, which I called filerw.h
#include <fstream>
#include <string>
#include "filerw.h"
to keep it simple we'll also be
using namespace std;otherwise we'd be writing std:: everywhere, which is just not so much fun really...
then the functions:
void PaperConfig::read() {
string line; // string where a line will be stored
// Open the file for reading
ifstream myfile("test.txt");
// If the file was opened
if (myfile.is_open()) {
// Until it reaches the end of the file
while (!myfile.eof()) {
// Get the next line
getline(myfile, line);
// If it's not an empty line, print it
if (line != "")
cout << line << endl;
}
// Close the file
myfile.close();
}
// If the file was not opened
else
cout << "Unable to open file";
}We use ifstream (in file stream?) to open the file for reading.We use the line variable as a temporary variable to store each line we read in so that we can write it to the console (or do something else with it). We use myfile.is_open() to check if the file could be opened, if not then it'll tell us and we use myfile.eof() to check if we have anything left to work with.
If the currently read line does not equal "" (an empty string).
When we're done we close the file.
void PaperConfig::add(string filename) {
// Open file for writing and set the append flag
ofstream myfile("test.txt", ios::app);
// Write filename to file
myfile << filename << endl;
// Close the file
myfile.close();
}Here we use the ofstream (out file stream?) to open the file for writing and the ios::app flag to tell the stream to append whatever we write to the end of the file.Then we write our parameter string to the myfile object like we write a lot of other things to cout and we add an endline character (endl)
Finally we close the file, this way we don't keep things in memory we don't need to.
Now I hope I have explained enough in this post, I don't often write things like this (in case you don't get it this is my version of a tutorial, but even I can't really call it that because it is writting in about 30 minutes) so if you see room for improvement please let me know. I will try to write more things like this in the future and hope to get better at writing, C++ and software development in general.
Saturday, May 23, 2009
My walk around the block
About a week ago I got fed-up with Zenwalk. I had a stint of trying to install software from source and I had some less-then-encouraging results, since many things just didn't build and some didn't build and didn't even give a reason why.
I started looking for alternatives. I tried to avoid Fedora in the beginning, but that didn't last long, since it is one of few mainstream distributions that features gnome as it's standard window manager.
I tried installing Mandriva with gnome first. Though since it got stuck in the initial phase of the installation, before I even selected a single package or anything, that effort was put a stop to quite quickly.
Then I thought about Arch Linux, since I'd already downloaded the install CD anyway, but as I started installing it I changed my mind.
I ended up installing Fedora 10 at that moment, which of course gave me grief over my video card, not allowing me to go beyond a 1024x786 resolution. Eventually I got it fixed though, but then after a few days I wanted to install MP3 and other non-free things such as win32 codecs and such, but then I rebooted my computer and it wouldn't start anymore. So I gave up on fedora too.
I then tried Gentoo, I have been working with Linux for a little over a year now and I thought it might be interesting to build it from near-scratch, and it was. But after going through the entire installation process with documentation and failing to get Xorg to work, I stepped off that train and moved on again.
I got to Arch Linux again, this time I actually went through the trouble of installing it and running it. Again though, the Xorg setup is what killed it, since it's documentation was not up to par with Gentoo.
I also tried g:Noblin, but since it didn't recognise my very generic 3-button mouse, it got thrown in the trash bin too...
Finally I got back to Zenwalk again. I installed it, it feels very comfortable to be back. This time I installed the gnome version, only to find out that it has just been cut-off from support since the guy maintaining the gnome parts had a fight with another guy and got kicked off. I hope he comes back or someone takes his place because I just can't deal with xfce.
During install I did have a few fatal errors installing certain packages, but fortunately I know enough to seemingly fix most of them.
The grass always seems greener on the other side, but when you actually go there you find out that it wasn't so bad where you were.
If I get fed up with Zenwalk again, then my only other option will become Ubuntu most likely, and even though it's very user friendly and all, but I feel it is too easy, I don't feel I will learn much from it. Besides, having it on my work laptop is enough for me, I'd prefer to use something else on my home computer.
I started looking for alternatives. I tried to avoid Fedora in the beginning, but that didn't last long, since it is one of few mainstream distributions that features gnome as it's standard window manager.
I tried installing Mandriva with gnome first. Though since it got stuck in the initial phase of the installation, before I even selected a single package or anything, that effort was put a stop to quite quickly.
Then I thought about Arch Linux, since I'd already downloaded the install CD anyway, but as I started installing it I changed my mind.
I ended up installing Fedora 10 at that moment, which of course gave me grief over my video card, not allowing me to go beyond a 1024x786 resolution. Eventually I got it fixed though, but then after a few days I wanted to install MP3 and other non-free things such as win32 codecs and such, but then I rebooted my computer and it wouldn't start anymore. So I gave up on fedora too.
I then tried Gentoo, I have been working with Linux for a little over a year now and I thought it might be interesting to build it from near-scratch, and it was. But after going through the entire installation process with documentation and failing to get Xorg to work, I stepped off that train and moved on again.
I got to Arch Linux again, this time I actually went through the trouble of installing it and running it. Again though, the Xorg setup is what killed it, since it's documentation was not up to par with Gentoo.
I also tried g:Noblin, but since it didn't recognise my very generic 3-button mouse, it got thrown in the trash bin too...
Finally I got back to Zenwalk again. I installed it, it feels very comfortable to be back. This time I installed the gnome version, only to find out that it has just been cut-off from support since the guy maintaining the gnome parts had a fight with another guy and got kicked off. I hope he comes back or someone takes his place because I just can't deal with xfce.
During install I did have a few fatal errors installing certain packages, but fortunately I know enough to seemingly fix most of them.
The grass always seems greener on the other side, but when you actually go there you find out that it wasn't so bad where you were.
If I get fed up with Zenwalk again, then my only other option will become Ubuntu most likely, and even though it's very user friendly and all, but I feel it is too easy, I don't feel I will learn much from it. Besides, having it on my work laptop is enough for me, I'd prefer to use something else on my home computer.
Wednesday, March 4, 2009
Zenwalk: Logitech Quickcam Pro for Notebooks
After days of searching and dead end results I have finally been able to install my Logitech Quickcam Pro for Notebooks in Zenwalk.
It is surprising what kind of (old) junk you have to go through (like qc-usb, pwc and gspca) to find out that there is actually a universal driver that is integrated in most modern linux kernels.
So, today I finally found out that UVC is the way to go for my 0x46d:0x991 webcam. I checked compatibilities here.
If you're not quite sure which camera exactly you have you can always check by opening a terminal and typing:
All I had to do was download the uvc drivers from here, and then type:
Skype did not yet respond to it though, so I edited my /etc/rc.d/rc.modules file to modprobe uvcvideo every time zenwalk starts and I rebooted, and it seems to work fine now, Skype finds it and shows an image when I press test which even moves.
You might need to install the kernel source packages for this to work, you can find these with netpkg, called kernelsource. I've tried 3 other drivers before finding this one so it got a bit messy in the end.
It is surprising what kind of (old) junk you have to go through (like qc-usb, pwc and gspca) to find out that there is actually a universal driver that is integrated in most modern linux kernels.
So, today I finally found out that UVC is the way to go for my 0x46d:0x991 webcam. I checked compatibilities here.
If you're not quite sure which camera exactly you have you can always check by opening a terminal and typing:
/sbin/lsusbWhich will result in all devices that are hooked up to your USB hubs to be listed. This would be my webcam, and yours most likely would be similar:
Bus 005 Device 002: ID 046d:0991 Logitech, Inc. QuickCam Pro for Notebooksif you take a look at this line you will see the name and the ID of your webcam.
All I had to do was download the uvc drivers from here, and then type:
tar -xzvf uvcvideo-5ba3bf58b52d.tar.gzafter which I saw that I finally had a /dev/video0 file, meaning succes!
cd uvcvideo-5ba3bf58b52d
make
su
[password]
make install
modprobe uvcvideo
Skype did not yet respond to it though, so I edited my /etc/rc.d/rc.modules file to modprobe uvcvideo every time zenwalk starts and I rebooted, and it seems to work fine now, Skype finds it and shows an image when I press test which even moves.
You might need to install the kernel source packages for this to work, you can find these with netpkg, called kernelsource. I've tried 3 other drivers before finding this one so it got a bit messy in the end.
Tuesday, February 24, 2009
Zenwalk: Intel 82801G NIC
I have recently made a switch from Fedora to Zenwalk 5.2 Linux and today I got my internet connection (YAY).
Turned on my computer and to my surprise Zenwalk didn't recognize my ethernet card (an Intel Corporation 82801G (ICH7 Family) LAN Controller, as I found out by starting an old Live Fedora cd I still had lying around, though later I found out I could have used the command 'lspci -v' aswell).
I looked around a little and found out I had to start the mii and e100 modules in order to get it working, which worked, but then I still needed them to be loaded at startup.
This time around for as much and as long as I can I want to do thing right, I don't want this linux ending up the same way that my Ubuntu has and my Fedora had where I didn't know what was installed where or how.
Looking around a little I found out that you should edit the file /etc/rc.d/rc.modules to include these 2 modules at startup.
So, if you're having this same trouble that I'm having, all you need to do is edit the /etc/rc.d/rc.modules file:
(I use vi but you can of course use any editor you like)
and then add or uncomment the lines:
And that should get it working again for you.
Turned on my computer and to my surprise Zenwalk didn't recognize my ethernet card (an Intel Corporation 82801G (ICH7 Family) LAN Controller, as I found out by starting an old Live Fedora cd I still had lying around, though later I found out I could have used the command 'lspci -v' aswell).
I looked around a little and found out I had to start the mii and e100 modules in order to get it working, which worked, but then I still needed them to be loaded at startup.
This time around for as much and as long as I can I want to do thing right, I don't want this linux ending up the same way that my Ubuntu has and my Fedora had where I didn't know what was installed where or how.
Looking around a little I found out that you should edit the file /etc/rc.d/rc.modules to include these 2 modules at startup.
So, if you're having this same trouble that I'm having, all you need to do is edit the /etc/rc.d/rc.modules file:
su
[enter password]
vi /etc/rc.d/rc.modules
(I use vi but you can of course use any editor you like)
and then add or uncomment the lines:
/sbin/modprobe e100
/sbin/modprobe mii
And that should get it working again for you.
Subscribe to:
Posts (Atom)
