./configure --with-mysql=/usr/local/mysql --with-apxs=/usr/sbin/apxs --with-tidy=/opt/local/ --enable-shmop --enable-sysvsem --enable-sysvshm
apxs is the apache thingy which generates the module (.so) file.
I installed tidy using darwinports: sudo port install tidy
The php makefile adds the necessary directives to your httpd.conf file.
ShareThis
This could be really neat. From Surfin’ Safari:
Karelia Software is working on an exciting new app that uses WebKit: Sandvox. This web authoring tool is shaping up to be rather spiffy and elegant. But they need your help. There’s a couple of bugs in WebKit which are impeding their progress and that they’d really like fixed soon. So they are generously offering bounties for fixes.
Except look at how much money they are offering. $250! They are asking expert developers to put their overhead, expertise, and time into solving another company’s problems. I can’t imagine that these bugs that Apple has not been able to fix yet will take any less than 10 hours for someone to fix. At a modest $100 an hour, they should be offering $1000 minumum per commited bug.
ShareThis
$ nmap -sT -p22,80 blog.johnjosephbachir.org
Starting nmap 3.93 ( http://www.insecure.org/nmap/ ) at 2005-11-03 01:48 EST
Interesting ports on basic-linus.olympic.dreamhost.com (64.111.108.87):
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap finished: 1 IP address (1 host up) scanned in 0.736 seconds
$
ShareThis
no more flapping adium bird in the dock
\cp /Applications/Adium.app/Contents/Resources/Dock\ Icons/Adiumy\ Yellow.AdiumIcon/Awake.png /Applications/Adium.app/Contents/Resources/Dock\ Icons/Adiumy\ Yellow.AdiumIcon/Flap.png
ShareThis
In object oriented programming languages, I like the Singleton pattern, and I also like the static concept. But I think there are some unfortunate misuses, or arguably just poor terminiology, mixed up with both of them.
The static concept does (or should…) mean, any characteristic or functionality of a class that doesn’t change, and/or, any characteristic or functionality that is independent of any particular instance of that class. However, static functions are often piled into a class that is never instantiated, and effectively becomes a glorified library. It’s great that Java provides so much standard functionality, but come on, the Math class is not object oriented at all, it’s just a convenient place to put a bunch of tools. Don’t get me wrong, the way that Java handles namespaces is great. But to call Math a class is just silly. (Or am I wrong? Does Math have a bunch of extension classes that depend on its structure and namespace in order to be designed well?)
Second, I’ve never used the singleton pattern in a class that was also arbitrarily instantiable. If a class can be used as a singleton, then it should only be used as a singleton. And while it’s nice to think of a singleton object as a “real” object, with the same presense and role as the other objects that interact with it, this is really just for the conceptual pleasure of the programmer. (Actually this makes me think of a side concern: is a singleton object just a glorified set of static members and methods, similar to all-static classes like Math? I.E., have you ever designed a singleton object that changed state at runtime?).
I propose two features that I want to see in OO languages that would cut down on a lot of redundant syntax:
- A “library” concept. (Perhaps call it something other than library, to avoid confusion with how people label various other projects and tools. Maybe “toolset”). This would be what we today call a uninstantiable class with only static methods. The advantage would be purely conceptual and syntactic (no need to declare everything static). It would save beginners some headache, programmers some time, and programs some clutter.
- The singleton concept supported at the language level. For example:
protected singleton class NullNode extends LinkedListNode{ ... }
Now, to refer to the singleton, instead of any ridiculous bussiness such as NullNode.singleton or NullNode::singleton(), one could simply refer to NullNode.
ShareThis
Answer: when you have to write THE SAME METHOD in every single extension class:
PHP:
-
public static function tableHeader
(){
-
return parent::tableHeaderMaker(self::ColumnSpecs());
-
}
PHP does not allow a parent class access to an extension class' static methods (or members).
Or maybe this isn't so strange? Can Smalltalk, Objective-C, Java, Ruby, or Python do this? I'm very interested.... if you are reading this and know one of these languages, please chime in.
Another gripe: see how I am calling self::ColumnSpecs()? I originally wanted to make ColumnSpecs a static member, but static members can't have instantiated Classes (or an array of instantiated classes, in my case) assigned to them. So I have to use a static method to generate this array with each call. It works okay in this case, but it's ugly, and incurrs a performance hit.
PHP:
-
public static function ColumnSpecs
(){
-
-
new ColumnSpec('shirt', 'Shirt'),
-
new ColumnSpec('mailingaddress', 'Address'),
-
new ColumnSpec('billingaddress', 'Address'),
-
new ColumnSpec('price'));
-
}
ShareThis
Having problems configuring your Apache 2 virtual servers? I was banging my head against the wall for days trying to get them working. The trick is to comment out absolutely everything relevent to having a "main server" (I'm too lazy to look up the official term for that) and only have virtual servers. In Apache 1, I would always maintain my "main server" configuration and then have my virtual servers. I do think it's cleaner and more intuitive to have only virtual servers (each server has a parallel block of configuration syntax), but as far as I can tell, the necesity of doing this is not documented anywhere.
ShareThis
Now Google has instant messaging, using the Jabber protocol, for everyone with a gmail account. Your username is your gmail address (the whole thing, with @gmail.com), and the server is talk.gmail.com. This is great news.
Many have said that there is no SSL support. However, there is TLS support. In fact, I could not connect when I had TLS off, even on port 5222, so it seems that it is required. HOORAY.
I checked and ports 5222 (traditional Jabber cleartext port), 5223 (traditional Jabber encrypted port), and port 5224 are open on talk.jabber.org. I didn't check if any of the other two do or don't support cleartext.
My setup:
client: Adium
username: mygmailname@gmail.com
server: talk.google.com
port: 5222
TLS: on
UPDATE: I am told that with iChat, port 5223 and "Connect Using SSL" works.
UPDATE: Port 5222 requires TLS, port 5223 requires SSL, and nothing works on 5224.
ShareThis
Set display_errors = On in php.ini
It's off by default.
ShareThis
A seemingly underused feature of find is its -exec feature. Undoubtedly, the main reason for this is the rather confusing covereage of this feature in find's man page, which I reproduce for you here:
-exec utility [argument ...];
True if the program named utility returns a zero value as its
exit status. Optional arguments may be passed to the utility.
The expression must be terminated by a semicolon (``;''). If the
string ``{}'' appears anywhere in the utility name or the argu-
ments it is replaced by the pathname of the current file.
Utility will be executed from the directory from which find was
executed. Utility and arguments are not subject to the further
expansion of shell patterns and constructs.
Whenever I needed to do such a task, I found myself fumbling with xargs, pipes, outputting to a file and manipulating the resultant text with other programs, etc. I always looked at -exec with great hope and wonder, but always walked away thinking it did not offer me the functionality I seeked. I admit, looking at the man page now, it clearly describes exactly what -exec does and how to use it. But I swear, I read that thing 10 times over the course of 5 years and it never clicked. I think what threw me was the first sentence, which made me gather that it was some sort of tool to do an audit of a boolean characteristic of each file in the search results. Referring to a program/command/binary as a "utility" also doesn't really help things.
But recently I found a page on the web, I believe it was this one, that showed me the -exec flag does exactly what I need.
The key is knowing that {} should be placed where each result of find should be placed in the desired command, and the series of flags should be terminated with \;.
For example, If you want to check the syntax on each php file in a tree by executing php -l on each, you would use this command:
find . -name "*.php" -exec php -l {} \;
Awesome.
ShareThis