Re: [vox-tech] Simple fixed field parsing language (DSL)

2013-05-30 Thread Harold Lee
The other really cool aspect is that your ANTLR parser is parsing the
format.txt in order to build a parser for sample.dat.


On Thu, May 30, 2013 at 2:21 PM, Harold Lee  wrote:

> This makes a really cool sample project for how to use ANTLR :-)
>
> These days on the JVM I'd favor Scala parser combinators. Here's a great
> example of solving a similar problem (CSV) with those:
>
>
> http://stackoverflow.com/questions/5063022/use-scala-parser-combinator-to-parse-csv-files
>
>
> On Wed, May 29, 2013 at 8:36 PM, Brian Lavender  wrote:
>
>> I created a simple language inspired by the picture format in COBOL.
>>
>> https://github.com/brieweb/fixedfield.git
>>
>> In order to run it, you need Maven 3 and Java 6.
>>
>> brian
>> --
>> Brian Lavender
>> http://www.brie.com/brian/
>>
>> "There are two ways of constructing a software design. One way is to
>> make it so simple that there are obviously no deficiencies. And the other
>> way is to make it so complicated that there are no obvious deficiencies."
>>
>> Professor C. A. R. Hoare
>> The 1980 Turing award lecture
>> ___
>> vox-tech mailing list
>> vox-tech@lists.lugod.org
>> http://lists.lugod.org/mailman/listinfo/vox-tech
>>
>
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Simple fixed field parsing language (DSL)

2013-05-30 Thread Harold Lee
This makes a really cool sample project for how to use ANTLR :-)

These days on the JVM I'd favor Scala parser combinators. Here's a great
example of solving a similar problem (CSV) with those:

http://stackoverflow.com/questions/5063022/use-scala-parser-combinator-to-parse-csv-files


On Wed, May 29, 2013 at 8:36 PM, Brian Lavender  wrote:

> I created a simple language inspired by the picture format in COBOL.
>
> https://github.com/brieweb/fixedfield.git
>
> In order to run it, you need Maven 3 and Java 6.
>
> brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] C++ problem

2012-05-13 Thread Harold Lee
Using delete[] for an array allocated with new[] is correct, so I
don't think you've given us enough information to find the bug.

Are you getting any compiler warnings or errors?
Have you tried compiling with -Wall and -Wextra?
Are any of these overwritten variables pointers into the array var?
Could the array size stored at address (var - 4) have been overwritten
by accident by some other code?
Have you tried using valgrind to automatically find an accidental
overwrite earlier in execution?

Harold

On Sat, May 12, 2012 at 11:38 PM, Jeff Newmiller
 wrote:
> It did make it to me, but
>
> a) I am out of town away from computers, and
>
> b) without a working example I probably would not look at it very closely
> ---
> Jeff Newmiller                        The     .       .  Go Live...
> DCN:        Basics: ##.#.       ##.#.  Live Go...
>                                      Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> Richard Harke  wrote:
>
>>My last post seems to have gotten lost so I'll try again.
>>
>>I'm working on a small C++ program. In one of the constructors I
>>create an array with
>>double * var = new double [size]   After use, before exiting the
>>constructor I return the memory with delete [] var  But after return
>>from the delete, several private class variables are written over.
>>I have checked that these variables are correct just before the delete
>>call and are modified right after. Does anyone have any idea what is
>>going on?
>>
>>I'm running debian squeeze for amd64  with gcc 4.4.5 This morning I
>>did an apt-get upgrade to be sure I had any recent fixes.
>>
>>Richard Harke
>>___
>>vox-tech mailing list
>>vox-tech@lists.lugod.org
>>http://lists.lugod.org/mailman/listinfo/vox-tech
>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Secure Wiping hard drives

2012-05-11 Thread Harold Lee
There are a bunch of secure delete programs that one-up dd by
overwriting the file many times, asking the OS to sync the changes to
disk immediately, etc.

srm, wipe, shred and diskscrub documentation all reference a paper by
Peter Gutmann: "Secure Deletion of Data from Magnetic and Solid-State
Memory" 
(http://static.usenix.org/publications/library/proceedings/sec96/full_papers/gutmann/).

wipe (http://lambda-diode.com/software/wipe) seems to overwrite the
disk 34 times with different bit patterns. srm defaults to 35 passes.

Harold

On Fri, May 11, 2012 at 4:07 PM, Brian Lavender  wrote:
> Perhaps dd from /dev/zero is the solution for this problem? Wikipedia
> makes reference to a SpringerLink publication. See below for both.
>
> http://en.wikipedia.org/wiki/Dd_%28Unix%29#Disk_wipe
>
> Wright, Craig; Dave Kleiman2, and Shyaam Sundhar R.S. (2008). "Overwriting
> Hard Drive Data: The Great Wiping Controversy". Lecture
> Notes in Computer Science. Information Systems Security 5352:
> 243.257. doi:10.1007/978-3-540-89862-7_21. Retrieved 7 March 2012.
>
>
>
>
> On Fri, May 11, 2012 at 03:47:39PM -0700, Norm Matloff wrote:
>> Zeroing out all bytes gives some level of security, but is not enough
>> against a truly determined adversary who has lots of resources,
>> according to what I've read.
>>
>> A disk drive, being a mechanical device, will write to a slightly
>> different physical spot each time it writes to a particular bit position
>> on the disk.  Sophisticated sensing mechanisms may thus be able to
>> determine what had been stored in that bit before a 0 was written to it.
>>
>> For that reason, the more sophisticated shredding utilities do more than
>> merely write 0s; they will do so multiple times.
>>
>> Norm Matloff
>>
>> ___
>> vox-tech mailing list
>> vox-tech@lists.lugod.org
>> http://lists.lugod.org/mailman/listinfo/vox-tech
>
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] writing to a shell instance

2011-10-26 Thread Harold Lee
You could do this at an X11 level, e.g.

http://www.doctort.org/adam/nerd-notes/x11-fake-keypress-event.html

This tool looks promising also, but I haven't tried it:

http://www.semicomplete.com/projects/xdotool/

I think you'd need to use some Windows API to do this there.

Harold

On Wed, Oct 26, 2011 at 4:20 PM, Bruce Wolk  wrote:
> On 10/26/2011 03:34 PM, Norm Matloff wrote:
>>
>> Here's what I'd like to do.  I'm running code, in this case Python, in
>> xterm A (replace by your favorite terminal emulator), and want that code
>> to write to xterm B, just as if I had typed directly into xterm B.
>>
>> Say for example I want to run the ls command in xterm B, but do so via
>> some action in A.  Say the latter is /dev/pts/8.  I could run the Python
>> code
>>
>> import os
>> os.system('echo "ls">  /dev/pts/8')
>>
>> I have 2 questions:
>>
>> 1.  How do I get the end-of-line character in there, so that the ls
>> command actually runs?  I've tried "ls\n", "ls \r\n" and lots of
>> variants, e.g.
>>
>> echocmd = 'echo "ls'+chr(14)+chr(10)+'">  /dev/pts/13'
>> os.system(echocmd)
>>
>> But no matter what I try, it doesn't work.  The "ls" does appear in
>> xterm B, and the newlines, but it's still expecting more input from me.
>> If I manually hit Enter in xterm B, then it works.
>>
>> I know this must be simple ridiculously simple, but I don't see it.
>>
>> Yes, I know I could use a pipe here, but I want to retain the ability to
>> manually type in xterm B, i.e. I want to be able to input there either
>> by physically typing there or by having the program in xterm B do it.
>>
>> Maybe I can launch xterm A via a pipe in the first place?  I've tried
>> that a bit, but don't have enough experience with pipes to see how to
>> make that work either.
>>
>> One solution is to use "screen," which is what I'm doing currently,
>> but some people would like to use my program from Windows.
>>
>> 2.  Which brings me to my next question:  How can I do this in Windows?
>> (Not Cygwin.)
>>
>> Any ideas would be much appreciated.
>>
>> Norm
>
> As for question 1, backticks are what you want:
>
> echo `ls` > /dev/pts/8
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] HTML coding conundrum

2011-07-31 Thread Harold Lee
You can generate links to a bunch of files using "find":

cd /path/to/parent_directory
find directory_name -type f \( -name '*.jpg' -o -name '*.jpeg' -o -name
'*.gif' \) | while read filename ; do echo "$filename"; done

The "-o" means OR, so you can add more file extensions in the find command.

You can put this output into your HTML if you just want to generate a bunch
of links. Or you can use the find command this way to bulk post pictures to
some online gallery (e.g. a Drupal or Wordpress site) using curl or wget
instead of echo.

Harold

On Fri, Jul 29, 2011 at 6:46 PM, Darth Borehd wrote:

> I have a lot of club media files (pictures, videos, and sound) on a drive
> running Ubuntu 10.04 LTS.  I want to share these media files on the
> Internet.  I figure the best way is to make a webpage with links that
> correspond to the files, so clicking on a link downloads the file or plays
> it in browser.
>
> The problem is there are thousands of these little files.  I tried manually
> creating links by copying and pasting, but it's taking me to long.
>
> I tried webmagick, but I found it only works on picture files.  Otherwise,
> it looks to be exactly what I want.
>
> Any suggestions?
>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Baffling C++ problem

2011-07-15 Thread Harold Lee
Looks like you're missing a << between the " " and the g2_n[i]

On Fri, Jul 15, 2011 at 4:23 PM, Richard Harke wrote:

>   if (i_cnt < 10) {
> std::ostringstream file_name;
> file_name << "ch" <<  i_cnt << std::ends;
> std::ofstream test_file(file_name.str().c_str());
> test_file << std::setprecision(15);
> test_file << "  r   X_n   X_nf  Z_n   Z_nf   g1_n   g1_nf  g2_n
> g2_nf  mass_n  mass_nf";
> test_file << std::endl;
> for (int i = 0; i < size; i++) {
>   test_file << r1[i] << ' ' << X_n[i] << ' ' << X_nf[i] << ' ' <<
> Z_n[i] << ' ' << Z_nf[i]
> << " " << g1_n[i] << " " << g1_nf[i] << " " g2_n[i] << " " <<
> g2_nf[i] << ' '// this is line 1785
> << mass_n[i] << ' ' << mass_nf[i] << std::endl;
> }
> i_cnt++;
>
>
> grid.cc: In member function 'void
> Grid::interpolate_from_parent(Special_Float)':
> grid.cc:1785: error: expected `;' before 'g2_n'
> make: *** [grid.o] Error 1
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Programming languages and the Haskell meeting

2011-06-30 Thread Harold Lee
As a functional programming alternative to lex/yacc, flex/bison and ANTLR
for parsing, I've enjoyed using parser combinator libraries like Parsec in
Haskell (included in GHC) and Scala's built-in scala.util.parsing.combinator
library.

Harold

On Thu, Jun 30, 2011 at 10:39 AM, Brian Lavender  wrote:

> I was initially excited about the Haskell presention, but at the end
> I was sort of disappointed. It seemed like we got a lot of "This is
> really good stuff", but I was looking for a little more of "show me
> what you have done or are doing". But hey, I did learn about using let
> for defining functions in ghci. That was good news. I had been always
> loading functions from files.
>
> I took a class on Programming Language Principles at Sac State where we
> used SML to define the grammar, do static analysis, dynamic analysis,
> and finally evaluate the program. The starting point for this was that we
> manually derived the program in Bauchus Naur Form.  SML is a functional
> programming language and in the end, we could see the power of SML. Yet,
> I have been eager to continue doing work in this area.
>
> Here are few tools/resources I am excited about and I would like to
> share.
>
> 1. Most languages are constructed using a Context Free Grammar (CFG)
>   and ANTLR works has a graphical interface for laying out your rules.
>   It will construct the lexer and parser code too,
>   but beyond that, I don't think Java is the right tool.
>   http://www.antlr.org/download/antlrworks-1.4.2.jar
>   http://www.antlr.org/
>
> 2. I got a hold of Dan Friedman's book
>   "Essentials of Programming Languages". It uses Scheme and one
>   can use Dr. Racket (http://racket-lang.org/) that has a
>   EOPL (abbreviation for the book) mode.
>
> 3. I found that my thinking recursively could be improved, so I also
>   got Dan Friedman's book titled "The Little Schemer". It has
>   a lot of practical examples that I think really help look
>   at things recursively, as seems to be essential in writing
>   a language.
>
> Hopefully someday, I will have a language of my own. ;-)
>
> brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] best way to validate an XML file?

2011-06-09 Thread Harold Lee
There's also Jing (http://www.thaiopensource.com/relaxng/jing.html), which
supports several flavors of schemas.

On Wed, Jun 8, 2011 at 1:35 PM, Bryan Richter wrote:

> On Wed, Jun 08, 2011 at 12:52:20PM -0700, Brian Lavender wrote:
> > What is everyone using to validate an XML file on GNU/Linux? I have a
> > pom.xml file that I would to check is valid.
>
> I used xmllint, which is in the libxml2-utils package on Ubuntu.
> However, I recall I mostly used it for parsing, and I think the
> version I used didn't even support validation.
>
> It appears to support it now, however. The system I was using xmllint
> on was 'stable' and enterprise-y and had old software. :)
>
> -b
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] hsqldb

2011-03-22 Thread Harold Lee
I've used HSQLDB for unit testing in the past. I wrote JUnit test
cases that access an in-memory HSQLDB database (which is created with
sample data each time the unit tests are run): very fast, and you
don't need to run a separate database server for your tests. Works
great!

Harold

On Tue, Mar 22, 2011 at 10:42 AM, Brian Lavender  wrote:
> Many of you have probably used HSQLDB without realizing it.
> OpenOffice uses it!
>
> Here is some info on HSQLDB. A lot of tutorials for Java use HSQLDB, but
> you can use HSQLDB with PERL too. You can start an HSQLDB server with a
> single command. The following will start a database with called EMPLOYEE.
>
> java -cp /hsqldb.jar org.hsqldb.Server -database.0 file:db/employee 
> -dbname.0 EMPLOYEE
>
> The data for EMPLOYEE will be stored in the sub-directory db.
>
> HSQLDB comes with a nice GUI tool too!
>
> java -cp /hsqldb.jar org.hsqldb.util.DatabaseManager -driver 
> org.hsqldb.jdbcDriver -url jdbc:hsqldb:hsql://localhost/empoloyee -user sa
>
> You can download hsqldb from the below site. Thus far, I have used 1.8.0 
> version. There is a new version,
> but I believe it works a bit different. But,... it probably comes with more 
> features.
> http://www.hsqldb.org
>
> Here is some documentation using HSQLDB with PERL.
> http://hsqldb-ber.sourceforge.net/
>
> brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] crontab and scp puzzle

2011-03-16 Thread Harold Lee
Are you passing your public or private key filename via -i?

These lines imply that scp tried to use the file as a private key but
failed because it couldn't figure out what kind of file (rsa/dsa) it
was. That happens if you use the id_dsa.pub instead of the id_dsa
file.

debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type 

Harold

On Wed, Mar 16, 2011 at 5:37 PM, Bruce Wolk  wrote:
> I tried -B as well.
>
> On 03/16/2011 05:36 PM, Michael Wenk wrote:
>> I was going to suggest the -B option, but that should be the same as
>> -o BatchMode=yes ...
>>
>> Mike
>>
>> On Wed, Mar 16, 2011 at 5:09 PM, Kyle Ambroff  wrote:
>>> On Wed, Mar 16, 2011 at 5:06 PM, Kyle Ambroff  wrote:

 I know I've used this answer before on this list, and I'm sure it's 
 annoying, but if your solution involves passphraseless ssh keys, you're 
 doing it wrong.
 That being said, since cron is a daemon, it is not attached to a 
 controlling terminal. That means that a script that expects to be able to 
 read input from the user is going to fail. You can probably force it to 
 bypass this code with BatchMode.
      ssh -o BatchMode=yes ...
 For good measure, you could even set TERM if it's not being set.
      env TERM=dumb ssh -o BatchMode=yes ...
>>>
>>> Replace "ssh" with "scp" and that still works.
>>> ___
>>> vox-tech mailing list
>>> vox-tech@lists.lugod.org
>>> http://lists.lugod.org/mailman/listinfo/vox-tech
>>>
>>
>>
>>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] exiting slime?

2011-01-31 Thread Harold Lee
For commands to the slime system (not lisp code), start with a comma.
The command that kills the child process and ends your slime session
is ",quit". The is tab completion after you type comma.

Harold

On Sun, Jan 30, 2011 at 2:26 PM, Brian Lavender  wrote:
> In emacs, if I do
>
> M-x slime
>
> it starts slime, a scheme clisp or whatever dialect, REPL.
>
> How do I kill or exit it?
>
> brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "Keep your feet on the ground and keep reaching for the stars."
> --Kasey Kasem
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Idea for 'tee' -- shut up already!

2010-12-04 Thread Harold Lee
Nick hack!

I like to do this:

cat hugefile.log | grep whatever | cut -f 1,2,3 > output.txt &
tail -f output.txt

You'll get the same effect, but when you hit Control-c you'll just
kill the tail command. The pipeline building output.txt keeps running
in the background. But if you end up viewing the entire output, tail
won't tell you when the pipeline exits, it'll just sit there waiting
for some other process to append to output.txt - you have to exit the
tail command. Great for log files, e.g.:

tail -f access.log | grep Safari

When experimenting to find the right parameters for grep/egrep/cut, I
usually use |more or |less to preview the grep/cut operation and then
re-run with |tee. But after you asked this, I went looking and sure
enough, less has a command for this. From the man page:

s filename

  Save the  input to  a file. This only works if the input is a
  pipe, not an ordinary file.

So you'd run

cat hugefile.log | grep whatever | cut -f 1,2,3 | less

Check the output, then type "s" and "output.txt" when you want to stop
viewing it.

Harold

On Fri, Dec 3, 2010 at 4:41 PM, Brian Lavender  wrote:
>
> On Fri, Dec 03, 2010 at 02:13:15PM -0800, Bill Kendrick wrote:
> >
> > So I'm grepping & cut'ing a huge log file (6.4 million lines)
> > and made the mistake of deciding to pipe it through "tee" to
> > watch for a while.  I forgot to do this from within a "screen"
> > session, so I'm kind of stuck staring at it in a terminal.  *sigh* :)
> >
> > I don't want to watch any more, and wish I could do something like,
> > I dunno maybe like this...?
> >
> >
> >   $ cat hugefile.log | grep whatever | cut -f 1,2,3 | tee output.txt
> >   {huge dump of data}
>
> Signal handler perhaps in a shell script that toggles output to stdout?
> http://linuxcommand.org/wss0160.php
>
>
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "Program testing can be used to show the presence of bugs, but never to
> show their absence!"
>
> Professor Edsger Dijkstra
> 1972 Turing award recipient
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] creating a bootable USB key

2010-11-16 Thread Harold Lee
I was thinking the same thing: how to boot Linux from a USB key on a Windows PC.

But if you want to make a Windows installer USB key, try this article from MS:

http://technet.microsoft.com/en-us/magazine/dd535816.aspx

On Tue, Nov 16, 2010 at 10:51 AM, Brian Lavender  wrote:
> On Tue, Nov 16, 2010 at 10:14:33AM -0800, Brian Lavender wrote:
>> On Tue, Nov 16, 2010 at 01:29:13AM -0800, Thomas Johnston wrote:
>> [snip]
>> >
>> > My question is, has anyone successfully made a bootable windows USB
>> > key using Linux? If so, how did you do it?
>>
>> Let me just share my own experience and see if it provides assistance.
>
> Sorry, I just automatically saw bootable USB. I missed that you wanted it to
> be a Windows bootable.
>
> I found this. Did you try this? It's not "free" software in the sense of 
> freedom.
>
> It uses components of free software components and works with XP and
> 2003 server. I don't know about Windows 7 though.
>
> http://www.nu2.nu/pebuilder/
>
> I found it as a result of this page.
> http://www.tomshardware.com/reviews/windows-pocket,1113.html
>
> brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "Program testing can be used to show the presence of bugs, but never to
> show their absence!"
>
> Professor Edsger Dijkstra
> 1972 Turing award recipient
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Experiences with linode or similar?

2010-11-10 Thread Harold Lee
Thanks for all the great feedback.

On Fri, Oct 22, 2010 at 3:20 PM, Ryan Castellucci
 wrote:
> On Thu, Oct 21, 2010 at 05:00:56PM -0700, Scott Miller 
> scottlinux-at-gmail.com |lugod| wrote:
>> The only 'bad' thing (depending on your use or who you ask) is disk
>> space. You do get 16GB in the $20 plan which is enough for me.
>> Understand these are 15k SAS drives, so it's expensive storage but
>> crazy fast performance.
>
> Well, you don't have a dedicated spindle, so the IOPS isn't really
> impressive, but it is good enough for the most part.  You can also buy
> extra storage a la carte.
>
>> The cpu is a 4 core Xeon. I've never been able to utilize all of the
>> available CPU.
>
> Clearly you're not trying hard enough ;-)
>
>> Linode has a very good control panel, iphone app, and DNS manager
>> tools. Forum is there and friendly, but not very active.
>
> I'm fond of the DNS manager - way better than most I've seen.  They also
> have an IRC channel on OFTC, which *is* quite active and usually has
> staff in it.
>
>> I highly recommend Linode
>
> Seconded. I've been with them for at least two years now, can only recall
> 3 signifigant instances of downtime.
>
> -Ryan
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Seeking Router Advice

2010-10-29 Thread Harold Lee
Another thing you might try: I've installed the open source DD-WRT
firmware on older wireless routers. It has worked well for me. It
supports WPA2 and has a solid reputation. I know it runs on Linksys
and D-Link routers, not sure about your model.

Harold

On Fri, Oct 29, 2010 at 12:35 PM, Alex Mandel
 wrote:
> On 10/29/2010 11:01 AM, Bob Scofield wrote:
>> I am asking the following questions in regard to a wireless router I use in 
>> my
>> home.
>>
>> I recently attended a class where I was told that one should use WPA2 if it 
>> is
>> available.  I have an old D-Link (DI 614) which is not longer supported by
>> D-Link.  It's been good.  I've had no problems with it.  Right now I've got
>> it set up with WEP and MAC filtering.  I could use WPA, but it cannot use
>> WPA2.
>>
>> I saw a discussion on the Internet where people were saying that WPA2 is not
>> really better than WPA.  People were saying that WPA2 was just being pushed
>> so that vendors could sell more products.  Here are three question:
>>
>> 1) Should I get a new router just to use WPA2?
> Depends, what is the density of your neighborhood? How strong is your
> current router (ie how far outside your walls does the signal reach?
> Would plugging into a wire be acceptable for things that you're paranoid
> about (ie Credit Card transactions).
> Sorry I'm not familiar with the difference between WPA and WPA2.
>
>> 2)  How new would the computers in my family have to be to use WPA2?
> WPA2 in my understanding is a software thing, so theoretically any
> hardware could run it if the proper driver is supplied. Doable on any
> recent version of linux, but on other OS's with older hardware may not
> be possible without a vendor provided driver.
>>
>> 3)  If I did get a new router, what would be a good one to get?
>>
> I've had good times with Netgear and ASUS routers. My 2 current ones are
> also open source variants that are hackable, and include things like
> OpenVPN etc.
>
>> I've been happy with D-Link, but I've had occasions where my laptop with an
>> Atheros card could not connect with a Linksys router in Linux, but could
>> connect with Windows.
>>
>> Thank you for any advice.
>>
>> Bob
>
> Enjoy,
> Alex
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Experiences with linode or similar?

2010-10-21 Thread Harold Lee
Hey,

Can anyone share experiences with Linux VPS hosting services like
linode? I'd be interested to hear about a bunch of different hosting
providers in that entry-level price range.

Harold
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] problems with setenv command

2010-07-21 Thread Harold Lee
setenv is for the csh / tcsh shells. If you run "ps" you can see which
shell you're using. bash is very common, and for bash you will want to
use "export" instead of "setenv".

What value are you trying to set for WRF_EM_CORE_1? If you just need
to set it to some value, you could try this:

export WRF_EM_CORE_1=true

On Wed, Jul 21, 2010 at 11:49 AM, Jason Snyder  wrote:
> I tried using the setenv command in my linux terminal and get the following
> error message:
>
> snyde...@snyderjm-laptop:~/Desktop/WRFV3$ setenv WRF_EM_CORE_1
> No command 'setenv' found, did you mean:
>  Command 'netenv' from package 'netenv' (universe)
> setenv: command not found
>
> How can I resolve this problem?
>
> Thanks,
>
> Jason
>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] complex XML to CSV via XSLT

2010-07-14 Thread Harold Lee
I don't think it'll work to have several result-document instructions,
that'll probably overwrite the file or fail instead of appending.

So what you'd need is to match the pedon_collection, put the
result-document instruction at that level and then apply templates to
each pedon/vegitation/vegitation_record from there.

Maybe this (untested)?








On Wed, Jul 14, 2010 at 2:10 PM, Dylan Beaudette
 wrote:
> Thanks!
>
> That seemed to do the trick. However, I have a new problem.
>
> The following works when I have a simple XML document with only 1 'pedon'
> per 'pedon_collection'
>
>        
>                
>                
>                
>        
>
>        
>                
>                
>                
>                
>        
>
>        
>                
>                
>                
>                
>                
>        
>
> How can I apply these rules to _each_ 'pedon' in a 'pedon_collection', such
> the results are appended to the same file?
>
> Thanks!
> Dylan
>
>
>
> On Wednesday 14 July 2010, Harold Lee wrote:
>> If you want one XSLT program to output multiple files, then use the
>> result-document instruction/element:
>>
>> http://www.w3.org/TR/xslt20/#element-result-document
>>
>> It allows you to specify all of the formatting options available via
>> xsl:output, so you can output text - i.e. CSV - this way.
>>
>> Harold
>>
>> On Wed, Jul 14, 2010 at 11:40 AM, Dylan Beaudette
>>
>>  wrote:
>> > Hi,
>> >
>> > I have an XML file generated via PHP, and containing the contents of
>> > several linked tables from a relational database. I would like to
>> > generalize some sample XSLT documents to convert the entire file into a
>> > sequence of CSV files. The XML file will essentially be exploded back
>> > into a set of CSV files, one for each of the original tables. The idea
>> > would be to create a couple XSLT files for converting the XML format into
>> > several possible output formats.
>> >
>> > Attached is the XML file, as well as two XSLT files. I suppose that I
>> > could loop over the tables of interest, and apply separate XSLT files to
>> > the original XML-- saving to different output files each time. It would
>> > be more convenient to have all of that logic embedded in the XSLT file--
>> > if possible.
>> >
>> > Any ideas?
>> >
>> > Cheers,
>> > Dylan
>> >
>> >
>> > --
>> > Dylan Beaudette
>> > Soil Resource Laboratory
>> > http://casoilresource.lawr.ucdavis.edu/
>> > University of California at Davis
>> > 530.754.7341
>> >
>> > ___
>> > vox-tech mailing list
>> > vox-tech@lists.lugod.org
>> > http://lists.lugod.org/mailman/listinfo/vox-tech
>
>
>
> --
> Dylan Beaudette
> Soil Resource Laboratory
> http://casoilresource.lawr.ucdavis.edu/
> University of California at Davis
> 530.754.7341
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] complex XML to CSV via XSLT

2010-07-14 Thread Harold Lee
If you want one XSLT program to output multiple files, then use the
result-document instruction/element:

http://www.w3.org/TR/xslt20/#element-result-document

It allows you to specify all of the formatting options available via
xsl:output, so you can output text - i.e. CSV - this way.

Harold

On Wed, Jul 14, 2010 at 11:40 AM, Dylan Beaudette
 wrote:
> Hi,
>
> I have an XML file generated via PHP, and containing the contents of several
> linked tables from a relational database. I would like to generalize some
> sample XSLT documents to convert the entire file into a sequence of CSV
> files. The XML file will essentially be exploded back into a set of CSV
> files, one for each of the original tables. The idea would be to create a
> couple XSLT files for converting the XML format into several possible output
> formats.
>
> Attached is the XML file, as well as two XSLT files. I suppose that I could
> loop over the tables of interest, and apply separate XSLT files to the
> original XML-- saving to different output files each time. It would be more
> convenient to have all of that logic embedded in the XSLT file-- if possible.
>
> Any ideas?
>
> Cheers,
> Dylan
>
>
> --
> Dylan Beaudette
> Soil Resource Laboratory
> http://casoilresource.lawr.ucdavis.edu/
> University of California at Davis
> 530.754.7341
>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Regular expression help

2010-06-30 Thread Harold Lee
Take 2:

perl -n -e 'chomp; if(/([^ ]+)$/) { print "rm -f $1\n"; }' < files-to-delete.txt

-n will loop over the input lines like -p but it won't echo the input
lines. Chomp will remove the newlines. Adding the "if" makes sure we
don't print "rm -f" for empty lines or lines that don't match.

Then you have your rm commands and you can scan them for correctness.

Harold

On Wed, Jun 30, 2010 at 3:13 PM, Harold Lee  wrote:
> If none of the filenames contain spaces(!), you can write a regexp to
> match the end of the line using the $ anchor, e.g.
>
> perl -p -e '/([^ ]+)$/; print "rm -f $1\n";' < files-to-delete.txt
>
> Harold
>
> On Wed, Jun 30, 2010 at 3:01 PM, David Spencer, Internet Handyman
>  wrote:
>> Guys, I'm sorry about asking this on the list; but I seem to have a mental
>> block when it comes to regular expressions. Here's what I'm trying to do:
>>
>> I have a lot of directories with a vast number of files, some of which I wish
>> to delete based on the month they were created. I've built a file from some
>> full directory listings that has all the files I wish to delete. (Just go 
>> with
>> me on this and don't suggest alternative methods of performing the task - I'm
>> simplfying the job so it can be explained more easily.)
>>
>> A snippet of the file would look like this:
>>
>> -rw---  1 auser auser 3.7K Apr 12 10:11 auser/folder/new/127109228.file
>> -rw---  1 auser auser  16K Apr 12 12:32 auser/folder/new/127110076.file
>>
>> I would like to write either single-line perl command or a nano search and
>> replace to substitute the directory info and replace it with a file delete
>> so it would look like this:
>>
>> rm -f auser/folder/new/127109228.file
>> rm -f auser/folder/new/127110076.file
>>
>> Then I can just execute converted directory file as a shell script and
>> delete my files. But I'm having a brain-freeze on what a valid regex would
>> look like to match. Help??
>>
>> Thanks again,
>>
>>
>> -- Dave Spencer, PageWeavers
>> ___
>> vox-tech mailing list
>> vox-tech@lists.lugod.org
>> http://lists.lugod.org/mailman/listinfo/vox-tech
>>
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Regular expression help

2010-06-30 Thread Harold Lee
If none of the filenames contain spaces(!), you can write a regexp to
match the end of the line using the $ anchor, e.g.

perl -p -e '/([^ ]+)$/; print "rm -f $1\n";' < files-to-delete.txt

Harold

On Wed, Jun 30, 2010 at 3:01 PM, David Spencer, Internet Handyman
 wrote:
> Guys, I'm sorry about asking this on the list; but I seem to have a mental
> block when it comes to regular expressions. Here's what I'm trying to do:
>
> I have a lot of directories with a vast number of files, some of which I wish
> to delete based on the month they were created. I've built a file from some
> full directory listings that has all the files I wish to delete. (Just go with
> me on this and don't suggest alternative methods of performing the task - I'm
> simplfying the job so it can be explained more easily.)
>
> A snippet of the file would look like this:
>
> -rw---  1 auser auser 3.7K Apr 12 10:11 auser/folder/new/127109228.file
> -rw---  1 auser auser  16K Apr 12 12:32 auser/folder/new/127110076.file
>
> I would like to write either single-line perl command or a nano search and
> replace to substitute the directory info and replace it with a file delete
> so it would look like this:
>
> rm -f auser/folder/new/127109228.file
> rm -f auser/folder/new/127110076.file
>
> Then I can just execute converted directory file as a shell script and
> delete my files. But I'm having a brain-freeze on what a valid regex would
> look like to match. Help??
>
> Thanks again,
>
>
> -- Dave Spencer, PageWeavers
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] loop never exits!

2010-04-21 Thread Harold Lee
I've used static analysis tools before, and they find many many more
bugs than compilers do.

http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis

They list tools for Python, Perl, PHP and JavaScript, proving that
dynamic languages can be safe too. These tools go much farther than a
type system by following the data flow in and out of functions.

http://stackoverflow.com/questions/141498/what-open-source-c-static-analysis-tools-are-available

It looks like the OSS splint program would find that infinite loop -
see the example here:
http://en.wikipedia.org/wiki/Splint_%28programming_tool%29

Harold
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] DVD DRM Problem

2010-01-25 Thread Harold Lee
Macs have this "feature". VLC (http://www.videolan.org/) plays DVDs,
ignores the region code and runs on Windows. Some people out there
also seem to be replacing the firmware on their DVD drives with a
patched version that makes the drive ignore region codes.

On Mon, Jan 25, 2010 at 9:11 PM, Bob Scofield  wrote:
> My son has spent a lot of time in New Zealand the last few years, and is
> getting ready to go back.  His laptop is a Toshiba purchased in the U.S.
> When he rents DVD's in New Zealand, Windows Media Player warns him that the
> DVD he is about to play was made to be played in a different part of the
> world.  (I.e., Windows is telling him that his computer distributed in the
> U.S. is about to play a DVD distributed in New Zealand.)
>
> Windows then gives him a chance to change the DVD type on his computer so that
> he can play the New Zealand DVD.  But there's a catch.
>
> The catch is that he is only allowed to change the DVD type so many times.
> After the limit is reached his computer will be frozen so that he can only
> play one type.  Thus as strange as it sounds, he may end up in California
> with a computer that can only play DVD's distributed in the New Zealand,
> Australia, et. al. area.
>
> He says he downloaded a program that would play DVDs with no DRM hassle.  But
> that program messed up his computer.
>
> So the question is:  Can anyone recommend DVD playing software that runs on
> Windows 7, and that will play DVD's without freezing a computer to one type
> of DVD?
>
> (It certainly seems to me that world travelers who can't break from Windows
> ought to be dual booting.  Do Mac's have this problem?)
>
> Thank you.
>
> Bob
>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] .jpg Mystery

2010-01-21 Thread Harold Lee
I'd get a dump of all metadata via the ImageMagick "identify" command

http://www.econowics.com/linux/258/show-image-properties-meta-data-from-cli-linux/

I'd also try to get the current date and time from the camera that
took the photo, and see if that camera model auto-adjusts for daylight
savings time. Also, some cameras seem to go for a hybrid approach:
time is updated from the computer:

http://fleetingglimpseimages.wordpress.com/2009/10/27/setback-for-digital-cameras/

If that was happening with the camera that took the photo, then I
don't see how you can know what the timestamp on the photo represents
for sure. Was the computer using NTP to get the correct time? Or had
the computer time drifted? Was DST being observed correctly by the
computer? Had someone maliciously changed the computer's time?

For that matter, what's to stop someone from just changing the EXIF
metadata to give the photo a different timestamp?
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Strange problem with bash?

2009-10-30 Thread Harold Lee
Or when it's a "shebang" script, a la

#!/usr/bin/perl

or similar where the program isn't in the same location.

-Harold

On Fri, Oct 30, 2009 at 9:45 PM, Tim Riley  wrote:
> On Fri, 2009-10-30 at 21:35 -0700, Bruce Wolk wrote:
>> I am doing some Android development and borked my Gentoo system for the
>> last time and decided to install ubuntu.  Everything went fine until I
>> tried to build my projects.  Eclipse shows errors executing "aapt".  So
>> I checked on aapt and it is definitely there, but look at the following:
>>
>> br...@erisa:~/android-sdk-linux/platforms/android-1.6/tools$ ls -al
>> total 4596
>> drwxr-xr-x 3 bruce bruce    4096 2009-10-30 19:09 .
>> drwxr-xr-x 8 bruce bruce    4096 2009-10-30 19:09 ..
>> -rwxr-x--- 1 bruce bruce 3416299 2009-10-30 19:09 aapt
>> -rwxr-x--- 1 bruce bruce 1054182 2009-10-30 19:09 aidl
>> -rwxr-x--- 1 bruce bruce  198061 2009-10-30 19:09 dexdump
>> -rwxr-x--- 1 bruce bruce    2214 2009-10-30 19:09 dx
>> drwxr-xr-x 2 bruce bruce    4096 2009-10-30 19:09 lib
>> -rw-r- 1 bruce bruce   10800 2009-10-30 19:09 NOTICE.txt
>> br...@erisa:~/android-sdk-linux/platforms/android-1.6/tools$ ./aapt
>> bash: ./aapt: No such file or directory
>
> This happens when the binary executable is not compatible with your CPU.
>
> 
>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Converting to Kubuntu

2009-05-02 Thread Harold Lee
I found the (K)ubuntu packages to be much more up-to-date than the Debian
packages, even with Debian unstable. Ubuntu's been really dependable and the
transition was easy (apt-get == apt-get). Graphics and audio devices seem to
me to have better support and auto-detection under Ubuntu also. I say go for
it.

On Sat, May 2, 2009 at 1:11 PM, Peter Jay Salzman  wrote:

> Dear all,
>
> This summer I plan on building a new workstation and I think I'm going to
> install Kubuntu instead of Debian.
>
> Has anyone here made this switch?  Any thoughts or comments about whether
> Kubuntu met/didn't meet your expectations?
>
> Thanks,
> Pete
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Call for SQL help

2009-04-22 Thread Harold Lee
Looks like MySQL 5.4 fixes that performance issue:

http://dev.mysql.com/tech-resources/articles/mysql-54.html

On Sat, Apr 18, 2009 at 6:01 PM, Brian Lavender  wrote:

> On Fri, Apr 17, 2009 at 11:20:01AM -0700, Bill Kendrick wrote:
> >
> > On Thu, Apr 16, 2009 at 06:06:21PM -0700, Bryan Richter wrote:
> > > 1. Definetely break out subqueries. A possible starting point would be
> creating a temp table of interesting categories. Temp tables are
> indispensible.
> > >
> >
> > Ah, my predecessor popped up and mentioned this discovery.  Instead of
> > the subselect ("AND bc.categoryid IN ( SELECT ... )"), doing the
> following
> > 'EXISTS' test does the same thing.
> >
> > It now takes under 1 second, rather than 90 seconds.  A speed improvement
> > of over 100x.  Yay :)
> >
> >   bill.beers_owed_to_people++;
>
> I could go for some beer. Are you buying? :)
>
> --
> Brian Lavender
> http://www.brie.com/brian/
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Question related to Apache mod_rewrite and regular expressions

2009-04-21 Thread Harold Lee
On Tue, Apr 21, 2009 at 10:14 AM, David Spencer, Internet Handyman <
spen...@pageweavers.com> wrote:

> In looking at the results, I was wondering if it's possible to "hide"
> the resulting URL for SEO purposes? In other words, when the link is
> to product-Another-Thing.php, the URL changes internally to
> product.php?name=Another-Thing but it doesn't update in the location
> string.


Just remove the R=301 flag - that's the default behavior :-)
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Question related to Apache mod_rewrite and regular expressions

2009-04-20 Thread Harold Lee
On Mon, Apr 20, 2009 at 3:36 PM, David Spencer wrote:

> I've killed the better part of the morning and this afternon trying to
> figure out this use of Apache's mod_rewrite.


Welcome to mod_rewrite. There's a logging facility that can create a log of
which rules were tried, but it doesn't help in this case where you only have
one rule.


> RewriteEngine On
> RewriteRule ^/?product-([A-Za-z0-9-]+)\.php$ product.php?name=$1
> [ R=301,L]
>

You did a gread job here, but ...

1) No spaces in the [] at the end of the line, so you want [R=301,L]

2) I found I needed to add this option also:
Options +SymLinksIfOwnerMatch

3) You almost certainly also want QSA (query string append), making it
[R=301,L,QSA] at the end of the line. This will add the name parameter to
whatever other parameters were sent, instead of dropping the original
parameters:

product-a.php?quantity=4 -> product.php?name=a&quantity=4

You can check Apache's error_log if this still isn't working for hints.

Harold
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] [OT] Math question: help me make a rainbow

2009-04-01 Thread Harold Lee
Not sure if the formulas you've set out do this, but couldn't the rainbow
tool treat the difference between y coordinates as depth, the way that the
grass tool does? When y1 == y2, you get a semi-circle with the height == 1/2
* abs(x2 - x1), i.e. the radius. Otherwise you get a rainbow with a wider
base at the point closer to the bottom of the screen that arcs back to the
other point.

On Tue, Mar 31, 2009 at 10:12 PM, Bill Broadley wrote:

> Bill Kendrick wrote:
> > On Tue, Mar 31, 2009 at 07:21:36PM -0700, Bill Broadley wrote:
> >> Some.  Not sure what you are getting at though.  You want to draw 180
> degrees
> >> of a circle with the end points defined by p1 and p2?  What if you want
> to
> >> make an upside down rainbow?  Or 1/2 of one?
> >
> > I only want to draw all 180 degress if y1==y2.  Otherwise, it'd be
> > less of the arc.  (See my ASCII diagrams)
>
> Hrm, I don't think ascii is going to help, at least for me.  Ah, ok, I have
> an
> idea of what you think you want to do.  I think you do need 3 points.  A
> center, radius, range of angles.  Basically there are an infinite number of
> 180 degree curves that go through 2 points, and there's no way to know how
> high the peak should be, nor which exact fraction of a circle to display.
>
> So for your diagrams how do you decide that in case 1 you do 1/2 a circle
> and
> the circle doesn't go above P2, but in case #3 you get 60% of a circle.
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Clustering two Linux machines

2008-03-10 Thread Harold Lee
On Mar 10, 2008, at 12:52 PM, Matin Hashemi wrote:

> I would like to know how to make two Linux machines work as one  
> computer. [...] I just want to add another computer [...] and make  
> it more powerful.


What are you trying to speed up?

Examples:

To provide more CPU for a multi-user interactive environment, look at  
distributed filesystems like NFS that'll allow users to log into  
either machine and get the same $HOME.

If you want to speed up C/C++ compiling, look at distcc.

For web applications, you can use various tricks to send different  
users to different machines.

If you've written a program and you want it to run faster, you likely  
need to add logic to take advantage of 2+ machines, and some libraries  
and kernel enhancements can make this easier (e.g. shared memory  
synchronized between machines using the network).

etc.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] bash, short circuit logic, and errexit

2008-01-18 Thread Harold Lee

This page seems to clarify that behavior

http://www.ss64.com/bash/set.html

saying that statements in while loops or && chains don't cause the  
script to exit on failure. Seems sensible since those are designed to  
give different behavior depending on the exit status of commands. You  
can always check the $? variable and exit based on that (yeah, makes  
the script longer, which is probably what you're trying to avoid with  
"set -e" -- sorry).


-Harold

On Jan 18, 2008, at 11:08 AM, Bryan Richter wrote:


Does everyone agree that the following script shouldn't last forever?
And if you agree, does it last forever nonetheless?

--
#!/bin/bash

set -e

false && false;

while true; do
   echo "Still here"
   sleep 1
done

-

I discovered that 'diff -q $file1 $file2 && echo "no differences"'
wasn't ending my script, in spite of having 'set -e'. From the example
above, which does last forever, it looks like all short-circuit logic
confounds it.

bash 3.00.15(1)-release

Red Hat Enterprise Linux ES release 4 (Nahant Update 4)



--
Bryan Richter
aka chreekat
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] collaborative data storage (of excel files)

2008-01-15 Thread Harold Lee

Now that I want to find it ... d'oh

There were three interesting things I've run across lately. The first  
was a study that estimated the cost of bugs in Excel spreadsheets to  
the U.S. economy. The other two were a history of PowerStep for the  
NextStep machine, and a different product based on PowerStep that  
targets the financial market, runs on Windows and costs about $1,000/ 
person. Both products' marketing argue that they cut down on bugs by  
having separate formulas that use column names in the code.


I'll keep looking, let me know if you find anything good. I feel this  
is one of many ways that programmers earn their keep - and as a  
programmer, I'm glad to see some studies quantizing the cost of  
spreadsheet bugs :-)


Here are some other related items I found while looking for the older  
articles:


http://www.theregister.co.uk/2003/06/19/excel_snafu_costs_firm_24m/

Here's a pay article advising against using standalone spreadsheet  
documents:

http://www.cfoproject.com/documents.asp?d_ID=2842

On Jan 15, 2008, at 12:11 PM, Henry House wrote:


On 2008-01-15, wrote Harold Lee:
[...]

I advocate separating the data and code - some recent studies point
out that bugs in Excel code are actually a widespread and expensive
problem. As you pointed out, even just having a version-controlled  
CSV
file and linking it in to a spread sheet should provide some  
protection.


Got a reference? I've long suspected this but lacked documentation to
demonstrate it.

--
Henry House
+1 530 753 3361 ext. 13
Please don't send me HTML mail! My mail system frequently rejects it.
The unintelligible text that may follow is a digital signature.
See <http://hajhouse.org/pgp> to find out how to use it.
My OpenPGP key: <http://hajhouse.org/hajhouse.asc>.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] collaborative data storage (of excel files)

2008-01-15 Thread Harold Lee

On Jan 15, 2008, at 10:33 AM, Dylan Beaudette wrote:


On Tuesday 15 January 2008, Henry House wrote:

On 2008-01-15, wrote Dylan Beaudette:

Hi,

some of the people in my lab are interested in collaboratively  
compiling

a large quantity of environmental data- each user appending several
hundred measurements of several variables every week.

They are currently emailing around a spread sheet file and there  
have
been numerous data accidents. Now they are asking to put the file  
onto a
shared drive, so that they can access it remotely. This sounds  
like a

terrible idea to me- even worse than the previous attempt.


Their idea is distilled evil! But you already knew that.


Indeed!


The data are essentially rows and cols of numbers that are added  
to and

edited weekly.

At first I thought subversion might be helpful, but revision control
doesn't work so well with binary data (excel files)... unless  
there is
something I don't know about. It would be hard to detect  
conflicts, or to
merge data. However, it would allow for timestamps and revision  
numbers

to provide some level of authority.

Designing some kind of database-driven system seems like a logical
choice, but I do not have the time to do this. Perhaps there is  
already

something out there.

Does anyone have some insight into how to solve this data management
nighmare?


The right way to do this is to use a database. But, an easier
maybe-almost-as-good solution might be to use subversion and save the
data as CSV text files (excel can do this just fine). It is useful to
add comment lines (maybe you could have an internal convention about
this) that help subversion to figure out where to merge in changes.


This is a good idea. Unfortunately we might be stuck with 4 or 5  
mega CSV
files which are constantly appended to, but SVN should be able to  
deal with
keeping things sane. The trick will be to get people to realize that  
these

are CSV files, and therefore no monkeying around with formulas, etc.



OpenOffice.org provides a database tool that would probably work for  
you. You can then use the database data in spreadsheet formulas. Since  
you have only one table (for now) it should be easy to design and  
create the database. FileMaker is better, but costs money.


Either way, you'll get admin-free database work on a shared file, but  
they're not geared towards merging different copies that people are  
working on off-line.


I advocate separating the data and code - some recent studies point  
out that bugs in Excel code are actually a widespread and expensive  
problem. As you pointed out, even just having a version-controlled CSV  
file and linking it in to a spread sheet should provide some protection.


The next step up, sorta, might be to set up a web server with a very  
simple CGI for appending records to the CSV and committing, accessed  
via a web form. From there you could proceed to using an low-admin  
database if you wanted.


-Harold


I'll keep digging around for ideas.

Dylan

--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] server setup

2007-10-10 Thread Harold Lee

On Oct 9, 2007, at 11:26 PM, Cylar Z wrote:


I've got a domain name I'm going to associate with
this thing, but that comes later. Eventually I'm
going to set this up to handle incoming HTTP requests,
and I also want to run a mail server.


You should be able to assign the Linux server a static IP address in  
your local network (e.g. 192.168.1.10 usually works well). Just  
configure the Linux box with that static IP and see if it works. Then  
you can configure the router to forward ports like 80 (HTTP) and 25  
(SMTP) to that IP address. On my Linksys router this is under  
"Applications and Gaming" -> "Port Range Forward". That should be all  
you need to do to be able to get to your Linux Apache server from  
"the outside".


- Harold
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] I'm over my head - need a cookbook for transfering system to new disks

2007-08-21 Thread Harold Lee
I've had great success using parted / qtparted (GUI) to resize ext2/ 
ex3 and FAT partitions in Linux.


http://www.gnu.org/software/parted/index.shtml
http://qtparted.sourceforge.net/

From the point of having Ghosted the data onto 300 GB partitions on  
the new drives, you could disable the RAID mirroring, resize them,  
and then rebuild the mirroring.


- Harold

On Aug 20, 2007, at 1:56 PM, David Spencer, Internet Handyman wrote:


I'm hoping that somebody can help me by directing me to a step-by-step
cookbook of some sort for what I'm trying to do. Here's the summary:

We've got a Dell SC1425 1U server. The system has dual 300GB SATA  
drives

that I've configured in a software RAID 1. It's running CentOS 4.5 and
is pretty much up to date. We've also got Plesk installed on it and
it's purpose to exist is to host websites.

We recently got this idea to replace the 300GB drives with 500GB  
drives.

My programmer and I thought that the best way to accomplish this would
be to use Linux Ghost to copy the contents of the drives. So we pulled
one of the 300's and replaced it with the 500. Then we ghosted the 300
to the 500. Next we replaced the 300 with the other 500 and used ghost
again to copy the data on the first 500 to the second. We rebooted the
system and it worked! Well, almost.

The problem was that Linux Ghost did a fantastic job of duplicating
the exact dimensions of the 300 drives onto the 500. So we had a  
system

with partitions that were only 300GB in size. Obviously we wanted to
take advantage of all that extra space. And that's where things went
terribly wrong.

We've tried a number of things from using Linux Ghost to expand the
partition to using fdisk and dd to redefine the partitions and then
copy the data from one of the 300's using an external USB 2.0 drive.
Nothing works. Where did we go wrong?

Your assistance is much appreciated,


-- Dave Spencer, PageWeavers
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech




smime.p7s
Description: S/MIME cryptographic signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Older Laptop Memory?

2007-07-10 Thread Harold Lee
I have a 256 MB PC-133 SO-DIMM in working condition that I've pulled  
from a now-defunct iBook (the dreaded iBook G3 logic board failure).  
I now live in San Jose, but I'd be happy to mail it to you.


-Harold

On Jul 10, 2007, at 10:25 AM, Kyle Oliveira wrote:



Does anyone have some PC133 So-Dimm memory (the kind you'd find in  
older

laptops)?
I recently acquired a secondhand laptop that had some problem that was
stopping it from running XP (possibly the 256 mb of RAM, I suspect). I
installed Xubuntu 6.06 and it's running surprisingly well.  
Everything works
fine, it's just a little slow sometimes and will not run DVD movies  
well
(it's either extremely choppy or throws a colored line across the  
screen or
both). I am sending this laptop down to my little brother so he has  
one for

a summer program at UCSD and I've gotta mail it off today (or early
tomorrow morning) so if anyone does have memory they'd care to get  
rid of
I'd need to know today. I'll pay up to $40 depending on size, if  
you'd like.
Sorry for such a small window, I didn't even think to ask the group  
until

just now.
Thanks,

Kyle Oliveira
UCD Computer Science major
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech




smime.p7s
Description: S/MIME cryptographic signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Monitor Recommendation?

2007-05-30 Thread Harold Lee
Dell's monitors seem nice to me (though they're various brands with the 
Dell logo on them). If you're buying the computer from Dell, maybe it 
makes sense just to get one of theirs from the perspective of a bundle 
discount.


I can second the Samsung recommendation. We have a 6 year old 17" LCD of 
theirs that still looks great.


The ViewSonic 19" widescreen LCD I picked up last fall/winter looks 
great and has given us no problems either.


I had a good experience with a CTX CRT that worked well for years (gave 
it away recently).


I've had problems with both of the Princeton Graphics CRTs I've owned 
within 1 year of purchase, so I avoid them now (though maybe they're 
better with LCDs - don't know, not willing to risk it).


Joshua Morris wrote:
Hi Bob, we have had great luck with Samsung on there flat panel tft 
displays.  we have the syncmaster 906bw and the prices are not bad for 
the quality of the display.  but i made the assumption you where 
talking about flat panel monitors and not large CRTs


On 5/30/07, *Bob Scofield* <[EMAIL PROTECTED] 
> wrote:


My wife is going to buy a new Dell computer.  She's trying to
decide what kind
of monitor to get.  She'll be doing mostly web surfing, e-mail, word
processing, and collecting digital photos.

It seems like Sony had a great reputation for CRT monitors when I
bought this
one around 2001.  But we're seeing monitor reviews without Sony
even being
mentioned.  So I don't know what's going on.

Can anyone recommend a good flat screen monitor?  She wants a 17
inch monitor.

Thank you.

Bob
___
vox-tech mailing list
vox-tech@lists.lugod.org 
http://lists.lugod.org/mailman/listinfo/vox-tech




___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech
  

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] postgres: run function on each row returned from select statement

2007-04-23 Thread Harold Lee

Dylan Beaudette wrote:
Is there any way to run a function, which expects a single value as an 
argument, for each row returned from a select statement? Note that this is a 
special function, used in the following way:


SELECT sum(length(the_geom )) as dist_meters 
FROM 
shortest_path_as_geometry('roads', 2192, 154) ;


In the above example the function "shortest_path_as_geometry" expects three 
arguments... Is there any way to feed a function like this its arguments from 
column returned from a previous select statement? Or, would this function 
have to be re-written to allow for this flexibility?


thanks in advance,

  


You question isn't 100% clear to me, but I'm not going to let that stop 
me from opining :-)


Sounds like you have some query that returns (string, roadid1, roadid2) 
and you want to call the shortest_path_as_geometry function on each row 
that comes back from that, then sum the length of those geometries.


Approach #1:

Change the sum_path_as_geometry function to take an array or row instead 
of three value and move the shortest_path_as_geometry function into the 
SELECT list, e.g.


SELECT sum(length(sum_path_as_geometry(a.c1, a.c2, a.c3)))
FROM ( SELECT c1, c2, c3 FROM ... ) a;

Approach #2:

Glue the other query and sum_path_as_geometry together with a new table 
function (i.e. a function that returns a set of rows). Define the new 
function to apply the sum_path_as_geometry function to the appropriate 
rows and then use the new function in your query:


SELECT sum(length(the_geom)) FROM new_function();
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Fujitsu & Atheros?

2007-01-26 Thread Harold Lee

Richard Harke wrote:

On Fri January 26 2007 12:08, Bob Scofield wrote:

Here are two easy questions:

1)  Is it true that, all other things being equal, a Linux user would
prefer an Atheros wireless card because of better driver support?

I sought out an Atheros based card for my HP laptop. (Linksys WPC55AG)
I had to build the driver from source tar-ball, but given that, it was
one of the easiest installs I've done. And I have native 64 bit for
my AMD64 Kubuntu system.
To weigh in on the other side, I have a (company issued) Thinkpad with 
the Intel wireless card built-in. Getting it working requires you're 
okay with Intel's proprietary binary license (if that's a deal breaker, 
Atheros is the way to go), and can download the firmware file. Once you 
copy it into /lib/firmware, life is good. I haven't had any problems 
using it, and it actually works better than in Windows for me.


-Harold
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] [OT] MS Windows nice

2007-01-22 Thread Harold Lee

Peter Jay Salzman wrote:

1. Is there a cron for Windows?  I would like to run something like:

  cd /path/to/application
  ant create.reference.data

   before coming into work.

  
Look up the command "at". I think if you run "at help" on the command 
line, it'll help you out.



2. Is there a nice for Windows?

  I don't think the ref data is built any faster when it has full
  control of my system.  I really would like to read digg.com while
  the data is being built.  Is there a way to nice a process in Windows?

  
MS discourages people from playing around with process priorities 
because, in my experience, it is easy for processes to get CPU starved 
or to hog the CPU - not a lot of subtlety in the scheduler, I think. 
Better to just run it when you're not around.


My guess is that you're killing the disk, writing tons of data as fast 
as you can pull it over a gigabit ethernet - if that's the case, and you 
need to be able to use the computer meanwhile, you could always add a 
sleep() call (or Java equivalent) to wait a little while after each 
write to disk. Also look at how much data you're gathering before each 
write - maybe it'll help Windows if you build a larger buffer of binary 
data and do fewer, larger writes... just a thought.


-Harold
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Nifty macro expansion bug

2007-01-19 Thread Harold Lee

Peter Jay Salzman wrote:

On Thu 18 Jan 07,  4:14 PM, Bill Kendrick <[EMAIL PROTECTED]> said:
  

So at work, a coworker noticed an issue with the following code:

  for (i = 0; i < n; i++)
myFREE(foo[i]);

which went away when he wrapped it in braces:

  for (i = 0; i < n; i++)
  {
myFREE(foo[i]);
  }

Figured maybe it was a weird compiler bug.  Being author of the myFREE()
code -- which happens to be a macro -- I realized immediately what I did
wrong.  (And continue to be annoyed with C syntax ;) )

See, myFREE() is actually a macro that looks like this:

  #define myFREE(x) if ((x) != NULL) FREE(x); x = NULL;

Two statements... hence the need for {} around the call to the macro.
(Or, more sensibly, including {}s around what the macro expands to.)

That was a neat catch. :)

 


I ran into something similar, but more complicated, last week.  An
expression that should've executed didn't.

I looked at the output of "cl.exe -E" (similar to gcc -E) which displays
what the compiler "sees" after the preprocessor does its thing.  From this
view, it was easy to see that what looked like:


   if ( some condition )
  die( some error message )
   else
  do_something();


was arriving at the compiler as:


   if ( some condition )
  if ( lots of stuff )
 print error message with lots of stuff.
  else
 do_something();

So the code needs to look like:

   if ( some condition ) {
  die( some error message )
   } else {
  do_something();
   }


Pete

  

This is why Lisp has those parentheses...   ;-P
And don't get me started about Lisp macros versus the C preprocessor.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Ubuntu sound card issues on KDS laptop

2007-01-16 Thread Harold Lee

Eric Engelhard wrote:

One of my neighbors purchased a used KDS Valiant 671XH laptop for his
daughter. The machine was running Windows XP, but was crippled with viruses
and malware. I turned six people on to Ubuntu Linux in the last year and have
had no issues on three laptops and three workstations. Unfortunately, this
install (Ubuntu 6.06) had trouble with the sound card. Even worse, the
original OS was so crippled that I did not even bother to check out the
hardware specifications (I know, I know...). Bitten by overconfidence.

I tried looking on linux-on-laptops.com and tux-mobil.org, but there are no
references to this model. I also tried kdscomputers.com, but it appears that
they have gone out of business. The ALSA site also has no specific references
to this model.

Is anyone familiar with this model or have sufficient ALSA/sound card
experience to offer a suggestion?

Many thanks,

Eric Engelhard
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech
  
Knowing the sound card model is more interesting than the laptop model, 
try "lspci -v" and look for sound card info. e.g.


00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM 
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)

   Subsystem: IBM: Unknown device 0537
   Flags: bus master, medium devsel, latency 0, IRQ 11
   I/O ports at 1c00 [size=256]
   I/O ports at 18c0 [size=64]
   Memory at cc00 (32-bit, non-prefetchable) [size=512]
   Memory at c800 (32-bit, non-prefetchable) [size=256]
   Capabilities: 

Then you can go Googling for Linux support for that chipset.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Apple & Linux

2007-01-10 Thread Harold Lee

Matin Hashemi wrote:
Thanks for the detailed information. I "thought" these virtual 
machines (Parallels, VMWare, etc) work a lot slower. A few years ago I 
used VMWare on my 800MHz AMD-based PC to write/run a few small 
programming class projects and it was like 20X slower than when I 
installed Fedora as a secondary OS. But I guess the world has changed 
a lot :-) http://en.wikipedia.org/wiki/Vanderpool


I'm sure there is still some performance penalty. You said you are 
using those softwares; How much slower is it when you run some 
Win/Linux application in VMWare comparing to when you run it in a real 
Win/Linux OS? like 10%? it would be awesome then.


Another option people haven't mentioned is fink. The fink project 
provides many Free / Open Source Software (FOSS) programs for Mac OS X, 
so you would not really need the version compiled for Linux. It uses 
Debian's apt-get, which makes installing additional software very easy. 
Get this and install the X server from the OS X CD/DVD and enjoy a Unixy 
world.


http://fink.sourceforge.net/

I've enjoyed using Q (the OS X version of QEMU), which is a free 
virtualization engine. Although officially alpha software, I've used it 
to run Solaris, Plan 9, Linux, Windows, BSD and FreeDos under OS X. 
Based on the documentation, it does not use the kqemu accelerator, so 
the performance is "about a 500Mhz PC in x86-on-x86 emulation." If you 
want better performance, I guess you'll need to buy one of the other 
products you've mentioned.


http://www.kju-app.org/kju/

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] [OT] Running/compiling win32 executables from cygwin

2006-12-15 Thread Harold Lee

[EMAIL PROTECTED] wrote:

Is it possible to run win32 executables from a cygwin xterm?

I'm trying to figure out how to compile stuff using VC++ from the command
line at work.  When using the "command prompt", I need to run a batch file
to set up the environment:

   $ c:\Program Files\Microsoft ... 2003\Common7\Tools\vsvars32.bat



In the past, I've just converted the SET commands to bash-friendly 
export statements, and it "just works". I'm using Visual Studio 2003 also.


___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] For "C" gurus

2006-12-07 Thread Harold Lee

Jeff Newmiller wrote:

Richard Harke wrote:

But suppose this is changed to the following:

int
asub(jmp_buf env)
{
.do something
longjmp(env, 1);
}

int
my_wrapper(jmp_buf env)
{
int x;

if (x = setjmp(env)) {
 return x;
 } else {
return 0;
 }
int
main()
{
jmp_buf env;
/*init*/
some code
 if (my_wrapper(env);) {
/* returned from longjmp */
clean up
exit(0);
} else {
/*just returned from setjmp */
asub(env);
may not return
}
}

Notice that because we returned from my_wrapper before
calling asub, the local variables for asub have been
removed from the stack. Thus they cannot be restored
by the longjmp. It seems to me this usage should
be explicitly rejected. Can any one point me to an
authoratative reference that says this?


I don't have the latest standard, but this is covered in ANSI X3.159-1989
Section 4.6.2.1 lines 7-10:

  The longjmp function restores the environment saved by the most recent
  invocation of the setjmp macro in the same invocation of the 
program, with
  the corresponding jmp_buf argument.  If there has been no such 
invocation,

  or if the function containing the invocation of the setjmp macro has
  terminated execution in the interim, the behavior is undefined.



Wikipedia has a good article on the subject that should scare you away 
from using my_wrapper:

http://en.wikipedia.org/wiki/Longjmp

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] A complicated SQL question

2006-11-09 Thread Harold Lee
On Thu, Nov 09, 2006 at 12:49:25PM -0800, Richard S. Crawford wrote:
> I have a number of rows in my database which look something like this:
> 
> 
> id | username | canonicalname | password
> ---+--+---+---
> 01 | asmith   | ART SMITH | md5 encrypted password
> 02 | asmith1  | ART SMITH | 
> 03 | bjones   | BILL JONES| md5 encrypted password
> 04 | bjones12 | BILL JONES| 
> ---+--+---+---
> 
> 
> There are something like 275 entries like these.  I'm having a hell of a time 
> finding a way to select rows like 02 and 04, where canonicalname is a 
> duplicate of the same value in another row and the password is blank, and 
> then deleting those rows.  After executing my query, the table should look 
> like this:
> 
> 
> id | username | canonicalname | password
> ---+--+---+---
> 01 | asmith   | ART SMITH | md5 encrypted password
> 03 | bjones   | BILL JONES| md5 encrypted password
> ---+--+---+---
> 
> 
> Is there a simple way to execute a single select query which would pull up 
> all 
> the rows I need?
> 

Try a query like this (I've named the table Q) to select the records
(best to make sure before deleting them:

select id 
  from q 
 where password is null 
   and canonicalname in 
   (select canonicalname 
  from q 
 where password is not null)

If you also want to make sure that the username in the record with a
password is a substring of the username in the record without a
password, you can add that predicate too:

select id 
  from q a 
 where password is null
   and canonicalname in 
   (select canonicalname 
  from q b 
 where password is not null 
   and substr(a.username,1,length(b.username)) = b.username)

Then, if you want to delete these records (assuming the ID column is a
primary key), you can say

delete from q where id in (... whichever select you choose ...)
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] at my wit's end

2006-11-02 Thread Harold Lee
On Wed, 2006-11-01 at 23:18 -0800, Norm Matloff wrote:
...
> and get an error message something like "eth0: no IPv6 router present."
> I just tried running dhclient by hand under Mandriva, and got a message
> "eth0:  unknown hardware address type 24."
...

Hi Norm,

For the IPv6 error, you might try disabling IPv6 support in the kernel.
I found this article that describes how the code might not be giving
IPv4 a fair chance:

   http://www.linuxquestions.org/questions//showthread.php?t=145028

That would be consistant with not seeing the problem on earlier versions 
- maybe IPv6 wasn't there.



I think the Mandriva distribution suffers from old DHCP code - which 
keeps it from reaching the IPv6 error. Here's why:

I did a Google code search ( http://www.google.com/codesearch ) for your
error message, and it is coming from the dhcp client. In that code, it
reads a sockaddr struct from a network response from your Powerline
modem/adapter/whatever. The "unknown hardware address type" is 24, which
is the sockaddr.sa_family value.

>From /usr/include/linux/socket.h

struct sockaddr {
sa_family_t sa_family;  /* address family, AF_xxx */
charsa_data[14];/* 14 bytes of protocol address */
};

The #defines that the dhcp code is using are defined
in /usr/include/linux/if_arp.h, my version of which has this:

#define ARPHRD_IEEE1394 24  /* IEEE 1394 IPv4 - RFC 2734 */

If you want to go with Mandriva, I'd look for a newer version of the DHCP 
client.

- Harold Lee
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Laptop + eSATA

2006-11-01 Thread Harold Lee
I run Linux on a Thinkpad T40 and I'm thinking of getting a PCMCIA eSATA
card and external drive. My internal drive is 4200 RPM, and I want
something faster.

I don't want to replace the internal drive because this system belongs
to my employer and I don't want to get stuck with a 2.5" ATA drive. I'd
much rather have an extra 3.5" SATA drive in an external enclosure -
faster, not already obsolete, easy to re-purpose.

Anybody have experience with eSATA and Linux, especially laptops? Can
anyone recommend a good eSATA PCMCIA card?

-Harold

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech