come again?

a long time ago, when i still used to use xmms, there was this nice plugin called Repeat It! that let you say, “repeat this song between this and this times forever.”

i found myself missing that feature today… unfortunately, i don’t have xmms installed and don’t want it installed because i now like the gtk2 based mp3 players, like beep for example.

but because beep is being rewritten as bmpx, i figure rather than porting the plugin, i can just write a much simpler command line version based on the existing plugin that works with beep.

note however that this is really bad… it does very little error checking, and the sleep solution isn’t really the best solution… but its a pretty good solution for my limited uses :)

and in 25 lines, here it is:

#include <stdio.h>
#include <signal.h>
#include <bmp/beepctrl.h>

void got_signal(int x){
	printf("Exiting!\n"); exit(1);
}

int main(int argc, char** argv){
   int startpos, endpos;
   if (!xmms_remote_is_running(0))
      return (0*printf("\033[1mbmp is not running.\033[0m\n"))-1;

   if (argc != 3)
      return (0*printf("usage: %s start end\n", argv[0]));

   startpos = atoi(argv[1]);
   endpos = atoi(argv[2]);

   signal(SIGINT, got_signal);
   if (!xmms_remote_is_playing(0)){ xmms_remote_play(0); }

   while (1){
      xmms_remote_jump_to_time(0, startpos * 1000);
      sleep(endpos - startpos);
   }
}

to compile it, just do:

gcc `beep-config --cflags --libs` loopsegment.c -o loop

then just run beep, load up the file you want to play, and run the script passing in start and end seconds.

del.icio.us

mmm, delicious! this thing is pretty cool, i wish i’d known about it before…

random stuff

my desktop is sorta dying… everytime i reboot, it kinda sits there doing nothing, and i often have to shut it off and turn it on for it to work (sometimes more than once). when it does decide to come on, i often get a message about “dram timing is loose” - not sure if this means my ram is going bad or if my board is going bad… either way, its not good news.

i can now browse the net on my palm using bluetooth… not exactly sure why this is really helpful, but its pretty neat just to be able to do it. i found a pretty nice guide on the gentoo forums.

i gave bloglines a try today… it seems pretty neat, but for some reason, it doesn’t seem to me that it truly sticks to its promise of checking the site hourly. either way its kinda neat.

php doesn't take "ﻻ" for an answer?

peace… one interesting observation i came along is the treatment of “ﻻ” (which you get by pressing b on a qwerty keyboard) in php… for whatever reason, if someone enters it into a form for example and you try to get the value of the first character of the string, you get 0. oddly enough, this works fine for any other arabic characters typed in. any ideas on why this would happen?

no one has still fixed the bugzilla bug i reported a while back about arabic shaping… looks like i might have to grit my teeth and do it if i really want it done :)

!عربى

لقد عزمت النية ان اتعلم كتابه العربيه على الكمبيوتر إن شاء الله.

eid mubarak, a 'WHAT' prayer service!?, etc

eid mubarak to all… eid mubarak :) big arguments, like every year, about when eid is, when we can and when we can’t have eid, some people want others to fast 31 days because they think its impossible for the moon to be seen today… but anyhow, i looked online at a lunar calendar and it says that the new moon is tonite, which makes eid tomorrow, so whatever man… that’s what my masjid is doing, that’s what a lot of people are doing, and al7amdulillah, that’s what i am doing. its not worth such a big fight, argument, and controversy as far as i am concerned.

anyhow, so our masjid, islamic society of central jersey rented out the new jersey convention and exposition center for eid prayers. very interestingly enough, no the convention center’s site, there’s a “events calendar…” – i took a screenshot of the calendar because this will go away tomorrow… (if its showing up small, click the image for the full size picture).

imagine that… “pakistani prayer service” - mind you, this masjid is mostly arabs too… i wonder if they won’t let me in because i am egyptian… Allahu a3lam.

speaking lion

this video is totally sub7anAllah-inducing. you may have to right click and “save target as” to get it to download.

hitchhiker's guide, ruby mozembed

“Space is big. You just won’t believe how vastly, hugely, mind- bogglingly big it is. I mean, you may think it’s a long way down the road to the chemist’s, but that’s just peanuts to space.”

i finally got around to reading the hitchhiker’s guide to the galaxy. really funny book. maybe i will try to read the other books at some point.

i played around some today with ruby-gnome2 bindings. all i can say is wow. the website documentation is incredible, and you can do so much in so little code. i played around some with ruby-gtkmozembed, and in a few lines of code, you basically have a fully functional web browser.

require 'gtkmozembed'

class Main
   def initialize
      Gtk.init
      window = Gtk::Window.new
      window.resize(800, 600)
      window.title = "ahmed's google test"

      browser = Gtk::MozEmbed.new
      browser.chrome_mask = Gtk::MozEmbed::ALLCHROME
      browser.location = "http://www.google.com"
      browser.signal_connect("title"){ window.title = browser.title; }

      window << browser
      window.show_all
      window.signal_connect("destroy"){ Gtk::main_quit }
   end
end

Main.new
Gtk.main

that’s all for now.

some islamic poetry

here’s some islamic poetry i came across in a lecture by sheikh muhammad al-shareef:

_ la dara lel mar2ee ba3d al mowtee yaskonoha illa alatee kana qabl al mawtee yabneeha fa2in banaha be’7ayrin taaba maskanahu wa in banaha be sharin, ‘7aba baneeha _

roughly… there is no home for a person after he dies to live in, except the one he was building before he dies, so if he builds it with khayr/good deeds, his home will be beautiful, but if he builds it with the sin/disobedience, its builder will be in trouble.

_ a6a3see al ilaha wa anta tuzhiru 7ubahu hatha la 3amree fel qeyasu badee3u in kana 7ubaka sadiqan la a6a3tahu inna al mo7iba leman yu7iba mo6ee3u _

roughly… how can you disobey Allah (SWT) and claim that you love Him, this is a very strange and unique way of understanding, if your love of Allah (SWT) were true, you would have obeyed Him, for verily the person who loves someone will follow them.

first bugzilla bug

at the suggestion of behdad off the arabeyes-developers list, i’ve posted my color and arabic shaping frustrations [along with the code] on gnome’s bugzilla.

hopefully someone can point me in the right direction…