home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] Re: [NMOSUG-L] Random Questions #28



On Sunday 28 August 2005 14:58, Sarang Gupta wrote:
> % In tcsh, is there a shortcut to "echo ???????????????????????"
> (echo "?{23}" doesn't work)

"echo ?{23}" expands to "echo ?23"; {}'s in a shell aren't like {}'s in a 
regex. There isn't any simple built-in way in the shell to that concisely. 

You can probably craft something in pure shell, but I'd just do:

echo `ruby -e '23.times { print "?" }'`

> % What program reports the *number* of files in a given directory and its
> subdirectories, similar to what du does for diskspace usage? [1]

You can just use:

find . -type f | wc -l

(The trivial caveat being that will report the number of regular files, 
excluding directories, links, sockets, etc.)

> % Can I edit my previous tcsh commands using pico/emacs? (tcsh equivalent
> of mysql's "\e"?) [2]

Emacs has a nice shell mode, or if you use bash, C-x C-e will pull up the 
command in $EDITOR. 

I don't think tcsh can do that, but it can toggle between an editor an a 
shell (in a I-should't-have-used-screen-instead-way) with M-C-z.

> % Can tcsh (or any shell) "cache" the output of commands? [3]

I don't know of any shell that has something like this built in, but it 
wouldn't be terribly hard to write a wrapper that does this, say by running 
your shell in 'script' (to capture the output) and making a program called 
'cached' that matches your command against the script output file. 

If you are really interested in doing this, I can give you more details.

> % I have millions of polygons, lines and points in 3D space, and want to
> efficiently display the largest 500 polygons, the longest 500 lines, and
> the "most important" 500 points for a given view. Is this a typical 3D
> rendering problem? [4]

Doesn't sound like an isomorphism to any typical clipping or culling 
techniques. It might take a little work to come up with the most efficient 
way to do this. 

If you can get away with it, you could use some heuristics, like immediately 
dropping polygons/lines that are outside of a certain angle range relative 
to the viewport plane. Basically any operation that you could do that's 
less complex than calculating length or area could be worth it, as long as 
it doesn't give bad results. =)

> % Is there a pannable, zoomable world map that shows the largest cities
> in a given area? [5]

Probably. I'll let someone else answer this one. ;)

-- 
Wesley J. Landaker <wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.b9.com/pipermail/nmlug/attachments/20050828/5c8dd99f/attachment.pgp



Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache