POV-Ray : Newsgroups : povray.off-topic : Very cool Ubuntu distro Server Time
6 Sep 2024 05:15:06 EDT (-0400)
  Very cool Ubuntu distro (Message 21 to 30 of 43)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 09:03:12
Message: <49ddf210$1@news.povray.org>
Warp wrote:

>   That seems to be a problem with Windows: It simply doesn't invite you
> to do things by scripting.

I guess that's because it's "designed for novicies".

On the other hand, just about every tool in MS Office comes with VBA. 
It's just that Windows itself doesn't really invite you to script it.

>   I have been a regular Windows user for over 10 years, yet I don't have
> the slightest idea about vbscripts nor even how you could even run them.
> Can you run them directly? Do you need some kind of interpreter for it?
> Does Windows support them by default, or do you need to install something?
> I really don't have the slightest idea. I don't even know where to start.

The DOS scripts I usually write work regardless. (*.bat, or *.cmd for NT 
or later.) As I understand it, to run exotic languages like VBScript or 
JavaScript, you need the Windows Script Host (WSH). This is an optional 
extra for NT 4.0, but comes with XP (and, presumably, later). I did have 
a look at using JavaScript in this capacity, but I couldn't find any 
documentation anywhere.

>   I have also been a regular Unix user for over 10 years, and I'm somewhat
> fluent in shell scripting. I'm in fact so used to it, that I find a terminal
> emulator much more comfortable for browsing and handling files than a
> graphical file browser (even though all linux distros have both).

I find a GUI to be a superior way of *viewing* files (in general), but 
the CLI can be a superior way of *working on* files. From a command 
prompt, I can easily say "del *.png", but no GUI I've ever seen offers 
similar functionallity.

Sometimes I fantasise about writing my own file manager. It's right up 
there next to my various other unfinished projects. :-/


Post a reply to this message

From: Darren New
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 11:56:54
Message: <49de1ac6@news.povray.org>
scott wrote:
> Umm I typed into google "md5 checksum windows", 

And, fwiw, the term "win32" usually gives better hits than "windows" if 
you're looking for ports of GNU stuff to native windows.

>> Under Windows... well, there's a CLI tool that will compute the MD5 
>> sum for *one* file, but you try scripting it to process several...)
> 
> If you have ever done any windows scripting it should be a piece of 
> cake, this is pretty standard stuff for dealing with files in scripts:
> 
> Set FSO = CreateObject("Scripting.FileSystemObject")
> Set Folder = FSO.GetFolder("folder name")
> Set Files = Folder.Files
> For Each File in Files
>  do something with File.Name here
> Next

Or just
for %I in (*.txt) do md5 %I >>checksums.txt
or whatever parameters you want. It's not like Windows doesn't have a shell. :-)

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

From: Invisible
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 12:05:17
Message: <49de1cbd$1@news.povray.org>
>> If you have ever done any windows scripting it should be a piece of 
>> cake, this is pretty standard stuff for dealing with files in scripts:
>>
>> Set FSO = CreateObject("Scripting.FileSystemObject")
>> Set Folder = FSO.GetFolder("folder name")
>> Set Files = Folder.Files
>> For Each File in Files
>>  do something with File.Name here
>> Next
> 
> Or just
> for %I in (*.txt) do md5 %I >>checksums.txt
> or whatever parameters you want. It's not like Windows doesn't have a 
> shell. :-)

Does that work recursively?

Slightly more fun is trying to make it produce the exact same output as 
the Unix MD5 tool so it's portable between OSes... ;-)


Post a reply to this message

From: Darren New
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 12:16:38
Message: <49de1f66$1@news.povray.org>
Invisible wrote:
> I can easily say "del *.png", but no GUI I've ever seen offers 
> similar functionallity.

Sort by type, select the range of png files, and delete them.
Alternately, type "*.png" into the search bar, ctrl-A, delete.

Not quite as intuitive as del *.png, I'll grant, but potentially quicker 
than opening a command window and navigating to the directory manually. :-)

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

From: Darren New
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 12:16:41
Message: <49de1f69$1@news.povray.org>
Warp wrote:
>   That seems to be a problem with Windows: It simply doesn't invite you
> to do things by scripting.

Not at the command level, true. Within applications, there's all kinds of 
macro capabilities, at least in the sophisticated apps.

>   I have been a regular Windows user for over 10 years, yet I don't have
> the slightest idea about vbscripts nor even how you could even run them.
> Can you run them directly?

Open a command prompt and type "echo %pathext%"
.vbs is visual basic script.
.wsh is windows scripting host.
.js  is probably javascript.

(Those are the extensions that cmd.exe will treat as executable)



> Do you need some kind of interpreter for it?
> Does Windows support them by default, or do you need to install something?

Yes, built in.

> I really don't have the slightest idea. I don't even know where to start.

http://en.wikipedia.org/wiki/Windows_Scripting_Host   ;-)

>   I have also been a regular Unix user for over 10 years, and I'm somewhat
> fluent in shell scripting. I'm in fact so used to it, that I find a terminal
> emulator much more comfortable for browsing and handling files than a
> graphical file browser (even though all linux distros have both).

