Re: [vox-tech] handling urls in Thunderbird on Kubuntu

2006-09-25 Thread Micah J. Cowan
On Mon, Sep 25, 2006 at 03:20:17PM -0700, Dave Margolis wrote:
 Hello,
 
 I'm running both Thunderbird and Firefox under Kubuntu (Dapper). 
 Thunderbird is assuming Konqueror as the default browser.  Thunderbird 
 doesn't appear have a setting for this (as far as I know; the setting 
 may be buried in T-Bird's about:config panel or may be right in front of 
 me in the preferences).  Under System Settings / KDE Components / Web 
 Browser I have 'In the following browser: /usr/bin/firefox' specified 
 (though this setting is supposed to be specific to KDE apps so should 
 have no effect on this issue).
 
 Anyway, this is a relatively minor GUI annoyance, but if anybody knows 
 what to do, please let me know.

Here are a couple things you could check:

 - Do you have BROWSER set in your environment?
 - What is the output of namei x-www-browser?

If x-www-browser appears to point at conquerer, you'll want to do a:
  sudo update-alternatives --config x-www-browser

Also, a suggestion in
https://launchpad.net/distros/ubuntu/+source/mozilla-thunderbird/+bug/31841
was to perform sudo dpkg-reconfigure mozilla-thunderbird and pick
GNOME

-- 
HTH,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] confusing httpd log entry

2006-09-24 Thread Micah J. Cowan
On Sun, Sep 24, 2006 at 01:30:36AM -0700, Cylar Z wrote:
 Hey all,
 
 I was looking at my httpd log the other day (via the
 Logwatch program that emails me a daily update) and I
 saw this:
 
  - httpd
 Begin-
 
  0.45 MB transferred in 21 responses  (1xx 0, 2xx 13,
 3xx 1, 4xx 7, 5xx 0)
 11 Images (0.03 MB),
  1 Windows executable files (0.41 MB),
  8 Content pages (0.01 MB),
  1 Redirects (0.00 MB),
 
  Requests with error response codes
 404 Not Found
/favicon.ico: 4 Time(s)
/robots.txt: 2 Time(s)
http://www.searchpost.net/azenv.php: 1 Time(s)
 
  A total of 1 ROBOTS were logged
 Mozilla/5.0 (compatible; Yahoo! Slurp;
 http://help.yahoo.com/help/us/ysearch/slurp) 2 Time(s)
 
 --httpd
 End 
 
 1 Windows executable files (0.41 MB)?? WTF? This
 system runs Linux. Why is it transferring an .EXE file
 from my server...or did someone somehow push one ONTO
 the system through my Apache httpd service? If so, how
 and why? Where in the directory tree would I look for
 it?

I don't know the answer to that... it's possible the log parser saw a
/request/ for an .exe (as often happens) that wasn't fulfilled, but it
isn't listed in the error response section... perhaps Apache is
configured to recognize certain .exe requests and redirect them (trying
to kill two questions with one answer ;) )?

If I were you, I'd scan the logs by hand from yesterday, and search for
.exe requests. I'd also do a search for .exe files in your htdocs or www
directory.

 For that matter, why is it issuing redirects when I
 haven't set up any on the system?

There are some redirects that are built into Apache. In particular, if
someone types a URL which resolves to a directory, and don't include a
final slash, Apache would redirect it to the location that includes the
slash.

-- 
HTH,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Special Character Issues in a web page

2006-09-20 Thread Micah J. Cowan
On Wed, Sep 20, 2006 at 10:06:04AM -0700, Richard S. Crawford wrote:
 This may be a dumb question, but can the backslash character be used to 
 denote 
 special characters on a webpage under some circumstances in addition to the 
 ampersand?  I'm asking because as I review some of our old pages, some of our 
 Spanish text pages seem to use, say, \351 to refer to the accented o 
 character instead of oacute; or even #351.  Strangely, when I worked on 
 these pages in a text editor, those characters were rendered as strange 
 characters, nothing like what they were supposed to be.
 
 Anyone have any thoughts?

\351 in HTML can only represent the four characters, \351. I strongly
suspect that it is in fact, one character, and certain text editors are
representing it using the string \351. This suspicion is bolstered by
the fact that you've mentioned that some text editors display it as
garbled. Probably, those text editors were configured to interpret in a
different charset (UTF-8, most likely), and didn't know what to do when
they came across this ISO 8859-1 character.

Using character codes directly within the HTML is permissible, but to
work reliably the server needs to indicate the character set being used,
in its response headers (or, the HTML page itself can use meta
http-equiv=Content-Type ...).

Another possibility is that it's not actually HTML, and is being
preprocessed into HTML, during which time escape sequences such as \351
are translated into the corresponding character. This seems less likely
to me.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] spam current events

2006-08-31 Thread Micah J. Cowan
On Thu, Aug 31, 2006 at 04:51:26PM -0400, Peter Jay Salzman wrote:
 i'm getting hammered with email containing text designed to trick bayesian
 filters.  unfortunately, it appears to be quite successful in that endeavor.
 the email text is nonsensical, however the email has a gif image attachment.
 
 at first, the gif was always named image001.gif, and i was able to REJECT
 such emails when Postfix detected a gif attachment named image001.gif.
 but whoever is sending this got smarter and now the gif file is named all
 kinds of things.
 
 i'm not quite sure how to filter these things anymore other than to REJECT
 all gif attachments, which I'd prefer not to do if i can help it..
 
 the gif image itself is mostly white with a few colored threads here and
 there.  i certainly don't see any text, so i'm not quite sure what their
 purpose is.  perhaps it's some kind of virus?
 
 anyone else seeing these things?  i'm getting them a few times a day now.

Well, since I work for the leading manufacturer* of spam filter
appliances... I can tell you some of the avenues we've pursued for
dealing with this. Note that these are features-in-progress, and not
necessarily features that are currently or will at some point be
available. To my knowledge, none of this information is confidential.



One method for dealing with this is to obtain a checksum of all image
attachments within all emails that are reported to be spam, and place it
in a database. Then, whenever we receive an email, we get checksums of
each image, and check it against the database. If we find
the checksum, it's spam.

I don't know if there's a public database of this type somewhere. I
wouldn't be surprised if there were. If there isn't, you can at least
keep track of the attachments you've already seen in your own local
database, and use that to throw future emails out.



Another method is to do OCR on the image, and check the results against
SpamAssassin-style rules. For my money, I'd probably do bayes and intent
checks (via spamhaus.org) against it as well. In fact, I would not be
surprised if we end up doing that here at some point.

From what I understand, we are using GNU Ocrad for this.



* Barracuda Networks, Inc.  http://www.barracudanetworks.com/

Since I've mentioned some things regarding my employer, it's probably
best to mention that anything I've said or opinions I have are strictly
my own words or views, and not necessarily those of Barracuda Networks,
Inc. :-)

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] spam current events

2006-08-31 Thread Micah J. Cowan
On Thu, Aug 31, 2006 at 02:33:17PM -0700, Alex Mandel wrote:
 On a separate thought has anyone tried out any of the community based 
 blacklist/anti-spam groups where they use a dispersed reporting tool to 
 identify servers to blacklist and email address's to identify providers 
 that may have violators on their system, or in the case of this one file 
 complaints in bulk with the spammer.
 
 http://en.wikipedia.org/wiki/Blue_Frog

Note that they don't do this anymore (this is mentioned at the end of
the article). The spammers' response was effective enough to win them
the battle :(

http://www.washingtonpost.com/wp-dyn/content/article/2006/05/16/AR2006051601873.html

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] spam current events

2006-08-31 Thread Micah J. Cowan
On Thu, Aug 31, 2006 at 02:47:30PM -0700, Rod Roark wrote:
 On Thursday 31 August 2006 13:51, Peter Jay Salzman wrote:
  i'm getting hammered with email containing text designed to trick bayesian
  filters
 
 I think content filtering is almost a waste of time.  As you see, 
 spammers can always design content that gets past the filters.  What
 else are you doing to combat spam?
 
 The blacklists (RBLs) are my core defense, however some stuff
 inevitably gets through.

More disturbingly, good things inevitably get blocked. Some people's
experience have shown that too many RBLs let politics interfere with
their jobs, and block sites for questionable reasons. I'm not speaking
from my own experience on this, so please don't ask me to corroborate
this claim ;-)

Spamhause's SBL has been one of the more reliable services, in my own
experience and that of others from whom I've heard.

But, Rod, while content filtering is a continual game of one-upmanship,
it /is/ fairly effective when it's kept up-to-date. And, of necessity,
RBLs will always have some degree of lag.

One relatively effective method is to combine content-filtering with
RBLs (intent-checking: SpamAssassin will do this with spamhaus if you
enable it). But spammers still have some sneaky tricks in dealing with
this, so the engine you use to reap URLs from an email needs to be
effective; and you need to have fast lookups maybe combined with
whitelists, because spammers will throw in 50 good URLs to confuse the
scanner, or tie it up with too many lookups. I can't comment on the
effectiveness of SpamAssassin's engine; Barracuda Networks uses the
engine I wrote.

-- 
My $0.02,

Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] vim: change characters, then dumping in insert mode.

2006-08-01 Thread Micah J. Cowan
On Tue, Aug 01, 2006 at 03:59:36PM -0400, Peter Jay Salzman wrote:
 In Vim,
 
ncw
 
 deletes n words and puts you in insert mode.  Is there a similar construct
 for deleting n characters and leaving you in insert mode?
 
 I'm using the Vim plugin for the Eclipse IDE.  Unfortunately, it doesn't
 support visual mode, and something like ncx (which doesn't work)
 along with . would be almost as good.

ncl will do what you want. So would nxi (same number of characters...).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] vim: change characters, then dumping in insert mode.

2006-08-01 Thread Micah J. Cowan
On Tue, Aug 01, 2006 at 03:43:40PM -0500, Ken Bloom wrote:
 On Tue, Aug 01, 2006 at 01:18:38PM -0700, Micah J. Cowan wrote:
  On Tue, Aug 01, 2006 at 03:59:36PM -0400, Peter Jay Salzman wrote:
   In Vim,
   
  ncw
   
   deletes n words and puts you in insert mode.  Is there a similar construct
   for deleting n characters and leaving you in insert mode?
   
   I'm using the Vim plugin for the Eclipse IDE.  Unfortunately, it doesn't
   support visual mode, and something like ncx (which doesn't work)
   along with . would be almost as good.
  
  ncl will do what you want. So would nxi (same number of characters...).
 
 nxi can't be repeated with the . key because it's two commands.

Yeah, I missed the . part.

 BTW, I ususally type ncw or ncl as cnw or cnl because
 commands like ni insert n times, and I would expect ncl to do
 similarly even though in reality it doesn't.

Yeah, I do, too. It makes a bit more sense to me to say change the text
consisting of the next 3 words, then do `change the next word' 3
times (which, as you point out, would be wrong anyway).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] quickie postfix config issue

2006-07-23 Thread Micah J. Cowan
On Sun, Jul 23, 2006 at 06:16:53AM -0700, Rod Roark wrote:
 On Sunday 23 July 2006 01:52, Cylar Z wrote:
 ...
  The system is able to receive mail normally. It also
  sends it with no problems. HOWEVER, mail sent from the
  system appears to come from
  [EMAIL PROTECTED] instead of from my domain
  name. How can I fix this?
 ...
 
 Postfix, being a Mail Transport Agent, just moves mail around; it
 does not create the FROM header.

Unless he was talking about what shows up in the trace headers or
X-Return-Path or something... then it's the MTA.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] rar unrar and non-free package

2006-06-27 Thread Micah J. Cowan
On Tue, Jun 27, 2006 at 12:14:41AM -0700, Ryan wrote:
 On Sunday 25 June 2006 11:15 pm, Micah J. Cowan micah-at-cowan.name |lugod| 
 wrote:
  ...I suspect that trying to do so would be impractical on Unix,
  though: Unix users have far too much control over their environment to
  be deterred from using something based on some sort of time-tracking
  scheme... :-)
 
 http://freshmeat.net/projects/dateshift/
 
 I use it in my wrapper shell script for cdrecord-ProDVD to keep it for 
 expiring every 6 months (it's free as in beer, but you still have to update 
 the key every 6 months, and it annoys me greatly)

Thanks for proving me right, and for the link to a very interesting
piece of software.

What is cdrecord-ProDVD? If it's just a CLI DVD-recorder, have you tried
growisofs from dvd+rw-tools? It is insanely easy to use, and works
extremely well. However, I highly recommend you use the latest version
(compile from source if necessary), especially if you have a Pioneer
drive (as I do). Other drives are extremely likely to work with whatever
your current distro version has.

Free as in speech...

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] rar unrar and non-free package

2006-06-26 Thread Micah J. Cowan
On Sun, Jun 25, 2006 at 09:55:21PM -0700, Bill Kendrick wrote:
 On Sun, Jun 25, 2006 at 05:05:19PM -0700, Micah J. Cowan wrote:
  It's worth pointing out, though, that the rar utility is also
  non-free-as-in-beer: it's shareware.
 
 Oh, interesting.
 
 Aside from the apt description's comment on the shareware/registration issue,
 does 'rar' or the rar package do anything to enforce the registration
 requirement, or at least remind users after 40 days?

I have no idea.

...I suspect that trying to do so would be impractical on Unix,
though: Unix users have far too much control over their environment to
be deterred from using something based on some sort of time-tracking
scheme... :-)

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] rar unrar and non-free package

2006-06-25 Thread Micah J. Cowan
It's worth pointing out, though, that the rar utility is also
non-free-as-in-beer: it's shareware.

  $ apt-cache show rar
  
  snip
  
  Description: Archiver for .rar files
   This is the RAR archiver from Eugene Roshal. It supports multiple volume
   archives and damage protection. It can also create SFX-archives. There are
   versions which run on DOS, Windows (3.1x,95,NT), FreeBSD, BSDI.
   .
   This program is shareware and you must register it after 40 days of use.
  Bugs: mailto:[EMAIL PROTECTED]
  Origin: Ubuntu

-Micah

On Sun, Jun 25, 2006 at 06:06:09PM -0400, Hai Yi wrote:
 thank you, Norm and Bill.
 Norm, I tried out the site you refered to and have it downloaded and
 working; Bill, thanks for the clarification in regard of the
 non-free stuff, maybe I'll then try some of them : )
 
 Hai
 
 
 On 6/25/06, Bill Kendrick [EMAIL PROTECTED] wrote:
  On Sun, Jun 25, 2006 at 10:01:46AM -0400, Hai Yi wrote:
  
   I downloaded a rar zip file and check the debian packages and found
   the utilities like rar/unrar are non-free.
  
  snip
  
   How to proceed if I do want to purchase a non-free package?
   ^^^
 
  In Debian, non-free specifically refers to the license, not the monetary
  cost.  From The Debian GNU/Linux FAQ, Chapter 5: The Debian FTP archives
  [ http://www.debian.org/doc/FAQ/ch-ftparchives.en.html ]:
 
stable/non-free/: This directory contains packages distribution of
which is restricted in a way that requires that distributors take
careful account of the specified copyright requirements.
 
For example, some packages have licenses which prohibit commercial
distribution. Others can be redistributed but are in fact shareware
and not freeware. The licenses of each of these packages must be
studied, and possibly negotiated, before the packages are included in
any redistribution (e.g., in a CD-ROM).
 
 
  So when you go to download a package from the non-free Debian 
  repositories,
  you're not being charged for it. :)
 
  Just thought I'd clear that up, since it looked like there was some
  confusion.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] re: selinux woes (Apache issue?)

2006-06-23 Thread Micah J. Cowan
On Thu, Jun 22, 2006 at 11:17:19PM -0700, Cylar Z wrote:
 [Thu Jun 22 01:12:57 2006] [error] [client
 71.XXX.XXX.XXX] (13)Permission denied: access to
 /images/picture012.jpg denied, referer:
 http://www.mydomain.com/parentdocument.html
 
 [Thu Jun 22 01:18:15 2006] [error] [client
 71.XXX.XXX.XXX] File does not exist:
 /var/www/html/mydomain.com/images/ranch_trip_032,
 referer: http://www.mydomain.com/images/images.html
 
 Doesn't exist? This is a joke, right?
 
 [Thu Jun 22 01:19:24 2006] [error] [client
 71.XXX.XXX.XXX] (13)Permission denied: access to
 /images/ranch_trip_032.jpg denied, referer:
 http://www.mydomain.com/images/images.html
 
 Interesting...first it doesn't exist, now it does
 exist but permission is denied.

First it doesn't exist... but if you look carefully, what it claims not
to exist is actually a different file than the one whose access is
denied: ranch_trip_032 vs ranch_trip_032.jpg.

...you might try su-ing to nobody (or whoever httpd runs as) from within
the document root, and trying to navigate the directories and read the
appropriate files...

If Mr. nobody can read the files you want, then maybe post any
ACL-related portions of your httpd.conf, and any other portions that
might conceivably be relevant?

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] LART Manufacturer [OT]

2006-06-21 Thread Micah J. Cowan
On Wed, Jun 21, 2006 at 04:24:19PM -0700, Alex Mandel wrote:
 Anyone know of a local company or super geek capable of making these:
 http://www.lartmaker.nl/

Huh. I visited that site fully expecting to see some sort of torture
device for use against clueless lusers.

Clever choice for an acronym, but does it convey the right connotations,
I wonder?

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Firefox find utility

2006-06-20 Thread Micah J. Cowan
On Tue, Jun 20, 2006 at 11:09:35AM -0700, Bill Kendrick wrote:
 On Tue, Jun 20, 2006 at 11:46:05AM -0400, Peter Jay Salzman wrote:
  I find the FF find feature to be weaker than what I've come to expect from
  Unix tools.  For example, it would be really nice to specify regex type
  syntax, like
  
 ^foo
  
  to find the substring foo abutted against the left margin.
 
 
 Wouldn't that depend
 on how wide your brower
 is and how things are
 word-wrapping? ;^)
 
 I guess maybe you meant at the beginning of a paragraph, in the leftmost
 cell of a table, just after a br line break, etc.?

I doubt that's what he meant. After all, though it /does/ depend on how
your browser is, it's the browser that is performing the search in the
first place: it knows where all the line breaks are.

Myself, I'd probably never use ^ in firefox (unless the document were
actually plaintext); but there's scads of times when I would've wanted
basic regex support... The dot character, character classes, maybe
word boundaries...

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] a comment on Pete's fast-loop question

2006-06-19 Thread Micah J. Cowan
On Sun, Jun 18, 2006 at 11:44:19PM -0400, Peter Jay Salzman wrote:
 On Sun 18 Jun 06,  8:13 PM, Micah J. Cowan [EMAIL PROTECTED] said:
  Given your explanation above, you might also find Hacker's Delight
  to be enjoyable reading (if you haven't read it already).
  
  ...just promise me you'll document the hell out of pretty much anything
  you /use/ out of there... :-)
  
 You know... a long time ago I read a /. book review of this book and it's
 been in the back of my head for a long time.  I never had the money to
 purchase it (I think it's still on my nerdbooks.com wishlist).  You just
 reminded me of it.  Yeah, that's a book I can afford now; I think I'll take
 the plunge.
 
 I set up a wiki on www.dirac.org/programming to document everything I learn
 about programming, numerics, and numerical algorithms.  Slowly but surely, a
 lot of my saved vox-tech messages (like this one) are getting documented
 there.  I also plan on documenting things I learn from books like Hacker's
 Delight.

I should also point out that it may be unwise to implement some of the
operations that book describes, that are already easily supported
through more conventional means. For instance: the book may have some
neat tricks for integer division, but the truth is that optimizing
such things is the compiler's job, and sometimes the compiler will know
better ways to do it (especially down the road in the future). Simpler
code is frequently the best approach, no matter what cool tricks you
know.

Some things, OTOH, such as bit-counting, or other properties of a
value-type evaluations, are much enhanced by exactly these sorts of
tricks.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Mp3 Stereo to mono

2006-06-18 Thread Micah J. Cowan
On Sat, Jun 17, 2006 at 10:24:37PM -0700, Jeff Newmiller wrote:
 Alex Mandel wrote:
 
 [...]
 
  Any suggestions on this are quite welcome, keep in mind that these audio 
  files are for analysis of bird songs in a scientific setting so any 
  alteration of the actual original audio is unacceptable as we might lose 
  valuable information from filters and adjustments.
 
 If authenticity is so important, why are you using MP3 in the first place?

MP3 or Ogg, or any other compression method that is lossy and based on
throwing out information based on how the human brain processes audio
information, does seem /completely/ inappropriate as a storage format
from which to draw scientific conclusions...

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] a comment on Pete's fast-loop question

2006-06-18 Thread Micah J. Cowan
On Sun, Jun 18, 2006 at 08:26:21PM -0400, Peter Jay Salzman wrote:
 On Sun 18 Jun 06, 12:06 AM, Norm Matloff [EMAIL PROTECTED] said:
  Pete Salzman asked about optimizing a loop in terms of execution speed,
  by having the loop index go from high value to low instead of vice
  versa.  Some discussion ensued in terms of what machine instructions a
  compiler could take advantage of in this manner.
  
  One point that you might consider, Pete, is that these considerations
  are kind of nickel-and-dime in comparison to things like memory
  hierarchy issue.  There is much better payoff potential in writing code
  in such a way as to minimize cache misses, which cause major time
  penalties, and page faults, which cause catastrophic time penalties.
  
 Yeah, I know.  My company hired me for algorithmic optimizations --- my
 knowledge of devising a set of algorithms to accomplish a given task (e.g.,
 solving dense matrices, choosing a particular Monte Carlo for a given
 problem).
 
 I guess my attitude towards this was more along the lines of while I'm in
 the neighborhood, why don't I stop by and say hello.  It certainly wouldn't
 be prudent to re-implement code to use nickel and dime optimization, but
 while thoughts in my neurons travel down my CNS and translate into my
 fingers tapping on keys, I might as well tap on keys in such a way that the
 nickel and dime optimizations appear on vim's terminal.  The price of
 admission is free, so I might as well.
 
 OK.  I took that nutty metaphor as far as it can go.  Hope it made sense.
 
  There is even a book on this, I believe in the Intel Press series.
 
 Definitely sounds like a book I should pick up.  I'll Google for it!

Given your explanation above, you might also find Hacker's Delight
to be enjoyable reading (if you haven't read it already).

...just promise me you'll document the hell out of pretty much anything
you /use/ out of there... :-)

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] loop efficiency and testing against zero.

2006-06-16 Thread Micah J. Cowan
On Fri, Jun 16, 2006 at 12:52:17PM -0700, Tim Riley wrote:
 Peter Jay Salzman wrote:
  I've read somewhere that a loop that runs from 0 to some number should be
  written to go in reverse order, e.g. instead of:
  
 for ( int i = 0;  i  10;  ++i )
  
  we should write:
  
 for ( int i = 9;  i = 0;  --i )
 
 I would think this:
   for( int i = MAXINT; i; --i );
 is faster than this:
   for( int i = 0; i  MAXINT; ++i );
 
 However, on my machine they both took the
 same time -- 3.24 seconds.
 
 I would think the test of 'i'
 would be a single instruction and the test
 of 'i  MAXINT' would take multiple
 instructions. But surprise!

No, they are both exactly identical in meaning, and thus representable
with exactly the same instructions.

I don't know how GCC's optimizations work, but it's the compiler's job
to handle rote optimizations like this; I imagine that if you enable
-O3, GCC might (should) notice that you're not actually using the value
of i, and optimize it to the decrement operation if appropriate.

Optimization should always happen after implementation.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] loop efficiency and testing against zero.

2006-06-16 Thread Micah J. Cowan
On Fri, Jun 16, 2006 at 02:31:10PM -0700, Rod Roark wrote:
 On Friday 16 June 2006 14:21, Micah J. Cowan wrote:
 ...
  Optimization should always happen after implementation.
 
 No generalization is worth a damn, including this one.

Absolutely.

And, in fact, I think that phrase (the one I just wrote a moment ago...)
is a bit simplistic and overused without qualification.

The truth is, if you know two ways to do something: an easy one that's
exponential-time, and a /slightly/ harder one that's linearythmic, by
golla, you'll do the linearythmic one... especially if you can pretty
much count on it being used frequently.

I think the thing you really want to warn against is nit-picky
optimizations that have exactly the same complexity (as denoted by the
Big Theta notation), but that just tweak the constant term, or the
constant multiplier by a negligible amount.

But Optimization should happen after implementation is quicker to say,
and is a good rule-of-thumb at any rate...

:-)

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] loop efficiency and testing against zero.

2006-06-16 Thread Micah J. Cowan
BTW, I found a terrific (IMO) post about code optimization a while back:

  http://www.jroller.com/page/rolsen?entry=five_truths_about_code_optimization

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


Re: [vox-tech] Why change default ssh port?

2006-06-16 Thread Micah J. Cowan
On Fri, Jun 16, 2006 at 05:31:34PM -0700, Rick Moen wrote:
 3.  We Were Here First.  Speaking for myself, I'll be damned if I'll
 abandon port 22 just because a bunch of cretin kiddies and Russian
 mafiosi with automated 'sploit code and dictionary files want to conduct
 doorknob-twisting on it.  Likewise, it's beneath my dignity to obscure
 my e-mail address just because someone might try to send it adverts for 
 dubious investment opportunities.  Do those guys think they're better at
 Internet management than the open-source technical community is?   Well,
 they're wrong, and they can kiss my shiny Exim rulesets.

This is exactly the same reasoning I used to decide I didn't want to
obscure or control access* to my email address, either.

* Although I never tried it, AFAICT, trying to give your email address
  only to trusted individuals /never/ works. Some idiot forgets to be
  careful with it at some point...

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Why change default ssh port?

2006-06-16 Thread Micah J. Cowan
On Fri, Jun 16, 2006 at 05:54:35PM -0700, Rick Moen wrote:
 Quoting Micah J. Cowan ([EMAIL PROTECTED]):
 
  This is exactly the same reasoning I used to decide I didn't want to
  obscure or control access* to my email address, either.
  
  * Although I never tried it, AFAICT, trying to give your email address
only to trusted individuals /never/ works. Some idiot forgets to be
careful with it at some point...
 
 There were two things I noticed some years back, that made up my mind:
 
 1.  I noticed that apparently staggeringly large botnets were
 (seemingly) attempting dictionary-style delivery to all possible
 usernames at my mail exchanger.  (The scale of resources required
 sort of boggled me.  I have no idea if this method works for the
 spammers, but the fact that I still see it occasionally argues that it
 does.) 

Did you mean brute-force-style, there? 'Coz I've seen that, too...

I'm not /too/ worried about dictionary-style attacks, as my first name
is fairly unusual..

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Tracking down a redirect

2006-06-14 Thread Micah J. Cowan
On Wed, Jun 14, 2006 at 02:30:54PM -0700, Richard Crawford wrote:
 We're having a strange domain resolution issue, and it's stumped me.  Here's 
 the setup.
 
 Domain http://unexdlc.ucdavis.edu should be resolving to IP address 
 152.79.198.9.  However, it is instead resolving to http://extensiondlc.net, 
 which is an entirely different IP address.  Similarly, typing 
 http://152.79.198.9 into a browser brings up extensiondlc.net, which should 
 not be happening.
 
 When the physical computer which hosts .9 is disconnected from the network, 
 the redirect does not happen.
 
 There is nothing in the Apache configuration file on .9 which should account 
 for this behavior.  When I execute a traceroute, I'm redirected immediately 
 on the first hop to extensiondlc.
 
 We're trying to find out where this might be happening.  Can anyone offer 
 some 
 suggestions?

From your description, it's clear that it has nothing to do with Apache
or HTTP.

You say ... should be resolving to IP address 152.79.198.9. However,
according to dig:

;; QUESTION SECTION:
;unexdlc.ucdavis.edu.   IN  A

;; ANSWER SECTION:
unexdlc.ucdavis.edu.7200IN  CNAME   extensiondlc.net.
extensiondlc.net.   86364   IN  A   204.11.233.24

so, in fact it isn't. It looks like the UCD nameservers are
misconfigured.

-- 
HTH,

Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Tracking down a redirect

2006-06-14 Thread Micah J. Cowan
On Wed, Jun 14, 2006 at 03:57:25PM -0700, Mark K. Kim wrote:
 On Wed, Jun 14, 2006 at 03:16:50PM -0700, Micah J. Cowan wrote:
  On Wed, Jun 14, 2006 at 02:30:54PM -0700, Richard Crawford wrote:
 [snip]
   Domain http://unexdlc.ucdavis.edu should be resolving to IP address 
   152.79.198.9.  However, it is instead resolving to 
   http://extensiondlc.net, 
   which is an entirely different IP address.  Similarly, typing 
   http://152.79.198.9 into a browser brings up extensiondlc.net, which 
   should 
   not be happening.
 [snip]
  You say ... should be resolving to IP address 152.79.198.9. However,
  according to dig:
 [snip]
  unexdlc.ucdavis.edu.7200IN  CNAME   extensiondlc.net.
  extensiondlc.net.   86364   IN  A   204.11.233.24
 
 Furthermore, connecting directly to 152.79.198.9 causes 301 Moved
 Permanently redirection to unexdlc.ucdavis.edu, which is an alias for
 extensiondlc.net.  So it appears to be a 2-layer problem - DNS as well
 as some server issue.

snip

 152.79.198.9.  FYI, if you try HTTP/1.1 with host set to
 unexdlc.ucdavis.edu:
 
   $telnet 152.79.198.9 80
   Trying 152.79.198.9...
   Connected to 152.79.198.9.
   Escape character is '^]'.
   GET / HTTP/1.1
   host: unexdlc.ucdavis.edu
   
   HTTP/1.1 302 Found
   Date: Wed, 14 Jun 2006 22:52:50 GMT
   Server: Apache/2.0.44 (Unix) mod_perl/1.99_08 Perl/v5.8.0 DAV/2
   Location: http://unexdlc.ucdavis.edu/cfmx/DLC/
   Content-Length: 340
   Content-Type: text/html; charset=iso-8859-1
   
   !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
   htmlhead
   title302 Found/title
   /headbody
   h1Found/h1
   pThe document has moved a
   href=http://unexdlc.ucdavis.edu/cfmx/DLC/;here/a./p
   hr /
   addressApache/2.0.44 (Unix) mod_perl/1.99_08 Perl/v5.8.0 DAV/2 Server
   at unexdlc.ucdavis.edu Port 80/address
   /body/html
   
   Connection closed by foreign host.
 
 It's a 302 Found but it tells you to go to unexdlc.ucdavis.edu which
 is an alias for extensiondlc.net.  However you look at it, you're being
 sent to extensiondlc.net.

Well, but the server doesn't necessarily understand that
unexdlc.ucdavis.edu is a separate host: You've just told it (via the
Host header) that /it/ is unexdlc... so it probably thinks its
redirecting you to a different path on the same directory.

...huh. That's funny: I don't get the redirect message when /I/
connect... I get a 200 OK with an html body.

traceroute to 152.79.198.9 (152.79.198.9), 30 hops max, 40 byte packets
1  192.168.1.2 (192.168.1.2)  0.414 ms  0.311 ms  0.258 ms
2  69.36.252.1 (69.36.252.1)  1.309 ms  1.383 ms  1.207 ms
3  69.36.237.29 (69.36.237.29)  5.388 ms  4.296 ms  3.797 ms
4  g2-1.core3.eqx.layer42.net (69.36.239.82)  3.374 ms  18.542 ms
2.904 ms
5  sjo-ix.he.net (206.223.116.37)  3.292 ms  3.008 ms  3.069 ms
6  pos2-2.gsr12416.pao.he.net (216.218.224.105)  4.157 ms  4.652
ms  3.929 ms
7  paix-px1--hurricane-ge.cenic.net (198.32.251.69)  42.104 ms
204.192 ms  214.253 ms
8  dc-oak-dc1--svl-dc1-10ge.cenic.net (137.164.22.31)  43.757 ms
14.290 ms  17.195 ms
9  dc-csac-dc1--oak-dc1-ge.cenic.net (137.164.22.111)  14.411
ms  14.102 ms  14.043 ms
10  ucdmc-ge--sac-dc1.cenic.net (137.164.23.74)  42.767 ms
14.252 ms  15.646 ms
11  unexgal9.ucdmc.ucdavis.edu (152.79.198.9)  14.770 ms
42.390 ms  17.086 ms
12  unexgal9.ucdmc.ucdavis.edu (152.79.198.9)  46.669 ms
17.865 ms  15.950 ms
13  unexgal9.ucdmc.ucdavis.edu (152.79.198.9)  45.646 ms
23.779 ms  19.571 ms
14  * * *

Notice that unexgal9.ucdmc.ucdavis.edu (which is 152.79.198.9)
apparently doesn't realize that 152.79.198.9 is its own IP address, and
keeps trying to forward it on...?

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] mplayer color problem

2006-06-13 Thread Micah J. Cowan
On Tue, Jun 13, 2006 at 01:32:57PM -0400, Peter Jay Salzman wrote:
 On Tue 13 Jun 06, 10:25 AM, Bill Kendrick [EMAIL PROTECTED] said:
  On Tue, Jun 13, 2006 at 10:49:26AM -0400, Peter Jay Salzman wrote:
   I've played Quake 3, which uses SDL, on this computer and it plays fine.
   When I get home, I'll take a look at the cutscenes and see if they suffer
   from the same washed out color.
  
  Well, technically, Quake uses OpenGL. :)  It probably uses SDL for
  input/sound, though.
  
 Is that true?  It was developed by Loki; I would've thought they use SDL for
 video too.  I did an ldd on the executable and didn't see sdl or gl,
 although I *know* it uses OpenGL, either via an SDL window or using OpenGL
 directly...

I'm pretty sure Loki games load video/sound drivers at runtime (via
dlopen()), as it's usually configurable via something like +set
gl_driver ... so you might have better luck using strings on it, and
searching for the name of an OpenGL function they'd have to use.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] DVD-CD converion for linus distros?

2006-06-12 Thread Micah J. Cowan
On Sun, Jun 11, 2006 at 06:36:15PM -0700, Lewis Perdue wrote:
 Every Linux distro seems to come on DVD now ... but my Linux boxes 
 only have a CD drive ... is there a way to convert the DVD to CDs?

Ubuntu is somewhat well-known for residing on a single CD (they have a
DVD edition in addition).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Why change default ssh port?

2006-06-12 Thread Micah J. Cowan
On Mon, Jun 12, 2006 at 10:58:32AM -0700, Rick Moen wrote:
 Quoting Richard S. Crawford ([EMAIL PROTECTED]):
 
  Our hosting service has (without notice) changed our default ssh port from
  22 to 22799.  This strikes me as an unusual decision, but I am still a
  novice at this sort of thing.  Why would a host make such a switch (I
  won't ask why they wouldn't announce it ahead of time; I'm used to that
  level of service from them).
 
 Because they prefer to hide their network services, rather than
 concentrate on reducing actual vulnerability.

+1

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Why change default ssh port?

2006-06-12 Thread Micah J. Cowan
On Mon, Jun 12, 2006 at 11:59:24AM -0700, Rick Moen wrote:
 Quoting MB ([EMAIL PROTECTED]):
 
  Every little bit of security/obsfucation helps.
 
 Don't forget to make /etc/issue and /etc/issue.net claim that you're
 running ITS on SuperNintendo.  _Somebody_ might be fooled.
 
 Putting lampshades on top of your servers could be just the protection you
 need, too.
 
  Just changing the SSH port probably removes 90% of the threats with 10% 
  of the effort.
 
 It certainly does win in the easier than thinking department.

This seems a /bit/ harsh. And MB does make a valid point that the ROI on
simply shifting the ports is somewhat impressive.

But I agree that it's a poor substitute for truly improving security.
I'm not against changing the port, as it does hide the service's
existence, but it ought to at least be coupled with and is certainly no
replacement for ensuring that you are running a properly configured and
up-to-date service. Sadly, it seems likely that a support staff unwise
enough not to announce the move beforehand (thus creating a serious
support issue for themselves), is unlikely to take it any further than
the port move.

I think a good analogy for changing the port number to something
nonstandard might be writing a secret message using a Caesar-style
cipher. It /does/ provide some security. Someone reading through several
messages might be discouraged from bothering with your non-plaintext
message, and go for lower-hanging fruit (unfortunately, this seems to be
the only goal in too many people's security models), but anyone with the
smallest incentive to read your particular message (or, who is perhaps
intrigued by the fact that it's not plaintext in the first place) will
discover its content quite quickly. No one employing it should deceive
themselves into thinking that their communiqué is confidential.

Using a simple cipher also gives a decent return/investment ratio. But
that should not distract one from the fact that the return itself may
not be sufficient for one's needs.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] C and IEEE-754

2006-06-07 Thread Micah J. Cowan
On Wed, Jun 07, 2006 at 02:48:36PM -0500, Ken Bloom wrote:
 On Wed, Jun 07, 2006 at 03:41:02PM -0400, Peter Jay Salzman wrote:
  I started to read:
  
 http://www.cs.princeton.edu/introcs/91float/
  
  and came across an interesting comment:
  
 Java uses a subset of the IEEE 754 binary floating point standard to
 represent floating point numbers and define the results of arithmetic
 operations. Most machines conform to this standard, although some
 languages (C, C++) do not guarantee that this is the case.
  
  It's a poorly written paragraph, but seems to say that C and C++ don't
  guarantee adherence to the IEEE 754 standard.  If this really is the case,
  why don't they?
 
 I suppose if your hardware supports something else instead of
 IEEE-754, then a conforming C/C++ implementation can use the hardware,
 rather than having to emulate IEEE-754.

In fact, IIRC, C predates IEEE('s very existance as an orginazation) by
quite a bit. But the best format for every machine isn't IEEE-754, IBM
and Cray have used their own formats for floating point (though, AIUI,
for the most part they have supported IEEE-754 in addition to their
own).

Note that C doesn't even have particular requirements on the radix used
by the floating point model (i.e., it doesn't have to be 2. Hell, it
could be 10!).

However, you can test for the existence of a macro, __STDC_IEC_559__,
whose existence guarantees conformity to IEC 60559:1989 floating point
(which is the current designation for ANSI/IEEE 754-1989, which was also
designated IEC 559:1989 before it went to 60559. If that macro is
defined, then you are free to assume the usual semantics for floating
point.

C++ uses a completely different approach . You use the numeric_limits
type defined in the limits header:

  if (std::numeric_limitsdouble::is_iec559) {
...
  }

AFAICT, the __STDC_IEC_559__ macro is only available in C99; my draft
copy of C90 doesn't mention it (but does refer to IEEE 754 in some
examples).

However, float.h provides a number of definitions useful in describing
the floating-point model used, and there are certain guarantees made
about them (such as a double being convertable to 10 decimal digits and
back without loss of information).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] C and IEEE-754

2006-06-07 Thread Micah J. Cowan
On Wed, Jun 07, 2006 at 02:10:56PM -0700, Richard Harke wrote:
 On Wed June 7 2006 13:30, Micah J. Cowan wrote:
  On Wed, Jun 07, 2006 at 02:48:36PM -0500, Ken Bloom wrote:
   On Wed, Jun 07, 2006 at 03:41:02PM -0400, Peter Jay Salzman wrote:
I started to read:
   
   http://www.cs.princeton.edu/introcs/91float/
   
and came across an interesting comment:
   
   Java uses a subset of the IEEE 754 binary floating point standard
to represent floating point numbers and define the results of
arithmetic operations. Most machines conform to this standard, although
some languages (C, C++) do not guarantee that this is the case.
   
It's a poorly written paragraph, but seems to say that C and C++ don't
guarantee adherence to the IEEE 754 standard.  If this really is the
case, why don't they?
  
   I suppose if your hardware supports something else instead of
   IEEE-754, then a conforming C/C++ implementation can use the hardware,
   rather than having to emulate IEEE-754.
 
  In fact, IIRC, C predates IEEE('s very existance as an orginazation) by
 IEEE is actually quite an old organization around 100 yrs, I believe.
 IEEE has sections for power generation and transmission, and many others,
 not just computers. 

Doh! Of course, you are right. I was guessing on that. I meant to look
it up before saying such a thing, but I forgot.

However, I /believe/ I'm right when I say that it at least predates IEEE
754... which AFAICT comes from ~1987? Of course, I have no idea in what
forms it existed before it become an international standard. Certainly,
it predates C's first forray into standardization.

snip

 For a long time, there has been no way in C to control floating pt modes
 but I think recently some effort has been made. Rounding modes in
 particular can be quite important in some computations.
 I think C mostly goes with what is expedient with the hardware in use.
 On x86, the hardware float registers are actually 82 bits. This can be
 accessed directly with some compilers as long double But, OTOH, if you
 specify double it will be expaned to long double when loaded into
 a register. Now if it stays in the register through a series of operations,
 the result can subtly different than if it was rounded to double after
 every intermediate operation.

Yeah. Which was frustrating to implementors, because in order to be 100%
conforming, they _had_ to do the stupid truncations every single
operation. Which is why GCC added -funsafe-math-operations, I think.

So C99 (1) allowed these optimizations to take place by default, and (2)
defined a standard #pragma directive to control it (FP_CONTRACT).

Of course, this is all AIUI: I haven't nearly the intimate knowledge of
C and floating-point that many implementors and various folks at
comp.lang.c have; so better to check with them for details.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] C - passing chars and pointer to chars

2006-06-04 Thread Micah J. Cowan
On Sun, Jun 04, 2006 at 10:05:22AM -0400, Peter Jay Salzman wrote:
 I gave good reasons *why* passing the pointers should always work.  I think
 Micah really got at the heart of the matter:
 
 
Micah said:
Pointers to incompatible types are not guaranteed to be represented the
same way, even though in practice they are. /All/ pointer types must be
convertible to and from a pointer to any character type, and used as
such, so this makes it all the more likely that they will be represented
the same.
 
Irregardless, the Standard does /require/ that a warning be given when
you try to do this.
 
 
 I think the  main point is the lack of guarantee that they're represented
 the same way.  Here's what I think he means.
 
 I *think* what Micah is saying here is that even though a char and signed
 char types have the same width (1 byte) and are implemented the same way in
 practise, there's no guarantee that they *are* implemented the same way.

Actually, no: char and signed char /must/ be represented the same way,
if char is signed.

 For example, a perverse compiler writer may put a byte of dead storage (for
 whatever reason) in between contiguous elements of a char array and 2 bytes
 of dead storage in between contiguous elements of a signed char array.

Well, no, it couldn't. At the very least, you must be able to convert a
pointer to /anything/ to a pointer to character type, and be able to
inspect the byte values in that way.

I was actually talking about the fact that the /pointer/ types don't
have to be represented the same way. A compiler could represent signed
char pointers as a value bit-shifted two to the left, whereas a pointer
to char could be a bitwise complement of the same value. Not likely, but
basically, the Standard committee don't want you just passing stuff
around in general without first declaring, I know what the hell I'm
doing (via a cast).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] C - passing chars and pointer to chars

2006-06-04 Thread Micah J. Cowan
On Sun, Jun 04, 2006 at 05:52:34PM -0500, Ken Bloom wrote:
 On Sunday 04 June 2006 13:58, Micah J. Cowan wrote:
  On Sun, Jun 04, 2006 at 09:57:18AM -0500, Ken Bloom wrote:
   On Sunday 04 June 2006 09:05, Peter Jay Salzman wrote:
On Sat 03 Jun 06, 10:27 PM, Ken Bloom [EMAIL PROTECTED] said:
 Cue, the **Fundemental axiom of the C++ type system**, stated
 as follows:
   A* is automaitcally convertable to B* if and only if A is a
 B. (Likewise for pass by reference).

 (this is my own generalization though, and there may actually
 be exceptions)
   
Although this was interesting to read, it doesn't say much other
than to restate my observation in a more sophisticated way.
  
   IMO, all that matters is that the axiom is the reason.
 
  Except the axiom is rather far from the truth, only an ideal.
 
  C++ is more strongly typed than C. I am not a language theorist, but
  I believe it is still not considered strongly typed.
 
  The ability to silently convert from int to char (your compiler might
  actually complain about it in some circumstances: a compiler is
  allowed to complain about whatever the hell it wants, but there's no
  requirement to here, and in most cases, it won't) illustrates one
  exception, certainly.
 
 That's not an IS_A relationship. That's automatic conversion.

That was exactly my point. However, on looking back, I misread your
axiom to say A is automatically convertable to B if and only if...

My bad.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] C - passing chars and pointer to chars

2006-06-02 Thread Micah J. Cowan
On Fri, Jun 02, 2006 at 11:31:43AM -0400, Peter Jay Salzman wrote:
char  a = 0;
signed char   b = 0;
unsigned char c = 0;
 
a = b; a = c;// fine.
b = a; b = c;// fine.
c = a; c = b;// fine.
 
 You can even pass the different types of char to functions that take
 other types of char:
 
void takesAChar( char x, signed char y, unsigned char z );
 
takesAChar(a, b, c); takesAChar(a, c, b);  // fine.
takesAChar(b, a, c); takesAChar(b, c, a);  // fine.
takesAChar(c, b, a); takesAChar(c, a, b);  // fine.
 
 What the compiler complains about is passing *pointers* to different
 types of char:
 
void takesACharPtr( char *x, signed char *y, unsigned char *z );
 
takesACharPtr(a, b, c); takesACharPtr(a, c, b);  // warnings.
takesACharPtr(b, a, c); takesACharPtr(b, c, a);  // warnings.
takesACharPtr(c, a, b); takesACharPtr(c, b, a);  // warnings.
 
 The warning is:
 
pointer targets in passing argument foo of bar differ in signedness.

char is a distinct type from both signed and unsigned char.  Not only
that, but it is also considered incompatible with the other types,
even though it is required to have precisely the same representation as
one of the other two.

The actual fact that it warns about pointers to chars of different
/signedness/ is fairly misinformative (as then, it shoud not complain
when you swap a and b only).

 I'm trying to understand this.  I'm fairly sure the standard says that all 3
 types of char must have the same width.  For pointer operations like:
 
char s[] = hello;
unsigned char *cptr = s;
++cptr;
putc( *cptr, stdout );
 
 will correctly print e because char and unsigned char have the same
 width, and when we add one to cptr, it points to the correct location in
 memory.

Pointers to incompatible types are not guaranteed to be represented the
same way, even though in practice they are. /All/ pointer types must be
convertible to and from a pointer to any character type, and used as
such, so this makes it all the more likely that they will be represented
the same.

Irregardless, the Standard does /require/ that a warning be given when
you try to do this.

 What I'm getting at is this.  Because all the chars have the same width, it
 doesn't matter WHAT kind of pointer you pass in to a function: char, signed
 char, or unsigned char.  Pointer arithmetic just works, and it works because
 they all have the same width.
 
 On the other hand, the data is what gets mangled if you don't use the
 correct type:
 
char c = 255;
printf(%d, c);
 
 prints, as expected, -1.  Not 255.
 
 So it seems to me that if the compiler complains about anything, it should
 complain about passing a different type of char, not a different type of
 char *.

Perhaps; but assigning between different integer types does not require
a diagnostic, even when overflow occurs (as when you assign 255 to an
8-bit signed char).

 Why does gcc 4 complain about passing different char * and not char?

Assignment between different integer types happens all the time. It's
not always well-defined (for instance, assigning 255 to an 8-bit signed
char invokes undefined behavior, and can cause nasal daemons to fly
out your nose, as far as the Standard is concerned).

 And is this because of the standard or is it gcc specific?

Standard. gcc3 probably didn't complain because 4 has gotten a bit more
pedantic. GCC does not issue all required diagnostics, unless you also
throw in a -pedantic flag. To get the maximum diagnostics, I usually
invoke using -W -Wall -ansi -pedantic (if it's C90).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] gcc and quieting warnings

2006-06-02 Thread Micah J. Cowan
On Fri, Jun 02, 2006 at 12:27:38PM -0700, Bill Kendrick wrote:
 On Fri, Jun 02, 2006 at 11:53:43AM -0400, Peter Jay Salzman wrote:
  I always use -W -Wall when I compile code.  However, sometimes, I want gcc
  to ignore certain instances of a warning.  For example, in something like a
  stub function, or a signal callback, or even an API function that doesn't
  use all the parameters, like:
  
 JNIEXPORT void JNICALL
 Java_HelloWorld_print( JNIEnv *env, jobject obj )
 snip
 
 It may be sufficient to simply not NAME the variables, e.g.:
 
   Java_HelloWorld_print(JNIEnv*, jobject)
   ...

Unfortunately, C doesn't allow you to do that (C++ does...).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] K3B problem

2006-05-31 Thread Micah J. Cowan
On Tue, May 30, 2006 at 10:53:09PM -0700, Chris Horsting wrote:
 Micah J. Cowan wrote:
  On Mon, May 29, 2006 at 10:16:13PM -0700, Chris Horsting wrote:

  Hi,
  I am using Fedora 4.0 and when I tried to copy a CD with k3B I was 
  unsuccessful.
  I got an error the following error:
 Unable to eject media
  
 
  It sounds to me like your desktop may be attempting to automatically
  mount the CD while it's being burned. Have you made sure to disable
  that?
  No, I have not tried to disable that. Do I do that through K3B or KDE?

^^^

Careful: I almost didn't spot your input in there, since it was hidden
with your quote of my message.

I'm afraid I don't actually know how you would go about doing that;
probably a control panel somewhere. Can someone else give pointers?

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] K3B problem

2006-05-31 Thread Micah J. Cowan
On Wed, May 31, 2006 at 12:16:34PM -0700, Jan W wrote:
 
 
 --- Micah J. Cowan [EMAIL PROTECTED] wrote:
 
  On Tue, May 30, 2006 at 10:53:09PM -0700, Chris Horsting wrote:
   Micah J. Cowan wrote:
   
It sounds to me like your desktop may be attempting to
  automatically
mount the CD while it's being burned. Have you made sure to
  disable
that?
   No, I have not tried to disable that. Do I do that through K3B or
   KDE?
  
  I'm afraid I don't actually know how you would go about doing that;
  probably a control panel somewhere. Can someone else give pointers?
  
 
 There are a couple of things to do:
 
 1.  /etc/rc.d/init.d/autofs stop
 
 This will stop automounter services.  But the service will probably
 come up again on reboot, so you would want to do:

I was thinking that might not be enough on some setups. Don't some
desktops actually use helper daemons of their own, or somesuch, to
achieve the desired automounting? Or do they all just use autofs at some
level?

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] K3B problem

2006-05-30 Thread Micah J. Cowan
On Mon, May 29, 2006 at 10:16:13PM -0700, Chris Horsting wrote:
 Hi,
 I am using Fedora 4.0 and when I tried to copy a CD with k3B I was 
 unsuccessful.
 I got an error the following error:
Unable to eject media

It sounds to me like your desktop may be attempting to automatically
mount the CD while it's being burned. Have you made sure to disable
that?

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Video File Format

2006-05-21 Thread Micah J. Cowan
On Sat, May 20, 2006 at 11:44:48PM -0700, Alex Mandel wrote:
 I was always under the impression that .avi was a fairly standard and 
 easy to use format for video, most of what I download from the web is in 
 this format. But I'm finding editing with Avi's in linux to be a pain. 
 What formats do people recommend encoding to if I want to edit in linux. 
 I have tools in windows to convert to just about whatever I want I'm 
 just not sure what a great choice is.
 
 In the end I probably want to create downloadable files and author Dvds 
 in cross platform compatibilty.
 
 Suggestions, experiences?
 Alex

Open standards are best. AVIs are fine, except that almost all of them
get done using proprietary codecs, which ruins it.

MPEG-2 is probably the way to go, especially if you're planning on
authoring DVDs (which use MPEG-2).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] regex help - matching literal []

2006-04-28 Thread Micah J. Cowan
On Fri, Apr 28, 2006 at 03:45:25PM -0700, Kenneth Herron wrote:
 Micah J. Cowan wrote:
  On Fri, Apr 28, 2006 at 04:19:34PM -0500, Ken Bloom wrote:
  Target exception: java.util.regex.PatternSyntaxException: Unclosed 
  character class near index 5
  [[].*]
   ^
 
  java.util.regex.PatternSyntaxException: Unclosed character class near 
  index 5
  [[].*]
   ^
  
  Then it violates POSIX regex syntax. That's a broken response, IMO.
 
 I've been reading 
 http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html 
 and http://www.opengroup.org/onlinepubs/007908799/xbd/re.html, and 
 perhaps I'm missing it but they don't seem to support your assertion. 

No, those are the references I use as well.

 And of course google doesn't allow searching for punctuation. I'd 
 appreciate it if you would explain how [[].*] is valid, or point to 
 some source that supports your position.

Well, I'm not sure I understand what you're saying: you yourself seem to
prove the validity of the RE in your final sentence below. However, in the
SUSv3 spec you cited, the proof is in the grammar, and also (easier to
read) in 9.3.5, point #1, where it says that the [ character loses its
special meaning from within a bracket expression.

It would have a /new/ special meaning /if/ it were part of a character
class, collation class, or equivalence class; but it's none of those, so
what you have is [[] = literal [.

The final ] of my RE isn't special (since there's no active character
class), so it's literal.

 Besides which, Peter was trying to match [ and ] individually. A 
 single RE that matches either character isn't what he wanted. Does 
 [[].*] match [ or ]?

A single RE that matches either character isn't what I provided.

[[] means a character group consisting of the single character, [.

 ObAlternateSolution: the expression [[] matches [, []] matches 
 ], and [[][]] matches [].

If you'll look closer, you'll see that's exactly what I did. But Java
doesn't support it(!).

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Automating web site interaction

2006-04-10 Thread Micah J. Cowan
On Mon, Apr 10, 2006 at 11:12:17AM -0700, Bruce Wolk wrote:
 Does anyone have a recommendation for some software that I can run as a 
 cron job to go to a specific website, autheticate itself on a login web 
 page with a userid and password, then go to a specific page on the site 
 and mimick a button click?

You can use GNU wget to do this; however, it will require some knowledge
of web programming: the specifics of how this will work is entirely
different for different sites, and a little complicated. Bottom line is,
if you're not pretty familiar with web programming (HTML/CGI) and with
wget, you'll need to get someone to do this for you, I think.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Must a 300 microsecond delay keep the CPU busy?

2006-04-04 Thread Micah J. Cowan
On Tue, Apr 04, 2006 at 01:16:07PM -0700, Ted Deppner wrote:
 if (mlockall(MCL_FUTURE)) { perror(mlockall); exit(1); }

Might he want to bitwise-or that with MCL_CURRENT? Otherwise, isn't
swapping (of the preexisting page[s]) still a possibility?

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Must a 300 microsecond delay keep the CPU busy?

2006-04-04 Thread Micah J. Cowan
On Tue, Apr 04, 2006 at 02:52:08PM -0700, Ted Deppner wrote:
 On Tue, Apr 04, 2006 at 02:26:11PM -0700, Micah J. Cowan wrote:
  On Tue, Apr 04, 2006 at 01:16:07PM -0700, Ted Deppner wrote:
   if (mlockall(MCL_FUTURE)) { perror(mlockall); exit(1); }
  
  Might he want to bitwise-or that with MCL_CURRENT? Otherwise, isn't
  swapping (of the preexisting page[s]) still a possibility?
 
 That sounds right.  It's been years since I used these... I had to dust
 off some bits and refer a several archived no-longer-running machine
 backups to dig up that code.  :)

I've never used it; but I found it interesting enough to lookup after
you referred to it. :-)

BTW, this is also used for security concerns, right? To prevent
sensitive (eg, decrypted) data from getting to disk? I seem to remember
gnupg spitting out warnings that it couldn't do something like this, if
it wasn't run with privileges...

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] OT: Licensing

2006-03-14 Thread Micah J. Cowan
On Mon, Mar 13, 2006 at 05:25:23PM -0800, Alex Mandel wrote:
 1. I wrote a python GUI application on windows.
 2. Everything is open source in it except for the COM library that 
 connects into Access databases, MSVCR71.dll (At least I think that's in 
 this one, although reading on the python lists, it sounds like it's part 
 of python.)
 
 What are my options for Licensing this program, I'm overwhelmed by the 
 lists on this topic.
 GPL or LGPL would be preferable since I really want my code open, I just 
 don't know if I can pass around that windows dll or not.

You could make it GPL, with a special exemption that it may be linked
with proprietary DLLs for interfacing with Access.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Pdf Viewers

2006-03-10 Thread Micah J. Cowan
On Fri, Mar 10, 2006 at 09:02:43AM -0800, Bob Scofield wrote:
 I just made a disappointing discovery.  I was playing around with a DMV form 
 and learned that with the Adobe Reader (in SuSE) I could type into the form.  
  
 But in Debian neither XPDF nor KPDF would let me type.  
 
 So it seems that the open source readers are limited in ways that Adobe is 
 not.  I've read the KPDF Handbook, and there is no mentioned of typing into a 
 form.

Well, it's limited in a few other ways as well: The PDF format allows
you to embed movies, sounds, javascript, etc. I don't know for sure, but
I doubt xpdf supports any of those (and, IIRC, kpdf is a fork from
xpdf).

 So have I discovered a fact of life, or does someone know how to configure an 
 open source reader to type into a pdf document?

Probably a fact of life. I'm sure that AcroForms is an eventual goal,
but probably won't be coming for a while. You may need to resign
yourself to acroread. :-(

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: Fwd: RE: [vox-tech] bash: ls: command not found

2006-02-28 Thread Micah J. Cowan
On Tue, Feb 28, 2006 at 11:43:25AM -0800, Bill Kendrick wrote:
 bash: ls: command not found
 
 This is a new workstation that we got from our IT department and I've been
 able do get around on it before...
 What do I need to do to fix this?
 
 Thanks in advance,
 Joey
 
 
 I have the same problem, could you help me?
 
 thank a lot.

Have you checked to see if your problem was the same as the original
poster's?

Please give us the results of the following command lines (after
subscribing so we can receive further mails from you):

  $ echo $PATH
  $ type ls
  $ which ls
  $ whereis ls
  $ /bin/ls

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Creating large ramdisks

2006-02-20 Thread Micah J. Cowan
On Mon, Feb 20, 2006 at 01:05:16PM -0800, Ken Herron wrote:
 John Wojnaroski wrote:
 
  Hi,
 
  Is there a way to create large ramdisks (around 200meg) that act as a 
  single partition?  I seem to recall seeing something on the topic a 
  few weeks ago while surfing, but now can't seem to locate the site by 
  googling when I need it?
 
 Sure, it's a filesystem type called tmpfs. All of the memory for file 
 storage is taken from the system's virtual memory (ie swap space). For 
 example, I use this entry in /etc/fstab for my /tmp directory:
 
 tmpfs   /tmptmpfs   size=512m   0   0

Yeah, but if it uses swap, doesn't that sorta defeat the probable
purpose of a ramdisk partition?

I'm pretty sure there's something that will do this, but I don't recall
what it was...

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] benchmarking (again)

2006-02-17 Thread Micah J. Cowan
On Fri, Feb 17, 2006 at 04:16:29PM -0500, Peter Jay Salzman wrote:
 On Fri 17 Feb 06, 12:00 PM, Mark K. Kim [EMAIL PROTECTED] said:
  On Fri, Feb 17, 2006 at 11:13:42AM -0500, Peter Jay Salzman wrote:
  
   And I've read that java allocates
   memory for all data items on the heap, which is never stored in L1 cache
   while for C and C++, temporary objects are often put into the L1 cache.
  
  I think you mean CPU registers?  L1/L2/L3 caches are just buffers
  between RAM and the CPU registers, and all data allocated in RAM, stack
  or heap, go through L1 cache at some point.  Programming languages or
  compilers have no direct memory allocation access of the caches.
  
 I was under the impression that this is what computer scientists call
 locality of data -- if data is used once, it'll be used again soon.  The
 strategy that attempts to exploit locality of data is to hold recent data in
 L1 cache.
 
 I read that in an article on Java World on optimizing Java programs.

Yes, but to my understanding, there is no direct software access to the
L1 or L2 (etc) caches: the CPU does all the decision making regarding
what gets into the cache, and there are no (to my knowledge)
instructions to give direction on this.

  Anyway, wouldn't the details of data items getting allocated in the
  heap/stack/register depend on the JVM and the JIT compiler?  Objects,
  would have to be allocated in the heap, but simple data types like
  double can certainly be temporarily allocated in a CPU register until
  it's out of scope, no matter what the Java standard may say, if the JIT
  compiler, for example, determines it can be done safely and can speed up
  the execution.
 
 I see what you mean.  Yeah, but the question still remains -- what's going
 on with the user time in java apps, and why does the program run faster in
 Java than C++?  Certainly C++ compilers know how to do all that stuff too.

The Cygwin argument somebody put forth seems like it might be an
explanation... I really don't want to comment too much until I actually
get to see what assembly code gets generated from a given C or C++
test...

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] benchmarking (again)

2006-02-17 Thread Micah J. Cowan
On Fri, Feb 17, 2006 at 02:03:36PM -0800, Mark K. Kim wrote:
 As Jeff pointed out, Cygwin can be a bit of an oddball.  I'm not sure
 what happens if you run `time` on a non-Cygwin program like a JVM.
 Also, I'm not sure what JVM considers system and user time -- if the
 whole program gets executed by the JVM as a system driver then system
 time is what C++ would consider a user time.
 
 Try the code under Linux.  It should give more accurate measurements.

Or, you might try mingw.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] windows support, unfortunately

2006-02-06 Thread Micah J. Cowan
On Mon, Feb 06, 2006 at 02:19:39PM -0500, Peter Jay Salzman wrote:
 Hi all,
 
 At work I have to use WinXP, but all of my development is with open source
 tools like cygwin, miktex, etc., so I'm almost happy.
 
 This morning a bad thing happened.  Adobe Acrobat wanted to install an
 update 7.0.5 on my work computer, and stupidly, I allowed it.  It wanted to
 reboot to finish the upgrade, and again, I allowed it.
 
 Unfortunately, after the reboot, my system has become flakey.  Here are some
 manifestations:

snip

It's an obvious one, but I'm obliged to ask it: have you tried
/uninstalling/ Acrobat, and if so, did it make a difference? Also, is
your desktop backed-up?

 The reason why I'm posting to vox-tech is that one of the help desk guys
 noted that i have a lot of illegal software.  this is the term he actually
 used; i'm not making that up.  he was referring to firefox, putty, miktex,
 gvim, cygwin, etc.  he said i have to uninstall the illegal and unsupported
 software to fix the machine.

IMO, this is worth making an issue of. All of these are extremely legal
to have on your machine, and it is worth making the support guy
understand this. Now, some of it /may/ be against company rules: but
since you mentioned that you use cygwin to do development, I sincerely
doubt it.

Beat this into the support guy's head. Actually, a good tactic is to ask
/him/ questions, and make him answer them reasonably. Most answers from
these sorts of people will reveal more questions to ask.

How, exactly, is Firefox (e.g.) illegal to install?
How did you learn this (from the answer to previous)?
What do you think about (appropriate link to strong materials denying
the truthfulness of his previous answer)?

 I've got a better idea.  I'm going to try to fix whatever is wrong without
 uninstalling my illegal software.  Hence, the post to vox-tech.
 
 First, everything points to the Acrobat upgrade, since that is the only
 thing that occured in between the time the system was good and not good.
 But this hardly matters.
 
 Any ideas?  Many of the things seem to point towards permissions problems.
 The filesystem is NTFS.  Is there a notion of permissions and file ownership
 on NTFS?  If so, if I didn't have access to read a *.lnk file, would
 explorer tell me the link is not valid like I see in point #1 above?

Yes, but it's not quite like Unix. you should be able to access it under
Properties or something: certainly somewhere under the right-click
context menu (sorry: running Linux from work at the moment, so can't
give you better details).

 Many of the problems feel like permissions problems to me.  Could some kind
 of permission problem conceivably cause problem #2 above?

I would think so.

 I don't have the admin password for this computer, but I noticed a utility
 on the web that obtains the admin password on XP machines.  Actually
 *changing* the admin password is out of the question, for obvious reasons.

Actually snooping it may be a bad idea as well. You can certainly get
fired for such activity, and probably jail time, depending on the judge.

If you must use this, make it a last resort. Probably the one right
after attempting to reinstall your system, reinstalling cygwin, etc on
top of a fresh install.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] windows support, unfortunately

2006-02-06 Thread Micah J. Cowan
On Mon, Feb 06, 2006 at 04:26:08PM -0500, Peter Jay Salzman wrote:
 On Mon 06 Feb 06,  1:11 PM, Micah J. Cowan [EMAIL PROTECTED] said:
  On Mon, Feb 06, 2006 at 02:19:39PM -0500, Peter Jay Salzman wrote:
   Hi all,
   
   At work I have to use WinXP, but all of my development is with open source
   tools like cygwin, miktex, etc., so I'm almost happy.
   
   This morning a bad thing happened.  Adobe Acrobat wanted to install an
   update 7.0.5 on my work computer, and stupidly, I allowed it.  It wanted 
   to
   reboot to finish the upgrade, and again, I allowed it.
   
   Unfortunately, after the reboot, my system has become flakey.  Here are 
   some
   manifestations:
  
  snip
  
  It's an obvious one, but I'm obliged to ask it: have you tried
  /uninstalling/ Acrobat, and if so, did it make a difference? Also, is
  your desktop backed-up?
  
 Thanks, Micah.
 
 After the Acrobat update, I seem to have completely lost the ability to
 install and uninstall programs.
 
 Most of the time it says that I need admin privs.  Some of the time it says
 it can't access a particular .dll or it can't find a particular file.
 Before this whole thing started, I was able to install/uninstall programs
 just fine.

See: this is weird in and of itself: if you were able to
install/uninstall programs most of the time, chances are **REALLY** good
that your user /had/ Admin privs. Ask the support guy (shudder) if this
has changed recently?

   The reason why I'm posting to vox-tech is that one of the help desk guys
   noted that i have a lot of illegal software.  this is the term he 
   actually
   used; i'm not making that up.  he was referring to firefox, putty, miktex,
   gvim, cygwin, etc.  he said i have to uninstall the illegal and 
   unsupported
   software to fix the machine.
  
  IMO, this is worth making an issue of. All of these are extremely legal
  to have on your machine, and it is worth making the support guy
  understand this. Now, some of it /may/ be against company rules: but
  since you mentioned that you use cygwin to do development, I sincerely
  doubt it.
  
  Beat this into the support guy's head. Actually, a good tactic is to ask
  /him/ questions, and make him answer them reasonably. Most answers from
  these sorts of people will reveal more questions to ask.
  
  How, exactly, is Firefox (e.g.) illegal to install?
  How did you learn this (from the answer to previous)?
  What do you think about (appropriate link to strong materials denying
  the truthfulness of his previous answer)?
 
 I think his intent was it's against company policy, but I'll try this
 tactic.

Well, against company policy is another issue entirely. You could try
to get that changed, but...

Thing is, your boss knows your developing with cygwin, right? So how can
it be against company policy?

Somewhat more likely: against MIS policy...

   I don't have the admin password for this computer, but I noticed a utility
   on the web that obtains the admin password on XP machines.  Actually
   *changing* the admin password is out of the question, for obvious reasons.
  
  Actually snooping it may be a bad idea as well. You can certainly get
  fired for such activity, and probably jail time, depending on the judge.
 
 Woof!  Yeah, I definitely don't want to lose my job.  ;)
 
  If you must use this, make it a last resort. Probably the one right
  after attempting to reinstall your system, reinstalling cygwin, etc on
  top of a fresh install.
  
 Unfortunately, my hands are completely tied now; I can't install or
 uninstall anything.  It's almost as if my user account went from 'admin' or
 'power user' to 'restricted user'.
 
 Maybe tomorrow I should try calling support again and telling them that I
 can no longer install/uninstall software?  I really don't know what else to
 do, and you have me too spooked to try to change my user permissions now...

No, no, I meant install WinXP afresh (or the company's baseline image),
and install things over that. You can do that if you have access to the
machine... (but you may need MIS's permission/help).

Didn't mean to spook you... figured you already guessed as much. And it
really depends on the employer: some will be sympathetic, some won't.
But with an IS department like that, I'm thinking it's wiser to avoid.

As far as changing your own user permissions: as I previously noted, it
seems very likely that you once /had/ Admin permissions. If you can
ascertain that this was true, then it seems justifiable to get them back
(although, again, illicitly gaining access to the Admin account itself
may not be a good idea).

As far as getting fired over stuff: just keep in mind, a guy can pretty
much get fired for whatever reason the company wants--including quite
illegal reasons--provided the company never tells anyone why the guy's
getting fired, and nobody can prove the reason beyond a reasonable
doubt. So even if there's not a legal case against such (though I'm
certain DMCA

Re: [vox-tech] windows support, unfortunately

2006-02-06 Thread Micah J. Cowan
On Mon, Feb 06, 2006 at 01:46:30PM -0800, MB wrote:
  I have hosed up many windoze boxes ;) 

Are you /sure/? IME, they tend to be quite adept at doing that
themselves. :-)

(Disclaimer: I can't actually claim this to be true anymore; XP seems to
be a quite more stable platform than its predecessors, and I can't
recall actually having to reinstall it yet.)

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] grokking g++ errors

2006-02-02 Thread Micah J. Cowan
On Thu, Feb 02, 2006 at 02:59:35PM -0500, Peter Jay Salzman wrote:
 On Thu 02 Feb 06, 10:21 AM, Jeff Newmiller [EMAIL PROTECTED] said:
  
  You didn't ask for assistance in actually troubleshooting this problem, but
  templates traditionally must be defined before they are instantiated in the
  source.  It is possible that newer compilers can handle definition after
  instantiation, but I don't know how they do it.
 
 Sorry for being so dense, but I'm just now starting to try to really learn
 function and class templates.
 
 Do you mean that the template function definition must be seen before the
 any calls to the function is made (I assume that's the instantiation)?
 
 I guess what I'm asking is -- is the template function's prototype not
 enough?  The actual definition must be seen before any calls to the function
 are made?

IIRC this should not be true (though I'll point out that in your sample
code, no such prototype has been provided); however, for many
implementations, it is. You may also need to explicitly tell g++ to
instantiate that template into an actual function definition. Something
like:

  template void split(const string str,
  back_insert_iteratorvectorstring);

but that may not be necessary.

Realize that defining a function /template/ does not define any
function, only a template. That's what /instantiating/ the template
does. It makes it easy on the compiler if the function template's
definition is in scope at the time you implicitly or explicitly
instantiate it, and some compilers may require this, though the C++
stnadard does not (only that it's in the same translation unit
somewhere).

I'd be happy to help you debug the problem if you want to give me access
to the actual code.

-- 
HTH,

Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] using windows pathnames in cygwin

2006-01-31 Thread Micah J. Cowan
On Tue, Jan 31, 2006 at 04:37:03PM -0800, Jeff Newmiller wrote:
 I've never used gvim.exe, but one of the issues that comes up in using
 Windows versions of posix tools in cygwin is the newline problem...
 the windows versions may or may not handle the normal cygwin LF
 newlines properly.  gvim probably can... others don't always.

Can't you use set fileformat?
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] using windows pathnames in cygwin

2006-01-31 Thread Micah J. Cowan
On Tue, Jan 31, 2006 at 06:49:08PM -0800, Jeff Newmiller wrote:
 Micah J. Cowan wrote:
  On Tue, Jan 31, 2006 at 04:37:03PM -0800, Jeff Newmiller wrote:
  
 I've never used gvim.exe, but one of the issues that comes up in using
 Windows versions of posix tools in cygwin is the newline problem...
 the windows versions may or may not handle the normal cygwin LF
 newlines properly.  gvim probably can... others don't always.
  
  Can't you use set fileformat?
 
 I don't know... in what context?
 
 As a gvim command? Quite possibly... but as I said I don't use gvim
 so you tell me...

Ah. I missed that.

In the context of POSIX tools in cygwin, then: when you install cygwin,
it gives you the option of whether to use Windows or Unix line-endings,
so that's probably a source of your trouble. I don't know where you go
to reconfigure that.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] using windows pathnames in cygwin

2006-01-31 Thread Micah J. Cowan
On Tue, Jan 31, 2006 at 02:17:49PM -0800, Micah J. Cowan wrote:
 I've got a shortcut on my desktop that launches X with an xterm. I'm
 pretty sure I found it in either $CYGROOT/usr/bin or
 $CYGROOT/usr/X11R6/bin. I'll let you know what it is when I get home,
 unless you find it first.

You should have a file startxwin.bat in your /usr/X11R6/bin. Copy a
shortcut to that to your desktop.

snip

 However, it may interest you to know that the fact that xterm and other
 clients pop up alongside the other Windows apps is a relatively recent
 /feature/ (root-less X). You can disable it in your XF86Config, I
 believe.

Apparently, you can get the right setting by editing the invocation of
XWin in the startxwin.bat file I just mentioned the -multiwindow
option is what you probably have enabled, and activates the integrated
Windows-based window manager. The -rootless option actually uses a
/transparent/ root window with an external window manager. You probably
want to use the -fullscreen option, which does the normal X thing. Then
you'd want to replace the (commented-out) line that starts twm with
whatever wm you'd like to enjoy.

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


Re: [vox-tech] update on the audio CD problem

2006-01-27 Thread Micah J. Cowan
On Thu, Jan 26, 2006 at 11:51:08PM -0800, Norm Matloff wrote:
 I then turned to my daughter's machine.  I had thought this one would be
 harder, since the symptoms there had been worse.  But it turned out to
 be a very simple problem in that case:  The file permissions on /dev/hdc
 were not set correctly. :-)

I've noticed that Fedora resets permissions on these things from time to
time. Make sure you did it the approved way (which, unfortunately, I
don't remember). But just manually running chmod is not going to work.
You'll have to google for this one, I'm afraid (unless someone onlist
remembers how you're supposed to do it).

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] update on the audio CD problem

2006-01-27 Thread Micah J. Cowan
On Fri, Jan 27, 2006 at 04:05:23PM -0500, Peter Jay Salzman wrote:
 On Fri 27 Jan 06, 12:50 PM, Bill Kendrick [EMAIL PROTECTED] said:
  On Fri, Jan 27, 2006 at 05:06:09AM -0500, Peter Jay Salzman wrote:
   Digital extraction is where the cd is read, and the signal gets pumped
   through the ATA port to your speakers.  This is more efficient from the
   CPU's standpoint.
  
  Woah, I would think this is way LESS efficient.
 
 No.  The CPU is involved in many read-copy operations when the signal passes
 through the sound card.
 
 AFAIK, the north and south bridge use DMA during digital extraction.

Pete, I'm pretty sure that the CPU isn't even /involved/ with analog
mode. It's analog. There is no read/copy. There's nothing to read/copy.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] update on the audio CD problem

2006-01-27 Thread Micah J. Cowan
On Fri, Jan 27, 2006 at 07:30:50PM -0500, Peter Jay Salzman wrote:
 On Fri 27 Jan 06,  2:27 PM, Micah J. Cowan [EMAIL PROTECTED] said:
  On Fri, Jan 27, 2006 at 04:54:14PM -0500, Peter Jay Salzman wrote:
   On Fri 27 Jan 06,  1:17 PM, Micah J. Cowan [EMAIL PROTECTED] said:
On Fri, Jan 27, 2006 at 04:05:23PM -0500, Peter Jay Salzman wrote:
 On Fri 27 Jan 06, 12:50 PM, Bill Kendrick [EMAIL PROTECTED] said:
  On Fri, Jan 27, 2006 at 05:06:09AM -0500, Peter Jay Salzman wrote:
   Digital extraction is where the cd is read, and the signal gets 
   pumped
   through the ATA port to your speakers.  This is more efficient 
   from the
   CPU's standpoint.
  
  Woah, I would think this is way LESS efficient.
 
 No.  The CPU is involved in many read-copy operations when the signal 
 passes
 through the sound card.
 
 AFAIK, the north and south bridge use DMA during digital extraction.

Pete, I'm pretty sure that the CPU isn't even /involved/ with analog
mode. It's analog. There is no read/copy. There's nothing to read/copy.

   sure there is.
   
   data needs to be copied from kernel space to user space.  that 
   _definitely_
   requires the CPU.  that's why the whole zero-copy user-space access was
   such a big deal.
  
  Kernel space? What the heck are you talking about?
  
  There is a direct analog connection from the CD drive to the sound card.
  It doesn't ever even touch the mother board. The signal sure as hell
  isn't routed out through the soundcard to the motherboard, and then back
  into the soundcard. No kernel, user, or any other sort of space is
  involved.  It's an analog signal, which isn't even representable in
  kernel or user space unless you convert it to digital, which kind of
  defeats the purpose.
 
 1. read() is performed on a block file device to obtain sound data.
 2. write() is performed to write the data to the sound char device file.
 
 it looks like this:
 
read(drive_fd, buffer, size);
write(sound_fd, buffer, size);
 
 the kernel performs these system calls in kernel mode on behalf of the
 application.  the data is read into kernel space, and recopied into
 userspace no fewer than 4 times.

You've /just/ described digital extraction. BTW, DMA is (typically) used
in the read above: that's what you've been referring to. It would be
/impossible/ to refer to the above as analog, since, at the end of it,
you have the data in buffer, which is of course, digital, by its very
nature.

But I'm curious: if the above is analog, then what does digital look
like?

 if you don't understand me, or don't believe me, i'll do the google search
 and post a link that explains this.

I already did. Check a message or two back. Or try it yourself. Here is
the previous link, along with another.

http://www.epanorama.net/documents/pc/cdrom_audio_wire.html
http://www.smart-projects.net/isobuster/help/noframes/hs210.htm

Or, hey, you could look at the source to XMMS's cdaudio plugin, and see
what it does under Digital Extraction Mode. Here's a summary.

  Digital Extraction Mode:
dae_play_loop() gets called, which does plenty of read()s and
write()s. Yes, DMA /may/ be involved (depending on your hdparm
settings). But it definitely gets copied into user space and back.
  Analog Mode:
seek() gets called (a local function, poorly named IMO), which does
a single ioctl() to the CD device file.

 ps- i'm not sure how you can claim that no kernel, user, or any other space
 is involved when we're talking about I/O to hardware device files.

That's /exactly/ my point. There is no read/write from any device files,
whatever. There is an ioctl()--to your CD drive device file, and not the
sound card device file. That's it. The actual signal is never, ever in
core memory (or swap). The motherboard (and CPU, and therefore software)
never sees it.

And I can't believe we're still even discussing this. Please give me a
reliable reference, from google or whatever, or let's stop now.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Need to bypass Squid proxy

2006-01-26 Thread Micah J. Cowan
On Thu, Jan 26, 2006 at 01:01:18PM -0600, Ken Bloom wrote:
 Ehrhart, Jay wrote:
  I have a Linux proxy server filtering all my outbound web traffic.  All
  traffic leaving the proxy assumes the proxy IP address.
  
  I have an internal web site and I need that web server to see the
  originating IP address of my internal web traffic.
  
  How can I make that one IP address or url bypass the proxy?  Can I use
  Squid or iptables and if so how do I set it up?
 
 In addition to what everyone else said, if it's a transparent proxy that
 you have no control over, you can connect by HTTPS. I don't know of any
 proxy that can proxy an encrypted connection.

If it's not transparent, it can (the CONNECT method).
But, yeah, I don't see how a transparent one could do that.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Need to bypass Squid proxy

2006-01-26 Thread Micah J. Cowan
On Thu, Jan 26, 2006 at 11:41:28AM -0800, MB wrote:
 Unfortunately (or fortunately), squid WILL proxy SSL and regular web 
 sessions.  It will also proxy other connections like ftp.  Squid happens 
 to be a *very* powerful proxy.

I'm aware that squid will proxy SSL, at least on non-transparent
connections (I do that often). I don't see how it can do that
transparently: It doesn't know the server's private key. It could use a
totally /separate/ key to pretend to be the server, and then pretend to
be the client to the server, but that would be wrong, wrong, WRONG, and
I very much doubt the developers of squid make it do that.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Need to bypass Squid proxy

2006-01-26 Thread Micah J. Cowan
On Thu, Jan 26, 2006 at 12:43:47PM -0800, Seth Nagao wrote:
 On 1/26/06, Micah J. Cowan [EMAIL PROTECTED] wrote:
  I'm aware that squid will proxy SSL, at least on non-transparent
  connections (I do that often). I don't see how it can do that
  transparently: It doesn't know the server's private key. It could use a
  totally /separate/ key to pretend to be the server, and then pretend to
  be the client to the server, but that would be wrong, wrong, WRONG, and
  I very much doubt the developers of squid make it do that.
 
 Interestingly enough, I went to an ISSA meeting which included a
 vendor that intended to do EXACTLY that.  The line of thought went
 something like, Well, we're the good guys, so it's not really a MITM
 attack.  I'll see if I can find the info I have on them next time I'm
 in the office.  I've been curious of what legal implications that such
 a proxy might incur if a breach of security happened at that point,
 but that might be covered in the big nasty legal documents you often
 have to sign.

There are concerns in doing this, even from the vendor point of view.

For instance, since you can't get a trusted certificate authority to
give you a signature for the destination server you're pretending to be,
the user's browser (if it's any good) will always through up a WARNING:
not signed by a trusted provider or WARNING: certificate doesn't
belong to the site they're claiming to be.

So, being able to do this transparently is pretty limited. And once
users realize what's going on, several of them are liable to become
PISSED.

And, documents or not, I'm willing to bet that if a security breach
happened at that point, you can sue their friggin' ass off. Deployed
against employees at a corporation, you could probably sue the
employer's ass off, too: and they probably didn't think hard enough
about it to make you sign documents anyway.

All in all, a much better alternative, if you really want to have
absolute* control over what goes out over your network, is to simply
disallow outgoing HTTPS altogether. Let them check their bank accounts
from home, etc. :-)

Clearly, these guys had not thought things through. And no sysadmin
worth his salt would buy such a product (and, if he were forced to,
would never enable such a stupid feature).

*Practically, no such thing. Even if we do this, what's to prevent
someone from setting up their /own/ proxy over permitted channels?
Someone once implemented IP-over-email to illustrate circumvention of
firewalls...

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Need to bypass Squid proxy

2006-01-26 Thread Micah J. Cowan
On Thu, Jan 26, 2006 at 01:38:54PM -0800, Ehrhart, Jay wrote:
 I don't think I made what I want to accomplish clear.
 
 I am at a county office of Education.  By law all web traffic to the
 real Internet must be filtered.  I have a Red Hat Linux server running
 N2H2 web filtering.  It is a transparent proxy.  All traffic goes
 through the proxy filter and there is no way around it.
 
 I have an internal web server that is only for the schools and is not
 publicly accessible.  The proxy server does its job and sends the
 traffic out where it dies on the outside of my publicly facing firewall.
 I want to bypass the proxy with squid or iptables so that the private
 sites can reach the private web site.

I realize this. The message you're responding to was
something of a tangent.

So, it is a transparent proxy, and editing your Connection Settings
won't work. Any changes made must be done at the proxy server, or at a
routing level.

First off: as things currently stand, does traffic directed at the
private web server actually get there (though redirected from the proxy
server)? If not, then you need to make sure that the proxy knows how to
direct traffic there.

Now, if things are getting to the private web server, but always show
the IP address from the proxy server, there's a couple options. The
easiest, if you are able to make the appropriate adjustments at the web
server, is to comprehend and correctly interpret the HTTP
X-Forwarded-From (non-standard) header that your proxy should be
emitting.

Another option is to configure the proxy server to directly forward
IP packets to the internal web server, virtually unchanged (that is,
with the original source IP address intact). If you're not using Linux,
I can't help you there (it may not be possible).

But your best option would be to ensure that the routing tables of the
machines on your network don't direct intranetwork traffic through the
proxy. If you're using DHCP, then it's the DHCP server you need to
configure for this.

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


Re: [vox-tech] playing an audio CD

2006-01-24 Thread Micah J. Cowan
On Tue, Jan 24, 2006 at 02:10:06PM -0800, Norm Matloff wrote:
 Being as busy as I am, unfortunately almost all of my work with
 computers is serious, e.g. no game playing. :-(
 
 Now my 14-year-old daughter has suddenly decided she wants to become a
 Linux user.  Yay!  But I can't seem to get either her Linux machine or
 mine to play music from audio CDs, something of absolutely prime
 importance to her. :-)  This is gonna be a dealbreaker for her, so we
 risk losing a potential Linux enthusiast.  Thus any help you people can
 give me would be much appreciated.

See if your CD player has a Direct digital playback option or similar.
This may fix the silent success problem.

I can tell you how you might get it to work using xmms...

The fact that the slider is going but nothing is playing, /might/
indicate that the CD drive's audo output cable isn't plugged into the
sound-card's input jack. XMMS lets you deal with this situation
gracefully. If you click on the upper-left icon, you will get a menu.
Goto Options and select Preferences. On the Audio I/O Plugins tab,
select CD Audio Player and hit the Configure button.

Make sure that the Device field has the correct device file on it, and
use any intuitive path for the Directory field. When you tell XMMS to
Play Directory on that directory, it will automagically load your
Audio CD (if it has been configured correctly).

If you're having trouble getting the sound to play (same situation as
you're currently seeing in CD Audio Player), select Digital audio
extraction instead of Analog.

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


Re: [vox-tech] java

2006-01-20 Thread Micah J. Cowan
On Fri, Jan 20, 2006 at 03:29:34PM -0800, Matin Hashemi wrote:
 I want to install a program from its source distribution, and
 unfortunately the source is in java which I don't know anything about!
 
 The package Makefile use Jikes (IBM java compiler), so I installed the
 jikes first. But I get this error when trying to make:
 
 **
 jikes -nowarn +F -g  at/dms/compiler/tools/lexgen/Main.java
 
 Found 1 system error:
 
 *** Semantic Error: You need to modify your classpath, sourcepath,
 bootclasspath, and/or extdirs setup. Package java/lang could not be
 found in:
 /home/bin/antlr-2.7.5.jar
 /home/streamit-src-2.0/src
 /home/streamit-src-2.0/3rdparty
 .
 
 make[1]: *** [at/dms/compiler/tools/lexgen/Main.class] Error 1
 make[1]: Leaving directory `/home/streamit-src-2.0/src'
 make: *** [all] Error 2
 ***
 
 What is this java/lang? kind of a library? how should I add it in?

I forget the details, but I believe you need to add JAVA_HOME to your
environment, or some similar thing. Point it at the root directory of
your java installation. This information may be Sun-specific, but the
IBM version should be fairly similar.

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


Re: [vox-tech] java

2006-01-20 Thread Micah J. Cowan
On Fri, Jan 20, 2006 at 05:20:58PM -0800, Matin Hashemi wrote:
 I set JAVA_HOME env var to $HOME/j2sdk1.4.2_10It didn't solve the
 problem  :-(

Okay. Check out
http://www.tldp.org/HOWTO/Enterprise-Java-for-Linux-HOWTO-2.html

According to this, you should have

  JAVA_HOME=$HOME/j2sdk1.4.2_10
  PATH=$JAVA_HOME/bin:$PATH
  CLASSPATH=$JAVA_HOME/lib/classes.zip:.

Don't forget to export all of these. To make sure they're really
accessible to programs you run, look through the output of env.

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


Re: [vox-tech] Funny characters in aterm on kubuntu

2006-01-11 Thread Micah J. Cowan
On Wed, Jan 11, 2006 at 08:39:13PM -0600, Jay Strauss wrote:
 Hi all,
 
 I'm running Kubuntu breezy.  I've installed aterm
 
 [EMAIL PROTECTED]:~$ aterm -V
 aterm version 0.4.2
 
 When I use man or perldoc I get funny characters in the output.  Most 
 (99%) of the output is normal but ever so often there is a funny character 
 embedded in the output.  It seems like it happens mostly (but not 
 exclusively) 
 at the end of a line.
 
 Regular xterm outputs perfectly.
 
 Can anyone suggest some things to try to fix this?

Sounds like probably an encoding problem.

What character set does aterm expect to be using? UTF-8?

Most manpages assume ISO-8859-1, I believe.

What is the output of ( env | egrep '^LC|LANG' )?

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] amazon search in the book questions

2006-01-06 Thread Micah J. Cowan
On Fri, Jan 06, 2006 at 01:25:22PM -0500, Peter Jay Salzman wrote:
 Hi all,
 
 Consider this URL, which is a page inside a book about Green's functions:
 
 http://www.amazon.com/gp/reader/0521282888/ref=sib_rdr_prev2_ex1/104-6467245-0944703?%5Fencoding=UTF8p=S00Hns=1#reader-page
 
 When I use the browser (FF) to print the page, the book's contents don't
 show up on the printed page.  Same thing when I use FF's preview print
 feature.
 
 When I use left click view image, the book page's contents disappear too.
 No matter where I click, the page title is transparent pixel.
 
 How exactly does Amazon do this?

From what I've seen of how it works, I believe they use JavaScript to
swap the image in and out. That might affect why it doesn't print with
that; I don't know: however, I don't know how it doesn't show up when
you view image.

...Of course, if they're using CSS to achieve layers, then they might be
putting the transparent pixel image in /front/ of the real image,
meaning that when you right-click on it, you're actually right-clicking
on the transparent pixel instead of the one you see. And I think the
printing stuff doesn't handle transparency, so that would make some
sense, too.

 Is there a way of saving the book page
 contents to an image file?  The only thing I could think of is taking a
 window image with GIMP or something like that.

That seems simplest. For more, you may have to dig around quite a bit to
check out the JavaScript, and any interactions with the server. Probably
not worth the hassle.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] gimp no print

2006-01-06 Thread Micah J. Cowan
On Fri, Jan 06, 2006 at 01:42:38PM -0500, Peter Jay Salzman wrote:
 Using gimp 2.2 on Debian Etch.  The print menu (which I recall being under
 File) has disappeared.
 
 Has this happened to anyone else?

You mean, the right-click File menu, right? 'Coz the one on the
toolbar doesn't have it.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] gpg-agent issues

2005-12-17 Thread Micah J. Cowan
On Fri, Dec 16, 2005 at 10:02:00AM -0800, Richard Crawford wrote:
 I'm trying to get gpg-agent running on my FC3 laptop so that I don't have to 
 type in my passphrase each time I send out an e-mail.  Unfortunately, when I 
 try to start gpg-agent with the command:
 
 $ gpg-agent
 
 I get the following error message:
 
 gpg-agent: can't connect to '/home/richard/.gnupg/S.gpg-agent': No such file 
 or directory
 gpg-agent: no gpg-agent running in this session

snip

 When, for kicks and giggles, I try to execute:
 
 $ gpg-agent --daemon
 
 I get this error message:
 
 can't connect to '/home/richard/.gnupg/log-socket': No such file or directory
 GPG_AGENT_INFO=/tmp/gpg-4p6U8v/S.gpg-agent:10175:1 export GPG_AGENT_INFO;
 
 ...even though there is a file in /home/richard/.gnupg called log-socket.  
 However, that file appears to be empty.  Also, when I again execute

