POV-Ray : Newsgroups : povray.off-topic : The other OS Server Time
30 Jul 2024 02:22:32 EDT (-0400)
  The other OS (Message 81 to 90 of 130)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Orchid XP v8
Subject: Re: The other OS
Date: 8 Aug 2011 10:23:28
Message: <4e3ff160$1@news.povray.org>
>    You could use the same argument for any of the several features in your
> text editor that you, personally, never use.

What? The argument that because I don't need a particular feature, its 
presence or absense isn't particularly important to me? Seems like a 
fairly valid argument.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Mike the Elder
Subject: Re: The other OS
Date: 8 Aug 2011 10:45:01
Message: <web.4e3ff540a0509d2f85627c70@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
....
> Because typing "banana" is way, way easier than typing "62 61 6E 62 6E
> 62". Obviously.
....

"62 61 6E 61 6E 61" actually.

And, yes, I *am* consdiering professional help... Perhaps "Coders Anonymous" -
It's a 0C step program.  ;-)


Best Regards,
Mike C.


Post a reply to this message

From: Warp
Subject: Re: The other OS
Date: 8 Aug 2011 10:45:46
Message: <4e3ff69a@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> Now, if there was a single program that had decent support for text 
> /and/ binary editing, then sure, I'd use that.

  But you said you wouldn't use a text editor to edit a binary.

-- 
                                                          - Warp


Post a reply to this message

From: Orchid XP v8
Subject: Re: The other OS
Date: 8 Aug 2011 11:01:55
Message: <4e3ffa63$1@news.povray.org>
On 08/08/2011 03:40 PM, Mike the Elder wrote:
> Orchid XP v8<voi### [at] devnull>  wrote:
> ....
>> Because typing "banana" is way, way easier than typing "62 61 6E 62 6E
>> 62". Obviously.
> ....
>
> "62 61 6E 61 6E 61" actually.

I REST MY CASE!

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: The other OS
Date: 8 Aug 2011 11:03:20
Message: <4e3ffab8$1@news.povray.org>
On 08/08/2011 03:45 PM, Warp wrote:
> Orchid XP v8<voi### [at] devnull>  wrote:
>> Now, if there was a single program that had decent support for text
>> /and/ binary editing, then sure, I'd use that.
>
>    But you said you wouldn't use a text editor to edit a binary.

I wouldn't use a program specifically designed for editing text to edit 
binary.

If it had a seperate mode for editing binary, I might use that. But I 
would never, ever use a text editor running in text mode to edit raw 
binary. That's just silly.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: The other OS
Date: 8 Aug 2011 11:27:38
Message: <4e40006a@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> I wouldn't use a program specifically designed for editing text to edit 
> binary.

> If it had a seperate mode for editing binary, I might use that. But I 
> would never, ever use a text editor running in text mode to edit raw 
> binary. That's just silly.

  You are missing the point. You said:

> OK, fair enough. However, I don't work with any file formats where such
> trailing spaces would be significant.

> I also don't work with any file formats which should ever contain a tab
> character, so I've configured my editor to strip those too.

  Which is contradictory with your earlier lamentation that you don't have
any hex editor. (If you never work with any file formats where automatically
stripping some characters breaks the file, what would you use a hex editor
for?)

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: The other OS
Date: 8 Aug 2011 12:04:47
Message: <4e40091f$1@news.povray.org>
On 8/8/2011 4:29, Orchid XP v8 wrote:
> I can see how an application might expose a COM object such that invoking a
> certain method is like clicking on a particular button. What I can't figure
> out is how COM lets you do stuff like link a chart to a database such that
> every time the database changes, the chart updates. I'm not sure how you
> invoke methods to make that happen.

Assuming you're talking about (say) a SQL server and excel, you write a 
macro in excel that runs whenever you open the spreadsheet (probably in 
VBA). The macro in VBA opens a connection to the SQL COM object, tells it to 
read a database, and then loops over the results, using the Excel COM object 
to stick the rows into the spreadsheet. When it gets to the end of the 
result set, it closes the SQL COM object and tells Excel to draw a chart 
using the COM interface for that.

> Would Excel be a single COM object? Or would you have like seperate objects
> for each workbook, worksheet, cell, etc?

Excel would be a single COM Server. You instantiate an "application" object, 
and that object will have methods for instantiating workbooks, worksheets, etc.

So looking at the Tcl example of talking to Excel again:

 >> set application [::tcom::ref createobject "Excel.Application"]

This makes the "application" variable refer to a COM object of type 
"Excel.Application", which fires up Excel if it isn't already running. If 
you look in the registry for "Excel.Application", it shows you all the data 
structure links telling you which executable it is, what command line 
arguments it uses to do that, and what GUID Excel will store in the 
appropriate data structures to make it work. It also tells you the threading 
model, permissions needed, etc etc etc.

You can also pass the GUID directly instead of the name to be looked up, at 
which point you get that and only that implementation.

In a scripting language like Tcl, things like "Visible" and "Workbooks" are 
passed to a function called IDispatch. So "$application Visible 1" is really 
closer to "$application IDispatch ("Visible", 1)". However, there is also 
statically typed interfaces, and the description of those interfaces (like C 
"struct" headers or C++ class declarations) are described in the Interface 
Description Language, or IDL.

 >> $application Visible 1

This is a method invocation. It's passing "1" to the argument of the 
"Visible" method on the Excel Application object.

 >> set workbooks [$application Workbooks]

The Workbooks method returns the list of workbooks in the currently focussed 
spreadsheet.

 >> set workbook [$workbooks Add]

This adds a new workbook and returns it.

 >> set worksheets [$workbook Worksheets]

This gives you the list of worksheets in the given workbook.

 >> set worksheet [$worksheets Item [expr 1]]

"Item" is the standard method name for indexing elements, like [] in C. You 
have to run "1" thru expr to make sure it's an integer, or you might wind up 
looking for the worksheet whose name is the single-character string "1". 
Because Tcl doesn't have types.

set data [list \
     [list "North" "South" "East" "West"] \
     [list 5.2 10.0 8.0 20.0] \
]
set sourceRange [$worksheet Range "A1" "D2"]
$sourceRange Value $data

So you create some data, pick out the range A1 through D2 in your worksheet, 
and set the values into that range. Again, "Value" is a pretty standard 
method that means "assign the value to the content", basically the inverse 
operation of "Item".

 >> set charts [$workbook Charts]
 >> set chart [$charts Add]

Get the list of charts and add a new one.

 >> $chart ChartWizard $sourceRange 5 [::tcom::na] 1 1 0 0 "Sales Percentages"

Start the chart wizard and answer these values. You'd have to look at the 
docs to figure out what the chart wizard arguments mean here, but a couple 
are obvious.

And that's how you drive Excel. You want to drive it from SQL? Replace the 
"set data" line with one that opens Sql.Application, creates a query, 
submits it, and retrieves the data.

But that page of code is all you need (given Tcl and TCom and of course 
Excel) to actually create a chart in Excel from your script.

Word has similar stuff, where you can insert text, set it bold or change the 
font, etc etc etc.  A lot like javascript's DOM model.

> See, I've always assumed that the glitering world of native Windows GUIs,
> IPC, DLLs, COM, etc. are all behind closed doors, accessible only to people
> who know how to write really low-level Windows code. And I've always assumed
> that the really /good/ stuff (like embedding one application inside another)
> is accessible only to Microsoft themselves. (Or anybody who pays really vast
> sums of money. People like Symantec.)

Nope. You really can do it in Tcl.  Getting it to actually display in your 
code is a little messier, but not much.

>>> I've yet to see a language that can invoke DLLs either...
>>
>> Maybe you should learn a normal language, then. :-)
>
> So... you mean basically C or C++ then?

Something not experimental. Java, C, C++, C#, Ruby, Python, VBA, Tcl, etc 
etc etc.

>>> I'd be perfectly happy doing COM from, say, JavaScript. It's not that
>>> Haskell is the problem, it's that I can't see *anything* that speaks COM.
>>
>> Tcl, VBScript, WScript, VBA, and C# all have trivial interfaces to COM.
>
> Oh dears.

Looks like Python has COM access:

http://www.devshed.com/c/a/Python/Windows-Programming-in-Python/2/

The best way to search seems to be something like
     python "com interface"
because otherwise it finds python.com and stuff like that.

This may be broken, but maybe it'll be easier for you to understand how COM 
works:
http://research.microsoft.com/en-us/um/people/emeijer/Papers/HaskellCom.pdf
I mean, that looks like a pretty good description of how it all works.