Me too, but that's more because the Linux file browsers I've found don't 
really offer enough functionality to make them worthwhile. On Linux I use 
the command prompt for most things, and on Windows I use the graphical shell 
for most things. When I want to do something more sophisticated, I generally 
use Tcl in both cases.

>   I can't say which system I have used more overall, but I think it's
> rather telling that in one system I'm pretty fluent with its scripting,
> while in the other I don't have the faintest idea where to even start
> looking. There is just some fundamental difference in these two systems
> which causes different natural way of thinking.

For one, everything in Windows can assume you have a graphical interface, so 
all the configuration files and manipulations and such all have graphical 
editors for them. Even the registry, which would be ideal for command-line 
stuff, has a graphical editor.  So there tends to be less need to use the 
command line in Windows.

I wouldn't say one is better than the other *because* of the shells. There 
are things that bug me about Linux GUIs, and things that bug me about 
Windows CLI shells. Generally, I think in Windows one tends not to use the 
shell except when specifically scripting or building macros or whatever. In 
Linux, it's the normal way to interact with things (and for the system to be 
configured a la .bashrc), so one tends to learn how to use the Linux shells 
bit by bit.

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

From: Darren New
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 12:39:17
Message: <49de24b5$1@news.povray.org>
Invisible wrote:
> Does that work recursively?

for /R %I in ....
for /R drive:path %I in ...

You have Windows there, don't you? The "for" command has like five pages of 
options.  for /?

> Slightly more fun is trying to make it produce the exact same output as 
> the Unix MD5 tool so it's portable between OSes... ;-)

Probably easier to take the result from UNIX and format it to what Windows 
creates. That sort of stuff is how UNIX works.

The basic difference between UNIX scripting and Windows scripting is that 
UNIX scripting is defined on file formats while the Windows scripting is 
defined over APIs.  Personally, I think APIs are the way to go, but file 
formats allow for easier quick-and-dirty stuff compared to future proofing 
and portability.

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

From: nemesis
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 12:55:01
Message: <web.49de284114a2c6a4bbbb20030@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Warp wrote:
> >   That seems to be a problem with Windows: It simply doesn't invite you
> > to do things by scripting.
>
> I guess that's because it's "designed for novicies".

No, perhaps that's because scripting like as if you were writing a Java app --
as in the previous example, complete with "object factories" and useless
declarations -- just sucks?

> The DOS scripts I usually write work regardless. (*.bat, or *.cmd for NT
> or later.) As I understand it, to run exotic languages like VBScript or
> JavaScript, you need the Windows Script Host (WSH). This is an optional
> extra for NT 4.0, but comes with XP (and, presumably, later). I did have
> a look at using JavaScript in this capacity, but I couldn't find any
> documentation anywhere.

What I find most amusing about Microsoft's hype machine about several languages
implementations available for use with their frameworks is that the
programs/scripts so produced all look exactly alike, except for faint syntatic
differences.  That's because language truly doesn't matter when all you do is
call predefined stuff.  Languages only matter when most of the code is spent
implementing new stuff rather than calling from libs.

> Sometimes I fantasise about writing my own file manager. It's right up
> there next to my various other unfinished projects. :-/

You could take a look at the Zipper Filesystem, a fully transactional and purely
functional filesystem implemented in Haskell with GHC:

http://okmij.org/ftp/Computation/Continuations.html#zipper-fs

Oleg is a kind of modern day compsci genious, something rare among the IT
workers and dictators of today.  His head seems to operate on a level far above
ours, always amazing us with ingenious takes on innovative ways to do things.
Shame he never went into designing a programming language of his own, instead
relying on C++, Scheme and Haskell a vehicles for his imagination.

He also gave recently an interesting lecture at Haskell Cafe against Lazy IO:

http://groups.google.com/group/fa.haskell/browse_thread/thread/50cc28a0ae61c38e/d5917350262c3ebd


Post a reply to this message

From: nemesis
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 13:20:01
Message: <web.49de2d2d14a2c6a4bbbb20030@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> scott wrote:
> > Set FSO = CreateObject("Scripting.FileSystemObject")
> > Set Folder = FSO.GetFolder("folder name")
> > Set Files = Folder.Files
> > For Each File in Files
> >  do something with File.Name here
> > Next
>
> Or just
> for %I in (*.txt) do md5 %I >>checksums.txt
> or whatever parameters you want. It's not like Windows doesn't have a shell. :-)

ah!  That's definitely better.


Post a reply to this message

From: Jim Henderson
Subject: Re: Very cool Ubuntu distro
Date: 9 Apr 2009 15:00:45
Message: <49de45dd$1@news.povray.org>
On Thu, 09 Apr 2009 10:48:41 +0100, Invisible wrote:

> Except that the Linux MD5 tool can automatically compute the MD5 sum of
> multiple files. I have only found one tool for Windows that can do this,
> and it was buggy as hell. (Kept printing garbage characters to stdout,
> got confused by certain pathnames, etc.)

I've used md5sum.exe from etree.org in the past and it's worked very well.

Jim


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Very cool Ubuntu distro
Date: 11 Apr 2009 15:30:50
Message: <49e0efea@news.povray.org>
Invisible wrote:
> Does that work recursively?

Pass /R and it will.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.