Kwebble : Blog

Label: tip

  • To use localStorage in Firefox cookies must be allowed

    Gepubliceerd op 28 juni 2011 in Programming.

    In case a JavaScript generates a security error in Firefox when using localStorage, I found the advice to make sure the about:config property dom.storage.enabled to true.

    But this is not enough! localStorage is only available if cookies are allowed for the domain that serves the web page with the script.

    I find this strange, cookies are completely different things.

    • cookie
    • firefox
    • html5
    • javascript
    • localstorage
    • tip
  • Smaller classes make better code

    Gepubliceerd op 17 juni 2011 in Programming.

    Tip: read In Praise of Small Classes and its follow-up Making Large Classes Small (In 5 Not-So-Easy Steps) about writing better code. Better here means:

    • easier to read and understand, so easier to maintain
    • less complex classes
    • better testable classes
    • a better class and package structure
    • class design
    • improvement
    • object orientation
    • oo
    • source code
    • tip
  • PHP tip: omit ?> from PHP only files

    Gepubliceerd op 28 mei 2008 in Programming.

    Great tip from the Zend programmer’s Reference Guide: For files that contain only PHP code, the closing tag (”?>”) is never permitted..

    This is useful as it prevents whitespace after the closing ?> from being accidentally added to the output. I always check PHP files for whitespace manually, but this technique solves that problem automatically. Great!

    • php
    • tip
  • MySQL STRICT_TRANS_TABLES mode and truncated text values

    Gepubliceerd op 20 april 2008 in Programming.

    I just upgraded Apache, PHP and MySQL to their current versions on my development system. After that a unit test of one of my PHP classes failed on inserting a row in a MySQL table. The test inserts text with a greater length than the maximum column length of a VARCHAR column.

    This test fails because the new server runs with STRICT_TRANS_TABLES mode. It means that a inserted value must be equal to the stored value or the statement fails. Without the mode setting the inserted value is truncated to the column’s maximum length.

    • mysql
    • php
    • test
    • tip
  • Rubrieken

    • Artikelen
    • Foto's
    • Links
    • Media
    • Overheid
    • Programming
  • Recente Berichten

    • Stanford Web Applications course lectures
    • The importance of knowing Unicode
    • “If you are not paying for it, you’re not the customer; you’re the product being sold.”
    • Inzage in je gegevens bij Facebook
    • Tuning Oracle UCM 11 & Site Studio performance
  • Abonneren

    • Atom feed Artikelen
    • Atom feed Reacties
  • Archief

© Rob Schlüter - Contact