Writings Photos Code Contact Resume
English

You are here

Written in English.

Acer Embedded Controller no spinlock patch updated to 2.6.16.20

Submitted by msameer on Mon, 12/06/2006 - 1:25pm

OK, Without this patch, My laptop suffers from jumpy touchpad and sticky keys. It's mainly because the Linux ACPI implementation is trying to access the battery state through the laptop embedded controller. The problem is that this access causes lost interrupts which leads to the above problems.

The patch was only for 2.6.14 and was not updated to 2.6.16. It doesn't apply. I was stuck until I decided to port it. It's working fine since a couple of minutes ;-)

Here it is anyway. But be aware. I feel the touchpad is not in the usual state I used to. I'm not sure how.


Drupal, The rules, Start with 3...

Submitted by msameer on Sun, 14/05/2006 - 2:27pm

Rule #1: When you create a module, Never do

<?php
function foo_menu($may_cache) {
$links = array();
 if (
$may_cache)
  {
  
$links[] = array(
                
'path' => 'foo/foo',
                
'title' => 'FOO Title',
                 
'callback' => 'foo_page',
                 
'access' => TRUE
                 
);
}
 if ((
arg(0) == 'node') && (is_numeric(arg(1)) && (user_access('administer foo'))))
{
 
$links[] = array(
          
'path' => 'node/'.arg(1).'/foo',
          
'title' => 'Foo 2',
          
'callback' => 'foo_2_page',
          
'callback arguments' => array(arg(1)),
          
'access' => user_access('administer foo'),
          
'type' => MENU_LOCAL_TASK,
    );
}
return
$links;
}
?>

Always do:

<?php
function foo_menu($may_cache) {
$links = array();
  if (
$may_cache)
    {
     
$links[] = array(
                      
'path' => 'foo/foo',
                      
'title' => 'FOO Title',
                      
'callback' => 'foo_page',
                      
'access' => TRUE
                      
);
}
else {
    if ((
arg(0) == 'node') && (is_numeric(arg(1)) && (user_access('administer foo'))))
{
    
$links[] = array(
               
'path' => 'node/'.arg(1).'/foo',
               
'title' => 'Foo 2',
               
'callback' => 'foo_2_page',
               
'callback arguments' => array(arg(1)),
               
'access' => user_access('administer foo'),
               
'type' => MENU_LOCAL_TASK,
                 );
}
}
return
$links;
}
?>

Rule #2:
NEVER EVER have a module called foo and a theme called foo, The module foo_help will be called without an argument and you'll get a warning.

Rule #3: The ultimate: Screw Amr, Drupal 4.7 is not buggy, The problem is between your keyboard and monitor.


CLRSpell, My first and hopefully last VC++/.NET application.

Submitted by msameer on Fri, 12/05/2006 - 9:30pm

So, The wordlist has been growing lately, We hit 250,000 words, I tried hard not to put incorrect words but a lot of incorrect words went in, Manual review doesn't seem right to me, It'll take years!

There's already an Arabic spell checker shipped with Microsoft Office 2003, Why not use it ?

I tried to do it manually but hell, No way!

I tried to discover how can it be coded, Neither VBA nor VC++ helped me, Of course it's me here as I'm not a windows developer at all.

Diaa Radwan, One of our LUG administrators and the master of talking proposed that I wait for him, He'll ask any .NET developer to do it, Long weeks with nothing from him.

BooDy, The only one I know with windows development background said that he doesn't have windows installed.

Mohammed Nabil is a sweet guy! He wrote something for me using mono, Maybe it was my stupidity that I wasn't able to compile and run it.

Now enough is enough! I'll code it, Google found something for me this time and here it is in the CVS, Now I really don't get the whole thing of .NET/CLR

I thought that you can use existing COM objects in VC++ applications and that's what I did, The point is that no COM object was available in the Visual Studio 2005 References window when I didn't enable CLR, Strange.

Now WTH is CLR ? And how can .NET tie all this ?

Did I really use .NET ? I think yes, So .NET is only the System classes and such things ? So what is CLR doing here ?

And god damn it! You have old syntax for CLR where you have to use pointers and for sure no one is using the standard C++ auto pointers, There's a new syntax where you have to use ^ instead of a *, If I understand right, The main(int argc, char *argv[]) works fine with the old syntax but not with the new!!

The problem is that most of the tutorials use pointers, They don't use the new syntax and no one is telling you about that.

No farther comment about me searching for the Microsoft::Office::Interop namespace and not finding it, How would I know that I neede to rerun the Office 2k3 setup and select .NET programmability "Sure the setup had to fail for a lot of times anbd don't ask me how!", Poor windows developers using pointers because the damn classes don't have copy constructors!


Free Egypt And Alaa!

Submitted by msameer on Thu, 11/05/2006 - 12:56pm

Please digg this post. Let us campaign for Egypt And Alaa.

As a contribution for the Google Bombina for Alaa, The Egyptian blogger, Activist and One of the Egyptian FOSS leaders.



Wish...

Submitted by msameer on Sat, 15/04/2006 - 7:28pm

* Wish I can get a copy of "Operating Systems Design and Implementation" by Andrew S. Tanenbaum.
* Wish I can study computer science in a respectable place.
* Wish I can study @ the MIT or Berkeley.

Hell, I guess I'm too old for that, Can't also afford it anyway :-(


On Gentoo.

Submitted by msameer on Tue, 04/04/2006 - 7:19pm

Gentoo is a GNU/Linux distro characterized by building all your software from the source code, Gentoo users often claim how much speed boost they got, Forgetting the long time they had to spend building the software. They also like to use weired optimization flags when they build the software resulting in breakage of the system.

A lot of people especially me like flaming Gentoo users, OK. I was tired, I'm not getting enough skeep since the beginning of this week, I was missing my evening coffee and I was hungry. I wrote this to CVirus on the EGLUG IRC channel:

C. Gentoo was our gatekeeper oneday
he also used to clean the cars in the mornings
get us the plumber whenever we asked him to
and many other things
after that he worked as a pimp under Mr. F. O. S. S.'s supervision



Yet another Arabic support patch, Gedit!

Submitted by msameer on Sun, 02/04/2006 - 8:14pm

God damn you Islam you are always getting me into this.

Gedit doesn't identify Arabic as a known language thus won't use the aspell Arabic dictionary for it. This patch adds Arabic and Arabic (Egypt).

The patch is against 2.12.1 but should apply to 2.14 and here's the bug report!

Written and worked from the first time!



Pages