Wednesday, December 31, 2008

HTML framesets

A FRAMESET takes the place of the BODY

javascript assignment to variables.

This example that shows how to force a page to be displayed inside a frame was confusing at first. The reason was that I didn't understand that.

var ar2;
var num = 2;
window["ar" + num] = "frame4.html";

is the same as

ar2 = = "frame4.html";

Tuesday, December 30, 2008

The definitive guide.

Just found out that JavaScript: The Definitive Guide, 4th Edition is available online! I'm not sure if this is complete or not but either way it will be useful.

javascript learning curve

I've been working my way through the javascript lessons in javascript mall. Things were pretty easy until lesson 10. Lesson 10 showed a script that makes a calendar. I entered this on my own and found out that the javascript interpreter is pretty silent about mistakes. I worked my way through putting a calendar together. My goal was to construct one that looked more or less like the one that they showed in the example but by writing the code on my own. I used their code only for occasional html reference.

The process went slowly. I wanted to not only get through the lesson but to develop techniques that would speed the development process. After a while I looked for tools online. The most helpful was firebug. I also tried jslint but I must not be using it right; I didn't get any useful information from it.

here's the finished product

Monday, December 29, 2008

autoruns

After doing a windows update, I was getting an annoying error from some Nvidia rundll utility after every login. I tried using msconfig to fix this but it did not work. A little searching turned up autoruns which helped me take care of the problem.
Autoruns for Windows

Friday, December 26, 2008

javascript tutorial

Trying out: http://www.javascriptmall.com

javascript sandbox

Using http://javascriptsandbox.110mb.com as a test environment.
I need a testbed ; created http://sites.google.com/site/javascriptsandbox/ but google said my javascript is unsafe and will be removed when viewing.

Also tried posting directly into this blog but that does not seem to work.

javascript

I'm going to spend some time learning javascript. While doing so I will record my javascript related experiences in this blog.

Thursday, September 11, 2008

my firefox 3.0 extensions updated again

I'm a little disappointed with adblock. It seemed to be missing most of the ads that I expected it to block. This might be a configuration problem but I tried playing with it for a few minutes and did not see any obvious improvement.

So I backed out adblock and installed privoxy but *not* tor and added torbutton. This seems to work better.

Colorful Tabs
Delicious Bookmarks
Download Statusbar
Stumbleupon
Tab Mix Plus
Tree Style Tab
torbutton

my firefox 3.0 extensions updated

Colorful Tabs
Delicious Bookmarks
Download Statusbar
Stumbleupon
Tab Mix Plus
Tree Style Tab
adblock

Saturday, July 5, 2008

my firefox 3.0 extensions

Colorful Tabs
Delicious Bookmarks
Download Statusbar
Stumbleupon
Tab Mix Plus
Tree Style Tab

Sunday, June 29, 2008

imap to text messaging

A few days ago I got unlimited text messaging for my cell phone. This is a new thing for me. One feature that I didn't know that I was going to get is the ability to receive a text message that is sent to me via e-mail ( though not to send a text message to e-mail w/o getting an extra charge ).

I got to thinking that it would be nice to able to get e-mail through my phone while away from my computer. Ideally the technique for doing this would be independent of my email provider. After searching for and failing to find a program that would do this I ended up writing a python script that would monitor my IMAP inbox and send me a text message whenever a new entry appeared. The program is available in github:

git://github.com/dc25/imaptomsg.git

Monday, June 9, 2008

building knowit 0.11a1 on ubuntu 8.04

downloaded knowit-0.11a1.tar.bz2
ran make -f Makefile.cvs - this failed due to tool versioning problems and missing automake
sudo apt-get automake
edited admin/cvs.sh to fix versioning problems
make -f Makefile.cvs
./configure
make
sudo make install

can now run /usr/bin/knowit

building knowit on ubuntu 8.04

downloaded stable knowit
./configure failed with following error message:
checking for Qt... configure: error: Qt (>= Qt 3.0) (headers and libraries) not found. Please check your installation!

Installed the following packages using synaptic:
qt3-devtools (may not have needed this one)
libqt3-headers
libqt3-mt-dev
kde
kde-devel

./configure
make
sudo make install

(success!)

can now run knowit as /usr/local/kde/bin/knowit

Wednesday, April 16, 2008

switching to mercurial

After using bazaar for a few weeks, I'm switching to mercurial because it is faster. I was seeing check across the network (using bzr+ssh) in of a modified quicken qdf file ( about 12mb) take 15 minutes or so. Using mercurial this takes just a few seconds. I imagine that mercurial is doing a better job of diffing binary files. Also mercurial has better error messages. Also, mercurial worked out of the box in cygwin - though I'm using the windows native mercurial now.

I still like some things about bazaar better. It seems to handle empty directories better - I'm not sure if mercurial handles them at all. Mercurial assigns a hex string to each version. Is it a hash key? Probably. These strings are more visible than I would like them to be.

I still may try git at some point. For now though, I'm using mercurial.

Monday, April 14, 2008

ypops on ubuntu linux

I've been working in linux today. After yesterday's success with ypops. I wanted to get it working on linux as well. Unfortunately there does not appear to be an ubuntu package for ypops available ( though I did not look too hard).

So, I went to sourceforge for the source but it did not compile. Both the most recent CVS and the code tagged YPOPS_0_9_5_1 does not compile. However, from searching through the ypops forums, I did find the following:

YPOPs! 0.9.5.1 sources for UNIX platform

Posted by Thomas Skariah in this ypops forum entry along with instructions for compiling.

Thank you Thomas.

This code compiles and links. I glanced at the differences between Thomas's version and the cvs code and it all looks good.

Having compiled and linked the code I put my new ypops binary into /usr/local/bin . To get it to start up automatically on ubuntu 8.04, I created a file called /etc/event.d/ypops with the following content:
----------------------------------------------------------
description "start ypops"
author "Dave"

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

console output

exec /usr/local/bin/ypops

-----------------------------------------------------------

This file instructs upstart to start ypops .

Having done all this I can read my yahoo e-mail with thunderbird using localhost as my server.

Sunday, April 13, 2008

ypops

I belong to a few yahoo groups - essentially yahoo mailing lists. Rather than log on to yahoo multiple times to read the e-mail from these lists, I use "ypops", a nice little open source that provides a pop3 interface to yahoo. A couple of months ago it stopped working. Well, today I looked into it and learned that by setting yahoo e-mail to use the new-and-improved online yahoo mail interface, ypops works again

Thursday, April 10, 2008

TiddlyWiki

I'm using tiddlywiki again. I had used it before but stopped because my data seemed to be getting corrupted. I had (have) backups but didn't want to bother searching for the time of corruption and then dealing with entries past then. I weeded the useful info out and stored it in google notes but was not too happy with that because:

1. I was/am a little concerned about security - not that I had anything of a sensitive nature stored but just the principle of the matter bothers me.

2. I never looked at it. This is more important. I want something that I can double click and *easily* edit. google notes didn't satisfy that need but tiddlywiki does.

So now I'm using tiddlywiki again and my data is under version control and the version control data itself is backed up. This is mostly for speed of access reasons. With the data under version control I can keep my working copy locally. Hopefully it will also help prevent/track corruption problems.

Saturday, March 22, 2008

merging from an unrelated bzr project.

After converting my old svn repositories to bzr, I was left with a few other projects that had been in bzr all along that I wanted to integrate into the larger bzr collection. In this e-mail thread in one of the bzr mailing lists. I found a technique for doing this.

It says:

Currently, the way to do it is to set the base to 0 explicitly. E.g.
"bzr merge -r 0..-1 OTHER_BRANCH".


I'm such a bzr novice that I don't even know for sure exactly what this means but it seemed to work.

Friday, March 21, 2008

migration to bzr

For several years now, I've been using svn for VC on my personal files. When I upgraded my server to ubuntu gutsy, I started running into some trouble with svn. I could read repositories but was getting database errors when I tried to write to them. Rather than try to figure this out, it seemed like a good time to switch to bzr.

This ended up working pretty well. I used svn2bzr.py to convert the svn repos to bzr and now remote access works with bzr+ssh. I created a bzr user to manage the repos. At first I forgot to change the repository ownership to bzr so I had some permission problems but these went away upon correctly setting the ownership.

