Mandoo core 2.0 has arrived!

0
Filed under JavaScript, Mandoo, Web Development
Tagged as ,

The Mandoo JavaScript Library team has spent the last months in 2009 to fully rewrite the project core. So, as a New Year’s gift, we’re proud to announce the official 2.0 release! – that is already followed bt 2.01, actually.

What changed:

  • Upgraded Sizzle CSS selector engine to the latest version and compressed it with Google Closure
  • Faster and even more flexible DOM API
  • A more powerful animation engine was introduced, faster, making complex easings/animations easier
  • Effects has been added to a bundled plug-in
  • Modularization engine concept refactored
  • Many bugs were killed and features added

The Mandoo core is now even more extensible, easier than before. Fun fact: the uncompressed core is now 41.5kb (against ~66kb from 1.3x version) – we gained enhancements in all of the aspects.

All the code is at the Github repository, go grab it.

Note: if you find any bug on this new version, please tell us. Also, the new documentation is being written; if you are interested, please fork it and help.

Enjoy – and contribute! :P

New home

1
Filed under Uncategorized

Hello, readers :)

I apologize for one day with the blog off; the reason for that is a great news, though: we’re now in a new home.

This blog just got out from a good shared host and went to a VPS at Linode, now in an Nginx server. Now we have the power to see a faster blog. :D

How to connect with 3G through Kubuntu 9.10 (Karmic)

1
Filed under KDE, Linux
Tagged as , , , ,

The new Kubuntu Karmic was released yesterday and I just installed it here. Unfortunately, I could not connect to Internet through my Huawei E156 (3G).

I’ve been watching to the development of this new release, and I noticed that a previous version of the plasma-widget-networkmanagement (that comes with knetworkmanager, the application that let us manage our connections) worked fine with 3G. So I just installed this version here and now I am able to connect again.

Download here the older version (0.1~svn1023224-0ubuntu1).

Once you’ve downloaded it, open a terminal, go to the directory you just downloaded the package and run:

$ sudo dpkg -i plasma-widget-networkmanagement_0.1~svn1023224-0ubuntu1_i386.deb
$ sudo aptitude hold plasma-widget-networkmanagement

Now just restart knetworkmanager (or logout / login) and your 3G connections will be working.

Pâté, Kate and Kubuntu (KDE 4)

7
Filed under Applications, KDE, Linux, Python
Tagged as , , ,

It’s quite a long time I’ve been trying to run this awesome plug-in for Kate (Pâté) on my Linux box, a Kubuntu jaunty (with KDE 4.3).

Recently, when I got contact with Paul, the Pâté creator, we got it working here (Thanks, Paul!). I was very excited to see things like expanders working on Kate, and I like – very much – to have the power to enhance my favorite text editor easily.

So, here’s the magic I gotta do to install Pâté:

$ sudo aptitude install cmake kdelibs5-dev kdesdk-dev python-kde4-dev python-qt4-dev sip4

After that, you’re ready to compile Pâté and enjoy it. Compiling: In a shell, switch to the Pâté directory that you just downloaded from the git repository.

Then, run these commands (you might be familiar with them):

$ mkdir build && cd build
$ cmake .. --DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix)
$ make
$ sudo make install

There are some cool bundled plug-ins already. Can’t wait to use them?

$ cp -r src/plugins $(kde4-config --localprefix)/share/apps/kate/pate

One of these plug-ins is the awesome Expander, that can add code snippets to your code like Textmate does. Cool, huh? Now, start Kate, go to the plug-in list and voilà. Pâté is there. enable it and happy coding!

I noticed that it’s very easy to develop a python plugin for Kate. Please help us to make Kate even better and share your ideas with the community!

IRC: #kate @ Freenode

Using APT offline

0
Filed under Linux
Tagged as

Recently I had to set up some Kubuntu boxes but I faced an old problem: I got no Internet.

I could easily use AptonCD to make a CD with all my apt cache, but sometimes it’s kinda weird to use it, since I have make a ISO, copy to the other PC, add as a repository, etc.

I’d like to be able to simply copy the .deb packages from my apt cache to the other PC then use them with something like aptitude upgrade. But now I got another problem: gotta update the packages lists, but I don’t have a Internet connection. Ok, no way, then. But wait! “Accidentally” I found out how to do this! And it’s quite simple:

  1. First, update your own PC (the source, to reuse the cache):
    sudo aptitude dist-upgrade
  2. Then, clean the old packages in cache, so you don’t have any of them repeated:
    sudo aptitude autoclean

Ok, our PC is prepared. Now, let’s prepare the other, recent installed, PC (keep in mind that all the paths below are the same in both machines, so you’ll just synchronize the target PC to the source one):

  1. Copy your repository lists to the other PC. These files are in the following path:
    /etc/apt/ – Mostly of times the only list file is /etc/apt/sources.list.
  2. Copy all the list updates – a “custom” aptitude update in the other PC – from the following path:
    /var/lib/apt/lists
  3. Copy the packages from your cache:
    /var/cache/apt/archives/*.deb

After doing this, you can normally proceed with the upgrading, without Internet. Just run a sudo aptitude dist-upgrade in the target PC after these steps done. Enjoy! ;)

jQuery, Prototype, Mandoo – creating DOM elements

0
Filed under JavaScript, Mandoo, Web Development
Tagged as , ,

While I was porting the Lightbox library to a Mandoo module, I saw the way that Prototype handles elements creation and remembered the jQuery "different" – dirty, actually – way. I tweeted about it and got some replies from others JavaScript developers, dirs and gabrielgilini. This post will show the three different ways these libraries offer to create DOM elements trees. First, the jQuery way:

$('#grid').append(
'<tr class="even">' +
	'<td width="250">' +
		'<input type="checkbox" id="check"/>' +
		'<input type="text" id="item"/>' +
	'</td>' +
	'<td>' +
		'<a class="link" href="#" title="delete this item">Delete</a>' +
	'</td>' +
'</tr>'
);

Well, personally I really don’t like to mess HTML code with my JavaScript stuff (I am almost sure that neither you do). Thinking this way, we have another option, with Prototype:

$$('#grid')[0].appendChild(Builder.node('tr', {className:'even'}, [
	Builder.node('td', {width:'250'}, [
		Builder.node('input', {type:'checkbox',id:'check'}),
		Builder.node('input', {type:'type',id:'item'})
	]),
	Builder.node('td', [
		Builder.node('a', {href:'#',title:'delete this item'}, 'Delete')
	])
]));

Better, but we want something cleaner, simpler. What about joining the best ideas? The Mandoo way, using CSS selectors to create elements (why not? :D ):

u('#grid').append('tr.even')
	.append('td[width=250]')
		.add('input#check[type="checkbox"]')
		.add('input#item[type="text"]')
	.up()
	.append('td')
		.add('a.link[href="#"][title="delete this item"]', 'Delete');

Mandoo helps you to keep things simple, organize your code and follow the best JS coding practices. Share your thoughts and happy coding! :)

Kate color schemes

6
Filed under Applications
Tagged as ,

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!] ;)

Unavailable USB devices on VirtualBox 2

0
Filed under Applications
Tagged as

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. =]

Table[less]

0
Filed under Web Development
Tagged as

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. ;)

the utm project, growing

2
Filed under JavaScript, Mandoo
Tagged as

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: