Sunday, September 13, 2009

Reverse Proxying

Whatever that means:)
Here's what needs to be done :

Install a piece of software on one machine on which you have administrator rights. This is a daemon of course - runs all the time as a server.
Know the IP address of this machine, which has internet access.

Enter this IP address in some field of your Mozilla Firefox browser setup/preferences/options/etc and access the internet through the first machine.

How?

Tell me and see your name in big lights - or get another equivalent reward in the case of identities that need to be protected:)

Saturday, September 5, 2009

Processing's Serial.available()

How do they do it? They use java of course - and there's an input.available() in their source. But how do you do with Win32 C++ DLLs? I only see CreateFile, ReadFile and WriteFile.

Friday, August 21, 2009

Dear RealTerm

Is it possible somehow to run realterm from the cmd line on a one-shot basis

realterm -hidden -com28 -baud9600 -hex f3 0 f3 1

that is, have it run like a command line program - do its job and exit?

if not, can you suggest a way I could write such a program?

Thursday, August 20, 2009

Missing printf()

What the world needs is a simple program that can be run from the MS-DOS command prompt like this :

writeCom -id com28 -parity none -baud 9600 -stop 1 -data 8

Apparently, even with millions of smart people loose out there, we don't have something as simple as this that people can use. !$@!$#!$#!

The google search that finally got me somewhere was :

dos command line com port writing

Here are some resources :

http://www.experts-exchange.com/Programming/Languages/C/Q_21148982.html

http://electrosofts.com/serial/index.html
( conio.h outportb bios.h bioscom )

Available ports?
http://electrosofts.com/parallel/

As it turned out later, all of this stuff is utter crap if you're on WinXP. Why don't people update stuff?

Tuesday, August 18, 2009

Autohotkey on Unix?

Anyone know what the equivalent of AHK is on Unix? How would you do hotkeys dependent on the Window name, etc?

Guruspeak :

http://autokey.sourceforge.net/

Went there; my reaction - it's for supergeeks only. AHK was lighter - if you're not a god at package installation, you're looking at sleepless nights here.

Monday, August 17, 2009

FTDI USB

Windows says it can't find the drivers - this, despite my explicitly downloading them and telling it where they are, and then, using FTDI's executable to install them. Problem could be that it's seeing the CMAXQUSB command module and looking for something else.

If I try writing to the serial port, it asks for FTD2XX.DLL. If I place that file in the same directory as the program I'm running, it stops asking for the file, but it says Open Failed, FTDI write Failed. Well, WinXP still doesn't see it as a serial port. Hmm...

Sunday, August 9, 2009

USB Minimum Pulse Width

Simple question, you use USB and nothing else. (With a one-shot timer chip, this would be easy). What is the minimum pulse width you can generate writing to a serial port?

Thursday, July 23, 2009

Enhancing KDE Window Behaviour Actions

It was trivial in TWM and CDE - you would edit your .twmrc or some config file in ~/.dt/C or something like that. For some reason, KDE needs a jailbreak

Here's what I'm looking to do :

If you go into Control Center and then Desktop and then Window Behavior and Actions, you can set, for example the Window behavior for Titlebar Doubleclick to be Maximize instead of the default Shade.

But, under the modifier section, not only do you have a limited selection (left mouse, middle mouse, right mouse and just one modifier), but you don't even have all the window actions available. For example, I don't care for raise/lower though mouse (and how the hell do I set ALT-ESC to do that?) and I can't set Alt-Middle to do a Maximize. Congrats KDE, you're really blown it this time. Looks like I'm going with TWM.

Tuesday, June 30, 2009

iPhone NSUserDefaults and UISegmentedControl

Alright, iPhone forums mostly suck - very technically unfriendly - it actually reflects poorly on Apply - no cool factor here.

Anyhow, here's the prob:

NSUserDefaults is what you use to save some app state data to non-vol memory when you exit. I have a switch that toggles the display of an advanced options form. I save the state of this switch successfully. When the app is relaunched, the state is right, I'm able to display this form okay. But, the segmentedcontrol thing is not enabled. I have to cycle the switch twice before it gets enabled.

One line here is not working - the "YES" line :


if( [myDefaults boolForKey:@"advOpts"] ){

advOpts.on = YES;
lineStyleCtrl.enabled = YES;
[self advOptsToggle:nil];

}

Monday, April 27, 2009

Kundert Explains

spectre gurus speak - kudos to ACWWong of the UK as well.

How do you use spectre (and Cadence) to do a .stb analysis on your fully differential loop?

In unix, spectre -h stb
is a start - gives you something to read - which is not super helpful if you want to get stuff done, but, something's better than nothing.

The magic stuff is - use the cmdmprobe cell from analogLib and set the CMDM parameter to -1 if you want to measure the differential loop gain. Leave it at 1 for the common-mode loop gain.

Couldn't be simpler. Job well done folks.

And here's one time-saving tip when working on M$ Windows and needing to make screen captures - do a Windows-S key combo - now you get the option of doing a selective snapshot of a portion of your screen - eliminates on step - you don't have to do PrintScreen->Paint->Select. Now you can go straight from X-Windows to Windows app.

Saturday, March 14, 2009

Go Figure - TWM and .twmrc

When you have a .twmrc, even if it's blank, you're exterm title bar looks like this:



And, when you don't, it looks like this :



What gives? Tom LaStrange said it best in his reply to me:

Sorry, I can't help you. I haven't used twm for 20 years.

--
Tom L.

Wednesday, March 11, 2009

What Desktop Environment Are You Running?

Simple one, but I don't know how to fine out. The top right of the windows look like this. If I know which desktop environment this was, I could google for some keyboard+mouse shortcuts. This particular one doesn't seem to have any - really sucks.



Answer :

You are using twm http://xwinman.org/vtwm.php It is configurable but it is an ancient unmaintained version!

You really need to be using KDE especially KDE 4.1. Download and install Kubuntu 8.10 - it comes with KDE pre-configured. It's very very nice (like Apple's OS X). :-)

Resources :

The author's desk : LaStrange himself.
UWO.CA

Saturday, February 28, 2009

Foreach on Cygwin

Not only does my cygwin not have a manual entry for foreach, but it doesn't work.

foreach dir (*)

gives

bash: syntax error near unexpected token `(`

Any clues?

Yes. use:

for dir in *
do
whatever
done

Tuesday, February 10, 2009

Programs from G:

Simple one, but not for me.

I've installed some programs on my 80G HDD G:/ProgramFiles because my C: tends to fill up quickly.

Win XP is installed on C:

Question - now, if I reinstall XP on C:, is there anyway I can tell windows about the wonderful programs that I have on my G: and get them in my Programs list accessible from the Start menu?

Aus gurus:

Some may work out of the box. The ones that need registry entries won't and will require a reinstall. For the ones which work, you can drag shortcuts onto the start menu.

Tuesday, January 13, 2009

CPAN Bugs

Cockroaches and Pests Associated Network. Bugs for short. This page seems to have some useful help on this error :

cpan> i Term::ReadLine
Going to read /home/perl/sources/authors/01mailrc.txt.gz
Can't call method "value" on an undefined value at /usr/lib/perl5/vendor_perl/5.8/IO/Uncompress/RawInflate.pm line 64.

What idallen says is :

I ran an "install Bundle::CPAN" without first doing "apt-get install
build-essentials", and that was a mistake. Many things didn't build
fully, and CPAN wedged itself into a state where RawInflate.pm was
broken and nothing could be done. Make sure you run "apt-get install
build-essentials" first. It would be nice if CPAN would know this
somehow so that it didn't let you fail and wedge itself.

Running "apt-get remove libcompress-raw-zlib-perl" got CPAN un-wedged and
allowed "install Bundle::CPAN" to complete; but, when I did "apt-get
install spamassassin", it brought back the broken old version of
RawInflate.pm and CPAN was broken again! Looks like the Ubuntu package
for the compress library is too old for the current CPAN, and of course
CPAN and APT don't share version information and get along nicely.

------

Unfortunately, no one seems to have messed with this on Cygwin - so I can't find any non-guru-level stuff. Hmmm...

Here seems to be a helpful page that details how perl can behave differently on cygwin. Fascinating stuff if you don't have a life:

http://www.xav.com/perl/lib/Pod/perlcygwin.html

Saturday, January 3, 2009

Email with Cygwin

How? If you don't have mail or exim or mutt (last two I haven't heard of) ?

I want to hook up a motion-detector and a webcam to my PC. When the motion-detector fires, I want the PC to cature a picture from the webcam and make it available online - say on a blog, and send an email to my cellphone.