The error message above looks very fishy indeed: it looks like it's
attempting to read in that entire line, starting with GPG_AGENT_INFO and
ending with the export command, as the /name/ of a file. Try to find out
what is doing that (a miswritten config file somewhere?)

You can use the fuser or lsof commands to find all the processes that
have a given file open: that could come in handy; as could examining the
/proc/pid directory of gpg-agent (run with --daemon), and examining
what files it has open.

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


Re: [vox-tech] subversion: print non-versioned files in directory

2005-12-15 Thread Micah J. Cowan
On Thu, Dec 15, 2005 at 10:19:23AM -0800, Matt Roper wrote:
 Since it's quite common to have a bunch of junk files sitting in your
 directory that you don't care about (e.g., .o, .c~, etc.), subversion
 allows you to set a property on a directory that tells it names/patterns
 of files to ignore.  You can do this by running 
 
 svn propedit svn:ignore .

Yeah, but I won'd do that for .o, .c~, etc. Better to set global-ignores
in /etc/subversion/config or your ~/.sversionrc. I usually reserve
svn:ignore for specific targets, or anything else that I don't block in
general but that should be ignored in this specific directory.

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


Re: [vox-tech] moving an url gracefully

2005-12-14 Thread Micah J. Cowan
On Wed, Dec 14, 2005 at 01:52:20PM -0500, Aaron A. King wrote:
 Forgive my ignorance, but is this something that must be done by 
 reconfiguring 
 the server?  Or can one put the 301 redirect into an HTML page sitting at the 
 old site?

