Thread safety and PHP

December 26th, 2009 No comments

UPDATED

After a few seg-faults, I realized that eAccelerator isn’t thread safe (I was running it under a thread safe server)… It is thread safe… I just wasn’t loading it in thread safe mode (see the manual for details). Whoops.

Categories: Uncategorized Tags: ,

eAccelerator

December 26th, 2009 No comments

After getting somewhat annoyed with the slowness of my blog, and having nothing better to do, I decided to setup eAccelerator. I’m pretty sure I tried setting it up a long time ago, but for some reason, didn’t finish.

Following the path of logic, I went to the eAccelerator website in search of the appropriate files. Their Windows section directed me to SiteBuddy, which had a nice collection of binaries for various PHP versions. After determining my PHP version (5.2.9-2), I tried the closest match (5.2.9), and was greeted by the following error in the Windows event log:

Unable to start eAccelerator module in Unknown on line 0.

My initial reaction to the error: what the ****… (UPDATE: See this post for more details) After a quick Google search, I found that PHP modules must be built for the EXACT PHP version you plan to use them on.

Since I have just about every Microsoft C++ compiler, I figured compiling a new eAccellerator module for my version of PHP would be simple. I downloaded the archived PHP files I needed (now I understand why they keep archives), switched to the release configuration, and pressed build.
Read more…

Categories: Uncategorized Tags: ,

Some thoughts on TeamSpeak3

December 20th, 2009 No comments

After playing around with the client and server, here are my thoughts.

Server

Setup is pretty simple for any Linux admin. May pose problems for inexperienced admins.

The latest update (beta2), required a manual SQL diff and subsequent manual insert to enable the new permissions. I’m guessing they’ll fix this in future releases.

Client

The client UI has been completely redesigned. The default sound notifications are kind of annoying. I switched to the TTS sound pack and turned 90% of them off.

General

It seems like the  “clan server” option has been removed in favor of “subscribing” to channels. Basically, users aren’t visible unless you are subscribed to the channel they are in, or are in the channel. There’s a button and several menu options to subscribe to all channels.

The permission system is one of the most powerful I’ve seen; however, the documentation isn’t as complete as I’d like.

Categories: Uncategorized Tags: ,

Best of open source (2009)

December 16th, 2009 No comments

As 2009 starts to wrap up, here’s my list of the best open source software that I’ve used:

The best of open source
Software Comments
WordPress The best blogging platform.
Python One of the most modern and powerful programming languages. Incredible standard library.
Mumble The best conference style VOIP. Incredible sound quality, the lowest latency and lowest bandwidth usage that I’ve ever seen in a VOIP system (open source or not). Version 1.2 seems to have fixed some of the major server administration issues.
Sage (Open Source Mathematics) An open source alternative to “Magma, Maple, Mathematica and Matlab”. Good documentation.
Ubuntu My personal favorite Linux distribution. Version 9.10 adds cloud technology to both the desktop and server (yes, you can use it to make your own cloud).
SourceMod The most modular and powerful server administration tool for Source based game servers.
VirtualBox Open source (the RDP server, USB support, and USB over RDP are not) virtualization comparable to VMWare Workstation. Seamless windows for Linux and Windows guests. The closed source parts are available for free under the VirtualBox PUEL.
Firefox The best web browser.
Categories: Uncategorized Tags:

Browsing the web without ads

December 16th, 2009 2 comments

Amusingly, I didn’t use an ad blocker until a few months ago. Now, I enjoy viewing sites without half a million ads cluttering up my screen.

Ad blockers like ABP (Ad Block Plus) scan web pages for ads, and remove them. As simple as they are, ad blockers are incredible.

I installed ABP when I was trying to print an article from a coding website. There were so many ads on their main and print views of the article that printing it would have barely been worth the effort. I remembered that a friend of mine had talked about ABP, so I looked it up and installed it. After enabling it and returning to the website, the ads were gone, and I could actually print the article.

ABP also lets you block new ads that it doesn’t already detect with a few simple clicks. Some websites use JavaScript to display ads, and if ABP can’t block them, NoScript can.

Web masters should realize that intrusive ads will just cause more and more people to start using ad blockers, and start being reasonable.

Categories: Uncategorized Tags: ,

TeamSpeak3 – Not vaporware after all?

October 30th, 2009 No comments

It certainly doesn’t look like vaporware anymore. Over the past few months, it’s looked less and less like vaporware (with more frequent status updates, screenshots, etc), and more like an actual product that will get released.

The open beta was announced (for Dec 19, 2009). I have a feeling this is going to go one of three ways:

  • Worst case – Full of bugs, completely unusable
  • Possible case – Performance / quality issues, a reasonable number of minor bugs, interface issues
  • Best case – Polished through the private Alpha tests, only a few minor bugs remain

If the development team pulls off what’s been discussed for the past year, it will blow Ventrilo completely out of the water.

Categories: Uncategorized Tags: ,

C++ Good, bad or worse?

October 23rd, 2009 No comments

I’ve used many different programming languages, each with their own set of benefits and flaws. C++ was the first one I learned, and every class that I’ve taken has used it (with the exception of two language classes).

Before we discuss the pros and cons of  C++, here’s a factoid: C++ is based on C, which was written in 1972 (approximately 37 years ago) at Bell Labs for use with the UNIX operating system.
Read more…

Categories: Uncategorized Tags: , ,

Amusing mistakes in C++

October 9th, 2009 No comments

I was writing some complicated inherited classes in C++, and made a few amusing mistakes, which resulted in some strange errors.

Firstly, the concept of method hiding is when you declare a method with the same name of a method that exists in a parent class. This doesn’t override the method (unless it was marked as virtual), but any calls to that method will go to the method defined in the child class. This can lead to really strange results if you were expecting a method override, but forgot to put virtual in the parent class, as I did.

class Parent
{
   public:
        void foo();
};

class Child
{
    public:
        void foo();
};

Now mistakes like this are obvious in small classes, but in large classes, while on six hours sleep, they can be harder to pinpoint.

The other mistake was when I didn’t realize I already had a protected method, we’ll call it bar, declared in the parent class. I then defined a private method called bar in the child class, in which I was trying to call the parent class. Guess what? Infinite recursion.

Lesson of the day? Don’t code while tired. It doesn’t work very well.

Categories: Uncategorized Tags:

Bitwise operations

September 13th, 2009 No comments

While you don’t see them every day, bitwise operations are important. Everything at the hardware level is represented in binary (base 2, 1 and 0). Bitwise operations allow programmers to operate directly on the bits used by variables. This is very useful with enums, since you can have one variable be multiple values.

To understand how one enum variable can be multiple values, you need to understand the bitwise AND and OR operations.

An OR operation compares two sets of bits. If either bit is 1, the result is 1, else, result is 0. In the below example, set 1 is the value of enum option 1, and set 2 is the value of enum option 2.
Read more…

Categories: Uncategorized Tags: ,

Grid computing with Linux, Game engines

September 6th, 2009 No comments

If you have several old PCs lying around, you could turn them into a grid, a single computer that uses all their resources together.

I haven’t found a good use for a grid personally, but I found a nice piece software to setup a SSI (Single System Image, basically means one OS running on multiple machines) grid, and a nice tutorial.

If I had a grid running MySQL, the 35 million row DB table I use would probably search pretty fast.

In other news, Panda3D (a game engine, usable from C++ or Python) looks like it has excellent documentation, something that a lot of engines are lacking. I’m also wondering if I should buy a Mac now that Snow Leopard is out (that’s when I said I’d buy one)… I wonder if I’d really use the Mac applications…