I ended up upgrading my server bzr version from 0.9.0 to 1.2 which seemed to make things run smoother. I'm not sure whether or not the problems that I was seeing were related to the permissions issue or the version though. On windows, I'm currently running 1.3

I still need to do a checksum on binary files to make sure that they came through the transition ok but so far everything seems fine.

Incidentally, I'm also using a root level bzr repo on the server to track changes to config files. So far so good.

Wednesday, March 19, 2008

installing ubuntu 7.10 ( gutsy) over the network

I have a machine that I've been using as a server for a couple of years. Unfortunately, it has a broken cdrom drive which means that I can't easily reinstall a new operating system. I *could* bite the bullet and get a new cdrom but I have not done this because it needs a laptop drive and I don't want to pay the extra expense, I'm a little concerned about compatibility and I am not sure how much trouble it is to swap out the drive.

In any case, this machine has been long overdue for a os upgrade. I have been running some old version of ubuntu (hoary?) and I wanted to start from scratch with gutsy. The important data is on a couple of partitions that I can leave untouched and I had some free space on the drive.

My first thought was to copy an iso to a usb key but this did not work because, to my surprise, the machine does not have a way to boot from usb.

So, I fell back on installing from the network. For several years now I've done this with varying degrees of success using this page as a reference.... and I'm happy to say it worked today.

However, it took me a couple of times to get it to work. I think I might have downloaded the wrong linux/initrd.gz/default files the first time around. It took me a few tries to figure out how to specify the paths to the files in the menu.lst file for grub (it ended up being by full pathname). It was essential to specify a desktop environment to install - I used vanilla ubuntu - without that things just didn't seem to work at all. I had to specify /dev/sda to install grub onto the mbr instead of /dev/hda like the example said.

All that is behind me now and things seem to be working just fine!

Sunday, March 16, 2008

git vs bzr - further impressions

I find myself leaning towards bzr. I've been using git for a while now and the commands just seem less intuitive. For example. git-checkout with no arguments tells what items are deleted from a repository but git-checkout with an argument restores the argument if it is deleted. I'm not sure what git-checkout with an existing argument does.

Thursday, March 13, 2008

bzr-svn

Somehow I got the idea that it would be cool to be able to checkout a sourceforge project using the bzr-svn plugin. It turns out that this plugin requires an old version of bzr (1.1) and an unreleased version of svn (1.5) or later. I don't mind the old version of bzr but I don't want to take the time to build the new svn so this will have to wait. Maybe I'll try git-svn .

Monday, March 10, 2008

windows permissions problem (solved)

Yesterday I discovered that users other than myself could not install new software on a shared computer. This was due to not being able to access the "Program Files" folder. The other users all had administrator status but that did not seem to be enough.

It turns out that there is a level of control in windows that only shows up when in safe mode (!). For some reason, only I had full access to the "Program Files" . After booting in safe mode I was able to add full control for the administrators group and this took care of the problem.

Without being in safe mode, I couldn't even diagnose the problem since user/group access settings were not visible. Is there a program that will let me view/edit these settings in normal mode?

I also am curious as to what program changed these settings? Perhaps coLinux/andLinux since these packages have to do some things at a pretty low level and they have the option for file sharing between linux/windows - that's just a guess though.

Wednesday, March 5, 2008

on second thought

On second thought another way to handle the c++ -> calc connection would be to use swig to enable python to call c++. This way the spreadsheet could be used to handle both input and output. So... the next experiment is to call python functionality from inside of calc.

And it turns out it's easy. Just put the python program into:
c:/Documents and Settings/dave/Application Data/OpenOffice.org2/user/Scripts/python
and it is available as a macro. Need to play with this a little to see if it really suits my needs.

Still need to see if I can get swig to work with the python that comes with open office.

This may be a problem. The swig documentation implies that you need version compatibility between the python executable and the swig code for swig to work.

Yes this is a problem. I can't yet even compile the swig examples because the python included with open office is not a complete developement environment. Or at least I can't find the Python.h include file needed to compile the swig examples.

c++ to python communication

My next mini project is to get a c++ program talking to a python program. My expectation is that the solution for this problem will be a networked solution. I want it to be portable of course.

The first candidate is xml-rpc. I've used this in the past with c++ to c++ communication but it was some work to make the implementation that I was using work under windows so I will look for other clients. I'm not sure what I have in the way of alternatives in python but porting should not be an issue there.

After looking around a little at xml-rpc alternatives I found xml-rpc++ ( in sourceforge ) which looks like it might be a better option. The demo is easy to build and seems to work. This is only c++ to c++ code so I need to look into what is needed to make python work as a server.

And it works! Using xml-rpc++ as client and the built in xmlrpc python server I have the two programs talking!

Tuesday, March 4, 2008

open office spreadsheet scripting

I would like to be able to use output from a program to control an open office spreadsheet. Ideally this solution should work in both windows and linux. This blog entry is a record of my experiences.

Posted a how to question to the open office forum. Got a number of "yes it can be done" responses and some links to reference sites.

The available options seem to be c++, python, java, and beanshell ( a java scripting ) language. I'm going to try c++ first, then python, then beanshell, then java.

Tried c++. Started by downloading the open office sdk. It does not seem very well configured for windows. There are no include files but there are .idl files that are used to create include files. The tool for doing this is an executable called cppumaker and is available but it's not clear how to use it. It's invoked through the makefile which does not work on cygwin. I'm going to look for some cppumaker documentation but not for too long.

Found documentation for cppumaker but it's not easy to follow. On to python.

Python is a winner. Open office has a built in python and I found this article that tells how to interface to open office. The article uses open office writer for its example but I expect that the techniques will be easily adaptable to calc.

Monday, March 3, 2008

colinux / andLinux - followup

It looks like colinux and/or andlinux is not quite there yet. The functionality is nice but does not always seem to start reliably and also has a hard time shutting down. I'll wait until the next beta release and hope for better.

Sunday, March 2, 2008

git - first thoughts

Similar to bzr/hg. Unlike bzr but like hg appears not to treat directories as entities unto themselves. Seems strange to have to add changes to a file that is already in the database.

colinux / andLinux

I just installed andLinux ( a derivative of colinux ) on my windows machine. This looks like the best windows / linux interoperability solution I have seen so far. I can install native linux apps using apt-get and run them almost seamlessly.

Thursday, February 28, 2008

openomy.com / searching for free file storage - followup

The file modification problem that I mentioned a few posts ago was fixed a very short time after I sent them e-mail about it. Openomy remains the ideal solution for public file storage.

Wednesday, February 27, 2008

firefox extensions I use

foxylicious
delicious bookmarks
vertigo
fullerscreen
roboform
download statusbar

searching for free file storage - followup

A couple of days ago I said that openomy.com was the "perfect" solution for online file storage. Since then I found that I can not modify ( re-save ) a file w/o breaking the public link to that file. This is annoying but not a showstopper. I sent e-mail to the openomy developer about this.

bzr vs hg - first impressions

I've been trying out different version control systems. For a while I used svn but never was happy with the branching support. More recently, I have been using bzr but only locally. This morning, I tried out mercurial ( hg ) . My first impressions are:

Commands seem a lot like bzr.
Does not seem to allow addition of empty directories ( unlike bzr ).

Monday, February 25, 2008

how to build quantlib 0.9.0 using Visual Studio 2008 Express

These instructions are for building quantlib 0.9.0 in the Visual Studio 2008 Express Edition interactive development environment.

To build quantlib you will need The Microsoft Windows SDK for Visual Studio 2008 . This is available as an option when installing Visual Studio 2008.

You will also need boost installed on your system. See the previous blog entry for a way to build and install boost 1.34.1 in a way that will work with quantlib.

Click here to download quantlib 0.9.0 from sourceforge.

The quantlib 0.9.0 code needs some changes to work with Visual Studio 2008. You can use this patch
to make these changes. Instructions for applying the patch are in the patch (a text file) itself.

At the top level of the quantlib source code tree ( QuantLib-0.9.0 ) is a "msvc solution" file: QuantLib_vc8.sln . Open this with msvc 2008 . You will be asked if you want to convert older solutions/projects to the latest version. Answer yes and let the conversion proceed.

