Kate color schemes

June 21st, 2009

I’m getting more impressed with the KDE news each day. One of the greatest tools I found on it is its default text editor, Kate. However, I’ve been looking for new color schemes (personally I hate to code on white background), but I didn’t find anything that I could use on the new Kate (KDE 4.2+).

Today a friend of mine just installed Kubuntu 9.04 in his machine. One of the first things he did was change the KDE color scheme to a darker one. Then he started out Kate and voilà! Kate also followed the color scheme that was set to KDE itself. No, don’t go try it right now.

Ok, I went to my PC like a child runs for a lolipop to change my KDE’s color scheme. Changed it; what now? Oh, start Kate. Damn, I didn’t notice any change on syntax highlighting. Everything else (related to Qt) was darker. Everything but my Kate color scheme. You know, I just got frustated. Anyway, still didn’t quit.

Desperate, I immediatelly closed Kate, removed every Kate config file from my system – please don’t do that – then started it again. Whoah! Its color scheme was darker too! First thing I did: try to save that color scheme (Settings » Configure Kate » Fonts & Colors). Done; yay! I got a darker color scheme. Then I tried to copy the color schemes from other KDE ones by closing Kate, changing KDE color scheme then starting Kate again. Once again I got sad: The color scheme didn’t change. It was just the same than the previous scheme.

kate screenshot

I started to hack on the Kate’s config files ~/.kde/share/config/kateschemarc and ~/.kde/share/config/katesyntaxhighlightingrc and I noticed that the scheme kate - Normal was there. Once it should inherit the global KDE colors, it shouldn’t have any predefined color setting. I just erased it and restarted Kate. Alright this time, it inherited the global colors as it should do. Then I repeated all this process for almost all the color schemes I have on my KDE.

You can get the files I did for myself here. If you don’t have any personal change to these files, you can safely overwrite them with my ones. Now, finally, I have my favorite text editor with various dark color schemes, and so you can do easily. [If you write another scheme, share with us!] ;)

Applications ,

Unavailable USB devices on VirtualBox 2

May 20th, 2009

I’ve been facing an annoying issue to use my USB devices on a VirtualBox guest system (on a Kubuntu host). The problem was that the devices were listed but I couldn’t use them – they were “unavailable”.

unavailable USB devices on VirtualBox list

Just to confirm, I ran this command on a shell:

VBoxManage list usbhost

(if you run this too, make sure that your devices aren’t busy)

After some research and a talk in some IRC channels, I found out what I just suspected: it was just a permission issue.

Some deeper look ups and I found two simple possible ways to solve this

  1. [try this one first] Add yourself to the vboxusers group.
    sudo usermod -a -G vboxusers $USER

    After this, log out then log back in to the change take effect. Don’t need to restart you system. Now the USB devices may be available on VirtualBox.

  2. Change permissions to the device address

    The previous solution must work, but anyway, here’s an alternative solution. Has some security disadvantages, though.

    • Run this: VBoxManage list usbhost and copy the address of your device. It may begin with /dev or /proc and end with a number (like 003.
    • Set read+write permission to the address:
      chmod 777 /dev/address
    • Then turn on your guest OS on and you might see your USB device available.

Hope it solve the problem. =]

Applications

Table[less]

April 24th, 2009

Once upon a time, the humanity had a great idea: use tables to build their site layouts.
But no, that was not a great idea.

When we use tables for layout, we’re messing our HTML code and ignoring one of our best web development friends: CSS.

is not an element made to build layouts. We have it to put tabular data. Yea, like a data grid or something like that.

So, smarter humans had a better idea: clean the mess that layout tables do and use the element that was made to build layouts: <div>. They created a concept called “Tableless” (read more).

That was really cool but, unfortunately, there were people who got traumatized with tables and then decided to don’t use it anymore, even if it was for tabular data. So they started to replace all their tables with divs: they misunderstood the Tableless concept.

<table> is not an invalid or deprecated element (like <marquee> is). It has its meaning and use. Like <div>s are for layout, <table>s are for tabular data only. Don’t mess the ideas and don’t be afraid of using tables where they can (and should) be used. Then show this post to those who tell you that tables are ugly. ;)

Web Development

the utm project, growing

April 24th, 2009

Hello.

These last months, I’ve been working on the utm js library, and I’m glad that the community is growing and some of you readers are contributing to the project.

Next step is finish the new website and write the documentation pages.