You can't. There is a non-standard, but de facto standard way to
accomplish something very similar in HTML, by using meta
http-equiv=Refresh value=0; http://new-url/;, but you wouldn't want
to use that unless you really had no control over the server
/whatsoever/, even through local configs (.htaccess). There are pretty
good reasons not to use that method most of the time; and it also fails
to programatically notify indexers or user agents that the new
destination replaces the old one (as a 301 does--though I have no idea
how smart indexers are about that sort of thing).

Apache (and maybe other servers) supports the concept of an .asis
document (as-is), which gets served exactly as is, and includes the
appropreate HTTP headers _in_the_document_. However, IIRC, Apache
doesn't normally have these set up by default, and so if you're able to
get that working, you'd probably be able to get the mod_rewrite stuff
working as well (which is a generally better approach).
-- 
HTH,

Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Kmail Question

2005-11-15 Thread Micah J. Cowan
On Mon, Nov 14, 2005 at 11:38:03PM -0600, Ken Bloom wrote:
 I've tried Thunderbird, Balsa (from GNOME) and Sylpheed-Claws.
 My biggest problem with Balsa and Sylpheed-Claws are the GTK+
 click-and-paste wierdness. When you select text that becomes the text
 that's pasted when you middle-click. When you deselect that text, the
 previous contents of the paste buffer are restored (which doesn't feel
 like the correct behavior at all).

