Categories
Reviews

Eken M001, Android Tablet

I recently purchased an Eken M001, one of the cheap android tablets that you can find on eBay.

There are a lot of the super cheap tablets using Via WonderMedia chips. Based on online specs, the biggest differentiator between different models is whether it has 128 or 256 megs of RAM. It is possible that the displays vary.

My first complaint is that the screen and audio quality are poor. The screen has a strong screen door effect. The audio is subject to hiss and a large amount of internal interference (so, you can somewhat hear the machine “think”).

My second complaint is that the device is slow. I suspect that it is possible to wring a lot more performance out of this chip through better optimization of Android better for it, but while the SlateDroid team has made updated firmware for this device, I see no evidence that further optimization can be expected.

Battery life is poor, and the device doesn’t seem to go into much of a power saving mode. Again, I think this is largely a software issue, but also again I see no evidence that anyone is going to try and fix it.

The touch screen feels very unresponsive. I don’t know if this is a poor choice in touch screen technology and hardware, or if this is also software. Some people say it is obviously going to be poor since it is resistive instead of capacitive, but it is much worse than the resistive screens in old handhelds, such as Palm devices.

I will say that on the upside, Android 1.6’s web browser works extremely well (albeit sluggishly). In some ways, that makes the speed issues all the more aggravating, since it is a painful taste at what could be a really nice experience.

One possibility for this machine is to run Debian on it. I haven’t tried this yet, but it is supposed to be a simple operation. Debian on this would allow you to write code to use it as a control panel or display status information on it. You could also use it as a digital picture frame, but there are cheaper digital picture frames out there with a much nicer display.

In writing this, I see that there is a newer SlateDroid firmware available (now based on Android 2.0), so I will have to try that and post an update in the future.

Categories
Emacs

Handy emacs printing trick

emacs -nw myfile.c -e “ps-print-buffer” -e “save-buffers-kill-terminal”

By extension, you can keep stacking -e’s with interactive functions that take no arguments for as many commands as you want. I would imagine there is a way to pass arguments to the functions you list, but I haven’t found that yet. Also, it might be nice to be able to do something like -e “(+ 5 9)”, but I haven’t found the proper way to do that either.

Categories
Family

David in hat

David has a new hat to wear to his grandparents.

Categories
Cooking Reviews

A new thermometer

I don’t know where I got the idea from, but I’ve long thought that knowing how hot a pan is would be tremendously handy. And of course, the obvious way to measure surface temperature is with an infrared thermometer. So, I went and got a Ryobi IR001 Non-contact Infrared Thermometer (with Laser) from Amazon (see http://amzn.com/B001O7H61Y).

So far, it is particularly handy for seeing how close to boiling water is (212°F) and when a pan is hot enough to saute (350-400°F).

My only complaint is that it tops out at about 600 °F, and sometimes higher would be nice.

Also, I really wish that I would remember to keep notes on temperatures for frying eggs, pancakes, and what exactly is high, medium, and medium high?

Categories
Programming

Small revisit of C++ message passing (in a threaded program)

The post C/C++ Message Passing from June ’08 is one or the more popular ones, if Google Analytics is to be believed. Not only that, but every one who arrived there by Google search was looking for C++, not C.

Upon re-reading it, it occurs to me that it would be a good candidate for being a lock free structure.  With C++0x, this should be pretty simple to do, using the new atomic template.  For straight C though, I would have to use compiler specific extensions (or inline assembly), so there may be little reason not to make a C++ specific version of the code that is lock free.

I’ve also thought of trying to use C++0x to construct a purely functional data structure library.  In that case, C++0x would be chosen because of the new shared_ptr addition.  I might have to have a post soon exploring that idea a bit further.

So far, I’ve converted this to be a C++ class and to use templates instead of void*s. Otherwise, it still behaves the same and still uses pthread locking directly. Additional versions will be forthcoming. Here is the recent work.

Hopefully it will be of use to some of the searchers. Keep an eye out for future revisions.

Categories
System Administration

Oops

All the pictures in old entries are missing, and it seems that it is because a pictures folder was removed.  Now looking for a backup.  And this time perhaps I should let WordPress keep track of them instead of making my own image folder.

And now it should be fixed, so please let me know if you still see problems.

Categories
Family

Izzy Sitting in a Window, Looking Blue

Categories
Family

David again.

Categories
Programming

Circular buffers as C Macros

I was recently reviewing some FIFO based serial TX/RX circular buffer code that I thought was buggy in the FIFO part.  Since the FIFO was entwined with the ISRs, it was hard to test in isolation.  I looked around at some other FIFO implementations for PIC and AVR, and all of them did the same thing, including duplicated all of the FIFO code for every serial port implemented.   It seemed to me that it would be better to have the two activities separated to provide better re-usability and test-ability.

Back when I was working on PCI audio drivers, I thought the same thing.  Everyone wrote their sample FIFOs directly into the ISR functions in the driver.  Back then, I seperated my FIFO out into a separate reusable module that could be tested thoroughly from user land.  I grabbed that to use on my current project, but it depended on malloc and free, something notably missing on a lot of 8 bit micro controllers.  Also, it would result in extra function call overhead, which is not good in ISRs on PICs (very limited hardware call stack).

Anyway, after debugging the FIFO in my ISRs, I decided to extract it all out into a file of just that code. Then I transformed those functions into macros to do away with the function call overhead.

Here is draft 1, if it is of any use to anyone, and even if it isn’t I certainly wouldn’t mind review/commentary.

I could wrap the globals into a struct, but then I still would need a
custom struct for each instance to change the size of the array at run
time, unless I required a global struct, and MAKE_FIFO inserted a
pointer to a global array…

I’m not sure, which might be better.

Also, if you were to need 32bit elements instead of 8 bit elements, just change the type in MAKE_FIFO.

/**
* @file
* @author Joshua Boyd
* @version 1.0
*
* @description DESCRIPTION
*
* Macros for statically allocated, circular buffer, character FIFOs.
*
* NOTE: change the types in MAKE_FIFO to support types other than
* chars. Should just work for any primitive type, and only
* a little more work for structs.
*
* The basic usage is to MAKE_FIFO your fifo, giving it a name and size
* then GET, PUT, etc, the fifo of that name.
*
*/

/**
* Make a new FIFO.
*
* @param prefix - the name of the fifo, eg. 485_tx, or 232_rx.
* @param size - number of elements in the fifo.
*/
#define MAKE_FIFO(prefix, size) \
char prefix ##_buffer[size];\
long prefix ##_next_in = 0;\
long prefix ##_next_out = 0;\
long prefix ##_ovfl=0;

/**
* Get and remove an element from the FIFO.
*
* Value here works a little like a reference in C++.
*
* @param name of the fifo
* @param Location for the returned element.
*/
#define GET(prefix, value) { \
value=prefix ##_buffer[prefix ##_next_out]; \
prefix ##_next_out = (prefix ##_next_out+1) % sizeof(prefix ##_buffer);}

/**
* Get an element from the FIFO without removing it.
*
* Value here works a little like a reference in C++.
*
* @param name of the fifo
* @param Location for the returned element.
*/
#define PEEK(prefix, value) { \
value=prefix ##_buffer[prefix ##_next_out];}

/**
* Remove an element from the FIFO without getting it.
*
* @param name of the fifo
*/
#define REMOVE(prefix) { \
prefix ##_next_out = (prefix ##_next_out+1) % sizeof(prefix ##_buffer);}

/**
* Return the index of the next input location.
*
* NOTICE: This is the only macro meant for internal use, and not the
* application programmer.
*/
#define NEXT_IN(prefix) ((prefix ##_next_in + 1) % sizeof( prefix ##_buffer ))

/**
* Put an element into the FIFO.
*
* @param name of the fifo
* @param Value of the new element.
*/
#define PUT(prefix, value) { int8 t; \
prefix ##_buffer[ prefix ##_next_in ] = value; \
t = prefix ##_next_in; \
prefix ##_next_in = ( prefix ##_next_in + 1) % sizeof( prefix ##_buffer ); \
if(prefix ##_next_in == prefix ##_next_out) { \
prefix ##_next_in = t; \
prefix ##_ovfl = 1; }}

/**
*
* Set the points back to as if it were empty.
* Doesn't erase the data, but only a GET or PEEK will
* return garbage after this has been called.
*
* @param Name of the FIFO
*/
#define FLUSH(prefix) prefix ##_next_in = prefix ##_next_out = 0

/**
* Is the FIFO empty? True/False
*
* @param FIFO name
* @return T/F
*/
#define IS_EMPTY(prefix) (prefix ##_next_in == prefix ##_next_out)

/**
* Is there any data? True/False.
* Basically the opposite of IS_EMPTY
*
* @param Name of the FIFO
* @return TRUE/FALSE
*/
#define IS_NOT_EMPTY(prefix) (prefix ##_next_in != prefix ##_next_out)

/**
* Is there any data? True/False.
* Basically the opposite of IS_EMPTY
* The same as IS_NOT_EMPTY
*
* @param Name of the FIFO
* @return TRUE/FALSE
*/
#define KBHIT IS_NOT_EMPTY

/**
*
* Is the FIFO full? True/False
*
* @param FIFO name
* @return TRUE/FALSE
*/
#define IS_FULL(prefix) (NEXT_IN(prefix) == prefix ##_next_out)

/**
* Is there free space?
* This is basically the opposite of IS_FULL
*
* @param FIFO name
* @return TRUE/FALSE
*/
#define IS_NOT_FULL(prefix) (prefix ##_next_in>prefix ##_next_out?prefix ##_next_in-prefix ##_next_out:(prefix ##_next_in+sizeof(prefix ##_buffer) - prefix ##_next_out))

/**
* Is there free space?
* THis is the same as IS_NOT_FULL.
* This is basically the opposite of IS_FULL
*
* @param FIFO name
* @return TRUE/FALSE
*/
#define AVAIL IS_NOT_FULL

Categories
System Administration

Using rxvt with [Open]Solaris.

After years of hard coding TERM to xterm or vt100 in .bashrc to get around rxvt incompatibility, I finally found this:

sudo cp /usr/gnu/lib/terminfo/r/rxvt /usr/share/lib/terminfo/r/rxvt

I suppose I really should use pfexec instead of sudo, but mastering that is a job for another month.