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:
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.

Tuesday, January 20, 2009

Telerik Controls in Web Custom Controls

I work at a .Net Application Development company and the other day I didn't have anything to do, so I decided to change one of my User Controls into a Web Custom Control (ASP.Net Server Control) because I was told that we might want to use it in some of the other projects we have or are going to start in the near future.



I had never made a server control before and from what I had seen here and there I thought that this might be somewhat of a challenge. Thankfully it was easier then I thought it would be and I was successful fairly quickly.



Then one of my co-workers came up with the brilliant idea to make it's 'parent' into a server control, so I started work on that.

This 'parent' was a collection of a Fieldset with a legend, 2 radiobuttons, 2 instances of my new server control and 2 rad controls.



When I started building this control I did it all (as I was taught) in the RenderContents(HtmlTextWriter output) function.

The problem was that when it got to the point where the Telerik controls were being Rendered, they liked to throw some ReferenceNullExceptions my way.



After some looking around though I found an article in the Telerik Knowledge Base that said that I should add the Telerik controls in the CreateChildControls() function, so I did, and it works.

Check out the article here

Friday, December 19, 2008

Star Ocean: First Departure

Star Ocean: First Departure is, of course, a remake of the first Star Ocean game which was released on the Super Nintendo. It is not unexpected that Square Enix once again did a good job at remaking an old game since they have been gathering as much experience as they possible can in it.

Talking of course about games such as Final Fantasy III & IV and even I and II.



This is not the best game they have ever made and it is highly reminiscent of the Tales of Phantasia game, which was also first released on the SNES, with it's main difference being that Star Ocean employed an eagle-eye (now isometric) view of battles.

Both these games seem to start out very similarly too, since you are just hanging out in your peaceful village when, out of nowhere, bandits (or other evil people) show up and start trashing the place. But that is where similarities end.



Compared to the old SNES system these graphics look like an impossible improvement, I'm a big fan of actually re-writing a game for a remake. It would have been fine for them to do the same as they did with Final Fantasy I & II, just update the pixelated low-res graphics a bit to be less pixelated high-res screens, but apparently this was not enough for them.

Even though they did this it still looks like it predates even the first 3D playstation games, which is kind of shameful after presenting a game like Crisis Core, which looked almost like it could have been one of the better looking PS2 games (FF XII), but then again you don't want to spend too much money on an easy money-maker, do you?



Gameplay is nice. The battles are never really hard as long as you train enough and the idea of specialties and skills (not to be confused with special abilities) has always been a nice addition in my opinion. These skills, when used properly, can very easily make your characters very strong in the usual way of nicely upgrading your stats, but also by giving you skills to get more exp and find more/less enemies and gain more skill points per level. These come in handy in almost any situation. Walking around an easy area where you only get 7 exp? Just avoid enemies. Need a copy of an accesory so that you won't be petrified all the time? Make one. Very nice.



Sounds are quirky. During battles there is a lot going on at the same time, which is not unusual of course, but the things they choose to play and keep out seem far too random to be intentional. When 2 people cast a spell only one can be heard, for example, but after every battle 2 people always have a little victory speech.

The music is nicely done though, in my opinion, it suits the game and during the somewhat more exciting parts of the game it will slightly elevate your adrenaline levels if you are susceptible to such things.



The FMVs they made are awesome. It has the perfect anime look and feel and it suits the game very well, my only regret and complaint about these clips is that there are not nearly enough of them. And they started out so very promising with the entire first scene having transformed from a gameplay scene to an FMV.

The characters really come to life in these in my opinion, kudos.



The game isn't tough. It is not even really annoying at any point. Though of course you can increase difficulty for yourself by not training as much as I did (I had train and look for enemies on almost all the time), or trying to solo it with your main character.



Private actions are another nice thing. They show funny/nice/intruiging/sad scenes between your party members, it is fun to watch them sometimes and they will affect certain scenes in your story.



All-in-all this is a very nice game and it is a nice distraction from your everyday dealings. If you are a star ocean fan then you can't allow yourself to leave this one and if you just like RPGs then your should most definitely give it a try. If you neither like Star Ocean or RPGs then you are probably better off not bothering.

