December 2014
M T W T F S S
« Oct    
1234567
891011121314
15161718192021
22232425262728
293031  

Categories

Meta

Copy JVC Everio .MOD files on Linux

By Bart | June 4, 2012

I patched a little Python script to correctly copy .MOD/.MOI files to MPEG-2, including the aspect ratio bug in the format: http://blog.friesoft.nl/files/sdcopy.py. It is tested and works on Ubuntu 12.04.

Topics: Geekstuff | Geen reacties »

Adobe Flex snack: Error #2048: Security sandbox violation

By Bart | May 22, 2012

If you are building a Adobe Flex application that uses sockets, you have to send the policy-file-request, or crossdomain.xml. A lot of info available on it, except that you need to send a null character at the end of it.

Topics: Geekstuff, Snack | Geen reacties »

Javascript snack: enable both click and doubleclick events on one element

By Bart | May 10, 2012

HTML defines onClick and onDblClick event handlers on all elements. However, if you want to enable both on the same element, something goes wrong. the onClick event gets fired twice! And that is not what we want, so here’s a little Javascript to fix that:

// use these functions to enable *both* onclick and 
// ondblclick on one element:
// usage: onclick="singleClick(someFunction)" 
//        ondblclick="doubleClick(otherFunction)"

singleClickTimeout = null;
function singleClick(fcn) {
    if (singleClickTimeout == null) {
        singleClickTimeout = setTimeout(function() {
            singleClickTimeout = null;
            fcn();
        }, 500);
    }
}
function doubleClick(fcn) {
    if (singleClickTimeout != null) {
        clearTimeout(singleClickTimeout);
        singleClickTimeout = null;
    }
    fcn();
}

Topics: Geekstuff, Snack | Geen reacties »

Javascript snack: new Date() with time zone

By Bart | February 9, 2012

To set a time, use the (very convenient) Dat eobject:

var now = new Date();

If you want to set a certain date, use:

var someDate = new Date("yyyy-mm-ddThh:mm:ss+hh:mm");

e.g.:

var someDate = new Date("2012-05-17T00:00:00+02:00");

For May 17th, 2012 00:00:00, CEST. Notice (and I just found that out), not all browsers take the same timezone when it is not supplied. To be sure, use the time zone in your date definition.

Topics: Geekstuff, Snack | Geen reacties »

(Nederlands) Haiku

By Bart | January 10, 2012

Sorry, this entry is only available in Nederlands.

Topics: Lief dagboek, Verhalen | Geen reacties »

Android-dev-snack: what if R.id. doesn’t seem to be right anymore?

By Bart | November 1, 2011

In Eclipse, with the ADT plugin for Android development, what to do if your widget-IDs seem to be all over the place? What if that TextEdit suddenly seems to have jumped over two TextView widgets? Simply running a “Clean project” fixes it. It seems to be triggered by a lot of dragging, dropping and cutting and pasting in the UI-editor.

Still have to figure out how that R.id.<id> is linked to the XML file…

Topics: Geekstuff, Snack | Geen reacties »

Bye bye Facebook

By Bart | October 3, 2011

Ja hoor, vandaag al mijn social media profielen sites verwijderd. Facebook exit, Google+ exit. Ik ben er klaar mee. Wat mij betreft is de hype voorbij en kostte het alleen maar tijd. Ik kreeg er niks voor terug. Ow, en al dat privacy gedoe stond me vanaf het begin al niet aan.

Dus vanaf nu ben ik nog te volgen op Twitter, LinkedIn en dit weblog. Verder niks meer. En weet je? Het voelt als een bevrijding. Geen status updates meer moeten posten, niet meer in de gaten houden wat je ‘vrienden’ (ik heb ze gevraagd te helpen verhuizen, niks nie geen reacties denk) aan het doen zijn.

In de tijd van IRC, fora en een blog was het toch overzichtelijker. Daar ben ik dus weer terug. Overigens ben ik benieuwd of ik nu een trendsetter ben, of een loner. De tijd zal het leren.

Topics: Gelul in de ruimte, Lief dagboek, Opinie | 2 Reacties »

Websnack: dijit.form.Select vs dijit.form.ComboBox

By Bart | September 16, 2011

If you create a dijit.form.Select with a lot of items, it will become slow and render through the end of the page (no scrollbars). Instead, use a dijit.form.ComboBox; it is fast and renders correctly. It doesn’t necessarily need a itemstore, a HTML <select> list works perfectly fine. Just add dojoType=’dijit.form.ComboBox’ and you’re done.

Note: this doesn’t work if you have a  ‘value’ in your <option> tags. The ComboBox always takes the label as value.

Topics: Geekstuff, Snack | Geen reacties »

Memory use in Linux with the ‘free’ command

By Bart | August 31, 2011

After some memory problems on a server, I started to look into it: what do all those number in the output of free actually mean? And, I found the answer in a forum:

bf@tbwb-dt-bf:~> free -m
             total       used       free     shared    buffers     cached
Mem:          3978       3848        130          0         28       1985
-/+ buffers/cache:       1834       2144
Swap:         2055          0       2055

What do these numbers mean? Well, the first row is your physical RAM. That is, what is actually in chips on the motherboard of your computer. And, of that, the command shows what is actually exactly in use. In applications, buffers, caches, kernel, etc. (In this case in megabytes, because of the -m option with free.)

But, as we all know, Linux loves to cache everything. All that is read and received gets a place in the buffer memory. Most the time, there is more than enough memory available to do that. Those are the ‘buffers’ and ‘cached’ numbers. They really are in use in the system’s memory, but when an application needs RAM, the kernel will release those buffers. And the result of that, is in the line below. Following schematic shows how it works:

bf@tbwb-dt-bf:~> free -m
             total       used       free     shared    buffers     cached
Mem:             T          U          F          S          B          C
-/+ buffers/cache:      U-B-C      F+B+C
Swap:           TS         US         FS

The numbers in the second row are the used and free RAM for applications. ‘used’ minus ‘buffers’ minus ‘cached’ is in use by applications; ‘free’ plus ‘buffers’ plus ‘cached’ is available for new ones. And if the kernel runs out of that, the OOM-killer steps in. But I won’t discuss that further here.

Topics: Opinie | Geen reacties »

qTranslate: BBB is now multilanguaged

By Bart | August 3, 2011

Thanks to qTranslate, “Bart Blogt Beter” is now multilanguaged. Researched to make our TBWB company website two (or multi) languaged. I first tried it on my own weblog here. And, as you see, a language selector was added and this post is the first that is available in two languages (English and Dutch).

Topics: Opinie | 1 Reactie »


« Voorgaande Artikelen Volgende Artikelen »