Search This Blog

2009-08-27

codepad.org

codepad
codepad.org is an online compiler/interpreter, and a simple collaboration tool.

2009-08-23

HOWTO: CPU Frequency Scaling w/ Kernel Module

http://ubuntuforums.org/showthread.php?t=248867

C++ fails on my logic...

union u1 {
char[0];
long[0];
}

union u2 {
char[1];
}

union u3 {
char;
long;
}

union u4 {
char;
long[0];
}

union u5 {
char[1];
long[0];
}

// i can undesrtand these...
sizeof(u1); // 0
sizeof(u2); // 1
sizeof(u3); // 8

// but these do not make sense to me...
sizeof(u4); // 8... not 1?
sizeof(u5); // 8... not 1?

// found this when trying to code this:

template <unsigned int unitSize = 1, unsigned int length = 1>
union Bytes {
char c[length * (unitSize / sizeof(char))];
bool b[length * (unitSize / sizeof(bool))];
short s[length * (unitSize / sizeof(short))];
int i[length * (unitSize / sizeof(int))];
long l[length * (unitSize / sizeof(long))];
float f[length * (unitSize / sizeof(float))];
double d[length * (unitSize / sizeof(double))];
long double ld[length * (unitSize / sizeof(long double))];
};

2009-08-20

Enabling Rich Text Editing in your web page...

Midas Specification
Given a document, you can add the attribute "designMode" and set it to "on" to get an editable document. For example, in JavaScript, if you have an iframe with an id of 'edit', you can get its contentDocument and set designMode to "on" like this:
document.getElementById("edit").contentDocument.designMode="on";

2009-08-15

Electronic whiteboard for Linux (ubuntu)

Linux Tips: Electronic whiteboard for Linux (ubuntu)
How to convert our computer screen on to a digital electronic whiteboard, under Linux, could not be simpler. Only need a knob for Wii (Nintendo Console), an infrared emitter (such as a remote control), and the software for it...

Wii Remote