Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Vehicles smaller than cars (Score 1) 436

That's why they tend to use timers as well as sensors.
But when red-light were first introduced (and the film was itself very expensive) I seem to remember a load of Melbourne Uni students found one such intersection and spent a quiet evening all standing in the middle "mooning" the camera, while a few of their mates swung stainless buckets filled with nuts and bolts etc low over the sensors, so providing the police with a huge number of very expensive photos to process...

Comment Re:It won't work here (Score 1) 436

Few signals work based purely on the road sensor, most use timing cycles with input from the road sensors (eg they might adapt their cycle length dynamically depending on how whether cars are queued up at a red and the "green" direction seems to have no cars passing through, or only include a "green arrow" filter when there are actually cars queued up for it) - in fact one of my comp sci projects at Melb Uni was to design a system to do precisely this.

In the late 80's, Melbourne traffic planners tried 2 different high profile schemes (on Maroondah Highway and Canterbury Rd I think) - the first was smart and dynamic sync'ing of the lights depending on actual traffic flows so they'd try to identify a dominant block of traffic (eg rush hour in or out of the City) moving at a certain speed and ensure they caught as many consecutive green lights as possible, adjusting the duration of individual cycles to suit. The other scheme (on a largely parallel road) instead had the lights on a linked but less dynamic timing arrangement (eg there were still "rush hour out of the city" patterns etc but the cycles weren't individually adjusted), but in this case large illuminated signs over the road told you the speed to drive at to catch a green light at the next junction.

Of course both systems have their failings, and I take it the first is now the more common solution, but the latter was an interesting experiment (even if lots of people ignored it, on the basis of the joke about "I don't have to run faster than a lion, I just have to run faster than you").

Comment Re:OP here (Score 1) 254

If you're interested I can drop you an invitation code to

    http://www.mysparebrain.com/

(hit the button to request a pre-launch invite and then ping me on twitter or similar to identify yourself)

It's free and runs in the browser without plugins (but you can export your data locally, an offline mode is fairly straightforward, just not a high priority at this point) - it's aimed more at when you move your files onto the web for storage, but it can handle local files within browser sandbox limitations.

It mixes note-taking, bookmarking, annotation and tagging, reminders, and notifications, but then also features smart integration with other sources, so it knows about things like wikipedia and twitter and actively integrates with such sources via plugins (I'm toying with the idea of a Mendeley plugin).

The aim is not so much to replace lots of other services, but to sit on top of them and give you a smart integration layer, so rather than building a static "bucket" as a repository, you can build something that is more active, and lets you get on with what you need to do with your resources rather than constantly going back and checking them.

And I'm UK based so you may find some of the spellings familiar ("organise"!!)

Comment Re:mac != unix (Score 1) 699

With the right viewer or editor anything qualifies as human readable. Even ASCII requires a viewer to be read by humans.

This generation - don't know they're born etc etc :)

If you can't spot ASCII text strings in a hex dump then you're a tourist - nothing wrong with that, but don't believe that the natives don't understand the local lingo just because it sounds like gibberish to you.

Comment Re:"commercial UNIX" (Score 1) 699

I can install BASH on a Windows machine and open a full screen terminal, does that make Windows Unix too?

Sure, its got a kernel that started out as a Unix variant, but its heavily modified.

The real question is whether its Posix compliant.

No, the question is not POSIX compliance, the question is the unix philosophy.

Any idiot can emulate some system calls (as Windows Posix shell proudly does), the real question is whether you understood the real point of unix

  - is everything a file, for elegance, for ease-of-use, for consistanecy, for lack of special case hacks ?
  - do you have a small set of tools that do one thing, and apply to everything (because everything's a file) ?
  - can you easily compose such small tools because, at a base level, the way you lauch a new process is a fork style mechanism (whereby a new process inherits file handles etc) ?
  - are all the API's humane (to nick Jeff Raskin's term) - can system calls be interrupted or are system calls considered strangely privileged and all non-kernel code are undeserving scum ?

