I like the succinctness of the alternatives offered for my version of "whoami" in J but I'll have to check them in the other two OSs to which I have access to see how compatible they are.
I will note that the method of retrieving an environment variable is more easily spoofed (but am not sure whether this is a good or bad thing), e.g.: [Tue 11/17/2009 | 13:03:44.11 | C:\] >set USERNAME=puddin_tane [Tue 11/17/2009 | 13:04:16.85 | C:\] >jee.exe javaw j.jar 2!:5 'username' puddin_tane On Tue, Nov 17, 2009 at 10:06 AM, <[email protected]> wrote: > Send Beta mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://jsoftware.com/cgi-bin/mailman/listinfo/beta > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Beta digest..." > > > Today's Topics: > > 1. Re: Projects on USB drives WAS: Project Files (Sherlock, Ric) > 2. Re: Projects on USB drives WAS: Project Files (bill lam) > 3. Re: Projects on USB drives WAS: Project Files > ([email protected]) > 4. Re: Projects on USB drives WAS: Project Files > ([email protected]) > 5. Re: Projects on USB drives WAS: Project Files (Oleg Kobchenko) > 6. Find in Webs (Bj?rn Helgason) > 7. Re: Find in Webs (Dan Bron) > 8. Re: Projects on USB drives WAS: Project Files (Raul Miller) > 9. Re: Projects on USB drives WAS: Project Files (Raul Miller) > 10. Re: Find in Webs (Bj?rn Helgason) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 17 Nov 2009 17:28:57 +1300 > From: "Sherlock, Ric" <[email protected]> > Subject: Re: [Jbeta] Projects on USB drives WAS: Project Files > To: Beta forum <[email protected]> > Message-ID: > < > f43d47796ad0844785a03f363452208468692ce...@tur-exchmbx.massey.ac.nz> > Content-Type: text/plain; charset="us-ascii" > > > From: bill lam > > > > > > > The nicest cross-platform method to finding a computer's hostname > > > > that I know is: > > > > > > > > > > CRLF -.~ shell 'hostname' [ require 'task' > > > > > > > > In that case, I prefer 2!:5 IFUNIX{::'COMPUTERNAME';'HOSTNAME' > > > > > > > > > > The trouble is that it doesn't work for me on Linux (Ubuntu)! Does my > > method work on your flavour? > > > > the hostname for debian (also likely ubuntu) is stored in the > > /etc/hostname > > what will be the outout of > > cat /etc/hostname > > > > if there is no such file or its content is empty, try > > sudo -e /etc/hostname > > > > and write the hostname of your choice. > > > > Your method need to shell an external program to do what can be done > > by J native command. over-skilled ;-) > > Yes the hostname is stored in that file on Ubuntu. > So I could read that file to get the hostname: > 1!:1 <'/etc/hostname' > > Actually on Linux, shell just calls spawn which is 2!:0 - a foreign > conjunction just like 2!:5 !!! I'm not sure if any of the solutions could be > called native J commands? > > Is the hostname stored in /etc/hostname for all Linux flavours? Mac? > Even if it was, I think I'd prefer a simple cross-platform solution to one > that requires me to detect the OS and write different solutions for each. > Over-verbose ;-) > > > > ------------------------------ > > Message: 2 > Date: Tue, 17 Nov 2009 12:45:13 +0800 > From: bill lam <[email protected]> > Subject: Re: [Jbeta] Projects on USB drives WAS: Project Files > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > On Tue, 17 Nov 2009, Sherlock Ric wrote: > > Actually on Linux, shell just calls spawn which is 2!:0 - a foreign > > conjunction just like 2!:5 !!! I'm not sure if any of the solutions > > could be called native J commands? > > J should already be executed inside a shell, not sure if it is really > needed to retrieve shell variables in a sub-shell. Blame Eric ;-) > > -- > regards, > ==================================================== > GPG key 1024D/4434BAB3 2008-08-24 > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 > > > ------------------------------ > > Message: 3 > Date: Tue, 17 Nov 2009 05:34:07 +0100 > From: [email protected] > Subject: Re: [Jbeta] Projects on USB drives WAS: Project Files > To: [email protected] > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=us-ascii > > Henry Rich <[email protected]> wrote: > > I do that: I have > > 'Monitor';'~zip/quizmon';0 > > but, in the end, how does ~zip get defined? > > I have exactly the same problem whenever I develop work for clients: > I must either tell them that they have to introduce Yet Another > Path moniker to locate the project files or we have to agree to put > them into the same location; which may not even possible, because > I may just have a C: drive and their C: may be full or they may > lack the permissions to put things there. > > The projects I write sometimes "self-locate" themselves. This is > the code I used in a very old package: > > THIS_SCRIPT_DIR =: 'at this point, just some dummy value' > THIS_SCRIPT_DIR =: >{. pathname >(4!:4 <'PATH_wb_') { 4!:3 '' > > (All scripts of the project where then "buildsource"d into > THIS_SCRIPT_DIR and thusly "load"able. Methinks "buildsource" > doesn't exist anymore these days -- it extended the PUBLIC table.) > > > It [stick location] changes from machine to machine. And sometimes > > there is more than one USB drive installed in a machine... > > And sometimes, you want two versions of the same stuff in two directories, > and run some both alternately, without constantly having to adjust some > "~zip" locator. > > Martin > > > ------------------------------ > > Message: 4 > Date: Tue, 17 Nov 2009 06:14:36 +0100 > From: [email protected] > Subject: Re: [Jbeta] Projects on USB drives WAS: Project Files > To: [email protected] > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=us-ascii > > Matthew Brand <[email protected]> wrote: > > Is there a way to use an "autorun.info" file on usb sticks? > > Like that fileyou get on cd's which runs when you insert the cd into > > the computer. > > Maybe, maybe not. You can find all the (IMHO bizarre) details > at http://support.microsoft.com/kb/967715 > > (The title is "How to disable the Autorun functionality in Windows" > but it really tells you which version of Windows does regard or > ignore autorun.ini files on what kind of media. Or would regard/ignore > it if you'd have certain patches... it's a horrifying story.) > > Martin > > > ------------------------------ > > Message: 5 > Date: Mon, 16 Nov 2009 23:18:36 -0800 (PST) > From: Oleg Kobchenko <[email protected]> > Subject: Re: [Jbeta] Projects on USB drives WAS: Project Files > To: Beta forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > Sure that's what the ~user/Projects folder is for. > Although, I do not utilize project-based methodology, I > have placed other people's projects there and ran PM-- > all without having to configure any absolute or drive > letter paths. > > > > > > From: bill lam <[email protected]> > > > > Have you ever define a user folder and use that in a project? > > > > On Mon, 16 Nov 2009, Oleg Kobchenko wrote: > > > I do not understand why you insist on using > > > an absolute path: > > > > > > 'Source';'y:\jal\trunk';0 > > > > > > instead of a relative path: > > > > > > 'Source';'~user/jal/trunk';0 > > > > > > > > > [---=| TOFU protection by t-prot: 58 lines snipped |=---] > > > > -- > > regards, > > ==================================================== > > GPG key 1024D/4434BAB3 2008-08-24 > > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > > ------------------------------ > > Message: 6 > Date: Tue, 17 Nov 2009 10:11:48 +0000 > From: Bj?rn Helgason <[email protected]> > Subject: [Jbeta] Find in Webs > To: Beta forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=UTF-8 > > I am thinking that an extension of the find in J > > There is a find in script, find in files and with the new feature of > the upcoming new J version 701 it would be interesting to include a > Find on the Web. > > > -- > Bj?rn Helgason, Verkfr??ingur > Fornustekkum II > 781 Hornafir?i > Po Box 127,801 Selfoss , > t-p?st: [email protected] > gsm: +3546985532 > s?mi: +3544781286 > http://groups.google.com/group/J-Programming > > > T?knikunn?tta h?ndlar hi? fl?kna, sk?punarg?fa er meistari einfaldleikans > > g??ur kennari getur stigi? ? t?r ?n ?ess a? glansinn fari af sk?num > /|_ .-----------------------------------. > ,' .\ / | Me? l?ttri lund ver?ur | > ,--' _,' | Dagurinn ? dag | > / / | Enn betri en g?rdagurinn | > ( -. | `-----------------------------------' > | ) | (\_ _/) > (`-. '--.) (='.'=) ?????? > `. )----' (")_(") ?? > > > ------------------------------ > > Message: 7 > Date: Tue, 17 Nov 2009 09:29:10 -0500 > From: Dan Bron <[email protected]> > Subject: Re: [Jbeta] Find in Webs > To: Beta forum <[email protected]> > Message-ID: <pc1870200911170929100226eff48...@nbnycdbron> > Content-Type: text/plain; charset=iso-8859-1 > > > interesting to include a > > Find on the Web. > > At the moment, finding J code on the web is more an art than a science, and > is more suited to a human than a machine. > > In that vein, though, one topic we discussed at the last NYC JUG was > (optionally) including a copy of the entire J Wiki and J Forum archives > with the download. Compressed, it wouldn't be very big to download or > store, and it would certainly help Find-in-Files (or grep, or Windows > Search, etc) answer questions. > > But I would be happy if the FiF interface (UI) is improved in J7, even if > its data set doesn't change. > > -Dan > > > ------------------------------ > > Message: 8 > Date: Tue, 17 Nov 2009 09:49:43 -0500 > From: Raul Miller <[email protected]> > Subject: Re: [Jbeta] Projects on USB drives WAS: Project Files > To: Beta forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > On Mon, Nov 16, 2009 at 10:15 PM, Sherlock, Ric > <[email protected]> wrote: > >> {: sdgethostname coinsert 'jsocket' [ load 'socket' > > > Or > >{:sdgethostname_jsocket_ load 'socket' > > -- > Raul > > > ------------------------------ > > Message: 9 > Date: Tue, 17 Nov 2009 09:52:01 -0500 > From: Raul Miller <[email protected]> > Subject: Re: [Jbeta] Projects on USB drives WAS: Project Files > To: Beta forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > > ? >{:sdgethostname_jsocket_ load 'socket' > > I meant: > >{:sdgethostname_jsocket_ require 'socket' > > require will often be faster than load, and avoiding coinsert > in line is good, I think. > > -- > Raul > > > ------------------------------ > > Message: 10 > Date: Tue, 17 Nov 2009 15:05:56 +0000 > From: Bj?rn Helgason <[email protected]> > Subject: Re: [Jbeta] Find in Webs > To: Beta forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=UTF-8 > > Possibly build up a list of links/pages/wiki the Find on the Web could > use to find what is being sought. > The wget utility could be used. > > The list culd have a column with notes from users ranking the quality > of the info on the pages referred to. > > So the best items would thus be on top of the list helping new users > find pages with interesting info. > > The find could also have as a side effect to have canals (other lists) > to find info about something else than J > > 2009/11/17 Dan Bron <[email protected]>: > >> interesting to include a > >> Find on the Web. > > > > At the moment, finding J code on the web is more an art than a science, > and > > is more suited to a human than a machine. > > > > In that vein, though, one topic we discussed at the last NYC JUG was > > (optionally) including a copy of the entire J Wiki and J Forum archives > > with the download. ?Compressed, it wouldn't be very big to download or > > store, and it would certainly help Find-in-Files (or grep, or Windows > > Search, etc) answer questions. > > > > But I would be happy if the FiF interface (UI) is improved in J7, even if > > its data set doesn't change. > > > > -Dan > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > -- > Bj?rn Helgason, Verkfr??ingur > Fornustekkum II > 781 Hornafir?i > Po Box 127,801 Selfoss , > t-p?st: [email protected] > gsm: +3546985532 > s?mi: +3544781286 > http://groups.google.com/group/J-Programming > > > T?knikunn?tta h?ndlar hi? fl?kna, sk?punarg?fa er meistari einfaldleikans > > g??ur kennari getur stigi? ? t?r ?n ?ess a? glansinn fari af sk?num > /|_ .-----------------------------------. > ,' .\ / | Me? l?ttri lund ver?ur | > ,--' _,' | Dagurinn ? dag | > / / | Enn betri en g?rdagurinn | > ( -. | `-----------------------------------' > | ) | (\_ _/) > (`-. '--.) (='.'=) ?????? > `. )----' (")_(") ?? > > > ------------------------------ > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > End of Beta Digest, Vol 39, Issue 14 > ************************************ > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