These are some 30 hours that I have enjoyed very much.

Monday, November 17, 2008

Gfire on Fedora 9

Updating or installing software that does not come from the regular rpm repositories can be a big pain in Fedora. Especially if you don't have a lot of experience, like me.
I've only been using Linux for a few months now, and I don't have the time to find everything out from the beginning, I'm just doing what I can when I need to.



Now today I wanted to update my version of gfire, since I hadn't in a while and it had been acting up. Most likely since every time xfire updates it changes something in it's protocols which make all other things just act wacky.



I went to the website and downloaded the RPM, which started complaining about missing a certain rpmlib. This told me that I might be using an older version of RPM (which I found out after some googling), so I updated my system in the hopes of getting a new version of the RPM package manager, but alas this was not to be.

Found out later in the gfire forums that it was because the RPMs they offer are made for Suse.



Somewhere along this path I had already tried installing it from source, but the source files kept complaining that the pidgin package was not installed, even though it was.



The fix in the end was simple.

If you are having the same troubles as me then just install pidgin-devel and libpurple-devel and try to configure/make/install. This worked for me, it might too for you.

su -c "yum install pidgin-devel libpurple-devel
or
sudo yum install pidgin-devel libpurple-devel

Depending on which you prefer to use.

And then to install gfire from source go to where you extracted the source files (for me this was '~/Download/gfire/gfire-0.7.1/' and type:

su -c "./configure;make;make install"
or
sudo ./configure;sudo make;sudo make install

Wednesday, August 6, 2008

Non-presenter ServiceDependency

Well, ASP .Net developing can be a pain in the a$$ if you only have experience with windows applications in any language, but when the boss wants to use WCSF and the view-presenter model AND foundational modules, things can get even rougher. And don't even think about using Opf3 with that, it's fun, but you'll spend many hours researching stuff.



Case:

Opf3 uses an ObjectContext class to connect with the database and work with your business entities and such, so generally you should be able to access the static method you need to get this object from every single part of your application imaginable, right? So if you're working with WCSF you'll probably need to use a Foundational Module.
This all shouldn't really be a problem if you have presenters and views everywhere that derive from the Microsoft.Practices.CompositeWeb.Web.UI.Page class. Even if you have some pages that don't have a presenter you can make them derive from the CompositeWeb's Page class, so then your problem is fixed too. But what to do when you have a class that derives from MembershipProvider, or custom server controls?



Theory:

The ObjectBuilder goes through classes that derive from certain CompositeWeb classes and searches for attributes like ServiceDependency, InjectionConstructor, CreateNew and such. You can make a public property with a ServiceDependency attribute so that any dependencies are handled and your compiler won't complain about there not being an argumentless constructor.



Problem:

Classes that don't derive from CompositeWeb classes don't get the benefit of this ObjectBuilder.



Solution:

After many hours of trying, searching, researching and asking around I finally found out how to fix this. Being inexperienced as I am, though, doesn't make me at all certain if there's something wrong with this approach, but if you create an argumentless constructor and call the Microsoft.Practices.CompositeWeb.WebClientApplication.BuildItemWithCurrentContext(this) function, the ObjectBuilder will run through your class and use these attributes.



Code:
using System;
using Microsoft.Practices.CompositeWeb;
using Microsoft.Practices.ObjectBuilder;
using Chili.Opf3;

namespace Your.Namespace.Here
{
class MyClass : SomeClassItDerivesFrom
{
private ObjectContext _objContext; // The ObjectContext Opf3 uses to work with the database.
private IContextService _objContextFactory; // The Service you made with the static function.

[ServiceDependency] // This won't work without the function we call in the constructor
public IContextService ObjContextFactory
{
set
{
_objContextFactory = value;
_objContext = _objContextFactory.GetObjectContext(); // The static function you should have made.
}
}

public MyClass()
{
WebClientApplication.BuildItemWithCurrentContext(this);
}

private SomeFunction()
{
ObjectSet objectSet = _objContext.GetObjectContext();

// Well, you should know what to do next.
}
}
}


Comments:

Well, having never done anything like this before in my life I hope this is all and it might help someone. I've searched the internet for hours without any luck really, so maybe it will be helpful