Windows is so far from being a unix it's laughable to anybody except PHB's (and "developers" who've never worked for PHB's) - and implementing a few stupid POSIX APIs isn't going to make any difference to that.

Whereas the entire "BSD vs Unix" thing I've always thought was pretty fake, BSD is Unix, Linux is Unix, SunOs and Solaris are Unix, I'd pick any of them over a POS like the DOS/Win16/Win32 brain-dead systems I've had to endure for 20 years...

Microsoft

Submission + - Longhorn's IIS an Apache killer?

An anonymous reader writes: Long trailing Apache's shadow in the world of webservers, Microsoft has given IIS7 in Longhorn Server a near total makeover. You'll be surprised by some of its features, clearly targeted at Linux admins.
Programming

Submission + - Review of "The Art of C++"

scottsk writes: "THE ART OF C++
by Herbert Schildt
Osborne, 2004
0-07-225512-9
$39.99

I had seen some of Schildt's material in the early 90s, and had
recently found a copy of his original "Turbo C: The Complete
Reference" book because I was working with Turbo C 1.0 and 1.5 for
historical research. But what was Schildt up to now? I found a chapter
on garbage collection in C++ which looked really interesting, and
bought "The Art of C++" very cheaply because it's no longer in print
even though it is from 2004. I've been looking through it, trying to
brush up on both C and C++. The bottom line is, there's some good
stuff in this book, but some bad stuff too. It's probably worth what a
used copy would sell for to get the garbage collection chapter. Many
of Schildt's books have a quote about his material being "first-rate",
but much in this book is second-rate, as I'll explain when I get into
the individual chapters.

The goal of the book is to demonstrate the "Art" of C++ (does the
title echo Knuth on purpose?) by showing the artistry with which the
language can be used to craft elegant solutions. The book's chapters
are hands-on projects the novice can build to get some experience with
the language. It's by no means a professional programming book, but
not aimed at the rank novice, either. Because the book is a grab-bag
of extremely varied projects, there's probably something in here for
almost anyone. You're assumed to have some facility with your C++
compiler, editor, etc; and to know the basics about the
language. There are two chapters (multithreading and the Internet file
downloader) which are specific to the Windows environment, but the
other chapters could be worked through by anyone with a C++ compiler
(such as g++ on Linux).

Let's look at the chapters!

Chapter one is just a preface masquerading as a chapter. The author
basically could have said "C++ is a powerful language" on the title
page and skipped this. His point is valid, but doesn't require a
chapter to make. C++ allows the programmer to get close to the
machine and write expressive code. I assume anyone buying a
project-oriented book on C++ already knows this. It's curious that,
writing in 2004, the author doesn't even mention why p-code systems
such as the C# CLI and Java's JVM have eclipsed C++. That would be
interesting to examine, since there's got to be some reason people are
going back to the inefficiency of p-code.

Chapter two is the garbage collection chapter, and is actually very
interesting. Schildt uses C++ fully, and does a decent job explaining
how garbage collectors work. I was pleased by this. The explanation is
very simple and straightforward. I've seen garbage collectors in LISP
implementations written in C before, but never fully reverse
engineered them. Unlike LISP versions, this garbage collector is a
reference counter. It's probably not adequate for real-world use, but
it's fascinating to look under the covers of a simple garbage
collector and learn how it works.

Chapter three is about Windows multithreading, which I didn't pay much
attention to since I don't program on Windows. He extends the garbage
collector to run as a separate thread.

Chapter four is interesting. Schildt builds a front-end for C++ so new
language features can be implemented, much like the "cfront" program
added new C++ language features to C. The front-end reads your program
and translates several new features into their C++ equivalents. What's
interesting is that he adds a foreach keyword, but then doesn't extend
it to iterate over STL containers, just built-in arrays, so that's
underwhelming. If it supported STL containers, it would have made this
a killer chapter. Because I don't use C#, I don't understand the
benefits of the "typeof" operator Schildt develops. I thought it was a
cool idea to do to C++ what C++ did to C. The only beef I have is this
front-end is little more than C code. It isn't developed as an
object-oriented program from the ground up, even though it does throw
an exception. Where is the parser factory, and delegation to helper
objects which do the code rewrites, and the design patterns?

