Personal.X-Istence.com

Bert JW Regeer (畢傑龍)

Signed up for Google Summer of Code

I have signed up for the Google summer of code submitting two applications. One is off course bsdPanel, and hopefully that will be the one that is accepted, the other is the creation of BSD licensed text processing tools. Diff, grep, and sort. Entry on the FreeBSD website.

I am really hoping for bsdPanel though. If I don't get accepted for bsdPanel or the BSD licensed text processing utilities then I will be looking for people to sponsor me working on bsdPanel. If you want the chance to sponsor me, or know someone that is willing to sponsor me, please contact me at xistence [at] gmail [dot] com. It would be in part to cover some of my tuition cost, as well as money for books for school.

Re: Should apple be making fun of Vista UAC?

Should Apple be making fun of Vista UAC? by ZDNet's George Ou -- Windows Vista UAC (User Account Control) has an additional security feature called Secure Desktop that hardens the UAC privilege escalation prompt, but some people seem to be upset with this feature because they say it's annoying. Apple has even gone as far as making a new TV commercial out of it with "PC" being bossed [...]

I disagree, what you have shown here is how UAC shows up when installing an application, however installing an application on Mac OS X can be as simple as drag and drop. Most of the software I download is downloaded in a DMG which you can mount. I can drag it into my Applications folder, and if I have Administrator rights, I won't get asked anything. If I don't have Administrator rights, I can run it right from the DMG or move it into another folder in my home directory aptly named Applications and run it from there. Mac OS X does not ask me for a user-name and password in both those cases, whereas the UAC will ask you if you want to run it as Administrator to install it, even if you would like to place it on your Desktop in a folder named Program Files.

The Mac OS X commercials also seem to refer to the Windows firewall, which asks whether you want to allow incoming or outgoing. When I ran Vista I had disabled the firewall, so I can't say if that is true or not, however I do feel that the Apple advertising is fair. Nothing about it is unfair. I as a user of Windows Vista am unable to run a setup program under any user rights other than that of an Administrator, which allows the installer full access to my entire machine, which is unacceptable to me. In Mac OS X I can drag it to any folder and execute it from there, and it won't have privileges above that of what the user is running at.

Even most .pkg's in Mac OS X can be installed in an alternate location as to not require Administrator privileges, however most if not all .pkg's are .pkg's since they need to install something in /System which is the guts of Mac OS X. For example, SMCFanControl requires this to install a kernel extension.

X11 mouse button pressed

For a Rube Goldberg device I needed a way to know if a mouse button was pressed on the root window of an X11 screen. Here is the code for it:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <unistd.h>

#include <X11/Xlib.h>
#include <X11/Xutil.h>

int main() {

        Display *dsp = XOpenDisplay( NULL );
        if( !dsp ){ return 1; }

        int screenNumber = DefaultScreen(dsp);

        long eventMask = StructureNotifyMask;
        XSelectInput( dsp, DefaultRootWindow(dsp), eventMask );

        XEvent evt;

        eventMask = ButtonPressMask|ButtonReleaseMask;
        XSelectInput(dsp, DefaultRootWindow(dsp), eventMask); // override prev

        do{
                XNextEvent( dsp, &evt );   // calls XFlush()
                if ( (evt.type == ButtonRelease) || (evt.type == ButtonPress) )
                exit(2);
        } while( 1 );

return 0;
}

Compile:

gcc -lX11 -L/usr/local/include x11.c -o x11-mousebutton

Upon a mouse button being pressed it will exit 2, so using that return value in some script you can execute a command. For example, to open a CD rom drive so a domino falls over.

Boooo

Surprise!!!

It seems I have not blogged in a while. I don't know how many of you know that I have moved into a house with 6 other guys, which is going great. THe house is awesome, however with that also come some responsibilities which people do not seem to want to take. For example, cleaning the kitchen after using it. Currently it smells really bad, like foul. I need to go clean it since others will not do so, however I am not happy about that, off course. Since the kitchen is really mine, as I am one of the only ones that really cooks I am going to set some new rules. I don't know if I will be able to enforce them or not, but I can try can't I?

School is great, like always, recently did midterms, which were okay, nothing too hard. I am loving this semester, unfortunately our room 244 (Yes, our room) is being renovated so we were kicked out, however that did mean I got to take home quite a bit of free wire, solder and other cool toys to play with over this break. I went and visited the Phoenix FIRST Robotics competition together with Kris, a room mate of mine. That was rather fun, this years game was definitely a challenge for the different teams, and many of them played it extremely well, which was surprising. Then again, I did not get to see the pre-quarter finals matches, so my perspective may be skewed. I am considering going to visit FIRST robotics at nationals this year just to be there to watch the games!

Well, I am off to clean my room, which is currently in the state of mess. I need to send out the 4"x4" sample of my old air mattress which broke (long story, will explain later, perhaps) so I can get the replacement shipped to me so that I can sleep on something comfortable again. The floor is kind of hard and does not really feel all that great.