Notes on Java, Solaris, PHP, LDAP…

December 18, 2007

Google Pack

Filed under: Uncategorized — negev @ 9:38 pm
  • google pages – hosted as *
  • – it includes free antivirus for Windows

December 11, 2007

C-like shortcuts leading to errors in PHP

Filed under: Uncategorized — negev @ 6:06 pm

Today I’ve come across yet another tricky error in PHP… I had the following code. $info in it is an LDAP result array. I wanted to extend the if(..) condition to check whether $info[‘count’] is exactly 1. So I took

  if( $info=$myObject->All($res) ) {

and changed it into

  if( $info=$myObject->All($res) && $info['count']==1 ) {

Suddenly it stopped working, even for the LDAP results about which I knew they had exactly one item. As usual, it was the programmer’s error – but supported by PHP as it doesn’t check types in compile time. What I should have done was

  if( ( $info=$myObject->All($res) ) && $info['count']==1 ) {

Yet another reason to use strong-typed languages like Java, rather than script lingos as PHP.

Conflicts between Flex properties and component ids

Filed under: Uncategorized — negev @ 12:45 pm

Today I’ve been extending mx:TitleWindow component. And I wanted to have a TextInput called ‘name’. However, when I added

  <mx:TextInput id="name" ... />

then I was getting funny errors like

Attempting to initialize inherited property 'name' of type 'String'
with value of incompatible type 'mx.controls.TextInput'

You can define and access visual subcomponents in Flex MXML very easily. They are almost equivalent to properties and subcomponents defined via Action Script. Adobe standard components and classes have plenty of properties and methods. However, that is a double-sided sward – because you may want to use the same property name or subcomponent id for something else, and you just can’t.

Solution: You can put your properties into a separate object, or separate them in some other way. Or call your properties/subcomponents by some other name.

December 4, 2007

Single-user boot and fdisk in OpenBSD

Filed under: Uncategorized — negev @ 10:14 pm

I needed to test something in OpenBSD. So I’ve installed it on a separate partition on my AMD-based laptop. What a surprise – when I wanted to boot up the other system (Solaris), it turned out to be quite difficult.

In OpenBSD, if you want to choose (switch) the active (bootable) partition, you can’t do it on a hard-drive you’ve normally mounted from (read/write mount). You need the hard-drive to be mounted read-only. For that you need to start in a single-user mode. Right after you turn on/reset your computer, when the OpenBSD boot screen shows up, type boot -s. Then it asks you for terminal type and it doesn’t give you any default or common choice(s). It looks that vt100 is a good one. Then you boot up in a single-user mode.

You can run fdisk and it just prints the partition table and exits. Now let’s go change things: run fdisk -e wd0 where -e stands for interactive mode. You can type manual to show the commands at any time. If you want to change the active partition, type flag numer-of-partition. To commit the changes type write.

Surprises of Flex operators

Filed under: Uncategorized — negev @ 7:17 pm

Flex operator == is a funny one. You won’t get much info on its behaviour in Flex docs. But it turns out that

  • it compares Strings by value
  • but it compares arrays by reference
    • the same for ‘non-primitive objects’ (never mind the non-sense) – compared by reference

eDirectory LDAP – default rights and allowed values

Filed under: Uncategorized — negev @ 7:12 pm
Tags: ,

Due to default behavior of LDAP/eDirectory it also adds an ACL entry
for the user who created a group/container/object, e.g. “ACL: 16#subtree#cn=User
Name,ou=User Container,…,o=top-container#

[Entry Rights]”.


eDirectory (Novell’s LDAP product) suprisingly allows a lot of special characters for string attribute values (such as attribute ‘description’), but it forbids plus + character.

Following characters are OK, although some are not advisable if you want to compare the values in LDAP queries etc: =,#()[]”‘~\@:.-/!&*^ And some of them are not allowed for CN/OU or other special attributes.

Blog at