You will need to let the compiler and linker know where to find the boost files. Do this by selecting "Tools/Options/Projects and Solutions/VC++ Directories" (starting from the menu bar and ending up in a dataform). Add C:\Boost\include\boost-1_34_1 to the include directories. Add C:\Boost\lib to the Library directories.

Change the Output_File under Project/Properties/Configuration_Properties/Librarian/General from .\lib\QuantLib-vc80-mt-gd-0_9_0.lib to .\lib\QuantLib-vc90-mt-gd-0_9_0.lib

Press F7 to compile and link.

how to build boost 1.34.1 with Visual Studio 2008 Express

These instructions are for building boost 1.34.1 with visual studio 2008 express edition from a cmd prompt.

To build boost you will need The Microsoft Windows SDK for Visual Studio 2008 . This is available as an option when installing Visual Studio 2008.

To run Visual C++ (vc++) from the command prompt you will need some msvc related environment variables. Msvc comes with a batch file that sets these environment variables. An easy way to use this batch file to copy the "Start/All Programs/Accessories/Command Prompt" short cut from the start menu to your desktop and then change the short cut target property to %SystemRoot%\system32\cmd.exe /K call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat". After doing this, this short cut should bring up a command environment ready to run vc++. All the command line work described in the remainder of this post should be done using a cmd window in which vcvarsall.bat has been run ( whether through the shortcut just described or by some other means ).

Download boost 1.34.1 from sourceforge.net and uncompress. I used the zip file here

The 1.34.1 code needs some changes to work with Visual Studio 2008. You can use this patch to make these changes.

Instructions for applying the patch are in the patch (a text file) itself.

After extracting and patching boost, build bjam (the boost build tool) from the cmd shell as follows:

cd boost_1_34_1\tools\jam\src
build.bat

This should build src\bin.nt\bjam.exe, the command that you will use to build the rest of boost. You may see a few errors which you can ignore as long as bjam.exe gets built.

After making these changes, go to the top level directory: boost_1_34_1 and run:
tools\jam\src\bin.ntx86\bjam.exe
and then:
tools\jam\src\bin.ntx86\bjam.exe install

This will build the boost libraries and install them in c:\Boost .

Friday, February 22, 2008

searching for free file storage

I'm looking for free file storage. I don't need much space - for now all I want to do is to make some patches publicly available. I tried pasting a patch directly into one of these blog entries but that didn't work due to formatting restrictions ( some things that looked like HTML were rejected).

Tried yahoo briefcase but that didn't allow for free public sharing of files.

Tried xdrive but I wasn't even able to set up an xdrive or an aol account. Probably could have if I kept at it but the fact that account creation seemed to be in poor repair was a bad sign.

Tried snapdrive.net. Account creation was a breeze but uploading/managing files is very slow and results in blank screens and in fact may never have worked.

Looked at filesanywhere.com . They want you to log in every 60 days to maintain a free account. I'm going to look elsewhere for now but may come back to this one.

Found this review of online storage sites: http://www.techcrunch.com/2006/01/31/the-online-storage-gang/

Looked at omnidrive.com but their site was very slow - couldn't even register.

Tried out mediamax.com - the best so far. However the one file that I have uploaded has not appeared in my file manager yet. Their page said something about processing time so maybe there is some delay. Going to keep looking for now.

Tried esnips.com - very nice but does not provide for direct linking to uploaded files. Other than that seems good - fast, easy to use, etc. May come back to this one.

Tried openomy.com - This one seems perfect! Simple, and fast.

Thursday, February 14, 2008

fish shell compiled on cygwin

I'm trying out the fish shell in my cygwin environment. As far as I can tell this is not available as a package so I had to build it myself. Here are the steps required as best as I can recall.

1. iconv: download, configure, make, make install
2. download & unpack fish
3. remove iconv_open check from configure.ac
4. export LDFLAGS=-liconv
5. replace ARG_MAX in exec.c with _POSIX_ARG_MAX (this is optional in limits.h so I think this is a fish source code problem.)
6. configure, make, make install

Thursday, January 3, 2008

graphics under qt4 on linux

My sample qt and sample qt/opengl program worked just fine on linux. All needed was to install qt4 packages, create a .pro file specifying sources, run qmake and make.