...making Linux just a little more fun!



[ In reference to "A Short Tutorial on XMLHttpRequest()" in LG#123 ]

Jimmy O'Regan [joregan at gmail.com]

Mon, 2 Jun 2008 23:11:51 +0100

I was trying to remember how to use XMLHttpRequest, and just wanted to pop a note to say thanks for a useful article!

One thing: if you're trying to test something offline, Firefox will disallow any open() requests (to try to prevent XSS). http://www.captain.at/howto-ajax-permission-denied-xmlhttprequest.php has some details about it.

Or, better yet, here's the test page I was using (the rest of 'base' is 'webservice/ws.php' - I don't think Apertium's server is quite up to widespread use of the webservice yet):

<title>Translate as you type</title>
<script language=javascript type="text/javascript">
var base = "http://xixona.dlsi.ua.es/"
var http_request;
function GetTranslation(dir, data) {
	// For offline testing:
	// (see: http://www.captain.at/howto-ajax-permission-denied-xmlhttprequest.php)
	//try {
	//	netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
	//} catch (e) {
	//	alert("Permission UniversalBrowserRead denied.");
	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		http_request = new ActiveXObject ("Microsoft.XMLHTTP");
	if (!http_request) {
		alert ("Cannot create XMLHttpRequest instance");
		return false;
	} else {
		var url = base + "?mode=" + dir + "&text=" + escape(data);
		http_request.onreadystatechange = GetAsync;
		http_request.open("GET", url, true);
function GetAsync() {
	if (http_request.readyState != 4 || http_request.status != 200) {
	setTimeout("GetAsync()", 100);
// -->
<!-- direction hardcoded -->
<textarea id="input" onkeyup='GetTranslation("en-es",
<p id="translation"></p>


[ In reference to "/lg.tips.html" in LG#151 ]

Thomas Bonham [thomasbonham at bonhamlinux.org]

Thu, 29 May 2008 05:02:49 -0700

Ben Okopnik wrote:

> On Tue, May 27, 2008 at 03:41:01PM -0700, Thomas Bonham wrote:
>> Hi All,
>> Here is a 2 cent tip which is a  little Perl script for looping through 
>> directory's.
> Why not just use 'File::Find'? It's included in the default Perl
> install, and is both powerful and flexible.
> ```
> use File::Find;
> find(sub { do_whatever_you_want_here }, @directories_to_search);
> '''
> For more info, see 'perldoc File::Find'.

Perl File::Find didn't have everything that I want to be able to do this function. I was not just trying to find files with this but also was try to find items that was in different directory's.

When looking around on the internet for that I want to do everything thing that I was able to find said not to use file::find because it wasn't powerful enough for that I was doing so I just create that function to do some different things along the way.


[ Thread continues here (21 messages/26.84kB) ]


[ In reference to "Monitoring Function Calls" in LG#151 ]

Francesco Russo [francescor82 at email.it]

Wed, 04 Jun 2008 19:26:00 +0200

About the article http://linuxgazette.net/151/melinte.html, there's a typo: the architecture name is x86_64, not x86_86.

Francesco Russo
The White Rabbit put on his spectacles. 'Where shall I begin, please
your Majesty?' he asked.
'Begin at the beginning,' the King said gravely, 'and go on till you
come to the end: then stop.'
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

[ Thread continues here (2 messages/1.38kB) ]

Talkback:151/weiner.html (2)

[ In reference to "USB thumb drive RAID" in LG#151 ]

s. keeling [keeling at nucleus.com]

Sun, 15 Jun 2008 16:14:39 -0600

This was just too cool not to try it. It works great. I now have a 7 Gb RAID 5 on three 4 Gb pendrives.


   -  make sure the hub you buy leaves enough room between slots to
      insert your keys.  Some can be pretty tight.  Keys are all
      shapes and sizes, and some are pretty fat.  That tiny, elegant
      little hub may be cute, but is it usable?  I got the skinny Sony
      4 Gb MicroVaults, but still their button controlling the
      retractable connector gets in the way.  Staples generic Relay
      keys are too wide to use with this hub.
   -  The price range on this stuff is all over the map too, so best
      to shop around.  I bought a Targus hub for ca. $40, then found
      an Illum for $17.  Nowhere on the Targus does it mention USB
      2.0.  Is it?  Dunno.  It's going back.
   -  Just to be different (yet again), Debian Etch/Stable barfed on
      your mdadm syntax.  It insists on "-l 5" instead of "-l=5",
      ditto "-n 3" instead of "-n=3".
   -  I notice my copy of Sidux LiveCD does not contain mdadm, drat.
      Haven't looked at Knoppix yet.
   -  echo "(3 * 39.94) + 17" | bc -l == 136.82.  I just bought an
      Acomdata USB external 320 Gb 7200 rpm hard drive for 139.85.
      320 for $140, vs. 7 for $137, doesn't really make much sense,
      but it's still fun.
Thanks for helping me make a fun toy, and for a nicely written and enjoyable article.

Any technology distinguishable from magic is insufficiently advanced.
- -


[ In reference to "USB thumb drive RAID" in LG#151 ]

Mohammad Farooq [farooqym at gmail.com]

Tue, 3 Jun 2008 10:51:54 +0400

This PCI card is an alternative to USB. It can support up to 4 CF cards. http://news.cnet.com/8301-13580_3-9803084-39.html

[ Thread continues here (2 messages/0.96kB) ]


[ In reference to "Mailbag" in LG#151 ]

Benno Schulenberg [bensberg at justemail.net]

Fri, 13 Jun 2008 15:06:33 +0200

[[[ In re: 'lang="utf-8" makes Firefox use an ugly font' from LG#151 -- Kat ]]]

Hmm, not very nice of you to not CC me on the continued discussion.

Benno Schulenberg wrote:

> However, I'd still like to suggest you replace "utf-8" in the
> 'lang' attributes with "en", because utf-8 is not a language, and
> the language the Linux Gazette pages are written in is English.

As Kapil Hari Paranjape said, my main point was that "utf-8" is not a language name. But unlike Kapil says, lang is a _language code; it has nothing to do with the encoding.

  lang = language-code [CI]
      This attribute specifies the base_language of an element's
      attribute values and text content.
  Language information specified via the lang attribute may be used
  by a user agent to control rendering in a variety of ways.

The base language of the Linux Gazette looks to be English. So use "en". If you want to be perfect, mark any snippets in other languages with the appropriate lang attribute.



[ Thread continues here (3 messages/5.68kB) ]


Yannis Broustis [broustis at gmail.com]

Tue, 3 Jun 2008 17:07:44 +0300


I ran the tcpsnoop on two machines, and, similarly as in Pfeiffer's example, the contention window does not get larger than 2, as time progresses.

Any ideas why?

Thanks, Y.

[ Thread continues here (2 messages/1.15kB) ]

Talkback: Discuss this article with The Answer Gang

Copyright © 2008, . Released under the Open Publication License unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 152 of Linux Gazette, July 2008