>> Didn't you tell me you had written a VBA macro or two?
>
> Yeah. It took me several hours to finally construct a 25-line VBA macro
> which performs the utterly trivial task of setting the value of a certain
> cell to today's date. This was an exercise in extreme frustration, as the
> help files utterly failed to be remotely helpful in any way. I've been
> bitter ever since. :-P

Heh. Interestingly enough, that has been my experience too. Not uncommonly, 
the documentation for something will be just a little off, or it won't tell 
you exactly what you need installed to make it work, so the docs will tell 
you what the method is and the arguments, but it won't tell you what class 
it applies to, or which libraries have to be installed to find the 
implementation, or etc.

> Yeah, maybe that's what it comes down to. I tend to avoid all the
> MS-designed languages, which is maybe why I can't do COM.

But COM is really common in pretty much anything that's not so UNIX-centric 
that nobody even writes a COM library interface. Even PHP interfaces to COM:

http://php.net/manual/en/ref.com.php

Pretty much any language powerful enough to override the function call 
syntax is going to have something that looks like COM pretty easily. Or 
anything statically typed for which you have the IDL in advance, so you can 
compile interface stubs that take the arguments to calls and package them up 
for COM, which is how C++ gets to COM for example. (You just wind up with 
different syntax to get to dynamically-linked COM vs statically-linked COM 
interfaces.)

Funny enough, it looks like nobody ever wrote a COM interface for elisp. :-)

-- 
Darren New, San Diego CA, USA (PST)
   How come I never get only one kudo?


Post a reply to this message

From: Darren New
Subject: Re: The other OS
Date: 8 Aug 2011 12:11:19
Message: <4e400aa7@news.povray.org>
On 8/8/2011 3:37, Orchid XP v8 wrote:
> Oh, Google helps you find *millions* of hex editors. Which all cost money.
> And, from the look of their product websites, I suspect about 80% of them
> are actually trojans.

Fine. Here's a free one I've been carrying around since 1999 or so.

Alternately, google for "freeware hex editor" and take your pick. :-) 
There's probably a bunch much nicer than this one, but since I need a hex 
editor about once every 3 years, this does for me.

-- 
Darren New, San Diego CA, USA (PST)
   How come I never get only one kudo?


Post a reply to this message


Attachments:
Download 'hexedit.exe.dat' (148 KB)

From: Darren New
Subject: Re: The other OS
Date: 8 Aug 2011 12:30:29
Message: <4e400f25$1@news.povray.org>
On 8/8/2011 4:21, Orchid XP v8 wrote:
> Defining how to sort some data [efficiently] is a tad more complicated than
> defining a test of whether some data is sorted.

Yeah.

Incidentally, part of the point of DbC is that the pre/post/invariants are 
the actual important part. The rest is implementation details because you 
can change them around as long as you maintain the invariants. (Assuming, of 
course, that your invariants are complete.)

>> That would be preconditions and postconditions. It wouldn't be DbC, I
>> don't think.
>
> OK, well let me rephrase: You can do everything that DbC does. Whether you
> still call it DbC is a question which is untirely uninteresting to me.

Remember that DbC is a *design* technique, not a coding technique.

>> The invariant only holds while you're not manipulating the data. E.g.,
>> while you're rebalancing the tree, the invariant needn't hold. Now if
>> you start cutting global variables up into collections and corresponding
>> blocks of code that manipulate them, or talking about "the set of all
>> data structures that are manipulated by this particular set of code",
>> I'd say you have some OO design going on there. :-)
>
> If you want to consider a module to be some vague kind of "class", then OK...

It's not so much whether it's a "class" or a "module", but rather whether 
there's well-defined places in your code where the invariants don't hold and 
well-defined places where they do.

> It's not like turning the DVI file into PDF actually alters its appearence
> in any way, shape or form.

Sure it does. You stopped using metafont, for one thing.

>>> Has there ever /been/ a Unix that isn't distributed in source form?
>>
>> Of course.
>
> So... how would you compile it? I thought the entire reason Unix was so
> popular is that it operates on arbitrary architectures.

How would I compile what? Unix? Why would I compile Unix that works, any 
more than I'd compile Windows? Of course *somebody* has the source. Just not 
the end users.

>> It's certainly possible with Windows. You just need to get the source code.
> ...which you cannot ever have...

Why do you say that? I had access to Windows source code at my previous job. 
Not the OS, but selected libraries.

