Writings Photos Code Contact Resume
FLOSS

You are here

Free Libre Open Source Software


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!



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!



اللى قال ان ماعندناش قائمة كلمات عربية ضحك عليكم!

Submitted by msameer on Sat, 25/03/2006 - 9:54pm

[img_assist|fid=4723|thumb=1|alt=OpenOffice and Arabic spell checking!]

علشان الصوره اللى فوق دى بتثبت العكس

المشكله ان عدد الكلمات اللى فيها صغير جدا "اقل من 50000" بس اهو اللى عندى

الليله كلها فى ال CVS عندى و معاها شرح كامل ازاى تعمل قاموس ل OpenOffice و aspell.

بصراحه انا مش هاعرف اكمل الكلمات لوحدى و ماعنديش فكره ازاى ممكن تكمل. حد عنده اقتراحات ؟


Back to apache.

Submitted by msameer on Tue, 21/03/2006 - 12:58pm

lighttpd was doing fine but sometimes it doesn't start after the logrotation, I'm lazy to write a script to fix this plus, I miss the apache mod_security to filter out some SPAM comments. I'm using an old package from backports.org, Maybe it was fixed in a later package but it's not there for debian yet.

I also enabled a php accelerator when I moved to lighty, Now I'd like to test how apache'll perform with the acceleretor.