Tremend Tech Blog

"Software is a great combination between artistry and engineering. When you finally get done and get to appreciate what you have done it is like a part of yourself that you've put together." (Bill Gates)

Looking for software experts?

Need an expert advice on software development? Need consulting work done in time and at high standards? Tremend has the right solution for you.

We can provide expertise in:
  • high traffic and complex content website infrastructures
  • website development-advanced web programming with PHP, .NET, Java, Flash/Flex, Ajax

Our friends

Spreadsheet dojo widget with custom dojo build

September 28th, 2006 by Marius Hanganu

After getting a lot of requests on high load time of the spreadsheet widget, I decided to create a custom dojo build.

Here’s a link to the page that uses a custom dojo.js file of 248k.

Note: I started posting entries using Flock’s embedded blog tool. Editing a post in WordPress was a nightmare. Loses formatting, changes styles, a very painful process overall. But using Flock’s blog tool was a good experience.

Share/Save

Posted in HTML, Javascript | No Comments »

DynDNS blocks updates - from updatedd older than 2.4

September 27th, 2006 by Bogdan Nitulescu

If your home router has a Dynamic DNS feature and it suddenly does not work anymore with DynDNS… don’t despair. The guys at DynDNS have decided to discontinue service to older clients. You can read the small print here.

The bad part is you don’t get any notification. Their server simply returns a “Successful update” error code. You might smell something is fishy, because it also reports that your new IP is 127.0.0.1. But your real IP in the database remains unchanged.

The good news, though, is that your account is not blocked, too. You can update the DNS manually or from a desktop client. Check the router vendor site for a firmware upgrade. If there is no such upgrade, there’s not too much to do, except to use the desktop client, choose a different dynamic dns or router provider.

Share/Save

Posted in General, Tools | No Comments »

MySql, PHP and UTF8

September 26th, 2006 by Iulian Cutui

Nowadays UTF8 is far from being just “trendy”, it’s the de facto standard for information representation. There are a lot of discussions on the “why locales are bad” theme, and I’m not going to argue with that.

Getting right to the point, how can you use UTF8 in your PHP/MySql web app? First things first: use PHP 5 and MySql 4.1 as minimum requirements. The reason is the same for both of these apps: native/decent UTF8 support.

For MySql, define your tables with UTF8 character set and collation:

CREATE TABLE table_name (

………………..

) CHARACTER SET utf8 COLLATE utf8_general_ci;

For PHP, set the UTF8 encoding before extracting your information from MySql

if (!$link = mysql_connect(’mysql_host’, ‘mysql_user’, ‘mysql_password’)) {

echo ‘Could not connect to mysql’;
exit;

}

if (!mysql_select_db(’mysql_dbname’, $link)) {

echo ‘Could not select database’;
exit;

}
$sql = “SET NAMES ‘utf8′”;
mysql_query($sql, $link);

//select your UTF8 data
$sql = “SELECT foo FROM table_name”;
$result = mysql_query($sql, $link);if (!$result) {

echo “DB Error, could not query the database\n”;
echo ‘MySQL Error: ‘ . mysql_error();
exit;

}?>

If you need to process your UTF8 strings use the multi-byte versions of the string functions (they have the same name but a “mb_” prepended, e.g. mb_substr) as they work at the character level rather than the byte level.

For omitting the string encoding parameter that can be passed to the multi-byte string functions is useful to set the default encoding to UTF8 by issuing:

mb_internal_encoding(”UTF-8″);

Share/Save

Posted in PHP | 7 Comments »

Spreadsheet dojo widget

September 25th, 2006 by Marius Hanganu

Update3: We’re back to our own hosting.

Update2: Razvan Dragomirescu was kind enough to mirror the spreadsheet widget. Click here to access the demo. Thanks Razvan!

Update: Due to high traffic the demo page might load very slowly. Please have patience.

In the last weeks, I’ve been using my so very little spare time to create a spreadsheet widget based on dojo.

Click here for a demo of the spreadsheet widget. It is based on release 0.3.1 of dojo toolkit. Dojo is an excellent framework. Scores 3rd in this Ajaxian survey. The first two: Prototype and Scriptaculous are lightweight frameworks and certainly don’t offer as much functionality as Dojo. If you make a top of the “heavy” js frameworks, Dojo will definitely take 1st place.

So here’s a status of the widget:

Features

  • Based on Toolbar and TabContainer widgets
  • Keyboard cell navigation
  • Column, row resizing
  • Cell, column and row selection
  • Cell formatting (font, font size, bold, italic, underline, color, background color)
  • Sheet management (rename, delete, new)
  • Functions (22 math functions, 6 string functions)

Status


  • This widget is definitely not final and has several bugs
  • Tested with Firefox and IE only
  • On IE runs slower than Firefox
  • If it would be released as an independent piece of software it would be labelled as 0.7 version

Goals for “1.0″ version:


  • Fix all remaining bugs related to column, row resizing and selection
  • Support cell presentation format (dates could be displayed as mm-dd-yyyy, numbers as xx.xx, etc)
  • Support for date functions
  • Post spreadsheet data in JSON format to be saved serverside
  • Improve validation

technorati tags:, , ,

Share/Save

Posted in HTML, Javascript | 50 Comments »

End to end UTF-8 encoding usage with MySql and Spring - Part 2

September 1st, 2006 by Ioan Cocan

One thing I forgot to mention was the usage of Spring message bundles. Usually, a ResourceBundleMessageSource is configured to inject bundle messages for Spring MVC. The only bad thing is that I could not specify an encoding for the configured message.properties files. As the default properties format is ISO 8859-1 character encoding and tedious operations like transformation of Unicode characters using native2ascii tool is necessary, I looked for a way to load UTF-8 resource files without any transformations. Spring has a ReloadableResourceBundleMessageSource class that allows just that, along with the reloadable behaviour. The bundle configuration now looks:

<bean id=”messageSource” class=”org.springframework.context.support.ReloadableResourceBundleMessageSource”>

<property name=”basename”>

<value>/WEB-INF/classes/messages</value>

</property>

<property name=”defaultEncoding”>

<value>UTF-8</value>

</property>

<property name=”cacheSeconds”>

<value>-1</value>

</property>

</bean>

Share/Save

Posted in Java, General | No Comments »