Did you know that GTK+ also typically supports Ctrl-C, Ctrl-V, with a
separate (internal--not X) copy buffer? Also, deselecting via an arrow
key, or possibly via Ctrl-Shift-A, will not alter the copy buffer.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Kmail Question

2005-11-15 Thread Micah J. Cowan
On Tue, Nov 15, 2005 at 11:19:23AM -0800, Jeffrey J. Nonken wrote:
 On Mon, 14 Nov 2005 23:38:03 -0600
 Ken Bloom [EMAIL PROTECTED] wrote:
 
  My biggest problem with Thunderbird (and Firefox) are MIME
  associations. I get the impression that there's some combination of
  behavior where Thunderbird and Firefox don't remember them, don't
  share them with each other, and don't share them with any other
  standard system of MIME associations. Likewise for protocol helpers.
  We really need a better way to tie these apps together.
 
 I've tried Firefox on my Windoze machine, and while it's a decent
 little browser, I never liked it as well as I like Mozilla. Thing about
 Mozilla is that it's got the news/email and browser in the same package.
 I don't know if it addresses your plaint, but I'd expect it to be
 better integrated. Might be worth looking into.

I might be wrong, but I think Ken was talking about integration with
/other/, non-Mozilla applications that use MIME associations.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Kmail Question