Don’t you know the project yet? Check it out on the site or join our channel (#utmjs at irc.mozilla.org) and get involved! You’re all welcome and any help would be very appreciated.

For now, we need some special attention on:

  • new website
  • documentation
  • design projects
  • project management

Hope to see you there. And no, you don’t need to be an expert on JavaScript; I’m sure that anyone can help.

Soon, a new blog only for the project will be available.Technorati Tags:

JavaScript, utm

OOP JavaScript part 1: the constructor-prototype model

January 17th, 2009

How do we handle “classes” with JavaScript?

Some people says that JS is not object-oriented. But yes, it is. The difference between JS and some others OOP languages is that there are not “classes” in JS. There are “constructors” and “prototypes”.

Constructors

Nothing more than simple functions. You can create an instance by simply calling the function with the new keyword before. Now, by default, the function (then called constructor) returns an instance, a new object.

// create the constructor
function MyConstructor() {

}

// create a new instance
var myInstance = new MyConstructor();

Ok. And where are the methods, properties and all those stuff?
Like any other function, we can use arguments and put their values into the instance, that is referenced inside the constructor by the name this. Firstly, the instance is nothing more than a writable object; so you can add anything you want to it.

function Car(color) {
	// now the instance have the property 'color'
	this.color = color;
}

var myCar = new Car('red');

Prototypes

The instances also can inherit a bunch of defined stuff. Here we go, prototyping. Now we can predefine methods that can be used directly from the instance. So, every instance – including the already created ones – will have the stuff defined into their constructor’s prototype.

function Car(color) {
	this.color = color;
}

var myCar = new Car('red');

Car.prototype.changeColor = function (color) {
	this.color = color;
};

// now, myCar.color = 'blue'.
myCar.changeColor('blue');

We can write any object-oriented app with JavaScript, following the constructor-prototype concept; but some people just don’t like this concept. Therefore, they can use some script that “simulates” the classic class syntax. Sometimes it can make our code more organized. It’s not a huge advantage at all, but just coding preferences: nothing that we can’t do with pure prototyping.

JavaScript

How long..

January 17th, 2009

Sorry, readers. I do not plan to abandon this blog! =P

Recently I moved and there was no connection in this new place. Now I just found a way to connect my PC and here we go, back to the “normal life”.

Uncategorized

Banshee: watching and listening at Linux

December 12th, 2008

Some time ago I just found out another media player in my Ubuntu.
I was trying to find something more than the Ubuntu’s default players, and I got surprised with Banshee 0.2. It was really cool. Great tools, great music organization.

Then, after some days enjoying my new prefered music player, I finally had one idea: how about visit the Banshee website?
So I went there and saw that the current Banshee version was already 1.2. Damn, I was outdated. The Hardy Heron’s repository was kinda poor if I’d expect for newer versions of applications like Banshee. Today I use the version 1.4.1 on my Intrepid Ibex.

I downloaded and installed it on my PC and, wow, it wasn’t a music player anymore. It was a media player. Yes, music + video organized in one application.

Some of the things I like much in Banshee are:

Media organization and access

It’s very easy to organize and search for your media files: just sort, type and list.

Banshee Media Organization

Banshee Media Organization

Editing  Media Information

You can select multiple media files then update their meta information.

Banshee's Track Editor

Banshee's Track Editor

Smart Playlists

Banshee can go beyond organization with smart playlists.

Creating a smart playlist

Creating a smart playlist

It has many other features, like CD burning and extraction, media synchronization to media devices and album art automatic search & download.

Wanna see more? Go to banshee-project.org, download the latest version and enjoy!

Applications , ,

Now it’s about everything

December 12th, 2008

Until somedays ago this blog was only about JavaScript-related contents. Now, to make the blog richer and more interesting, I’ll make this a multi-subject blog.

So, from now on, many other themes will be used too, about web development, programming, technology and some other geek-like stuff.

Enjoy! =]

Uncategorized

utm + Sizzle

December 11th, 2008

The utm JavaScript library now is going to use the John Resig’s Sizzle.

Sizzle is a lightweight, fast and pure-JavaScript element selector that uses CSS3-based queries.

Somedays ago, while I was talking to John (the creator of Sizzle and jQuery), I decided to join the Sizzle project and integrate it with utm, as other JS libraries out there are joining too.

Why? Weren’t you writing a selector engine for utm?

Yes, I was. But both utm and Sizzle are open source and the Sizzle code is really, really great. So what’s the problem in using and contributing with it, like any other good open source software? =]
We’re not here for a competition, I don’t want to prove that utm is better or not. I’m trying to make two projects grow together.

Ok. So why don’t you use jQuery?

jQuery is an awesome library, but utm has a different focus. Its objetive is not just provide Ajax features or effects, but to provide an Web Application platform – this is exactly what I’m working on.

So, if you want, join the project too and let’s make it all better. =D

JavaScript, Web Development, utm , , , ,

What’s JSON?

September 28th, 2008

Have you ever heard about JSON? I’m almost sure you have.

JSON (JavaScript Object Notation) is an easy to handle and understand data format used everywhere.

As its name says, it’s based on the way that JavaScript can handle objects, like this:

var myCar = {
	color: 'red',
	doors: 5,
	wheels: 4
};

It’s easy to understand, isn’t it? I have a red car, that have five doors and four wheels.

Now imagine some data got from a database in this format. It would look like this:

var users = [
{ name: 'E. Myller', genre: 'male' },
{ name: 'Voziv', genre: 'male' },
{ name: 'K. Hellen', genre: 'female' },
{ name: 'Elomar', genre: 'male' }
];

It’s also easy to understand, right? We have four users: E. Myller, Voziv, K. Hellen and Elomar.

“Ok, uncle eMyller. It’s pretty beautiful and clean. Any other reason that would make me use it from now on?”

Yes. The usage. Now you can, for example, handle that data got from a database as a simple JS object. Take this example, using the previous code:

var user; while (user = users.shift()) {
	alert(user.name);
}

Easy to understand: it loops through the users and shows the name of each of them.

Many languages today have native support for it. At web, it’s even more useful because we can join some JSON data with Ajax requests and get awesome results easily.

Use your creativity and do things quickly and easily with JSON!

JavaScript, Web Development ,