COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### setting $0 • Email • Follow With the following file, t.rb, ---- #!/usr/bin/env ruby$0 = 'My Application'
puts $0 ---- the output is:$ ruby -v t.rb
ruby 1.8.1 (2003-12-05) [i686-linux]
My Applicati

Why does it get truncated?


 0
Reply vjoel (2600) 12/18/2003 6:08:39 AM

See related articles to this posting

>
> With the following file, t.rb,
>
> ----
> #!/usr/bin/env ruby
>
> $0 = 'My Application' > puts$0
> ----
>
> the output is:
>
> $ruby -v t.rb > ruby 1.8.1 (2003-12-05) [i686-linux] > My Applicati > > Why does it get truncated? 8.3 format? ;) (It's the right number of characters, just no dot.)   0 Reply gsinclair1 (862) 12/18/2003 6:21:35 AM On Thu, Dec 18, 2003 at 03:08:39PM +0900, Joel VanderWerf wrote: > #!/usr/bin/env ruby > >$0 = 'My Application'
> puts $0 > ---- > > the output is: > >$ ruby -v t.rb
> ruby 1.8.1 (2003-12-05) [i686-linux]
> My Applicati

Looks like a bug.  I find it suggestive that the length of the truncated
string is 12 characters - the same length as an 8+3 filename including the
period.

It gets even more interesting, however: the same code works as an -e
expression:

$ruby -ve '$0 = "My Application"; puts $0' ruby 1.8.1 (2003-12-05) [i686-linux] My Application (Different quotes for ease of keeping the shell out; I verified that changing the quotes in t.rb to double didn't affect the beahvior) -Mark   0 Reply markjreed1 (198) 12/18/2003 6:22:14 AM Hi, In message "setting$0"
on 03/12/18, Joel VanderWerf <vjoel@PATH.Berkeley.EDU> writes:

|With the following file, t.rb,
|
|----
|#!/usr/bin/env ruby
|
|$0 = 'My Application' |puts$0
|----
|
|the output is:
|
|$ruby -v t.rb |ruby 1.8.1 (2003-12-05) [i686-linux] |My Applicati | |Why does it get truncated? It's a Linux restriction. Wishing if linux has setproctitle(3). Interestingly, my linux box has a setproctitle man page. matz.   0 Reply matz (1855) 12/18/2003 8:10:20 AM I experienced the same problem just 2 weeks ago. It happens on Solaris as well as on Linux. I was about to post it here, when I found a work around: you can use$0.replace instead of $0= Gennady. Yukihiro Matsumoto wrote: > Hi, > > In message "setting$0"
>     on 03/12/18, Joel VanderWerf <vjoel@PATH.Berkeley.EDU> writes:
>
> |With the following file, t.rb,
> |
> |----
> |#!/usr/bin/env ruby
> |
> |$0 = 'My Application' > |puts$0
> |----
> |
> |the output is:
> |
> |$ruby -v t.rb > |ruby 1.8.1 (2003-12-05) [i686-linux] > |My Applicati > | > |Why does it get truncated? > > It's a Linux restriction. Wishing if linux has setproctitle(3). > Interestingly, my linux box has a setproctitle man page. > > matz. >   0 Reply gfb1 (202) 12/18/2003 3:47:56 PM 4 Replies 54 Views Similar Articles 12/13/2013 3:53:38 PM [PageSpeed]  Reply: Similar Artilces: Setting position of (0,0) with pgfplots Hi all, I have just discovered PGF/TikZ, and am continually amazed. But as usual there things I can't seem to find a way of doing, related to the pgfplots package. Essentially what I am trying to do is to have the (0,0) point at the top right corner of the plot (inverting it with respect to its normal position), with the axes going downwards and leftwards. Is this possible with pgfplots at all? Here is the code: \documentclass[a4paper,11pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[xlabel=F2,ylabel=F1] \addplot coordinates {(1925,4... ANNOUNCE: Tile Widget Set, version 0.8.4.0 [29 Nov 2010] ANNOUNCE: Tile Widget Set, version 0.8.4.0 ~ What is it? The Tile widget set is an experimental reimplementation of some of the standard Tk widgets. It is provided as an extension for use with Tk 8.4. Since it has been incorporated into Tk 8.5 you probably don't need this extension. ~ What's New in 0.8.4.0 Tile 0.8.4.0 is a checkpoint release, matching what is included in Tk 8.5.9 (including all bugs). It will most likely also match what is eventually to be available in Tk 8.6.0. ~ Changes since 0.8.2 + Support for Windows Vista + New... applying patchset 3501955 Hi, I'm trying to apply this patch set but always get the message "There are no patches that need to be applied from the patch set Oracle9i patch set 9.2.0.5.0" which would indicate i don't have correct version. I have version 9.2.0.1.0 which according to System requirements in readme.html should ok. Although the following note associated with above error message "If you attempt to install this patch set on a database release prior to Oracle9i release 2 (9.2.0.2.1), then the following error will appear: " would indicate i need 9.2.0.2.1. Which is it? and if it m... Variable set to 0 I have the following: use strict; use warnings; my$number=0; print "This:$number\n"; print "That:$number\n" if $number; __END__ Of the two lines that print the variable, why does it print the first line but not the second? If I change the$number to equal 1, then both lines print fine. thank you Faith, In Perl the number 0 is false and any number other than zero is true. The line with "if $number" will only execute when$number is not equal to 0. Kevin Sproule "Faith Greenwood" <fgnowfg@gmail.com> wrote in messa...

Setting Date/Time to 0
Hi: I need to use VB in Access 2000 to empty Time and Date fields. Can anyone tell me how to do this? If I put Time.Text = 0 then I get an error... If I set it to "" I get an error... how can I make it a nullfield? Thanks JP JP wrote: > Hi: > > I need to use VB in Access 2000 to empty Time and Date fields. Can anyone > tell me how to do this? > > If I put Time.Text = 0 then I get an error... If I set it to "" I get an > error... how can I make it a nullfield? > > Thanks > > JP > > Me.TimeFld = Null ...

Best RAID 0 settings
I am setting up a RAID 0 array and need some help with the settings. This will be for video storage with most files being over 1GB... I am using a LSI MegaRaid Elite 1600 controller card with a SuperMicro Drive cage/backplane. There will be (5) 147GB 10k rpm drives. My questions are what are the best settings to use. What is the best stripe size for the array? Also should I use: 1. No read ahead 2. Read Ahead 3. Adaptive Read Ahead.... 1. Write Back 2. Write Thru....... 1. Direct I/O 2. Cached I/O.......... Thanks for the help.. Todd Todd Hayslett <trhisdone@yahoo.com> wr...

Re: SET HOST 0
Hoff: Ahh, yes. Maybe that's what I'm remembering -- SET HOST 0 will work even without a license. Thanks for that! dave Hoff Hoffman <hoff-remove-this@hp.com> wrote on 07/15/2005 12:17:34 PM: > David D Miller wrote: > > > It seems to me that SET HOST 0 works even if DECnet isn't running. Or > > maybe I'm getting old -- the mind is the first to go. > > The second thing to go. > > But seriously, I'd expect SET HOST 0 tp work (only) if DECnet is > started, but typically regardless of whether or not you have a DECnet >...

Re: SET HOST 0 #2
Are you suggesting that perhaps DCL parses SET HOST 0 special? That would be nice, but I don't think so. You're convincing me that DECnet must have to run to process the command. dave. JF Mezei <jfmezei.spamnot@teksavvy.com> wrote on 07/15/2005 01:27:10 PM: > David D Miller wrote: > > Ahh, yes. Maybe that's what I'm remembering -- SET HOST 0 will work even > > without a license. > > Remember that "0" is also used in file specifications: > > DIR 0::"" will use DECNET/FAL to access your sys\$login, assuming you have ...

setting ip address of controller 2/0
Hey everyone, I need to set an ip address on a t1 card that is in a 7200 running IOS 12.1(27b). however.. I can not figure out which int it is. can u all help me? On Sep 28, 3:10 pm, "rbbl...@gmail.com" <rbbl...@gmail.com> wrote: > Hey everyone, > > I need to set an ip address on a t1 card that is in a 7200 running IOS > 12.1(27b). > > however.. I can not figure out which int it is. > > can u all help me? and when i say int.. i mean interface. On Sep 28, 3:36 pm, "rbbl...@gmail.com" <rbbl...@gmail.com> wrote: > On Sep 28, 3...

Setting every bit in all members of a class to 0
Hello everyone, Consider a class with many integer members. I want to set every bit in all members to 0 in the constructor. struct Foo { Foo() { memset(this, 0, sizeof *this); } int a, b, c, d, e, f, g, h, i, j, k; }; Is it safe to use memset this way in this situation? Regards. On 23 Mar, 10:36, Spoon <devn...@localhost.com> wrote: > Hello everyone, > > Consider a class with many integer members. > I want to set every bit in all members to 0 in the constructor. > > struct Foo > { > Foo() { memset(this, 0, sizeof *this); } > int a, b, c, d, e, ...

Generate a random integer of set [0,3]
I need to randomly choose one of four paths in my program. Using the tools I know, the best way I can think to do it is by doing something like the following: //============================== #include <stdlib.h> //allow rand() function int i; i = rand (); // i = any number of the set [0,2^32 -1] or [0, 4294967295] if (0<=i<(4294967295/4)) { /* choice one*/ } else if (4294967295/4<=i<(4294967295/2)) { /* choice two*/ } else if (4294967295/2<=i<3*(4294967295/4)) { /* choice three*/ } else if (3*4294967295<=i<=4294967295) { /* choice four*/ } //====...

v9.0.1 lost the default settings
When I installed v9 I kept the default notebook style from v8. I updated to v9.0.1 and things were just fine until all of a sudden, mathematica reset all my preferences: now old and new notebooks open in the new v9 Default, and all of my customizations in the notebook window (rulers, etc) are gone. On a different computer things still work correctly. Can I move com.wolfram.Mathematica.plist.lockfile or some other file from the "good" computer to the "bad" to restore my previous settings? v.9.0.1 on Mac OS 10.8.4 You should be able to copy the init.m file from the &q...

Q: on setting up a layout in Pagemaker 7.0
Hi everyone! I am inspired by the template from StockLayouts (seen here: http://www.stocklayouts.com/Products/Details.aspx?name=MD0130301 ) but I truly can't afford them, and thus I'm hoping to try to recreate the elements I like for a quartely community newsletter that we need to do. Our old templates are dull and really uninspiring, and I'd like to achieve a look similar to these ( http://www.stocklayouts.com/Products/Newsletter/Newsletter-Template-Design-Library.aspx?kwid=14 ) but honestly, I'm new at Adobe Pagemaker (I've used PrintShop up until now) and so it...

iTools problem with setting isotropic in 8.0
It seems that something changed between 7.1 and 8.0 that is not allowing a visualization to be isotropic in iTools. My IDLitVisualization instance has /ISOTROPIC set, and this should force the entire view hierarchy to be isotropic. It does not. Further, in the IDLITSYS_CREATETOOL function I have tried using no SCALE_ISOTROPIC keyword, which should default to zero for that variable, which should honor the /ISOTROPIC request in my visualization. I have also tried SCALE_ISOTROPIC=1, which should force isotropic scaling in any situation, and I have tried SCALE_ISOTROPIC=2, ANISOTROP...

Jet 4.0 and Regional Settings problem
Hi, I hope somebody can help here. I have an app. that uses both MS Access 2000 and SQL Server databases running under XP and 2003 server. The problem I have encountered during testing was that if I changed the Regional & Language settings to 'Mongolian (Cyrillic)', all Access queries fail, however the SQL server ones continue to work fine. I thought it was my code but apparently not so. I tried the following test code in VB 6 with the Northwind Database: Dim oRS as New ADODB.Recordset oRS.Open "SELECT * FROM Suppliers", Provider=Microsoft.Jet.OLEDB.4.0;D...

computation of the canonical collection of sets of LR(0) items
The dragon book gives this algorithm to compute the canonical collection of sets of LR(0) items for an augmented grammar G' (page 246 in the 2nd edition): void items(G') { C = CLOSURE({[S' -> .S]}); repeat for ( each set of items I in C ) for ( each grammar symbol X ) if ( GOTO(I, X) is not empty and not in C ) add GOTO(I, X) to C; until no new sets of items are added to C on a round; } which, if I understand correctly, from the first state on (where a state is a set of items), incrementally finds all the poss...

Sun Cluster 3.0
Hi, I have two nodes set up with Sun Cluster 3 and wish to set up the shared storage. I have the following disks. Disk Pack 1 - c1t2d0 through c1t5d0 and c1t8d0 through c1t9d0 6 x 4Gb disks Disk Pack 2 - c2t3d0 through c2t5d0 and c2t8d0 through c2t11d0 6 x 4Gb disks + 1 x 2Gb disk (c2t11d0) Using smc, when I go to Enhanced Storage, it sits their waiting indefinitely, which I think maybe due to SVM not being able support clustered volume management. Is that right? I would like to set up my disks as below. Please give me some help c1t3d0, c1t4d0, c1t5d0 = 3 disk stripe VolumeA c2...

set rstchown=0 doesn't work?
I have to be able to give away my files/directories with chown command. I. e. the following must work: chown otheruser some_dir Man page for chown states that to do it I have to set set rstchown = 0 in /etc/system, this will disable _POSIX_CHOWN_RESTRICTED option. So I changed the the system file and rebooted my box. But I am still unable to give away my files and folders - chown is saying "Not owner". What can be the problem? AFAIK the file system that I'm working with is mounted from network, can it be the problem? SunOS is 5.10 Sparc. Thanks. WBR, Dima Halka dima.halka@gma...

server patch set 9.2.0.8