2005-11-14 Thread Micah J. Cowan
On Sun, Nov 13, 2005 at 01:26:21AM -0800, Richard Harke wrote:
 On Sun November 13 2005 00:55, Richard Harke wrote:
  Kmail normally expects its mail directory to be the users home
  directory/Mail   Is there some way to set to something else?
  I want to use it with a jump drive under Knoppix.
 
 Well, duh! Just use a soft link.  Should have googled first.
 Richard

Still not very flexible, if you ask me. I recently gave up on KMail
after numerous issues with it; primarily that sometimes it would just...
stop working.

Actually, I have yet to find a GUI email client for Linux that I like.
But I need to use them for HTML-based emails that I receive at work.
:-(

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


Re: [vox-tech] Kmail Question

2005-11-14 Thread Micah J. Cowan
On Mon, Nov 14, 2005 at 03:32:47PM -0600, Jay Strauss wrote:
 You should try Thunderbird. It kinda sucks too :)

It's what I've switched back to. It has its problems, but it's my
favorite thus far.

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


Re: [vox-tech] [OT] IE fails on my page: error 80004004

2005-10-03 Thread Micah J. Cowan
On Mon, Oct 03, 2005 at 03:02:10PM -0700, Richard Crawford wrote:
 I spent my morning developing my personal homepage, http://www.mossroot.com, 
 using Quanta+ on my Linux computer and checking it in Firefox.  When I 
 finally got around to trying it out with IE, IE refused to finish loading the 
 page.  When I tried IE under WINE, I was told it got an error number 
 80004004.  I've Googled on that error number but I haven't found anything 
 that seems relevant.
 
 I'm stumped.  Anyone got any ideas?

Everything seems okay. I notice Connection: Keep-Alive is set by
default, and wonder if that has anything to do with it (although I was
pretty sure IE honors that correctly). Have you tried using tcpdump?

Maybe do tcpdump -vv -s 0 -X port 80 (as root) while connecting to your
server with IE, and maybe we can figure out what's going on... you might
not want to post that full log to the list, since it might be somewhat
lengthy: perhaps post a URI to it...

What version of IE are you using?

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


Re: [vox-tech] RESOLVED [OT] IE fails on my page: error 80004004

2005-10-03 Thread Micah J. Cowan
On Mon, Oct 03, 2005 at 05:44:09PM -0700, Richard Crawford wrote:
 Apparently, moving the JavaScript function that creates the menu outside of 
 the nested div tags fixed the problem.  Weird.

Okay, cool. Cause I was about to say I couldn't find anything obviously
wrong with the transfers.

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


Re: [vox-tech] Printing PNG's

2005-09-23 Thread Micah J. Cowan
On Fri, Sep 23, 2005 at 03:00:52PM -0700, Richard Harke wrote:
 I started to save some documents by scanning them into
 my computer and saving them as PNG files. I have been viewing
 them with Kview which has worked well until I wanted to print one.
 On screen, i can set the scaling to 33% and I get a good size to work with
 with just a little bit of scrolling. If I then print, the size goes back
 to 100% so that only a small part of the upper left corner
 is actually printed. I have tried using the preview print function
 and changing the scale there but that doesn't help. The best I got was
 with Firefox but then it was scaled down so that a page image was
 on about half the page. Everything was there but hard to read.

What about GIMP? I find its Printing set-up to be quite useful.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] [OT] Binary Representation Challenge

2005-09-20 Thread Micah J. Cowan
On Tue, Sep 20, 2005 at 12:02:26PM -0700, Alex Mandel wrote:
 I realize this might be not be a challenge for some of you.
 --
 I need to make a list of all possible permutations given 9 options and 
 that you can choose any number of options at once.
 I've figured out using nCr statistics that this is 511 choices, but now 
 I need to represent them in 2^9 binary code: 1, 00010 etc
 
 Anyone got a quick way? I thought about writing a python code or 
 something but then I got confused just thinking about the algorthim.
 
 Now the best would be if you had an idea that I could implement with my 
 limited toolset: R, OpenOffice, Python, and I guess I could add a 
 package to Cygwin if necessary.

Perhaps its simpler than you think?

If all you need is the different permutations of two-choice options, all
of which can be selected in any combination, then this is exactly the
same as counting in binary.

Or is it actually printing the representation of the binary that is
posing a problem?

FWIW, Knuth has recently published a couple of fascicles from Volume IV
of TAOCP; both of them dealing with Generating all Tuples and
Permutations. I was stumped by how much there is to know about such a
seemingly simple subject.

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


Re: [vox-tech] [OT] Binary Representation Challenge

2005-09-20 Thread Micah J. Cowan
On Tue, Sep 20, 2005 at 12:23:13PM -0700, Alex Mandel wrote:
 Micah J. Cowan wrote:
  On Tue, Sep 20, 2005 at 12:02:26PM -0700, Alex Mandel wrote:
  
 I realize this might be not be a challenge for some of you.
 --
 I need to make a list of all possible permutations given 9 options and 
 that you can choose any number of options at once.
 I've figured out using nCr statistics that this is 511 choices, but now 
 I need to represent them in 2^9 binary code: 1, 00010 etc
 
 Anyone got a quick way? I thought about writing a python code or 
 something but then I got confused just thinking about the algorthim.
 
 Now the best would be if you had an idea that I could implement with my 
 limited toolset: R, OpenOffice, Python, and I guess I could add a 
 package to Cygwin if necessary.
  
  If all you need is the different permutations of two-choice options, all
  of which can be selected in any combination, then this is exactly the
  same as counting in binary.
  
  Or is it actually printing the representation of the binary that is
  posing a problem?
 
 Correct, I need to print a list to represent the choices.
 It's going to be a lookup table in a database on the backside of a 
 webpage that pulls up a static map of the options picked.

Well; so perhaps you could have a nine-element array of strings naming
the options, and iteratively test each bit on each counting iteration,
printing out the string at the same index as the bit you are testing,
followed by  = yes or  = no, depending on your needs?
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] [OT] Binary Representation Challenge

2005-09-20 Thread Micah J. Cowan
On Tue, Sep 20, 2005 at 01:31:02PM -0700, Alex Mandel wrote:
 I get what your saying, lets just say I'm not that experienced at using 
 arrays.
 
 On an interesting note though, we figured out how to overlay tranparent 
 gifs(by layering DIV tags) so we only need 10 images instead of 512 and 
 now just have to write a short script to build the html dynamically 
 instead of a lookup table.

Hm, okay. I guess I'm not really clear on what your needs are, then: it
wasn't clear to me that this was for a web site or anything like that,
and I'm not sure why there is a need to layer transparent gifs. What
sort of image are you trying to generate?

Be careful with layering images: Mozilla and MSIE treat absolute
positioning /very/ differently (MSIE's is broken, naturally).

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


Re: [vox-tech] Empty sendmail log files

2005-08-31 Thread Micah J. Cowan
On Wed, Aug 31, 2005 at 06:05:50PM -0700, Chris Scheuble wrote:
   
 How do I empty the sendmail log files?

Hi Chris,

I'm not certain I know what you're asking: you can clear the mail log
files easily enough by doing something like:

  $  /var/log/maillog

or whatever the log name is (note the preceding ).

If this isn't what you meant, please give me a call at 408-247-8403.
During work hours, I'm at 408-342-5379 (new job).

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Attn Admin [Re: [vox-tech] Empty sendmail log files]

2005-08-31 Thread Micah J. Cowan
On Wed, Aug 31, 2005 at 06:35:36PM -0700, Micah J. Cowan wrote:
 If this isn't what you meant, please give me a call at [...]

Er, /oops/... Chris is a friend of mine, and I didn't realize he was
posting from vox-tech... could the mail admin please appropriately
remove my personal info from the archive?

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


Re: [vox-tech] sshd_config and PasswordAuthentication

2005-07-22 Thread Micah J. Cowan
On Fri, Jul 22, 2005 at 12:02:41PM -0700, Karsten M. Self wrote:
 on Fri, Jul 22, 2005 at 10:01:32AM -0500, Jay Strauss ([EMAIL PROTECTED]) 
 wrote:
  
  No.
  
  The authentication is handled by SSH using the public/private keypair.
  The system password itself isn't involved in the authentication at all.
  
  It's possible to have users whose remote passwords are unknown or
  disabled by this method.  This is the case for a number of remote hosts
  I access regularly.
  
  
  Peace.
  
  
  Karsten, I apologize, I didn't realize I hadn't responded.  Thanks for 
  all the info.
  
  I think you are talking about passwordless authentication, 
 
 It's not passwordless, which is a description of negation.  It is
 possible to set up accounts and SSH-keys without passwords or
 passphrases.  Naturally, this is highly insecure.

A small quibble: Using assymetric key cryptography without passphrases
is not necessarily insecure. If the private key is secure, then a
passphrase is not useful. A private key is not really harder to secure
than a passphrase is, and if the private key is accessible to someone,
chances are pretty good that the passphrase can be as well.

Also, use of a passphrase-encryption on a more-or-less publicly
available private key means that the weakest link in the security
chain will be the weaker of (1) the assymetric encryption algorithm and
(2) the symmetric encryption algorithm used to encrypt the private key
with the passphrase.

Of course, if the private key is truly private, then the passphrase does
no harm (other than the minor nuisance it presents to the owner), and
provides an extra level of protection in the case of *accidental*
compromise of the private key, for the paranoid (a generally good trait
to possess).

Nonetheless, it seems to me that calling the use of public-key
cryptography without passphrases highly insecure is a rather harsh
exaggeration.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] sshd_config and PasswordAuthentication

2005-07-08 Thread Micah J. Cowan
On Fri, Jul 08, 2005 at 10:23:28AM -0500, Jay Strauss wrote:
 
  What's wrong with PasswordAuthentication in a nutshell is, in order to
  authenticate yourself, both you and the destination host know your
  password.
 
 But, even if I have this set to no, and I do an interactive login, 
 then both me and the remote box need to know my password.
 
 public/private keys avoid the above issue.

True enough--although I did not realize before this thread that setting
PasswordAuthentication no still allows password authentication. Anyway,
in my quote above, s/PasswordAuthentication/password authentication/,
and it should be correct.

 But I dont' see how setting PasswordAuthentication yes accomplishes the 
 above.
 
 Obviously I'm missing something.  I'm going to go reread the thread

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Matching Contents of Lists

2005-07-08 Thread Micah J. Cowan
On Fri, Jul 08, 2005 at 10:28:00AM -0500, Jay Strauss wrote:
 Micah J. Cowan wrote:

snip

  First, you will need to create a comparison function, that will return
  an integer less than, greater than, or equal to zero depending on
  whether its first argument compares lexically less than, greater than,
  or equal to its second argument. This function should match based on
  your rules given above, and is meant as an analog for the cmp and =
  operators.

snip

 Won't this just match identical records, and not account for his 
 matching rules?  Seems like this is just a programmatic SQL join

(Read the above paragraph).

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Matching Contents of Lists

2005-07-08 Thread Micah J. Cowan
On Fri, Jul 08, 2005 at 01:52:38PM -0500, Jay Strauss wrote:
 sub parse {
   my $str = $_[0];
 
   # Capture the parts, leading alpha, followed by n digits,
   # followed optionally by alphas
   $str =~ /([a-zA-Z]+)(\d+)([a-zA-Z]+)?/;
   
   my @str = ($1,$2,$3);   # put the matches back into an array

Of course, this could have been:

  my (@str) = $str =~ /([a-zA-Z]+)(\d+)([a-zA-Z]+)?/;

eliminating the need to refer specifically to the positional variables.

   $str[1] =~ s/^0+//; # strip leading 0s from digit portion

Personally, I typically use $str[1] += 0, but obviously that's a style
thing.
 
   return @str;
 }

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Matching Contents of Lists

