h3x.no

Tor Henning Ueland`s thoughts about technology and other stuff

Archive for the ‘Development’ Category

The hierarchy of the type Foo is inconsistent

without comments

You can get the error:

The hierarchy of the type *classname* is inconsistent

If you are trying to compile a class that requires another class not available. Normally due to compilation errors in the dependent classes. So fix the classes needed by the main class and try again.

Written by Tor Henning Ueland

July 31st, 2010 at 8:20 am

Posted in Development,Java

Tagged with

sh: phpize: not found

without comments

When using pecl, or something else that require phpize, you may get a warning saying that phpize is not found, even when you have PHP installed on your server.  In order to use phpize you need to install the PHP development packages, normally named php-devel.

For Debian/Ubuntu, you can fix this by running:

sudo apt-get install php5-dev

Written by Tor Henning Ueland

July 9th, 2010 at 8:56 pm

Posted in PHP,Ubuntu

Tagged with ,

The markup declarations contained or pointed to by the document type declaration must be well-formed.

without comments

This error is caused by the DTD file not being valid. You have most likely created a DTD-file containing:

<!DOCTYPE…. [
...
]>

Simply remove the first and last line delcaring the DTD data, since those are only to be used when having the DTD within your XML file.

Written by Tor Henning Ueland

July 7th, 2010 at 7:58 am

Posted in Development

Tagged with ,

Wonder how many would like that PHP function

without comments

Oh, and yes. It is fake, something i made last year.

Written by Tor Henning Ueland

June 10th, 2010 at 4:59 pm

Posted in Development,PHP

Tagged with ,

A lesson in PHP stupidity

without comments

1:  post_max_size >= 2GB makes PHP overflow, resulting in a negative post_max_size:
“POST Content-Length of 0 bytes exceeds the limit of -2147483648 bytes”

2: defining post_max_size (etc) with MB instead of M causes PHP to only read the last character, in other words 10MB becomes 10 bytes . How hard can it be to either use the first character or even better, both?

(note 1: this can be avoided by actually reading the manual, but this should have been handled better from PHP`s side IMO)

(Note 2: This experience come from the latest stable PHP version in SLES 10SP2, hopefully this has been fixed in later releases.)

Written by Tor Henning Ueland

February 13th, 2010 at 1:16 pm

Posted in PHP

Tagged with

Locate hidden files on a given path

without comments

I have created a simple java command line tool that prints out all hidden files/folders in a given directory. If you need it, you can find it here: http://h3x.no/apps/hiddenFinder/hiddenFinder_v1.zip

Written by Tor Henning Ueland

November 8th, 2009 at 1:53 am

Posted in Java,Security

Tagged with

Display clock each 10 minutes x times forward in PHP

with one comment

Here is a simple code PHP snippet to display the clock each 10 minutes x times in the format of:

php5 test.php
20:40
20:50
21:00
21:10
21:20
21:30
21:40

Etc.

<?php

$j = 0;
for($i=0;$i<10;$i+=1) {
        $j += (10*60);
        $hour = date("H", (time()+$j));
        $min  = ceil((date("i", (time()+$j))/10))*10;
        if($min > 50) {
                $min = "00";
                $hour++;
        }
        echo $hour.":".$min."\n";
}

?>

Written by Tor Henning Ueland

August 16th, 2009 at 7:23 pm

Posted in PHP

Tagged with , , ,

Hint: “org.apache.jasper.JasperException: java.lang.NumberFormatException”

without comments

Getting the exception “org.apache.jasper.JasperException: java.lang.NumberFormatException” when developing a JavaEE-app?

If you are basing yourself on data from a query, make shure that you are doing a SELECT against the table name and NOT the individual fields!

Written by Tor Henning Ueland

May 13th, 2009 at 12:10 am