>> What part of Windows do you think is monolithic and can't be fairly
>> easily replaced that *can* be replaced in Linux?
>
> When you install "Windows", it installs one giant binary blob. I'm sure
> Microsoft probably structures it internally as many seperate modules, but
> such seperation is not visible in the finished product.

Not if you're not a coder. If you're writing a device driver or building a 
video card, I'm pretty sure it's lots of separate modules. Go into your 
control panel and look at the device drivers. Notice the "uninstall" bits 
there. Plug in a new USB device you never had before, or a new printer, or a 
new graphics tablet. What do you think happens, other than a new module 
being installed?

> You mean there's more than one program that uses that particular shortcut
> (for the same thing)?

Anything with a text box. One of the nifty things about Windows is that 
early on, back when Gates was still making tech decisions, they built a text 
box object that *everyone* can use. The only program I ever found that 
*didn't* use it is Mozilla and Thunderbird (and cmd.exe obviously). 
Everything else will (for example) take handwriting recognition on a machine 
that supports a touch screen, because MS just added that to the text box 
code everyone was already using.

I suspect Java doesn't use it either at least sometimes, but I never tried 
using a Java program on the machine with the touchscreen.

>>> The output is 4000 lines line? In what universe...?? O_O
>>
>> That was the small one. You don't think compiling a Linux distro
>> generates tens of thousands of lines of output?
>
> Why would you ever compile a Linux distro? (Other than for a laugh.)

First, I must admit amusement that earlier in this same thread, you 
expressed wonder that there had ever been a Unix distro not released in 
source form, and how in the world would you compile it?

Second, you compile a Linux distro when you're building a new piece of hardware.

> That's unlikely to ever be a problem for me. What /is/ a problem is that Vi
> was utterly incomprehensible...

True, it's unlikely to be a problem nowadays. Unless you wind up on an 8-bit 
machine again for some reason. It's also the case that (I think) vi tends to 
be installed by default and emacs isn't, so if you want to get into a server 
somewhere and make a 3-line configuration change, knowing enough vi to 
handle that is probably a good idea.

Do a tutorial on vi for the same length of time you did it on emacs, and see 
how it goes. Given its nature, of course it's incomprehensible if you never 
read the instructions.

> On the other hand, since Emacs is an entire operating system, it appears
> that most people just start Emacs after they log in, and never shut it down.

"It's a great OS, but the text editor is sooooo complicated!"

I was highly amused when I saw the icon for one of the emacs distributions 
was a kitchen sink.

>> The point is not "here's a useful plug-in for Haskell", but to show you
>> a counter-example to your assertion that VS doesn't support third-party
>> languages.
>
> I didn't say that VS doesn't support third-party languages. I said it was
> far too /hard/ to implement support for third-party languages.

Too hard for who?

> I seem to recall it got as far as "require package tcom", and Freewarp was
> like "WTF is tcom?" And I had a look at the package description, and it was
> like "OK, put this file in /bin, and that file in /lib" and I'm like "WTF?
> Where's that?"

Well, no, adding libraries to Tcl when you're using freewrap is going to 
make anything difficult. You've got a "here's a program you don't install 
with a selection of libraries already present" distribution, and you're 
surprised that adding libraries to it is difficult?

Use a real install of Tcl. Freewrap is specifically designed to package up a 
select collection of libraries.

> I don't actually /like/ Tcl all that much. I'd prefer something a bit safer,
> but hey... from the way you're talking, you make it sound as if almost
> /every/ programming language can trivially access COM.

Not necessarily "trivially". I don't know that I'd call the C++ interface 
"trivial", since it requires a somewhat more complex build system and more 
data than just the COM object itself. But most scripting languages have a 
pretty easy way of invoking COM even if they don't well support writing 
servers for COM.

-- 
Darren New, San Diego CA, USA (PST)
   How come I never get only one kudo?


Post a reply to this message

From: Darren New
Subject: Re: The other OS
Date: 8 Aug 2011 12:33:57
Message: <4e400ff5@news.povray.org>
On 8/8/2011 7:01, Warp wrote:
>> If you /need/ to generate large chunks of code automatically, you're
>> writing your program wrong.
>
>    You could use the same argument for any of the several features in your
> text editor that you, personally, never use.

I'd more say that if you need to generate large chunks of code 
automatically, your programming language is too low-level for the code 
you're writing. Boilerplate is a sign that your language needs to be able to 
automate the boilerplate.

-- 
Darren New, San Diego CA, USA (PST)
   How come I never get only one kudo?


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.