2005-07-08 Thread Micah J. Cowan
On Fri, Jul 08, 2005 at 03:53:00PM -0500, Jay Strauss wrote:
 
 
 Micah J. Cowan wrote:
  On Fri, Jul 08, 2005 at 10:28:00AM -0500, Jay Strauss wrote:
  
 Micah J. Cowan wrote:
  
  
  snip
  
 First, you will need to create a comparison function, that will return
 an integer less than, greater than, or equal to zero depending on
 whether its first argument compares lexically less than, greater than,
 or equal to its second argument. This function should match based on
 your rules given above, and is meant as an analog for the cmp and =
 operators.
  
  
  snip
  
 Won't this just match identical records, and not account for his 
 matching rules?  Seems like this is just a programmatic SQL join
  
  
  (Read the above paragraph).
  
 
 I didn't really know what you meant by lexically.  I thought you might 
 be saying:
 
 return -1 if $a lt $b;
 return 0 if $a eq $b;
 return 1 if $a gt $b;

Well, and that's more or less what lexically would mean, if I hadn't
qualified it with [matching] based on your rules above.

But there wouldn't be much point to rolling your own function otherwise,
when cmp works just fine ;-)

 But I now understand, you want to build sophisticated comparison, maybe 
 even character by character, to determine -1,0,1.  Seems hard, but 
 you've probably already boiled it down to a one-liner :)

No need for character by character comparison: in fact your regex-based
parsing would be fine. Just build the parsed string for each one, and
then do a cmp on that.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] sshd_config and PasswordAuthentication

2005-07-07 Thread Micah J. Cowan
On Thu, Jul 07, 2005 at 10:57:53AM -0500, Jay Strauss wrote:
  No, SSH never passes password across the net in cleartext. They are sent to
  the remote host when using this option, which means that unless you have a
  different password for each host, a malicious remote administrator could
  capture your password and then use if to compromise your other accounts.
 
 Feeling a bit stupid but I still don't understand what you mean
 
 If I ssh from A to sveasoft - the password is encrypted
 If I then ssh from sveasoft to C - the password is cleartext?

No. The ssh password is always tunneled, but it's tunnelled cleartext.
This means that a sysadmin at sveasoft could rig their sshd to capture
the cleartext password to a file, and they could then use it at other
sites where you use the same password.

Note that before you ssh'd in, they don't have your password
unencrypted: they have a password hash.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] sshd_config and PasswordAuthentication

2005-07-07 Thread Micah J. Cowan
On Thu, Jul 07, 2005 at 03:53:46PM -0500, Jay Strauss wrote:
 
 
 Micah J. Cowan wrote:
  On Thu, Jul 07, 2005 at 10:57:53AM -0500, Jay Strauss wrote:
  
 No, SSH never passes password across the net in cleartext. They are sent to
 the remote host when using this option, which means that unless you have a
 different password for each host, a malicious remote administrator could
 capture your password and then use if to compromise your other accounts.
 
 Feeling a bit stupid but I still don't understand what you mean
 
 If I ssh from A to sveasoft - the password is encrypted
 If I then ssh from sveasoft to C - the password is cleartext?
  
  
  No. The ssh password is always tunneled, but it's tunnelled cleartext.
  This means that a sysadmin at sveasoft could rig their sshd to capture
  the cleartext password to a file, and they could then use it at other
  sites where you use the same password.
  
  Note that before you ssh'd in, they don't have your password
  unencrypted: they have a password hash.
 
 
 I feel I'm going a little round and round here
 
 Please correct me if I'm wrong, but I think you saying simply is that 
 the data that comes out of the far side of the tunnel is clear text?

That's right. It's not clear while it's in the tunnel.

 ie:
 
 me --ssh/encrypted -- sveasoft -- tunnel/cleartext -- box C

I think that's right, although I'm not sure I entirely understand what
I'm seeing above... ssh/encrypted and tunnel/cleartext are the same
thing, unless the first one is intended to represent
assymetric (public/private) key encryption. Assuming
that you're not using assymetric key
encryption at any point, the password is cleartext at every
terminating point in the above (me, sveasoft and box C), but at no point
in between.

 BTW, sveasoft is just my own linksys router (at home) running a 
 different firmware, you could substitute any linux box in for the sveasoft
 
 But if I ssh to a box that has PasswordAuthentication yes, but then just 
 do vi and other admin tasks, nothing is clear text between the 2 
 computers, including (most importantly) my password.  The tunneling bit 
 I'm not too worried about.

No, it's clear text at the destination box, in terms of the sysadmin
(who could potentially read sshd's memory to see what it decrypted, and
hence the decrypted clear-text password), and in terms of the sshd owner
(who may have modified sshd to capture the password after decrypting
it).

 Furthermore if I, from the ssh session into my router, in turn ssh to 
 another box, everything from box router - c is encrypted, right?

Everything on an ssh connection from any box to any other box is
encrypted. It's the termination points that are the problem
(keylogging/ssh-prog capturing at origin, capturing or sysadmin-snooping
at destination).

The reason why public key cryptography is preferred, is that you prove
to the destination box that you are who you say you are, without
allowing the destination box to turn around and prove that /it/ is who
/you/ say you are.

What's wrong with PasswordAuthentication in a nutshell is, in order to
authenticate yourself, both you and the destination host know your
password.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Matching Contents of Lists

2005-07-06 Thread Micah J. Cowan
On Wed, Jul 06, 2005 at 03:08:38PM -0700, Lango, Trevor M.  wrote:
 I have two lists, not necessarily of the same length.  List #1 has two
 columns.  List #2 has one column.  I would like to do the following:
 
 Scan list #1 line by line.  If a match for column #1 in list #1 is found
 in list #2, extract the matching lines and put them in a new list (#3).
 Otherwise, leave the contents of lists #1 and #2 as they are.
 
 If I expected the contents of the first column of each list to match
 exactly (character for character) - this would be a simple task with C++
 or the like.  However, the contents will not necessarily be perfectly
 identical.  I do believe they are nearly identical enough though to use
 pattern matching via Perl or the like.  Personally this is difficult for
 me (as a Perl noob), I know how to scan through a file for a
 pre-determined pattern - I don't understand how to scan through a file
 for a pattern that is essentially given by a line in another file...?  I
 have not found anything in my reading of Perl documentation that
 explains how to read a file and use its contents as an argument for the
 pattern to search for in another file (suggestions on excellent Perl doc
 sources appreciated also!).

Perl allows you to build up a regex pattern in a scalar, and then use
that scalar to match against a string. For instance:

  @words = qw( foo bar );
  $pattern = join('|', @words);
  $line =~ $pattern; # Does $line match 'foo|bar'?

I'm not sure if this is actually the most useful mechanism for what you
want, though.

 This is what the contents of the lists may look like:
 
 TALL0047A
 TAL0047A
 TAL047A
 TAL47A
 TA0047A
 TA047A
 TA47A
 T0047A
 T047A
 T47A
 T0047
 T047
 T47
 
 Examples of matching:
 
 TALL0047ATALL047Amatch
 TALL0047ATAL0047A not a match
 TALL0047ATAL0470A not a match
 
 
 The contents will always be one to four alpha characters followed by one
 to four numeric characters possibly followed by one or two alpha
 characters.
 
 A match would be defined as the following criteria being met:
 
 - The last one to four digits being identical (excluding leading zeroes)
 - The first one to four letters being identical

It is not entirely clear to me what role the final 'A' character has in
determining a match. However, I would recommend the following alogirthm.

First, you will need to create a comparison function, that will return
an integer less than, greater than, or equal to zero depending on
whether its first argument compares lexically less than, greater than,
or equal to its second argument. This function should match based on
your rules given above, and is meant as an analog for the cmp and =
operators.

Next, sort both lists. Start with an index into the first element of
list 1 ($i), and an index into the first element of list 2 ($j).

If $list_one[$i] compares equal to $list_two[$j], you have your match:
remove that element from both lists, and append it to the new one.

If $list_one[$i] compares less than $list_two[$j], then advance $i and
compare again.

If $list_one[$i] compares greater than $list_two[$j], then advance $j
and compare again.

If either $i or $j falls off the end, you are done. This algorithm
has linear complexity-- O(N), where N is the number of elements in the
longer of the two lists. Not counting the complexity involved for
whatever sort algorithm you use. If you use Perl's sort function, you'll
get linearithmic time (N log N).

Test the hell outta your code before relying upon it. :-)

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


Re: [vox-tech] I'm out of space on /

2005-06-30 Thread Micah J. Cowan
On Thu, Jun 30, 2005 at 12:53:15AM -0700, Rick Moen wrote:
 Quoting Troy Arnold ([EMAIL PROTECTED]):
 
  I understand the reasoning behind all your boot options except the
  noatime on /var/* and /tmp.  What's the scoop on that ?
 
 Small speed advantage.  Fewer timestamp updates means faster access.
 (Don't forget that atime has to get updated if you merely ls a
 directory.)

Well, yeah: but only of the directory, yes? (Brief experimentation seems
to confirm this.) Seems like an incredibly small advantage.

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


Re: [vox-tech] I'm out of space on /

2005-06-30 Thread Micah J. Cowan
On Thu, Jun 30, 2005 at 12:12:36PM -0700, Rick Moen wrote:
 Quoting Micah J. Cowan ([EMAIL PROTECTED]):
 
 [noatime on some filesystems:]
 
  Well, yeah: but only of the directory, yes? 
 
 And subdirectories thereof, if/when they are stat'ed.
 
  (Brief experimentation seems to confirm this.) Seems like an
  incredibly small advantage.
 
 shrug  It cost me all of seven one-time keystrokes per filesystem.

Heh. Excellent point!

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] [fwd] backup solutions for 3 people

2005-06-29 Thread Micah J. Cowan
On Wed, Jun 29, 2005 at 08:35:21AM -0700, Jonathan Stickel wrote:
 Karsten M. Self wrote:
  
  Tape.
  
 
 I've never really used tape drives, but my one experience was not good. 
   Someone else backed up data to a tape on a mid 90s unix machine, I 
 think.  I needed the data about a year ago.  We were unable to access 
 the data because we were clueless about how the tape was formatted, what 
 software utility wrote to the tape, etc.  The computer that wrote to the 
 tape was long gone.
 
  From this experience, it seemed that there is no standard when it comes 
 to tape formatting, reading, and writing.  Has this changed?  If not, 
 they don't seem that useful to me.

I have no experience with tape either, but I thought that's what tar 
ar were for? AFAIK, no actual filesystem would be practical, so probably
a tape's content consists of nothing more than a tar file.

Someone who actually knows something can point out any idiocy in what I
just said. :-)

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] ..'xxx is not an ELF file' errors

2005-05-24 Thread Micah J. Cowan
On Tue, May 24, 2005 at 01:04:31AM -0700, Dylan Beaudette wrote:
 after manually re-installing about 30 packages until no errors were 
 returned from apt the system *appears* to be fine... however, just for 
 fun i tried to make a PDF from a latex file... it works without errors, 
 but there is something terribly wrong with the fonts ... now i am 
 beginning to think that a re-install of the entire system might be the 
 only way to get a functioning computer back...

How are you generating the PDF? There are a number of known problems
with MetaFonts that become converted to high-resolution bitmapped
Type 3 fonts. I usually use pdftex/pdflatex, which does a tremendous
job. If you are generating DVIs first and then converting to PDF, there
may be a bit more work. In any case, you must have the Type 1 versions of
the standard MetaFont fonts. Google for more info.

Alternatively, you could \usepackage{times} or \usepackage{psfonts},
which uses the standard PostScript fonts instead of Computer Modern et
al.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] emacs formatting

2005-05-13 Thread Micah J. Cowan
On Fri, May 13, 2005 at 01:19:07PM -0400, Peter Jay Salzman wrote:
  but in some situations emacs formats code like this:
  
  if(foo)
{
  doSomething();
}
  
 *barf*!!!

This is the official GNU indentation style. It does have some nice things about 
it... but lately I tend to use KR style.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] emacs formatting

2005-05-13 Thread Micah J. Cowan
On Fri, May 13, 2005 at 11:27:21AM -0700, Jonathan Stickel wrote:
  Charles McLaughlin wrote:
  Hello,
  
  I am hoping someone can point me in the write direction.  I want to 
  change how emacs formats code.  I'm very picky about spacing and 
  brackets.  If I have to make the change for every mode that is fine, but 
  I'd prefer to make the change once and have it apply to all types of 
  code I use.  The modes I'm mainly concerned about now are C/C++, PHP and 
  Perl.

 I'm an amateur when it comes to emacs hacks, but I suspect you'll need
 to add appropriate lines for each mode to your ~/.emacs file.  Probably
 cut and paste will do much of it, though.

Actually, it's much, much more elegant than that.

Hit M-x customize (press ENTER). Go to the Programming group, then to
Languages, and then C. You should find everything you need in there. You
can pretty much customize everything. When you hit the Save for Future
Sessions button, it will automatically adjust your .emacs file
appropriately and safely.

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


Re: [vox-tech] simple file command question

2005-05-04 Thread Micah J. Cowan
On Wed, May 04, 2005 at 01:57:24PM -0400, Mike Simons wrote:
 On Wed, May 04, 2005 at 10:45:30AM -0700, Ehrhart, Jay wrote:
  how do you use ll or ls to show the year the file was created?
 
 ls -l --full-time

Er, hm? This just prints the last time the file was written, in ISO format.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] C99 - Initializing complex

2004-09-06 Thread Micah J. Cowan
On Mon, Sep 06, 2004 at 06:12:47PM -0400, Peter Jay Salzman wrote:
 Must both parts of a complex variable be initialized:
 
long double complex z = 0.0L + 0.0L*I;   (i)
 
 or does only one part need to be initialized?
 
long double complex z = 0.0L;(ii)
 
 A test program shows that (ii) works, but I couldn't find an authoritative
 answer in the C99 standard.  Although I have no intention of using anything
 but Linux, I still don't want to rely on GNU extensions (as much as
 possible).

The following paragraph winds a bit, but the most important bit is the
final sentence.

6.7.8#11 says that the same type constraints and conversions as for
simple assignment apply In 6.5.16.1#1 (Simple Assignment:
Constraints), the applicable constraint that your (ii) fulfills is
that both operands must be arithmetic type (so now so far we are
guaranteed at least that a diagnostic has not been required). 6.7.8#11
states that the initial value of the declared object will be the value
of the initializer, after conversion; and 6.3.1.7#1 states that the
value of a complex object converted from a real is such that its real
part has the (converted) value of the real from which it was
converted, and the imaginary part is zero.

 BTW, my copy of the C99 standard is from August 3, 1998 and appears to be a
 pre-release.  I'm a little surprised that a Google search for C99
 standard just doesn't give a copy of the standard the way a Google search
 for US Constitution yields the Constitution.  Where is the official copy of
 this standard?

webstore.ansi.org has it (ANSI being a member of the ISO). C99 is a
nickname: the language is still The C Programming Language: the
official designation is ISO/IEC 9899:1999.

-- 
Micah J. Cowan
[EMAIL PROTECTED]
___
vox-tech mailing list
[EMAIL PROTECTED]
http://lists.lugod.org/mailman/listinfo/vox-tech


  1   2   >