Jul 27

More fun with Java (scope and duplicates)

Category: C++, Java, Programming

I thought this was interesting… In Java, a block scoped variable may conflict with a local variable declared later in method scope, but not previously (as shown below):

class A{
  public static void main(String args[]){
    {int k = 5;}
    int k = 12; //this is OK
    {int k = 22;}//this is not....
  }
}

This is not the same as C++ where this compiles happily:

int main(){
  {int i;}
  int i;
  {int i;}
  return 0;
}

Usually C++ has the more obscure behavior….

No comments

Jul 22

Protected within Java Enums

Category: Java, Programming

I just noticed that java enums allow protected member variables and methods. Why is this interesting? Can you think of any code that might actually make use of a protected member in an enum (as opposed to private)? Example after the jump (warning, not practical…).
Read more

No comments

Jul 22

SWIG, Java, and JRuby

Providing a robust, maintainable, and interactive interface to your C/C++ application can be a challenge, but I’ve found that a combination of SWIG, Java, and JRuby (or Jython if you prefer) makes for a very powerful combination.
Read more

No comments

Nov 19

Opening a TUN Device on UNIX

Category: C, Networking, Programming

The TUN/TAP interface under Linux provides user space access to Transport (Ethernet) or Network Layer (IP) traffic by allowing a developer to create a “virtual” interface that can be openend in user space as a file descriptor.
Read more

1 comment

Nov 17

Open Source Performance Tools

Category: Networking

A lot of performance tools are very web-oriented these days. Here are a list of tools for simulating network traffic conditions and check throughput, delay, jitter, etc.
Read more

1 comment

Nov 15

Overview of the CCSDS Network Protocols

Category: CCSDS, Networking

The CCSDS standards can be intimidating to the uninitiated, this article covers AOS, TC, COP-1, and other protocols used in space communications, how they interact, and where to find the details.
Read more

No comments

Oct 27

RSS and mercurial

Category: Programming

In a surprisingly well-kept secret, HgWeb and HgWebDir support RSS. Details below.
Read more

1 comment

Oct 25

LDAP, PAM, SSHA, and CRYPT on RHEL 5

Category: Networking

I’m putting this here because it took me two days to figure this out. RHEL 5 (or CentOS 5) has openLDAP broken out of the box. It does not handle SSHA password encryption (the default for openLDAP) properly. If you want openLDAP authentication to work with PAM on CentOs 5.3 you MUST edit the /etc/openldap/slapd.conf to contain:

password-hash    {CRYPT}

If you do not then as soon as you use ldappasswd to change a password your user will no longer be able to log in. That is all.

No comments

Jul 24

Why is XML Better?

Category: Programming, XML, XPath, XSLT

Why is XML better than custom internal formats? Isn’t a non-standard set of XML tags basically equivalent to a custom format when using data internally to an application? Absolutely not, and here is why.
Read more

No comments

Jun 26

DVSL: An Alternative to XSLT

Category: Java, XML, XPath, XSLT

DVSL is a fairly small, little known, product associated with the Velocity project over at Apache which takes the best part of XSLT: XPATH, and replaces the verbose and frustrating scripting of XSLT with a java-based template language instead.
Read more

No comments

Next Page »