Chapter five is about Internet file downloads, which is so 1998. To
develop this program, Schildt uses a Windows high-level API called
WinInet, which I have to guess is a wrapper around the usual socket
functions common to UNIX and Windows. It's certainly easy! Basically
you just have to call about five functions in the right order and it's
all magic. You learn nothing about TCP or UNIX socket calls in this
chapter, so I'm not sure what the point is. Since this is a book on
C++, you would expect to be using the Borland VCL, or maybe MFC, but
the demo program is a Petzold-era Windows program written in C. The
author even includes a manual resource definitions file! Get out your
Petzold book and try to remember how to manually compile a resource
file. I am not very impressed by this chapter, since you don't learn
anything useful!

Chapter six has a bunch of financial formulas from your college
economics book coded in C++. This chapter is totally awful! Every
single formula uses C++'s built-in floating point data type. Surely
you're joking, Mr. Schildt? I expected this chapter to discuss
rounding errors, BCD packages, fixed-point class libraries, and so
on. A guy billed as "a genuine C++ guru" on the cover (it really says
that; I couldn't invent anything that corny) ought to know more about
this. This chapter alone is a good reason to put all copies of this
book in the recycle bin. I hope no one from my bank reads it! The
chapter is so bad I don't even need to get into the fact that the code
isn't very object-oriented.

On to chapter seven, where things get better. This is a chapter on
(very basic) AI based problem solving. Back in 1987, Schildt wrote a
classic book on Borland's Turbo Prolog which included this chapter. He
actually did a commendable job bringing it up to date for this book,
re-writing the examples in C++. What this chapter covers is creating a
decision tree and walking it in different orders. Again, like most of
these chapters, it's really basic, but gives a newcomer to AI a way to
get started before, say, venturing into "Structured Interpretation Of
Computer Programs".

Chapter eight is how to build your own STL container. This is a gentle
chapter, which works through the standard interfaces containers need
to support to interoperate with the standard algorithms and
iterators. I liked this chapter because I find the STL a little
disorienting, and most books (like one I have, "Generic Programming
and the STL") to be almost too detailed for a novice. What he builds
is an array that's indexed from any number, not just zero. This gives
the container a nice, clean implementation (subtract the index from
the base and index a real array) that doesn't get in the way of the
STL stuff.

The final chapter is a Mini-C++ interpreter. Many of us will remember
Little C, Schildt's August 1989 contribution to Dr. Dobb's
Journal. (If not, you can find the original source and article online
if you convince Google you want it badly enough.) This is the same
code! The interpreter is a hand-coded recursive descent parser that
knows a rudimentary form of C. It does not use LEXX and YACC, so it's
actually a fascinating example of how these parsers work. Or, it
was. The trouble is this code has been around for a long time, and is
not even a C++ interpreter. It does not understand classes at
all. What else is there that distinguishes C++ from C? The interpreter
does understand using "cout > var" but not deeply,
it's just syntactic sugar.

If you're too lazy to enter the programs, you can download the source
online from Osborne's site, but a word of warning that the zip file
has a single text file for each chapter with the listings one after
the other, so it's hard to pick each file's source code apart. There
aren't any markers in the file to show you where one file ends and the
other begins. Almost silly to do it this way, since (hopefully) the
code was in separate files during testing!

My feeling at the end of the book was one of being underwhelmed. I
wouldn't waste much time with this book. If you can get it for a
couple of dollars, you might like to see the garbage collection
chapter. Given that the book bills its author as "the world's
number-one programming author" and "a genuine C++ guru", there's not
much to back up these claims.

(If you want to read the garbage collector chapter, see the link to it
on Schildt's Wikipedia entry.)"

Slashdot Top Deals

I've noticed several design suggestions in your code.

Working...