Home | Content | Search

Tuesday 8 April 2008

IE7 And '

Well, I learned something today.

The XML entity "'" is not displayed properly under IE7. Instead of showing the single quote, as I would expect, it shows "'".

' works well under FireFox, IE6, IE5, Safari and Opera. But no longer under IE7.

The most understandable explanation I've found about this is that it is part of the XML standard and not HTML.

To which I would reply: yeah, but I'm doing XHTML.

To which I've read the insightful reply:

If you're doing XHTML, the world is not ready for you.

Another hilarious and insightful answer to the problem was :

Use ' instead of ' ?

So I'm resting from the shock and looking at my HTML transformation libraries wondering if there is a tsunami of problems that is waiting for me if I remove the conversion from single quote to the ' entity.

I really don't expect any troubles as we never used single quotes to delimit parameters within HTML and we never used the HTML transformation methods to send text to javascript.

Still, one wonders about the woodpeckers and civilization.

Maybe Microsoft will let out a patch?

LOL.

For once, it seems that it is MS that is sticking to the standards. Brave new world?

To clarify the standards:

&apos is not part of HTML: W3CCharacter entity references in HTML 4

But is a part of XHTML: W3C xhtml DTD entity set: Special characters

Here's a link to an entity test, devised by W3C.

The whole issue is also described in Wikipedia - Entities representing special characters in XHTML

Thursday 3 April 2008

limiting CPU usage of a task under Linux

I have a few tasks that I run at irregular intervals on some of my servers.

Some of them actually eat up quite a bit of CPU - something that I don't want on certain servers.

Running the task when the CPU is normally less used is nice, but I was looking for a way to start the task with a very low priority.

Basically, if anything else than that particular task wants the CPU, give it up. Otherwise, have a ball.

After a bit of search, what I found was the command called "nice". "renice" is also nice. Uhm... well.. its not "nice", but its nice.

Moving on.

Each task is given a "nice" level, which is the process' stat about how nice it is with other processes when it comes to sharing the CPU. The "nice" level is used by the kernel to determine who gets the CPU's attention.

Basically, the higher the level is, the more prone the task is to share CPU resources. The lower the level, the more selfish the process becomes.

The "nice" commands starts a process and assigns it a "nice" value, while "renice" allows you to change the "nice" value of an existing process.

For example, because I love examples, you could do the following weird backup command:

nice -n 20 zip -r /root/ugly_backup.zip /var/www/*

Which would start a low-priority (nice=20) task to recursively zip all of /var/www within the fule /root/ugly_backup.zip

(and people, please, don't backup this way if you haven't been forced to by someone with a gun or a big cheque)

NB: if you see your low-priority task run with a high CPU attribution, don't panic - it just means that no other tasks is asking for CPU. And your web server's CPU don't have to sit on its tiny metaphorical sillicon hands while waiting for your visitors to take a peak at your awesome, (hopefully) relevant, web page.

While I'm in the process of writing this reminder note for myself, I feel that it is nice to add, for the benefit of my memory, that by ending a command line with an ampersand symbol &, the task will be started in the background.

Saturday 23 February 2008

Looking for Music Mixing & Midi Software

I'm currently playing with various Windows-based software to build songs using my midi controller.

My goal is to be able to build songs by myself using samples, loops, midi-based tracks and recording my voice / other instruments.

I got myself an M-Audio Oxygen49 midi controller a few months ago. Nice little piece of hardware.

I've been toying with various demo versions of software since then, planning to purchase when I am at least 90% convinced of my happiness with the software.

On the Mac platform, they have a nice piece of free software called 'Garage Band'. I've never used or seen it, but I hear its quite good.

I've been searching for similar software for Windows - not necessarily free - that would allow me to take advantage of all the buttons and sliders of my Midi controller.

There's one person I found on the lookout for such a product that keeps a blog about finding 'Garage band for Windows'. His research is a good source of information.

So far, I've been considering various software and just can't really decide.

Fruity Loops

I've been toying with FL for a while. It is very flexible and powerful.

The demo version comes with a collection of great synthetic instruments. I've kind of fallen in love with their Sytrus synth.

Besides that, the samples that comes with it are kind of bland and generic. Maybe the full version is more interesting. Can't be sure.

One of the things that I love about it is its ability to bind just about any control in the software to the programmable keys of my midi controller. This is something I really like and that I have a hard time finding in other products.

However, I have not actually managed to find a real use for it... I'm still too much of a neophyte with all the mixers and effects to actually tweak the multiple settings - which I guess is where the binding to the keyboard comes in.

Sadly, for some reason, I can't bind the 'play' and 'record' buttons on my keyboard, which would be a tremendous help.

I've been experimenting with its recording functions, but I keep getting weird delays with the keyboard and the sound. I'm guessing its because I have a crappy sound card. But I have doubts on that, as I don't get these kind of problems with other software.

All in all, its pretty good. My hurdle comes with price.

The basic prices are reasonable, really. Especially considering that a purchase comes with lifetime of updates.

What annoys me is that most of what I love about the software doesn't come with the basic version (100$). I loose Sytrus and all other advanced synth instruments, I loose recording of audio as well (wtf?).

The 150$ version has recording and audio editing enabled. That's good. Sounds reasonable. But I won't get my synths unless I extend an extra 150$. An that's going over my budget line.

Of course, I could probably get along just fine without it and use other samples, soundfonds and VST intruments that can be found free or cheap around the net.

Still, it bugs me.

Mixcraft 4

I've just started playing with that one. Sadly, the demo lasts only 7 days, which is really not enough. I almost prefer FL's demo - which has no limit, but does not allow you to save your work.

Anyway, it is a whole lot less expensive than FL. It is simpler and more intuitive - from what I hear, its pretty close to Garage Band.

The instruments that come with it sound decent enough to me.

Recording functions have been working fine. No odd delays with the midi.

So far, sounds like a clear winner - especially on a tight budget.

As far as I know, it doesn't come with free lifetime upgrades, as FL does. But it has a decent price tag and, frankly, makes for an easier to understand business model. I mean, once everybody has FL, how will they afford to build new versions? Anyway. That's besides the point.

Mixcraft4 is the first version to have midi. So while the pitch bend wheel works as expected, there's no way to bind any of the keyboard controls to anything. I don't know if they plan on doing anything on that front - I'll probably drop them a line to see.

And that's probably the only thing holding me back on this one at this point.

I've seen a bit of what Mixcraft can do. I think it fits my current skills.

However, I've been playing with FL for quite some time and I've got to learn the intricacies of the software. I feel it is much more advanced and that I could get frustrated with Mixcraft's limitations fast enough.

One thing that I'm missing is all the automation recoding (and, as mentioned earlier, keyboard bindings).

Then again, that might be in a few years... Mixcraft has time to get better... and I have time to save for the big version of FL if that's what I want at that point.

Jury's still out.

Sony Acid Music Studio

The affordable version seems nice.... but for the same price, it lacks the automation you'll find in FL.

The full version with automation and all the bells and whistle is just too expensive for a non-pro.

Oh, yeah, and I really like its interface...

Ableton Live

Sounds amazing. But I started with looking at the price and left the building. I'm not about to put 700$ on this. Except if it mows the lawn, shovels the snow in the drive way and changes diapers. Then I'd think about it.

Conclusion, for now...!!!

I'm alternating between Mixcraft and FruityLoops. When I'm on the verge to decide to go for Mixcraft, the lack of automation makes me think twice about skipping on FruityLoops.

Then, the higher cost of FL and my current dissatisfaction with the included samples brings me back to Mixcraft.

I guess I'll keep experimenting with the demos...

Wednesday 30 January 2008

EA support & The Sims On Stage.

I've been playing with a Web application called The Sims On Stage.

Basically, its an online community where people can share artistic tidbits such as songs, poems, videos, karaoke. I've been having fun with the karaoke part.

One of my ways of working through this is that when I hear a song I want to consider recording, I add it to my list of favorite songs.

I stumbled upon a little "bug" on their Website. It's a simple UI bug: every list in their application is broken up in pages of 20 items. Nothing wrong with that.

But in the list of favorite songs, they forgot to put in the page navigation controls - you know the "next page" and "previous page" links that we are all so fond of...

The functionality is there... see, if you go to my list of favorites songs, you'll see 20 items. At the time I'm writing this, I actually have 27...

Notice the lack of "next page" link in there. Well add a "startAt=20" parameter to the URL and you'll get the songs on the second page.

All this stuff being beta, and myself being a developer, user and tester of the system, I decided to report the issue to Electronic Arts.

I am no confronted to the "dreaded" first line of response.

There's nothing wrong with first line support in itself. Its frustrating when you can do you own first line, but first line has a reason to exist and I do my best to remain calm and help then realize that I need second line - it also backs me up in case I was being stupid and just didn't see an obvious solution :)

Anyway, I go through the hassle of creating an account for support (yes - its not the same account as for accessing the service) and submit the issue using what I believed was a simple enough message.

Navigating the favorite songs in Sims On Stage, there's no links for changing pages.
The functionality is there, if you use the page parameters as they appear on other sections of the Website... the links are just not displayed.

Of course, I should have known better... this is usually to dry, straight to the point and technical... words like functionality and parameters are not common to all people. And, in my experience, most people just ignore words they don't understand.

I received this typical first line answer:

Hello,
Thank you for contacting us here at Electronic Arts Technical Support. I'm sorry that you’re having difficulties with The Sims On Stage.
It sounds like you need to install or reinstall the Flash plug-in.
Instructions on how to uninstall Flash can be found at this link.
... (various links)
If this does not correct the issue please it could be a problem with your current browser. Depending on your hardware configuration a different browser than the one you are using might work better. Try to switching to another browser like Firefox, or Internet Explorer 7. If you are using a Mac you most likely have the Safari browser. Please try it. Otherwise try switching to the Firefox browser. You can get it from www.GetFirefox.com.

And it is follows by an invitation to search through knowledge base.

Okay, so, first line answers usually go with the solution that fixes 95% of the problems and, in the case of Sims On Stage, yes, reinstalling Flash probably fixes most issues.

Of course, if someone would've taken the time to actually read my original email and have at least working knowledge of the product they are supporting, they could have figured that flash had nothing to do with it...

Nevertheless, no to be deterred from my willingness to help with bug squashing, I reply with the following, hoping to clearly illustrate the problem and give the impression that I don't really care about getting help, but I am more about trying to help them...

Hi there.
This has nothing to do with flash.
Its the Web site.
If you go to the "favorites" section of "My Studio" and go through the favorite "Songs" - the one that you tag because you want to record them later...
If you have tagged more than 20 songs, you'll need page controls to navigate - you know, the "previous" and "next" links. In the "songs" section, the user interface does not show page controls.
This is a bug in the Web server part of your application - the one that generates the HTML. It has nothing to do with the client side and even less so with flash :)
You should let this issue reach the development team so that they can fix this small oversight for the next update of the web server software.

A few days later I'm getting hit with this response:

Hello Eric,
Thanks for contacting EA Technical Support! I am sorry that you are having difficulties with The Sims On Stage.
Customer feedback is greatly valuable to Electronic Arts. To comment on any of our titles, please post on the appropriate game forum. These forums are maintained and monitored by the community leaders and production team. By posting on these forums you will be able to submit direct feedback to the appropriate person. Please make sure that you follow the EA terms of service when posting. You must have an EA member account in order to post on the forum.

Follows links to forums (in which, by the way I have found no forums related to Sims On Stage).

I don't know about you, but I'm getting the feeling someone is not reading... or just plain not understanding my emails.

I think my willingness to help them with beta testing has been squashed...

(Oh, and feel free to listen to my songs and give me ridiculous amount of points)

January 31st: UPDATE

It seems that my whining actually worked... I have been notified by one of you readers (Thanks Tx!) that there is now a "Next" button where there only was a void.

Huzzah!!

Thursday 24 January 2008

mod_rewrite cheat sheet

Help Guide to mod_rewrite

Just found that, searching on the net for a comprehensive quick-guide to mod_rewrite (again).

mod_rewrite is cool. I used it "often", as in it solves a good number of "beautiful url" problems.

But I say "often" with quotes, because I'm not using it often enough for the syntax to remain in my head.

This is a nice cheat sheet to pin on your wall at work :)

Friday 7 December 2007

Accessing occluded outer class members and methods from inner class

I'm posting so it'll help me remember - I aways forget that stuff, because I rarely need it.

Okay, so, you got class "A", which is an "outer" class, which defines "B" as an "inner" class (called A.B).

class A {

 public void someMethod() {}
public class B {
}

}

Let's say an instance of A.B wants to call a method from A.

That's easy, because methods and members from A are directly visible to B.

The issue comes when B wants to class a member or field of A that has the same name as a member or field of B.

The this "pointer" becomes kind of ambiguous. When in "B", this refers to the instance of "B", and not to the instance of "A".

I'm here to tell you that yes, you can access the this of A!

Ready? Here's the syntax - that will only work while within "B" (of course).

Lets say that you wanted to call the "toString()" method of "A" from "B":

A.this.toString()

Yes, that is "<outerclassname>.this.<member or field name>".

Have a happy day.

Friday 5 October 2007

Lost my eth0 on my way to upgrade

Long time no post...

Today's post is not too entertaining, but might help someone. Who knows?

So I was making various tests upgrading portage profiles, too see how systems react before I try doing it on more important servers.

During my tets, on an old machine I never updated, I was trying to update "baselayout" (via "emerge -av baselayout"), as part of the thing I needed to update by moving to the 2007.0 profile.

Okay. So on that machine, I couldn't update because a silly old version of dhcp was installed.

Fine, I said. I removed the package - thinking I'll update later.

One "emerge -C dhcp" later and my baselayout installed fine.

All is well, I thought. Lets see if it holds water and reboot everything.

Forgettign about dhcp.

So, you know where I'm going, right?

The server boots fine, but now my connection to the network is also gone.

Of course, I can't emerge dhcp back (as I should've before rebooting...)

So here's how to get your network card back up again, without dhcp:

ifconfig eth0 up <ip_address>

Where <ip_address> is a valid ip address for your machine.

route add default gw <gateway_ip_address>

Where <gateway_ip_address> is the ip address of your gateway server.

From there, I could get my dhcp back up again and everything's fine.

Thursday 22 March 2007

Tomcat, out of memory under gentoo

Sometimes, you just need to give tomcat more than its 64megs that comes out of the box.

There's the nice way to do it under gentoo:

edit /etc/env.d/21tomcat - it should already be there.

Add the following line to it:

CATALINA_OPTS="-server -Xms128M -Xmx256M"

This means you're telling catalina (the tomcat engine) to start with an initial heap size of 128 megs. It also tells it to set its maximal heap size to 256 megs.

/etc/env.d is Gentoo's way of nicely handling global environment variables. But its not all magic. You need to let gentoo know you've made changes.

Run the following command:

env-update

This will regenerate the environment variables. This is neat. But the shell you're currently running doesn't know that. You could log off and log back on, but I've got better.

source /etc/profile

Now, if you run echo $CATALINA_OPTS you'll see the CATALINA_OPTS variable is set to what you put in the environment file.

This is all neat, but tomcat needs to be aware of this as well... so you'll need to restart it.

/etc/init.d/tomcat5 restart

Enjoy your enhanced heap size!

Saturday 17 March 2007

Gentoo and new timezone settings

Your gentoo server is not at the proper date? Well, perhaps you did not properly update to the new daylight saving settings?

read more

Friday 9 February 2007

Making PHP4 and PHP5 coexist on a WebServer

New open source software is coming out and wants to use PHP5.

Meanwhile, old open source software has been heavily modded and can't be updated to the latest release that has been fixed for PHP5.

And you really don't have the time, resources or willpower to go through a cesspool of community-spewed, fermented, piece of trash code to fix it.

Better let it run under PHP4.

It's a possible scenario.

There are many articles dealing with that theme:

Below, you will find the quick and dirty, step-by-step guide I used to setup the following:

  • PHP4 using mod_php (because the bulk of my PHP needs runs PHP4)
  • PHP5 using mod_fastcgi
  • Then, you can configure paths (or whole domains) to run with whatever PHP version you like.

read more

Tuesday 21 November 2006

MySQL 5 does not like MySQL 4.1.

Reading about the new features in MySQL 5.x go me really excited about upgrading.

See, we're running 4.1 on our production servers. Being a careful person, I decided to fit one of our dev machines with MySQL 5.0 to see how the switch would go.

read more

Saturday 11 November 2006

Gentoo, otrs, apache and mod_perl [Part 2]

I will now detail the steps on how I got OTRS working using mod_fastcgi instead of mod_perl.

read more

Gentoo, otrs, apache and mod_perl [Part 1]

In my spare time, I've been trying to get OTRS to work with acceptable performance on my Gentoo box.

OTRS is a very complete perl-based Ticket Trackign system. Using Perl as simple CGI simply kicks the sh*t out of my home box's CPU.

I wanted to run it under mod_perl.

That was back in july...

read more

Friday 10 November 2006

ERROR: sys-libs/glibc-2.4-r4 failed

Trying to do a system-wide gentoo update using emerge, I ran into a compile error trying to update glibc:

*** These critical programs are missing or too old: gcc
*** Check the INSTALL file for required versions.

!!!ERROR: sys-libs/glibc-2.4-r4 failed.
Call stack:
ebuild.sh, line 1546: Called dyn_compile
ebuild.sh, line 937: Called src_compile
glibc-2.4-r4.ebuild, line 1174: Called toolchain-glibc_src_compile
glibc-2.4-r4.ebuild, line 257: Called glibc_do_configure 'nptl'
glibc-2.4-r4.ebuild, line 925: Called die

read more

Monday 30 October 2006

Tricks for making Websites sell better..

My latest article on Secure-eBook's blog has just been posted.

This article gives a few tips on how to make an eBook sample more apt at selling.

The last three in there are also valuable tips when trying to streamline Web pages as well. Especially Web Pages designed to sell a single product:

  • Your eBook sample should talk only to your potential clients.
  • Keep it short. Organize your content well.
  • Always invite your reader towards action. And not only in your closing.

If you're into this kind of material, check out "5 tips to get your sample eBook to sell" for more details.