Re: D GC Benchmark Suite
Robert Clipsham, el 28 de marzo a las 20:52 me escribiste: Leandro Lucarella wrote: Hello. I'm trying to make a benchmark suite to evaluate different GC implementations. I'm looking for trivial benchmarks and full real-life programs. If you have something like that or if you are interested in more details about what I'm looking for, please read the following link: http://proj.llucax.com.ar/blog/dgc/blog/post/-1382f6a3 Thank you. I'd be interested to know what you come up with for this, I'd like more benchmarks to include in http://dbench.octarineparrot.com/ . I have already been sent a few, I have not had chance to include them yet though. Sure, but bare in mind that the benchmark I intend to make are targeted to one compiler only, because I want to compare GC implementations performance. But I guess they could be useful too to test different compilers too (they might have different GC implementations in the future as well :) -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) Cómo ser inconmensurablemente atractivo a la mujer del sexo opuesto. -- Libro de autoayuda de Hector Mesina.
Re: D GC Benchmark Suite
Vladimir Panteleev, el 29 de marzo a las 22:19 me escribiste: On Sat, 28 Mar 2009 22:28:11 +0200, Leandro Lucarella llu...@gmail.com wrote: Agree, but for now I'm just interested in the GC to finally get my diploma ;) Funny, I'm working on some D/GC-related projects (including a new experimental GC idea) for my university graduation paper too :) One of them is a D memory debugger: http://dsource.org/projects/diamond I'll post on the NG when I have further developments. Nice to know, that can be useful for getting some metrics about the GC usage. I'll take a look at it when I can. Thanks! -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) I've always been mad, I know I've been mad, like the most of us... very hard to explain why you're mad, even if you're not mad...
Re: [OT] [I mean totally OT] Re: What can you new
Hello Andrei, BCS wrote: IIRC the 7.62 NATO doesn't have that much penetration (more than the 5.56), enough to do in an Orc, but I don't think it would get the next in line, particularly if the Orc in question has armor on his back. Not enough penetration to do in an Orc? I haven't read the book, but the movie suggested Orcs were rather penetrable by the arrows and swords of the humans. Oh it would penetrate the first orc just fine, but meat is a lot of water and does a dandy job of stopping bullets. I know a guy who retrieved a 30-06 round (same bullet as the 7.62 but with a slightly bigger charge behind it) from a deer after a classic side shoot so a deer is thick enough to stop a bullet and I aspect that an orc is thinker.
Re: [OT] [I mean totally OT] Re: What can you new
Hello Walter, This would all make for a great scifi story! the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, really good geological maps and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation.
Re: [OT] [I mean totally OT] Re: What can you new
Hello Sean, In another MythBusters episode they were asked to try and figure out whether there was any practical benefit to arrows with flint tips vs. simply being sharpened, and their results were surprisingly ambiguous. The flint tipped arrows seemed to penetrate slightly better, but this didn't seem offset by the greatly increased labor to make them. Clearly, stone-tipped weapons were preferred over normal ones if archaeological evidence is any indication, but I'd really like to know why. Stone tools makes complete sense (and therefore hatchets as well), but why add a stone tip to something ostensibly disposable like an arrow unless it provides a substantial benefit in terms of the likelihood that a kill will be successful? After the tip get in the animal, it breaks off, grinds up and does more damage as the animal runs away. Even modern razor edged arrows kill by bleeding the animal out.
Re: [OT] [I mean totally OT] Re: What can you new
Sean Kelly wrote: I don't buy it. Most foods would spoil too quickly for this to matter, the wagons would be slow, wheels would need repair, etc. If I were in a nomadic tribe I wouldn't do more than pile stuff on the back of a Mule. It depends on whether you'd domesticated some sort of pack animal first. I'm talking about hand carts. As for spoiling...well, trial and error would get you to some reasonable system for storing food within a few hundred years, without much food loss. If you're willing to lose more food, you can get there sooner.
Re: [OT] [I mean totally OT] Re: What can you new
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Walter Bright wrote: Jérôme M. Berger wrote: Since we're on the subject, I suppose you all have read the 1632 series by Eric Flint and others. Natch! In the 1632 novel, a small American town gets transported to middle Europe in the middle of the 30 years war when small skirmishes, let alone full blown battles, routinely killed several times the population of the town. The story is all about how they survive. Despite their vastly superior weapons and knowledge, it's not so easy. Sure they can kick the cr*p out of any army they engage, at least so long as their ammo lasts, but they are *vastly* outnumbered and military might won't feed them or prevent them from being outflanked. Moreover, most of their technical knowledge proves to be either too theoretical to use directly or to need some tools or resources that they can't make out of what's available to them now. In addition to fiction, the rest of the series includes several very interesting technical essays about the problems involved in bringing technical advances to the 17th century: what can be done immediately out of the available industrial base and how does that industrial base need to be improved for other technological advances. A must read if you are interested in this kind of things (which from the discussion here, you seem to be). Jerome - -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknPIjMACgkQd0kWM4JG3k8cWQCfQUNvHchyYiIp4b+K9ZTFp0Yh GzsAniFkw1/bUoZ+k38YRXVpMvXsYxGX =Nmpq -END PGP SIGNATURE-
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sergey Gromov wrote: Sat, 28 Mar 2009 15:38:45 +0300, Yigal Chripun wrote: When you buy a car you are free to look under the hood and the same should apply to software. sure, the manufacturer can and probably should void any warranty if you mess with the internals of its product, but they shouldn't prevent you access to those internals. I hear automotive analogies here and there as explanations why open source is good. But automotive does not apply. Yes you can buy Ford, modify it and sell it at a higher price. But you cannot put Ford out of business this way because you must start from scratch on every single car you modify and that's a significant amount of work. And if you actually try to manufacture copies of Ford cars you'll be sued for patent infringement. Now, how would you make money on free, as in libre, software? How would you make a free, single-player RPG and still stay in business? All you can under GPL is take payment for distribution, as long as nobody else starts to distribute it for free. This means giving your hard work for free, as in gratis, not business. Ask RedHat, or any of the increasingly large number of companies that *do* make money on free, as in libre, software. Basically, you make your customers pay for specific developments and customizations. Once the software is released you still get paid for tech support and maintenance. Jerome - -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknPI10ACgkQd0kWM4JG3k/YagCfecpRE+55iKAXYxXgO+Q0Vml+ KxIAoL7Yno0jCJvlgaZwnX6xOXYAa0ug =uTy5 -END PGP SIGNATURE-
Re: DMC to Create C .lib ?
Sergey Gromov Wrote: I just wanted to double-check that you did the conversion correctly. So I ended up finding out what the hell TCOD was. Sorry for the spoiler! :D Hah, no biggie. Good news though, I removed my extern(Windows) and tried the code against the coffimplib altered library and... SUCESS!! So that works... like its supposed to when you're not a huge noob. :p Thanks for the advice in getting that straightened out. P.S. This post really belongs to D.learn. Oops, sorry. I'm still picking up the flow of these boards. Advice and questions goes in Learn, while D is for discussion about the language itself, yes?
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: Hello Walter, This would all make for a great scifi story! the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, You mean a ruggedised Kindle 2 a.k.a. the Hitchhiker's Guide to the Galaxy version 0.1? really good geological maps Here's hoping Google Earth has that planet, then. :P and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation. Without a supply of food, not long, I'd imagine. Assuming your list of materials is complete, they'd have to figure out what's edible, then hunt and gather their food for at least as long as it takes them to figure out what they can grow, and then grow it. Then there's the question of whether these people are skilled, or just a few thousand random people off the street. Not to mention that to get into space they'd need a hell of a lot of things. Even with written knowledge of how to do it, I don't imagine it would be an easy thing to do. -- Daniel
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
Jérôme M. Berger jeber...@free.fr wrote in message news:gqn80v$17g...@digitalmars.com... Ask RedHat, or any of the increasingly large number of companies that *do* make money on free, as in libre, software. Basically, you make your customers pay for specific developments and customizations. Once the software is released you still get paid for tech support and maintenance. Hmm, gaining income from specific developments and customizations is an interesting business model for a free software company (free as in both, because really, how often is free as in libre software ever *not* available at no cost? Heck, how often is that even realistically possible?), I didn't realize Red Hat was doing that. But I've never been a big fan of the idea of using tech support as a business model for free (as in both) software. The way I see it, that creates a conflict of interest. The better a piece of software is (almost by definition of better), the less tech support it really needs. If I were creating a program that had enough tech-support-income-potential to support a whole company, I'd be ashamed to call myself a software developer.
Re: [OT] [I mean totally OT] Re: What can you new
Sean Kelly wrote: In another MythBusters episode they were asked to try and figure out whether there was any practical benefit to arrows with flint tips vs. simply being sharpened, and their results were surprisingly ambiguous. The flint tipped arrows seemed to penetrate slightly better, but this didn't seem offset by the greatly increased labor to make them. Clearly, stone-tipped weapons were preferred over normal ones if archaeological evidence is any indication, but I'd really like to know why. Stone tools makes complete sense (and therefore hatchets as well), but why add a stone tip to something ostensibly disposable like an arrow unless it provides a substantial benefit in terms of the likelihood that a kill will be successful? Since stone arrowheads, and improvements in them, spread rapidly around the world, the people clearly thought they were substantially better. We often think of cavemen as idiots, but they weren't. They were ignorant of what we know, but they surely had intricate knowledge of their environment and how to survive. There's something that mythbusters was missing.
Re: .NET on a string
At a first look yes I think the assertion will fail, but not if you declare x: ref char[] x =trim this! .dup; It could be possible to tweak the compiler so that it forces you to declare x like that Steven Schveighoffer schvei...@yahoo.com wrote in umessage news:op.urex03gyeav...@steves.networkengines.com... On Tue, 24 Mar 2009 20:02:16 -0400, Cristian Vlasceanu crist...@zerobugs.org wrote: Steven Schveighoffer Wrote: On Tue, 24 Mar 2009 18:26:16 -0400, Cristian Vlasceanu crist...@zerobugs.org wrote: Back to the slices topic: I agree that my proposed ref solution would require code changes, but isn't that true for T[new] as well? Cristian There is not already a meaning for T[new], it is a syntax error. There is already a meaning for ref T[]. Yes, but the current, existing meaning will be preserved: void f(ref T[] a) { a[13] = 42; // still works as before if a is a slice under the hood a = null; // very easy for the compiler to make this work: a.array = null } OK, I'm not sure I understood your original proposal, before I respond more, let me make it clear what my understanding was. In your proposal, a ref T[] a is the same as a slice today. That is, assignment to a ref T[] simply copies the pointer and length from another T[] or ref T[]. However, it does not reference another slice struct, but is a local struct in itself. In the current situation, a ref T[] is a reference to a slice struct. That is, assignement to a ref T[] overwrites the pointer and length on the reference that was passed. So here is my objection: void trim(ref char[] c) { // // remove leading and trailing spaces // while(c.length 0 c[0] == ' ') c = c[1..$]; while(c.length 0 c[$-1] == ' ') c = c[0..$-1]; } void foo() { char[] x =trim this! .dup; trim(x); assert(x == trim this!); } Now, in your scheme, the ref simply means that c's data is referencing something else, not that c is a reference, so the assert will fail, no? If this isn't the case, let me know how you signify: 1. a normal slice (struct is local, but ptr and length are aliased from data). 2. a reference of a slice (references an external struct). -Steve
Re: What can you new
It is quite possible and practical to write an OS in D, and it has been done. This is not what I am arguing. What I dislike is allowing both GC and non-GC allocation styles mixed within the same program. The D + GC runtime support is for user apps; D + non-GC is a SPL When I say D is not a SPL I mean the default D + GC configuration.
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
Jérôme M. Berger wrote: Now, how would you make money on free, as in libre, software? How would you make a free, single-player RPG and still stay in business? All you can under GPL is take payment for distribution, as long as nobody else starts to distribute it for free. This means giving your hard work for free, as in gratis, not business. Ask RedHat, or any of the increasingly large number of companies that *do* make money on free, as in libre, software. Basically, you make your customers pay for specific developments and customizations. Once the software is released you still get paid for tech support and maintenance. And then, of course, there are the library developers that release their work as GPL, but sell commercial licenses to those who want to use it without GPL restrictions. Of course, one could argue they don't make money on the free (as in both) software, but on the non-free version of it (which may have identical code).
Re: Signaling NaNs Rise Again
Walter Bright schrieb: Inspired by Don Clugston's recent compiler patch. http://www.reddit.com/r/programming/comments/87vqv/signaling_nans_rise_again/ what about Witold Baryluk Converting FPU exceptions to D comment on the codetalk article - seems to be another good extension for the fpu exception party http://smp.if.uj.edu.pl/~baryluk/d/onpd/onp/ddoc/floatexp.html http://smp.if.uj.edu.pl/~baryluk/d/onpd/onp/arithmetic/interval/floatexp.d
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: BCS wrote: the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, really good geological maps and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation. Most of them would promptly die. The reference will be missing all kinds of woodcraft that is necessary to survive, but nobody found worthwhile to record. (The Firefox series of books is an attempt to record those old techniques before they were lost forever.) Foxfire, not Firefox. There are about twelve volumes, each roughly as long as a Wheel of Time novel. Most of the instructions in the encyclopedia will be useless, because they'll require non-existent precursor technology. How to build those precursors probably will not be recorded. Assuming that the encyclopedia is not lacking in that regard, building the prerequisite technologies could take quite some time. Then the people will have to have a very fast attitude adjustment, and many will die in that process. Take a look at the sad history of Jamestown. The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Thanks for ruining it for me! (Actually, thanks. I was never going to watch it anyway.)
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Damn! Thanks for the spoiler, I wanted to watch that! On second thought, maybe I don't :o). Andrei
Re: [OT] [I mean totally OT] Re: What can you new
On Sun, 29 Mar 2009 00:54:48 +0100, BCS n...@anon.com wrote: Hello Andrei, One that I do think would be more lethal is the mounted Gatling M134 (that Terminator made famous), see http://en.wikipedia.org/wiki/Minigun. That fires up to 6000 rounds/minute which is pretty crazy. I think a salvo of that would have made a trench through the Orcs, the same bullet killing or maiming several of them. IIRC the 7.62 NATO doesn't have that much penetration (more than the 5.56), enough to do in an Orc, but I don't think it would get the next in line, particularly if the Orc in question has armor on his back. At least in the movie, the orcs only had front-facing armor, as they weren't expected to run away from the battlefield.
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, really good geological maps and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation. Let's say, instead of just birthday suits and an encyclopedia, they'd have a magic box that just doles out any hand tool you can think of wishing you had. Oh, and another box that feeds them all. A third that keeps them clothed, and a fourth to tend to their medical issues. And, they'd be no ordinary rednecks, but all of them belonging to Mensa. But let's say they aren't NASA engineers, just otherwise smart. They'd have to start with some serious reading. They'd have to spend years figuring out the design of the ship, write the computer programs for avionics, fuel control, etc. Then they'd have to design the computers to run them on. And the computer programs to design the microchips. Then they'd have to design a chip factory to make the CPUs and other chips needed. Another factory to make fuel. A couple of mines, too, to get titanium and aluminium alloys, and a few plastics factories to make all the plastic parts. They'd need to either develop synthetic rubber or find rubber trees, or find a substitute, to make hydraulic tubing. They'd need some serious expeditions to find what they need, in great enough quantities. Before all of this, they'd need to find out how to create factories that make bricks for the other factory buildings, build a power plant big enough to run the factories, chemical processes for fuel and stuff, mills and forges. They'd need a few hundred Jeeps just to get around the planet in search of raw materials, and they'd need to build factories for oil well drills, piping, and truck factories for transport of all kinds of crap and raw materials. Oh, and they'd need to not be jealous, adulterous, envious, self-promoting, greedy, bossy, dishonest, delinquent, criminal, etc. and not treat others with disrespect. Or else half their progress will go to all that. (What's -50% compounded annually over, say, 20 years? Get it?) Motorola dominated the world of wireless communications, and was a big chip maker, only ten years ago. Ever wonder what happened? (Yesterday I saw a rerun of Bad Boys. That movie is so true to life in that anytime something is going down, people just start yelling at each other, instead of focusing on the emergency at hand.) And let's say /all/ the circumstances otherwise are perfect (like no earth quakes, no storms, floods, or even thunder). How many parts are there in a rocket? Not to mention a StarTrek kind of spaceship? In the 1970' I was a camera salesman. I saw an exploded view of the Canon FTb (a regular SLR camera). They boasted it had one thousand parts. Say it takes a thousand cameras to build a rocket. That's a million parts. How many rockets would they have to build just for testing various things, and getting it right? Any author in whose book even one of them gets up in space before 500 years, is an idiot, and should be sent back to college. Math, physics, chemistry, at least. Their number one problem is, they're too few compared to the task. Developing things to make things to make things[...], and having the knowledge is fine, but you have to be so many that it actually gets done before doomsday. Hell, if it was that easy to build a rocket, then the guys in Afghanistan and Nigeria would have been a few times to the Moon already. People really underestimate things. Yeah, this guy I know wrote this OS kernel, and today even mainframes run Linux. If you count the man-hours Linus and thousands of others have done, combined, guess what. Say they'd been a hundred instead. Today Linux is almost 20 years, so we're talking two hundred years, right? You know, if the entire mankind decided to stop fighting, and wanted to build the Enterprise now (forget warp drive), I'd say it would take way more than a generation. Hell, merely sending 2 guys to Mars seems too much. How long does it currently take the world's most powerful nation, from decision to deployment, to make a jet fighter? And these guys already have the factories, infrastructure, CAD programs, expertise, experience, clout, etc.
Re: [OT] [I mean totally OT] Re: What can you new
Jérôme M. Berger wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrei Alexandrescu wrote: Sean Kelly wrote: Christopher Wright wrote: Walter Bright wrote: Andrei Alexandrescu wrote: My list: - wheel - fire - smelting metals - writing - arithmetic But humans had fire 20,000 years ago! I think fire goes back a lot longer than that. I also suspect that simple arithmetic is innate, although a numbering system is not (see Mayan and Roman number systems). Wouldn't the wheel be useless to a hunter-gatherer tribe? If they are nomadic, wheels allow an individual to carry much more equipment. This allows them to store up surplus food more easily and safely. This in turn safeguards them from famine and allows for excess food to diversify roles in the community to a greater degree. Additionally, it means that the writing equipment that you supplied gets used, and the texts don't get tossed as soon as they move. I don't buy it. Most foods would spoil too quickly for this to matter, the wagons would be slow, wheels would need repair, etc. If I were in a nomadic tribe I wouldn't do more than pile stuff on the back of a Mule. When did you tame the mule??? :o) AFAIK, it's more a question of when did you *breed* the mule? ;) Mules are the result of breeding a horse with a donkey (one way or the other although using a male donkey and a female horse has more chance of success) and they are exceedingly rare in nature. You'd need an elevated donkey... or shorten the mare's legs. So what you actually need to do is first to tame the horse and the donkey, *then* you can breed them to get a mule. Jerome - -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknPHeoACgkQd0kWM4JG3k+37ACcCLEl7sLLm5xpUUdMnwllMG6m UMoAoITlDrp6PvHWh0FAEbmsvFhv+DOk =hIRx -END PGP SIGNATURE-
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: Hello Walter, This would all make for a great scifi story! the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, really good geological maps and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation. I'd bet it takes longer. Even with incredible knowledge, they'd have to build the technology from scratch, starting with improvised tools.
Re: [OT] [I mean totally OT] Re: What can you new
Andrei Alexandrescu wrote: Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Damn! Thanks for the spoiler, I wanted to watch that! On second thought, maybe I don't :o). It's well worth it, assuming you like space opera.
Re: [OT] [I mean totally OT] Re: What can you new
Jérôme M. Berger wrote: When did you tame the mule??? :o) AFAIK, it's more a question of when did you *breed* the mule? ;) Mules are the result of breeding a horse with a donkey (one way or the other although using a male donkey and a female horse has more chance of success) and they are exceedingly rare in nature. I always mix up mule and donkey. I suppose I should have done a web search to make sure I had it right. That, or gone with my first inclination and said Zedonk!
Re: [OT] [I mean totally OT] Re: What can you new
Christopher Wright wrote: As for spoiling...well, trial and error would get you to some reasonable system for storing food within a few hundred years, without much food loss. If you're willing to lose more food, you can get there sooner. Grain lasts for a reasonable time, but that requires agriculture to produce. I guess they could dig tubers. But I think there's a reason even modern hunter-gatherer societies don't use wagons, even in ostensibly flat regions like Africa. If nothing else, hand carts would dramatically increase the calorie expenditure for travel, which means they'd need more food than otherwise.
Re: [OT] [I mean totally OT] Re: What can you new
Georg Wrede wrote: BCS wrote: the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, really good geological maps and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation. Let's say, instead of just birthday suits and an encyclopedia, they'd have a magic box that just doles out any hand tool you can think of wishing you had. Oh, and another box that feeds them all. A third that keeps them clothed, and a fourth to tend to their medical issues. And, they'd be no ordinary rednecks, but all of them belonging to Mensa. But let's say they aren't NASA engineers, just otherwise smart. They'd have to start with some serious reading. They'd have to spend years figuring out the design of the ship, write the computer programs for avionics, fuel control, etc. Then they'd have to design the computers to run them on. And the computer programs to design the microchips. Then they'd have to design a chip factory to make the CPUs and other chips needed. Another factory to make fuel. A couple of mines, too, to get titanium and aluminium alloys, and a few plastics factories to make all the plastic parts. They'd need to either develop synthetic rubber or find rubber trees, or find a substitute, to make hydraulic tubing. They'd need some serious expeditions to find what they need, in great enough quantities. Before all of this, they'd need to find out how to create factories that make bricks for the other factory buildings, build a power plant big enough to run the factories, chemical processes for fuel and stuff, mills and forges. They'd need a few hundred Jeeps just to get around the planet in search of raw materials, and they'd need to build factories for oil well drills, piping, and truck factories for transport of all kinds of crap and raw materials. Oh, and they'd need to not be jealous, adulterous, envious, self-promoting, greedy, bossy, dishonest, delinquent, criminal, etc. and not treat others with disrespect. Or else half their progress will go to all that. (What's -50% compounded annually over, say, 20 years? Get it?) Motorola dominated the world of wireless communications, and was a big chip maker, only ten years ago. Ever wonder what happened? (Yesterday I saw a rerun of Bad Boys. That movie is so true to life in that anytime something is going down, people just start yelling at each other, instead of focusing on the emergency at hand.) And let's say /all/ the circumstances otherwise are perfect (like no earth quakes, no storms, floods, or even thunder). How many parts are there in a rocket? Not to mention a StarTrek kind of spaceship? In the 1970' I was a camera salesman. I saw an exploded view of the Canon FTb (a regular SLR camera). They boasted it had one thousand parts. Say it takes a thousand cameras to build a rocket. That's a million parts. How many rockets would they have to build just for testing various things, and getting it right? Any author in whose book even one of them gets up in space before 500 years, is an idiot, and should be sent back to college. Math, physics, chemistry, at least. Their number one problem is, they're too few compared to the task. Developing things to make things to make things[...], and having the knowledge is fine, but you have to be so many that it actually gets done before doomsday. Hell, if it was that easy to build a rocket, then the guys in Afghanistan and Nigeria would have been a few times to the Moon already. People really underestimate things. Yeah, this guy I know wrote this OS kernel, and today even mainframes run Linux. If you count the man-hours Linus and thousands of others have done, combined, guess what. Say they'd been a hundred instead. Today Linux is almost 20 years, so we're talking two hundred years, right? You know, if the entire mankind decided to stop fighting, and wanted to build the Enterprise now (forget warp drive), I'd say it would take way more than a generation. Hell, merely sending 2 guys to Mars seems too much. How long does it currently take the world's most powerful nation, from decision to deployment, to make a jet fighter? And these guys already have the factories, infrastructure, CAD programs, expertise, experience, clout, etc. Sorry for the long quote, I quoted this in full because I liked it this much. It's the best post I've read in a long time. One thing I'd like to emphasize is that building complex technology is hard for a small core of people because it's hard to get specialized in multiple things at once. Think of how long it takes to become expert in any serious domain... I'm not sure most of us could get up-to-speed in more than a couple major technologies fast enough to also use them creatively. We benefit
How to define templates
The documentation says: TemplateDeclaration: template TemplateIdentifier ( TemplateParameterList ) Constraint(opt) { DeclDefs } DeclDefs as defined where? What should be the effect of the following? import std.stdio; template gnomeSaying(T, U, V, string s) { writefln(s ~ motherfucker); } void main() { writefln(gnomeSaying!(int, double, int, Yo)); }
Re: How to define templates
On Sun, Mar 29, 2009 at 1:46 PM, Steve Teale steve.te...@britseyeview.com wrote: The documentation says: TemplateDeclaration: template TemplateIdentifier ( TemplateParameterList ) Constraint(opt) { DeclDefs } DeclDefs as defined where? http://www.digitalmars.com/d/2.0/module.html What should be the effect of the following? import std.stdio; template gnomeSaying(T, U, V, string s) { writefln(s ~ motherfucker); } An error, since a function call is not a DeclDef.
Re: [OT] [I mean totally, absolutely OT] Re: What can you new
Sean Kelly Wrote: Christopher Wright wrote: As for spoiling...well, trial and error would get you to some reasonable system for storing food within a few hundred years, without much food loss. If you're willing to lose more food, you can get there sooner. Grain lasts for a reasonable time, but that requires agriculture to produce. I guess they could dig tubers. But I think there's a reason even modern hunter-gatherer societies don't use wagons, even in ostensibly flat regions like Africa. If nothing else, hand carts would dramatically increase the calorie expenditure for travel, which means they'd need more food than otherwise. My dogs have ticks!
Re: [OT] [I mean totally OT] Re: What can you new
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Georg Wrede wrote: Jérôme M. Berger wrote: AFAIK, it's more a question of when did you *breed* the mule? ;) Mules are the result of breeding a horse with a donkey (one way or the other although using a male donkey and a female horse has more chance of success) and they are exceedingly rare in nature. You'd need an elevated donkey... or shorten the mare's legs. http://en.wikipedia.org/wiki/Mule first sentence: A mule is the offspring of a male donkey and a female horse. Jerome - -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknPtskACgkQd0kWM4JG3k+JaQCfY4qHqPyhEKDXAw8JBdCn30aD kF0An1P2GN8ZkCYNTlkSOL2MOL1919Nc =x5L4 -END PGP SIGNATURE-
Re: [OT] [I mean totally OT] Re: What can you new
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sean Kelly wrote: Jérôme M. Berger wrote: When did you tame the mule??? :o) AFAIK, it's more a question of when did you *breed* the mule? ;) Mules are the result of breeding a horse with a donkey (one way or the other although using a male donkey and a female horse has more chance of success) and they are exceedingly rare in nature. I always mix up mule and donkey. I suppose I should have done a web search to make sure I had it right. That, or gone with my first inclination and said Zedonk! Well, mules are a much better choice than donkeys for carrying things: stronger, with more endurance, more docile and less aggressive... Jerome - -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknPt00ACgkQd0kWM4JG3k8tJACeN3qkM5qPFKRP69o80k0F5gh7 6iEAn2iU5OgcjQKbhV7WDaF+9+41hlr4 =sJBa -END PGP SIGNATURE-
Re: [OT] [I mean totally OT] Re: What can you new
Christopher Wright wrote: Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Thanks for ruining it for me! (Actually, thanks. I was never going to watch it anyway.) You didn't miss anything. I've only watched a handful of episodes. I found it to be so dark, literally, that I had a hard time seeing what was going on on my TV screen.
Re: [OT] [I mean totally OT] Re: What can you new
Andrei Alexandrescu wrote: Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Damn! Thanks for the spoiler, I wanted to watch that! On second thought, maybe I don't :o). Sorry, it's been over a week now, so I assumed everyone who cared about it had already seen it.
Re: [OT] [I mean totally OT] Re: What can you new
Georg Wrede wrote: Any author in whose book even one of them gets up in space before 500 years, is an idiot, and should be sent back to college. Math, physics, chemistry, at least. To amplify your point a bit with a real life example, during WW2 a B-29 landed in the USSR, intact. It was decades ahead of Soviet aerospace tech at the time. Stalin had to essentially redirect his entire aerospace industry to simply copy it. A propeller driven, 4 engine bomber. I saw a documentary on this, it took maybe 10 years and 10,000 engineers who had to recreate every part on it. It was a monumental task. They had all the information needed, but no infrastructure to make the parts. People really underestimate things. Yeah, this guy I know wrote this OS kernel, and today even mainframes run Linux. If you count the man-hours Linus and thousands of others have done, combined, guess what. Say they'd been a hundred instead. Today Linux is almost 20 years, so we're talking two hundred years, right? People sometimes remark about how many thousands of programming languages are invented, and how few ever get anywhere. Part of the reason is that 99.99% of the work is not inventing it, it's debugging it, tuning it, deploying it, writing manuals, smoothing out all the rough edges, etc. That's what defeats all those language projects, the creators quit on them. You know, if the entire mankind decided to stop fighting, and wanted to build the Enterprise now (forget warp drive), I'd say it would take way more than a generation. Hell, merely sending 2 guys to Mars seems too much. How long does it currently take the world's most powerful nation, from decision to deployment, to make a jet fighter? And these guys already have the factories, infrastructure, CAD programs, expertise, experience, clout, etc. You're right. You'll need *millions* of people to create a starship, even starting with blueprints.
Re: [OT] [I mean totally OT] Re: What can you new
Sean Kelly wrote: I'd bet it takes longer. Even with incredible knowledge, they'd have to build the technology from scratch, starting with improvised tools. Huh, 99% of the people will be full time engaged just in food production.
Re: How to define templates
Jarrett Billingsley Wrote: On Sun, Mar 29, 2009 at 1:46 PM, Steve Teale steve.te...@britseyeview.com wrote: The documentation says: TemplateDeclaration: template TemplateIdentifier ( TemplateParameterList ) Constraint(opt) { DeclDefs } DeclDefs as defined where? http://www.digitalmars.com/d/2.0/module.html What should be the effect of the following? import std.stdio; template gnomeSaying(T, U, V, string s) { writefln(s ~ motherfucker); } An error, since a function call is not a DeclDef. OK, I didn't look there - perhaps a definition in 'Decalrations' would make thing easier. But then I wonder, since a plain old string is acceptable as a template parameter, why I can't use a statement that does not involve any of the other template arguments. Also, would it be reasonable for the compiler to issue a warning or error message to the effect that T, U, and V were never mentioned in the template body. What is the basic difference between Templates and Macros - the declarations thing is obviously crucial, but why?
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Sean Kelly wrote: I'd bet it takes longer. Even with incredible knowledge, they'd have to build the technology from scratch, starting with improvised tools. Huh, 99% of the people will be full time engaged just in food production. If the people were dropped on another planet, there's not even any guarantee that it would have the same mineral resources. And food, forget it. People would have to experiment with local plants and animals to find out what was edible, could be domesticated, had medicinal use, etc. There's a lot of really basic knowledge that we take for granted because our ancestors spent thousands of years experimenting and dying to find this stuff out. A Hitchhiker's Guide to the Galaxy would be about the only truly useful text in such a scenario.
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Christopher Wright wrote: Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Thanks for ruining it for me! (Actually, thanks. I was never going to watch it anyway.) You didn't miss anything. I've only watched a handful of episodes. I found it to be so dark, literally, that I had a hard time seeing what was going on on my TV screen. Obvious hint to start a donation campaign for a new plasma ignored. Andrei
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Sean Kelly wrote: I'd bet it takes longer. Even with incredible knowledge, they'd have to build the technology from scratch, starting with improvised tools. Huh, 99% of the people will be full time engaged just in food production. Well at some point it was said that a McDuff device provides food. Andrei
Re: How to define templates
On Sun, Mar 29, 2009 at 2:28 PM, Steve Teale steve.te...@britseyeview.com wrote: OK, I didn't look there - perhaps a definition in 'Decalrations' would make thing easier. But then I wonder, since a plain old string is acceptable as a template parameter, why I can't use a statement that does not involve any of the other template arguments. Because... templates don't contain statements? I'm not sure what your question is, or what not using T, U, and V have to do with it. Also, would it be reasonable for the compiler to issue a warning or error message to the effect that T, U, and V were never mentioned in the template body. Same idea as function arguments or locals. Just a QOI issue. What is the basic difference between Templates and Macros - the declarations thing is obviously crucial, but why? That can't really be answered until macros make their way into the language ;) but templates parametrize declarations, whereas macros parametrize arbitrary code. A parametrized type is something very different from arbitrary code.
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
On Sun, Mar 29, 2009 at 2:42 PM, Rainer Deyke rain...@eldwood.com wrote: Jérôme M. Berger wrote: Sergey Gromov wrote: Now, how would you make money on free, as in libre, software? How would you make a free, single-player RPG and still stay in business? All you can under GPL is take payment for distribution, as long as nobody else starts to distribute it for free. This means giving your hard work for free, as in gratis, not business. Ask RedHat, or any of the increasingly large number of companies that *do* make money on free, as in libre, software. Basically, you make your customers pay for specific developments and customizations. Once the software is released you still get paid for tech support and maintenance. There's a market for customizations to, or customer support for, single player RPGs? http://www.penny-arcade.com/comic/2006/4/5/the-zone-of-pure-breakfast/ Apparently so ;)
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
Sun, 29 Mar 2009 09:29:33 +0200, Jérôme M. Berger wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sergey Gromov wrote: Sat, 28 Mar 2009 15:38:45 +0300, Yigal Chripun wrote: When you buy a car you are free to look under the hood and the same should apply to software. sure, the manufacturer can and probably should void any warranty if you mess with the internals of its product, but they shouldn't prevent you access to those internals. I hear automotive analogies here and there as explanations why open source is good. But automotive does not apply. Yes you can buy Ford, modify it and sell it at a higher price. But you cannot put Ford out of business this way because you must start from scratch on every single car you modify and that's a significant amount of work. And if you actually try to manufacture copies of Ford cars you'll be sued for patent infringement. Now, how would you make money on free, as in libre, software? How would you make a free, single-player RPG and still stay in business? All you can under GPL is take payment for distribution, as long as nobody else starts to distribute it for free. This means giving your hard work for free, as in gratis, not business. Ask RedHat, or any of the increasingly large number of companies that *do* make money on free, as in libre, software. Basically, you make your customers pay for specific developments and customizations. Once the software is released you still get paid for tech support and maintenance. Yeah, sure. How much support a single-player game needs? Or a 3D-modeling tool? I agree with Nick: to make a profit on support you must create something unusable in the first place, and then charge money for fixing it. I agree that support is sometimes a valid business model, like when you create customized Linux kernels for various hardware and requirements. But it's definitely not universal enough to apply to every software created out there.
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Christopher Wright wrote: Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Thanks for ruining it for me! (Actually, thanks. I was never going to watch it anyway.) You didn't miss anything. I've only watched a handful of episodes. I found it to be so dark, literally, that I had a hard time seeing what was going on on my TV screen. The problem I ran into is that the audio is mixed with the music about the same volume as the voices, and it almost seems like they applied so effects to the voice audio to make it sound more like they were talking in a big metal room. In any case, I always had trouble hearing dialog clearly in that show, and often messed with the audio settings on my TV to boost that frequency range in hopes of hearing it better. That's what I get for not wearing ear plugs all those years I spent at loud concerts, I suppose.
Re: How to define templates
Jarrett Billingsley Wrote: On Sun, Mar 29, 2009 at 2:28 PM, Steve Teale steve.te...@britseyeview.com wrote: OK, I didn't look there - perhaps a definition in 'Decalrations' would make thing easier. But then I wonder, since a plain old string is acceptable as a template parameter, why I can't use a statement that does not involve any of the other template arguments. Because... templates don't contain statements? I'm not sure what your question is, or what not using T, U, and V have to do with it. Also, would it be reasonable for the compiler to issue a warning or error message to the effect that T, U, and V were never mentioned in the template body. Same idea as function arguments or locals. Just a QOI issue. What is the basic difference between Templates and Macros - the declarations thing is obviously crucial, but why? That can't really be answered until macros make their way into the language ;) but templates parametrize declarations, whereas macros parametrize arbitrary code. A parametrized type is something very different from arbitrary code. That's a most useful answer, and some of it should be in the documentation. I had tended to think that templates were something more general that macros. Maybe that's why (like many others) I've never really understood them. It also accounts for most of the error messages I've got when trying to use templates. So will we get macros ;=) ?
Re: DMC to Create C .lib ?
Sun, 29 Mar 2009 04:00:47 -0400, Chris Andrews wrote: Sergey Gromov Wrote: I just wanted to double-check that you did the conversion correctly. So I ended up finding out what the hell TCOD was. Sorry for the spoiler! :D Hah, no biggie. Good news though, I removed my extern(Windows) and tried the code against the coffimplib altered library and... SUCESS!! So that works... like its supposed to when you're not a huge noob. :p Thanks for the advice in getting that straightened out. Nice to hear! I hope that you actually not removed your extern(Windows) but replaced it with extern(C). Otherwise you risk getting D linkage for those functions which is neither C nor C++. This post really belongs to D.learn. Oops, sorry. I'm still picking up the flow of these boards. Advice and questions goes in Learn, while D is for discussion about the language itself, yes? Well, your question was about linking D with C++ code. Good interaction with C/C++ code is one of D's main selling points. One therefore could guess that there's not much to discuss but rather to ask what they do wrong. No worries though. There are no angry moderators with big plus-throwers here. ;D
Re: How to define templates
On Sun, Mar 29, 2009 at 3:01 PM, Steve Teale steve.te...@britseyeview.com wrote: So will we get macros ;=) ? The 'macro' keyword is already reserved, and Walter showed them as a future feature at the D con in 2007. Unfortunately they won't be coming in D2, probably D3, at least at last report from Walter. For all we know they'll just magically appear in the next compiler release as a minor note in the changelog. That's usually how things happen.
Re: [OT] [I mean totally OT] Re: What can you new
Sean Kelly wrote: The problem I ran into is that the audio is mixed with the music about the same volume as the voices, and it almost seems like they applied so effects to the voice audio to make it sound more like they were talking in a big metal room. In any case, I always had trouble hearing dialog clearly in that show, and often messed with the audio settings on my TV to boost that frequency range in hopes of hearing it better. That's what I get for not wearing ear plugs all those years I spent at loud concerts, I suppose. I've been having increasing problems understanding TV dialog, too. It sounds like they're mumbling their lines.
Re: How about a compatibility list?
I would think some of that work could be automated. Of course, setting up the automation could mean a fair bit of work... Yeah of course that would be awesome, but how difficult is it to set up a thing like the wine database?(serious question) As mentioned by dsimcha: For me, writing a review: no problem, creating a patch: big problem.
Re: [OT] [I mean totally OT] Re: What can you new
Andrei Alexandrescu wrote: Walter Bright wrote: Sean Kelly wrote: I'd bet it takes longer. Even with incredible knowledge, they'd have to build the technology from scratch, starting with improvised tools. Huh, 99% of the people will be full time engaged just in food production. Well at some point it was said that a McDuff device provides food. McDuff is right. Trying to get enough food to eat has been the bane of human existence for essentially our entire existence. The current obesity epidemic is a startling anomaly. Even now, I hear the siren call of the poptarts from the kitchen!
Re: How to define templates
Steve Teale wrote: Also, would it be reasonable for the compiler to issue a warning or error message to the effect that T, U, and V were never mentioned in the template body. No, because the template signature may be conforming to an externally applied interface, and may simply not need the args. What is the basic difference between Templates and Macros - the declarations thing is obviously crucial, but why? Macros manipulate text, templates manipulate syntax trees. They happen at very different stages in compilation.
Re: How to define templates
On Sun, Mar 29, 2009 at 3:24 PM, Walter Bright newshou...@digitalmars.com wrote: What is the basic difference between Templates and Macros - the declarations thing is obviously crucial, but why? Macros manipulate text, templates manipulate syntax trees. They happen at very different stages in compilation. Macros manipulate syntax trees. Useful ones do, anyway.
Re: [OT] [I mean totally OT] Re: What can you new
Hello Simen, On Sun, 29 Mar 2009 00:54:48 +0100, BCS n...@anon.com wrote: IIRC the 7.62 NATO doesn't have that much penetration (more than the 5.56), enough to do in an Orc, but I don't think it would get the next in line, particularly if the Orc in question has armor on his back. At least in the movie, the orcs only had front-facing armor, as they weren't expected to run away from the battlefield. that actually was a problem, the orcs were all AI driven CGI and for a while they had an issue if orcs running away from where they were supposed to get slaughtered.
Re: [OT] [I mean totally OT] Re: What can you new
Hello Walter, Sean Kelly wrote: The problem I ran into is that the audio is mixed with the music about the same volume as the voices, and it almost seems like they applied so effects to the voice audio to make it sound more like they were talking in a big metal room. In any case, I always had trouble hearing dialog clearly in that show, and often messed with the audio settings on my TV to boost that frequency range in hopes of hearing it better. That's what I get for not wearing ear plugs all those years I spent at loud concerts, I suppose. I've been having increasing problems understanding TV dialog, too. It sounds like they're mumbling their lines. I'm 25, don't like loud music and run movies with subtitles. It's kinda funny how the audio doesn't always track the text.
Re: [OT] [I mean totally OT] Re: What can you new
Hello Daniel, BCS wrote: Hello Walter, This would all make for a great scifi story! the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, You mean a ruggedised Kindle 2 a.k.a. the Hitchhiker's Guide to the Galaxy version 0.1? really good geological maps Here's hoping Google Earth has that planet, then. :P That to, but I was thinking of minral maps for finding ore. and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation. Without a supply of food, not long, I'd imagine. Assuming your list of materials is complete, they'd have to figure out what's edible, then hunt and gather their food for at least as long as it takes them to figure out what they can grow, and then grow it. I'd argue that working out the food supply is a prerqueset to keeping society together Then there's the question of whether these people are skilled, or just a few thousand random people off the street. Most of the work would be skilled labor and when know how to teach that fairly well. For the rest it wouldn't take much luck for a sampling of 5000 people to to include several doctors, engineers, some framers, a few scientists and some programmers. Besides, it a story, I can make my own luck. Not to mention that to get into space they'd need a hell of a lot of things. Even with written knowledge of how to do it, I don't imagine it would be an easy thing to do. If it were easy, it wouldn't make a good story. -- Daniel
Re: [OT] [I mean totally OT] Re: What can you new
Hello Georg, [...] I'll grant it's a hard job, but look at WW-II, throw in some large ugly unifying force and Stuff Gets Done! Heck, look at 1900-2009. I'd say that most of the tech that existed in 1900 could be built from the ground up in under 50 years if the people didn't needed to do any RD and are motivated enough. As for some hard numbers, I recall a NOVA show where a construction planner was asked to set up a time line for the pyramids using period tech. The time line was under 3 years (2.5 IIRC). With the best assumptions you can reasonably expect to get I think the timeline would surprise most everyone.
Re: [OT] [I mean totally OT] Re: What can you new
Hello Walter, BCS wrote: the story I want to puzzle out is that a group of a few thousand people get dropped on a planet with an indestructible encyclopedic reference, really good geological maps and their birthday suits. I've wondered how long it would take to get into back into space. If they can keep society together, I'd bet it would be under 100 years, it might even be under a generation. Most of them would promptly die. The reference will be missing all kinds of woodcraft that is necessary to survive, but nobody found worthwhile to record. (The Firefox series of books is an attempt to record those old techniques before they were lost forever.) No it does contain that knowledge. Assume, it has the totally recorded knowledge of earth, wikipidia + googel books + gotenberg + dusty tomes in the back of some monetary. The point is what if knowledge is not a limiting factor? Most of the instructions in the encyclopedia will be useless, because they'll require non-existent precursor technology. How to build those precursors probably will not be recorded. Then the people will have to have a very fast attitude adjustment, and many will die in that process. Take a look at the sad history of Jamestown. What goods a story without some risk of life and limb? That and a social aspect.
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Sean Kelly wrote: The problem I ran into is that the audio is mixed with the music about the same volume as the voices, and it almost seems like they applied so effects to the voice audio to make it sound more like they were talking in a big metal room. In any case, I always had trouble hearing dialog clearly in that show, and often messed with the audio settings on my TV to boost that frequency range in hopes of hearing it better. That's what I get for not wearing ear plugs all those years I spent at loud concerts, I suppose. I've been having increasing problems understanding TV dialog, too. It sounds like they're mumbling their lines. It's a conspiracy. You need to turn the volume up to understand, and meanwhile the entire house hears the bangs and shots, and everybody has to come and see. Same with commercials (at least around here) they got the nice idea to send commercials a lot louder than the program, so everybody in the building (including your freaking neighbors) has to hear what detergent to buy. #...@%!@#!!! I'd say that's harrassment and trespassing. Check out any movie from the fifties, and all of a sudden you aren't old anymore: you can actually hear what they say. Without burning the amp or your nerves! I've actually thought of buying a 5.1 sound system, for the sole purpose of turning everything else down, except the dialog speaker. (The one on top of the TV.) But I've been too lazy to go to a store and test if it actually would work. Does anybody know? @#...@$#!!! And they used to have this logo screen between commercials and programming, but now they've got rid of it, so when I watch a movie, I literally have to have the remote in my hand so I can be ready to cut the volume before everybody wakes up. Technology advances indeed.
Re: [OT] [I mean totally OT] Re: What can you new
Sean Kelly wrote: Andrei Alexandrescu wrote: Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Damn! Thanks for the spoiler, I wanted to watch that! On second thought, maybe I don't :o). It's well worth it, assuming you like space opera. That's the first series I'd consider buying a box set.
Re: DMC to Create C .lib ?
Sergey Gromov Wrote: I hope that you actually not removed your extern(Windows) but replaced it with extern(C). Otherwise you risk getting D linkage for those functions which is neither C nor C++. This is just going to sound silly now, but I was following along the .h to D conversion guide, so I basically took the .h files, wrapped them up in extern(C){} and set about translating the rest by hand (typdefs, types, etc). I just replaced all the exports with export extern(Windows). So, if I'm reading it right, what I did was extern everything to C, except what I had explicitly extern(Windows) instead. :P Sometimes I just don't think. But yeah, should all be extern(C) now, so it's all good.
Re: [OT] [I mean totally OT] Re: What can you new
On Sun, Mar 29, 2009 at 4:01 PM, Georg Wrede georg.wr...@iki.fi wrote: It's a conspiracy. You need to turn the volume up to understand, and meanwhile the entire house hears the bangs and shots, and everybody has to come and see. Same with commercials (at least around here) they got the nice idea to send commercials a lot louder than the program, so everybody in the building (including your freaking neighbors) has to hear what detergent to buy. #...@%!@#!!! I'd say that's harrassment and trespassing. It's not just there :P some commercials are, no kidding, about twice as loud as the program.
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: No it does contain that knowledge. Assume, it has the totally recorded knowledge of earth, wikipidia + googel books + gotenberg + dusty tomes in the back of some monetary. The point is what if knowledge is not a limiting factor? That's *recorded* knowledge. A lot of knowledge never gets recorded. For example, many people have tried to recreate medieval trebuchets. All they've got is a couple of crappy drawings, and so they had to guess and invent to fill in a lot of blanks. Damascus steel is a famous example. Anyone who has tried to recreate medieval or ancient technology from recorded documents has found that an awful lot of fairly crucial information was left out.
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: that actually was a problem, the orcs were all AI driven CGI and for a while they had an issue if orcs running away from where they were supposed to get slaughtered. Skynet 1.0 has some bugs!
Keeping a list of instances and garbage-collection
Hello, I have a class A and I'd like to keep a list of all the created instances of this class. To do that, I have a static List!(A) in the A class and, in the constructor, I add each new instance to this list. This gives me the following code: class A { private static List!(A) s_instances; public this() { s_instances.add(this); } public ~this() { s_instances.remove(this); } public static void printAll() { foreach (A instance; s_instances) print(instance.toString()); } } But then, since all the instances are referenced by the static list, they are never garbage-collected, which could be a problem. In some other languages, this can be solved using weak references, but I haven't found any informations about using weak references in D. Is there any way to solve this problem? Thanks, Simon
Re: [OT] [I mean totally OT] Re: What can you new
Remember that old Bill Cosby routine where he plays Moses and God is giving him instructions on how to build the ark? The design was all given in terms of cubits. And the end of the long, involved explanation, Moses (Cosby) says: What's a cubit?
Re: [OT] [I mean totally OT] Re: What can you new
Georg Wrede wrote: Walter Bright wrote: Sean Kelly wrote: The problem I ran into is that the audio is mixed with the music about the same volume as the voices, and it almost seems like they applied so effects to the voice audio to make it sound more like they were talking in a big metal room. In any case, I always had trouble hearing dialog clearly in that show, and often messed with the audio settings on my TV to boost that frequency range in hopes of hearing it better. That's what I get for not wearing ear plugs all those years I spent at loud concerts, I suppose. I've been having increasing problems understanding TV dialog, too. It sounds like they're mumbling their lines. It's a conspiracy. You need to turn the volume up to understand, and meanwhile the entire house hears the bangs and shots, and everybody has to come and see. Same with commercials (at least around here) they got the nice idea to send commercials a lot louder than the program, so everybody in the building (including your freaking neighbors) has to hear what detergent to buy. #...@%!@#!!! I'd say that's harrassment and trespassing. It was quite annoying, but I found a solution: don't watch broadcast television. There are friendly people on the internet who have already removed the commercials for me. That said, the only television I regularly watch is Korean starcraft (with fan-made English commentary, usually), and nobody's going to sue me for that.
Re: [OT] [I mean totally OT] Re: What can you new
Andrei Alexandrescu wrote: Georg Wrede wrote: How long does it currently take the world's most powerful nation, from decision to deployment, to make a jet fighter? And these guys already have the factories, infrastructure, CAD programs, expertise, experience, clout, etc. Sorry for the long quote, I quoted this in full because I liked it this much. It's the best post I've read in a long time. Cool! One thing I'd like to emphasize is that building complex technology is hard for a small core of people because it's hard to get specialized in multiple things at once. Think of how long it takes to become expert in any serious domain... I'm not sure most of us could get up-to-speed in more than a couple major technologies fast enough to also use them creatively. For the society, this is the problem with longevity. Exteding peoples' lives should really extend their productive years, which means keeping the brain young and spongy, sucking info and applying it effortlessly. Just adding retirement years is a burden no nation can soon afford to even try. We benefit of many generations who worked before us and created technology. Even before the exponential elbow of recent times, there was plenty of technology that we afforded to take for granted. Yes. It takes much thinking to even begin to appreciate how much we've got from earlier generations. It's all too easy to say that there was nothing we need before the telegraph and the steam engine.
Re: [OT] [I mean totally OT] Re: What can you new
Georg Wrede wrote: That's the first series I'd consider buying a box set. Waste of money time. Buy Band of Brothers instead.
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sergey Gromov wrote: Sun, 29 Mar 2009 09:29:33 +0200, Jérôme M. Berger wrote: Sergey Gromov wrote: Sat, 28 Mar 2009 15:38:45 +0300, Yigal Chripun wrote: Now, how would you make money on free, as in libre, software? How would you make a free, single-player RPG and still stay in business? All you can under GPL is take payment for distribution, as long as nobody else starts to distribute it for free. This means giving your hard work for free, as in gratis, not business. Ask RedHat, or any of the increasingly large number of companies that *do* make money on free, as in libre, software. Basically, you make your customers pay for specific developments and customizations. Once the software is released you still get paid for tech support and maintenance. Yeah, sure. How much support a single-player game needs? Or a 3D-modeling tool? I agree with Nick: to make a profit on support you must create something unusable in the first place, and then charge money for fixing it. A single player game does not need any support, but a game is not just software. So you can make a free game engine and have proprietary data (of course, that would mean spending some time on gameplay and scenario and so on, which most game companies don't do anyway, they'd rather add some more useless special effects and use the same old script and gameplay). As for the 3D modelling tool, I hope you're kidding? Even though they use mostly proprietary tools a lot of the budget of films go to custom extensions to whatever tool they're using. There's a huge profit to be made there even if the base software was free. I agree that you can't make money with free software on the consumer market, but most proprietary software companies don't make their money there either (the main exception being games). Most software companies make money on the B2B market and they *always* sell additional support (whether it's help to setup the software, special customizations or formations for the users and admins), so they could put the software under a free licence and still make money (and more and more of them do so). I agree that support is sometimes a valid business model, like when you create customized Linux kernels for various hardware and requirements. But it's definitely not universal enough to apply to every software created out there. I didn't say it could apply to *all* software, I do say it could apply to *most* (and your previous post stated that it couldn't apply to any). Jerome PS: making something unusable and charge for fixing it won't work with free software: if you were unable to get it right at first who will trust you to fix it right? They're much more likely to hire someone else to do it for them... - -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknP3tsACgkQd0kWM4JG3k9KcwCff8prkElFXsw5WI45AZ+vnxfA BJgAoKtvsx9oqZyE2VwptZex6GMVV9pA =MGxL -END PGP SIGNATURE-
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
== Quote from Georg Wrede (georg.wr...@iki.fi)'s article Seems BSD should be Our Way: [...] has a downside, the downside is that people, especially lawyers, especially corporate bosses look at the GPL and experience fear. Fear that all of their corporate secrets, business knowledge, and special sauce will suddenly be everted to the outside world by some inadvertent slip by some internal code. I think that fear is now costing us more than the threat[...] http://osnews.com/story/21192/ESR_GPL_No_Longer_Needed Unrelated to this, but interesting, too: Microsoft Server/Tools boss Muglia said that at some point, almost all our product(s) will have open source in (them). He went on to say that if MySQL (or) Linux do a better job for you, of course you should use those products. Well I'll be darned. I thought they'd get that like 5 years from now. (Hmm, maybe everybody should stick to the GPL, after all...) http://osnews.com/story/21053/Muglia_Open_Source_To_Permeate_Microsoft Been thinking about this, and I think one of the things that the GPL really does help with, for all its flaws, is resisting embrace, extend, extinguish tactics. I'm not sure how practical it would be to make a license like the following stand up in court and be unambiguous, but here's a very informal plain English version of a license that I think would in principle be a good compromise between permissive and copyleft: Anyone receiving this code may modify, redistribute it, etc. in both binary and source form without any except those mentioned below. All warranties are disclaimed. If you redistribute modified versions of this code in proprietary/closed source form, you must specify any information necessary to allow other similar software to interoperate with your product. This includes file formats, network protocols, etc. You do not need to provide an implementation, only a reasonably implementable specification. Any modifications that do not affect interoperability may be made and released with no strings attached.
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: You don't have to look far back to see many examples of superior technology burying a far more powerful foe. For example, there are several cases where a handful of stringbag airplanes sank capital battleships. Stirling's Island in the Sea of Time is about bringing modern weapons to bronze-age battlefields. Then, of course, there’s Arthur C. Clarke’s “Superiority”, that turns this trope on its head. —Joel Salomon
Re: Keeping a list of instances and garbage-collection
On Sun, Mar 29, 2009 at 4:42 PM, Leandro Lucarella llu...@gmail.com wrote: This was discussed several times in the past. For example: http://www.digitalmars.com/d/archives/digitalmars/D/learn/weak_references_13301.html http://www.digitalmars.com/d/archives/digitalmars/D/learn/Soft_weak_references_8264.html http://www.digitalmars.com/d/archives/digitalmars/D/announce/ANN_WeakObjectReference_-_class_to_hold_weak_references_9103.html etc. I hope it helps. The one provided by Bill: http://www.dsource.org/projects/scrapple/browser/trunk/weakref seems to work fine, and has the advantage of working in both Phobos and Tango.
Re: [OT] [I mean totally OT] Re: What can you new
On Sun, 29 Mar 2009 12:17:33 -0700, Walter Bright newshou...@digitalmars.com wrote: Sean Kelly wrote: The problem I ran into is that the audio is mixed with the music about the same volume as the voices, and it almost seems like they applied so effects to the voice audio to make it sound more like they were talking in a big metal room. In any case, I always had trouble hearing dialog clearly in that show, and often messed with the audio settings on my TV to boost that frequency range in hopes of hearing it better. That's what I get for not wearing ear plugs all those years I spent at loud concerts, I suppose. I've been having increasing problems understanding TV dialog, too. It sounds like they're mumbling their lines. Apparently the sound mixing is causing older audiences difficulties. http://www.guardian.co.uk/film/filmblog/2009/mar/02/john-cleese-film Gide
Re: Keeping a list of instances and garbage-collection
Simon TRENY wrote: Hello, I have a class A and I'd like to keep a list of all the created instances of this class. To do that, I have a static List!(A) in the A class and, in the constructor, I add each new instance to this list. This gives me the following code: class A { private static List!(A) s_instances; public this() { s_instances.add(this); } public ~this() { s_instances.remove(this); } public static void printAll() { foreach (A instance; s_instances) print(instance.toString()); } } But then, since all the instances are referenced by the static list, they are never garbage-collected, which could be a problem. In some other languages, this can be solved using weak references, but I haven't found any informations about using weak references in D. Is there any way to solve this problem? Thanks, Simon Maybe what you are looking for are the GC.removeRoot or GC.removeRange functions which are available in both Phobos and Tango? http://www.dsource.org/projects/tango/docs/current/tango.core.Memory.html http://www.digitalmars.com/d/2.0/phobos/std_gc.html http://www.digitalmars.com/d/1.0/phobos/std_gc.html
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: Hello Georg, [...] I'll grant it's a hard job, but look at WW-II, throw in some large ugly unifying force and Stuff Gets Done! Well, for example, when the Allied ganged up against Hitler, there were more than a hundred million people /focused/ on one single thing: to get him out before he gets us. /Nothing/ else had priority. Even housewives did the best they could to help, including nursing each others kids so the others could go to work making bombs. So, _one_hundred_million_ really determined people, a few years, and they made some simple airplanes and war boats, some explosives, and guns. (OK, I'm putting this down a little... They also trained some guys to walk across France with assault rifles. :-) ) But the whole point is, they were a lot more than a couple of thousand, they had the infrastructure all in place, a ready society, and a common enemy! And it *still* took a couple of years to get up to D-day. Heck, look at 1900-2009. I'd say that most of the tech that existed in 1900 could be built from the ground up in under 50 years if the people didn't needed to do any RD and are motivated enough. Reread my post. It's easier for the whole world than for a couple of thousand guys. There's simply too much to do. And, like Andrei said, too much expertise needed [for the nontrivial things] to have time to learn it all by that number of guys. As for some hard numbers, I recall a NOVA show where a construction planner was asked to set up a time line for the pyramids using period tech. The time line was under 3 years (2.5 IIRC). Say 2000 men and 3 years. But stacking stones is a bit easier than doing rocket science, right? Building rockets is not just stacking iron, most of it is the rocket science, and that takes reading, thinking, and asking each other. A lot. And even if they had full blueprints, there's an awful lot of parts to make, and a crapload of fuel to make. And the fuel factory, with or without blueprints. Just to get a measure, write on a piece of paper how many hours you would need to write a Monopoly (the board game) server that servers 1 players, on a PC. One honest and careful estimate, according to your own programming skills. Then, do that many hours of work on it, and see how many percent of the work you got done in that time. (If that's too big a project, then do a TicTacToe server.) I don't want the answer. It's for yourself.
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: BCS wrote: that actually was a problem, the orcs were all AI driven CGI and for a while they had an issue if orcs running away from where they were supposed to get slaughtered. Skynet 1.0 has some bugs! Yeah; in 2.0, they changed bool runningAway = false; to this: invariant bool runningAway = false; -- Daniel
Re: [OT] [I mean totally OT] Re: What can you new
Andrei Alexandrescu wrote: Speaking of which (damn ranting and subject changing!) I think the Medieval Ages were a stain on our history. I read somewhere how at the beginning of that dark time there was actual *loss* of technology: they had these aquaducts and pumps and mechanisms and whatnot from the Romans and didn't know how to repair them anymore, so they just let them go decrepit. Very scary. Jerry Pournelle defines a Dark Age as a time when not only is the knowledge of how to do things forgotten, but even that these things are possible. Usually folks’d ascribe some large construction (like the pyramids, the walls of Crete, c.) to magic or the gods or some such. —Joel Salomon
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Christopher Wright wrote: Walter Bright wrote: The Battlestar Galactica finale where they just sent all their tech into the sun and went native is a romantic delusion. Thanks for ruining it for me! (Actually, thanks. I was never going to watch it anyway.) You didn't miss anything. I've only watched a handful of episodes. I found it to be so dark, literally, that I had a hard time seeing what was going on on my TV screen. Don't forget that all their camera operators apparently suffer from extreme Parkinson's disease! The one cool thing I ever saw of BG was a clip online where they drop the Galactica through a planet's atmosphere to get their fighters deployed faster, then do a faster-than-light jump split seconds before they hit the ground. Very cool. -- Daniel
Re: Keeping a list of instances and garbage-collection
Jarrett Billingsley wrote: On Sun, Mar 29, 2009 at 4:42 PM, Leandro Lucarella llu...@gmail.com wrote: This was discussed several times in the past. For example: http://www.digitalmars.com/d/archives/digitalmars/D/learn/weak_references_13301.html http://www.digitalmars.com/d/archives/digitalmars/D/learn/Soft_weak_references_8264.html http://www.digitalmars.com/d/archives/digitalmars/D/announce/ANN_WeakObjectReference_-_class_to_hold_weak_references_9103.html etc. I hope it helps. The one provided by Bill: http://www.dsource.org/projects/scrapple/browser/trunk/weakref seems to work fine, and has the advantage of working in both Phobos and Tango. First, I doubt this actually works. The WeakRef stores the pointer as size_t, but the GC is conservative and will still recognize the size_t as a pointer. The unittest in the existing code only works, because he uses an explicit delete on the referenced object. To actually hide the pointer from the GC, you could XOR the size_t value with a constant. Note that you need to be very careful with the WeakRef.ptr() function: what happens, if the GC invalidates the object, and then the user calls ptr() in parallel, before the GC calls rt_detachDisposeEvent()? The user will get an invalid pointer. As far as I remember, rt_detachDisposeEvent() is supposed to be called when all threads have been resumed (after a collect() run). This is to avoid deadlocks if the dispose handler locks something. Secondly, this should be extended by a ReferenceQueue (like in Java). As soon as the object referenced by the WeakRef is collected, it is added to the ReferenceQueue associated with the WeakRef. (In Java, ReferenceQueue.remove() also provides a roundabout way to notify the program when a reference has been collected.) And finally: why is this thing not in Tango? Maybe a Tango dev could comment on this and the correctness issues mentioned above?
Re: [OT] [I mean totally OT] Re: What can you new
Georg Wrede wrote: ... It's a conspiracy. You need to turn the volume up to understand, and meanwhile the entire house hears the bangs and shots, and everybody has to come and see. Same with commercials (at least around here) they got the nice idea to send commercials a lot louder than the program, so everybody in the building (including your freaking neighbors) has to hear what detergent to buy. #...@%!@#!!! I'd say that's harrassment and trespassing. I have this long list of what I'd do if I was made Prime Minister. One of the entries relates to outlawing advertising firms and anything other than plain text ads with maybe a voice at a sensible volume over the top. (Rivers does this, bless 'em, and I always make a point of paying attention to their ads if I happen to see one.) Then, to really bugger 'em up, I'd make it law that if there's anything in an ad that you can't support with concrete evidence, you get hanged. Enough of this five out of six fluffy ducks love our toilet paper best or Australia's favourite or any of the other bullshit they use. Let's see how eager they are to make stuff up when it's their neck on the line... They can keep the cannes ad awards, though; if only as a hobby. Check out any movie from the fifties, and all of a sudden you aren't old anymore: you can actually hear what they say. Without burning the amp or your nerves! Probably because it was when they still gave a rats about quality and not annoying the crap out of the viewer. I guess this is all endemic of the media industry these days. I mean, I got so furious with all the bullshit going on that I just completely stopped buying/renting movies and music. I've actually thought of buying a 5.1 sound system, for the sole purpose of turning everything else down, except the dialog speaker. (The one on top of the TV.) But I've been too lazy to go to a store and test if it actually would work. Does anybody know? See, I just turn on subtitles. I guess I got used to them from watching Anime with Japanese language and English subs, so it really doesn't bother me. @#...@$#!!! And they used to have this logo screen between commercials and programming, but now they've got rid of it, so when I watch a movie, I literally have to have the remote in my hand so I can be ready to cut the volume before everybody wakes up. Technology advances indeed. I have a great solution to this: I don't watch TV. The only exception I make on any vaguely regular basis is to turn it on to watch TopGear (when someone reminds me, since I have an atrocious memory for this.) Sometimes, I wonder how far above my own the general public's tolerance for being treated like cattle is. Just how far do the media and TV companies have to push people before society at large turns around and hacks their hands off with a blunt spoon... -- Daniel
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Andrei Alexandrescu wrote: Walter Bright wrote: Sean Kelly wrote: I'd bet it takes longer. Even with incredible knowledge, they'd have to build the technology from scratch, starting with improvised tools. Huh, 99% of the people will be full time engaged just in food production. Well at some point it was said that a McDuff device provides food. McDuff is right. Trying to get enough food to eat has been the bane of human existence for essentially our entire existence. The current obesity epidemic is a startling anomaly. Aye... except, of course, for all the people starving to death. I get the sneaking suspicion that it's less a problem of too much food and more of too much of the food in too few places. We seemingly have the same problem with money, too. :P -- Daniel
Re: [OT] [I mean totally OT] Re: What can you new
On Sun, Mar 29, 2009 at 5:57 PM, Joel C. Salomon joelcsalo...@gmail.com wrote: Andrei Alexandrescu wrote: Speaking of which (damn ranting and subject changing!) I think the Medieval Ages were a stain on our history. I read somewhere how at the beginning of that dark time there was actual *loss* of technology: they had these aquaducts and pumps and mechanisms and whatnot from the Romans and didn't know how to repair them anymore, so they just let them go decrepit. Very scary. Jerry Pournelle defines a Dark Age as a time when not only is the knowledge of how to do things forgotten, but even that these things are possible. Usually folks’d ascribe some large construction (like the pyramids, the walls of Crete, c.) to magic or the gods or some such. Indeed. The European Dark Ages were dominated by views that humans were inherently flawed; that everyone was born a sinner; that you were predestined to go to either heaven or hell and there was nothing you could do to change that. There was pretty much a complete loss of faith in the capabilities of humanity itself. It wasn't until the renaissance that humanistic thought made a return and caused politics, science, and technology to simply explode in development. Heck, even most of the work of the ancient Greeks and Romans was lost, either unavailable to the public at large due to a lack of printing technology and literacy, or simply disregarded as heresy. Some incredible writings had the ink stripped off the pages and were reused in copying the Bible or other liturgical works. Incredible.
Re: Keeping a list of instances and garbage-collection
grauzone wrote: Jarrett Billingsley wrote: On Sun, Mar 29, 2009 at 4:42 PM, Leandro Lucarella llu...@gmail.com wrote: This was discussed several times in the past. For example: http://www.digitalmars.com/d/archives/digitalmars/D/learn/weak_references_13301.html http://www.digitalmars.com/d/archives/digitalmars/D/learn/Soft_weak_references_8264.html http://www.digitalmars.com/d/archives/digitalmars/D/announce/ANN_WeakObjectReference_-_class_to_hold_weak_references_9103.html etc. I hope it helps. The one provided by Bill: http://www.dsource.org/projects/scrapple/browser/trunk/weakref seems to work fine, and has the advantage of working in both Phobos and Tango. First, I doubt this actually works. The WeakRef stores the pointer as size_t, but the GC is conservative and will still recognize the size_t as a pointer. The unittest in the existing code only works, because he uses an explicit delete on the referenced object. If the WeakRef is on the stack, this is true. If the WeakRef is part of an aggregate type that contains pointers, this is true. Otherwise, the GC will see that the relevant block is marked as having no pointers. To actually hide the pointer from the GC, you could XOR the size_t value with a constant. Note that you need to be very careful with the WeakRef.ptr() function: what happens, if the GC invalidates the object, and then the user calls ptr() in parallel, before the GC calls rt_detachDisposeEvent()? The user will get an invalid pointer. As far as I remember, rt_detachDisposeEvent() is supposed to be called when all threads have been resumed (after a collect() run). This is to avoid deadlocks if the dispose handler locks something. True -- weakref is a difficult thing to make thread-safe.
Re: [OT] [I mean totally OT] Re: What can you new
Andrei Alexandrescu wrote: When I'll see loss of technology happening, I'll now we're in big trouble. I hope it won't happen in my lifetime, or ever. Hi-tech export restrictions are a good start. Forbidding teaching Darwin in schools. Forbidden encryption software. Forbidden stem cell research. It's here. There are better examples, but this is not a Politically Incorrect Forum... Although it seems to be getting a lot better now, with the change in power. And nobody can guarantee that the EU and US will outlast us. The USSR didn't. And simply nobody believed it would disappear within our lifetime. (One day I stood in the cafe at the top of the WTC, looking at the sunset. I still remember thinking I'll be long gone in 50 years, but this building will probably be here for a thousand years. http://en.wikipedia.org/wiki/File:Manhattan_from_helicopter_edit1.jpg) Once the big change comes, you can bet your last cent that those who take over will have a whole new idea of what is good an bad for you. (Technology-wise, the demise of the USSR or East Germany was no loss, but that was an exception compared to the US or the EU.) I really hope nothing will happen while my kids are around.
Re: Keeping a list of instances and garbage-collection
Part of the reason I wrote it and made it available was to serve as a focal point for such critiques. If you think it doesn't work and can fix it, please do so! --bb On Mon, Mar 30, 2009 at 7:00 AM, grauzone n...@example.net wrote: Jarrett Billingsley wrote: On Sun, Mar 29, 2009 at 4:42 PM, Leandro Lucarella llu...@gmail.com wrote: This was discussed several times in the past. For example: http://www.digitalmars.com/d/archives/digitalmars/D/learn/weak_references_13301.html http://www.digitalmars.com/d/archives/digitalmars/D/learn/Soft_weak_references_8264.html http://www.digitalmars.com/d/archives/digitalmars/D/announce/ANN_WeakObjectReference_-_class_to_hold_weak_references_9103.html etc. I hope it helps. The one provided by Bill: http://www.dsource.org/projects/scrapple/browser/trunk/weakref seems to work fine, and has the advantage of working in both Phobos and Tango. First, I doubt this actually works. The WeakRef stores the pointer as size_t, but the GC is conservative and will still recognize the size_t as a pointer. The unittest in the existing code only works, because he uses an explicit delete on the referenced object. To actually hide the pointer from the GC, you could XOR the size_t value with a constant. Note that you need to be very careful with the WeakRef.ptr() function: what happens, if the GC invalidates the object, and then the user calls ptr() in parallel, before the GC calls rt_detachDisposeEvent()? The user will get an invalid pointer. As far as I remember, rt_detachDisposeEvent() is supposed to be called when all threads have been resumed (after a collect() run). This is to avoid deadlocks if the dispose handler locks something. Secondly, this should be extended by a ReferenceQueue (like in Java). As soon as the object referenced by the WeakRef is collected, it is added to the ReferenceQueue associated with the WeakRef. (In Java, ReferenceQueue.remove() also provides a roundabout way to notify the program when a reference has been collected.) And finally: why is this thing not in Tango? Maybe a Tango dev could comment on this and the correctness issues mentioned above?
Re: Keeping a list of instances and garbage-collection
Christopher Wright wrote: grauzone wrote: Jarrett Billingsley wrote: On Sun, Mar 29, 2009 at 4:42 PM, Leandro Lucarella llu...@gmail.com wrote: This was discussed several times in the past. For example: http://www.digitalmars.com/d/archives/digitalmars/D/learn/weak_references_13301.html http://www.digitalmars.com/d/archives/digitalmars/D/learn/Soft_weak_references_8264.html http://www.digitalmars.com/d/archives/digitalmars/D/announce/ANN_WeakObjectReference_-_class_to_hold_weak_references_9103.html etc. I hope it helps. The one provided by Bill: http://www.dsource.org/projects/scrapple/browser/trunk/weakref seems to work fine, and has the advantage of working in both Phobos and Tango. First, I doubt this actually works. The WeakRef stores the pointer as size_t, but the GC is conservative and will still recognize the size_t as a pointer. The unittest in the existing code only works, because he uses an explicit delete on the referenced object. If the WeakRef is on the stack, this is true. If the WeakRef is part of an aggregate type that contains pointers, this is true. If WeakRef is a class, this is also true. Because all objects contain a hidden monitor pointer, and the monitor is subject to garbage collection AFAIK. Otherwise, the GC will see that the relevant block is marked as having no pointers. True -- weakref is a difficult thing to make thread-safe. It seems there's still work to do, and a thread-safe WeakRef can't be created with the current interfaces. Is this true? I'm thinking rt_attachDisposeEvent() should take a *pointer* to the reference instead of the reference itself (effectively a double pointer), and clear this pointer during garbage collection, when all threads are still globally locked.
Re: [OT] [I mean totally OT] Re: What can you new
Daniel Keep wrote: Then, to really bugger 'em up, I'd make it law that if there's anything in an ad that you can't support with concrete evidence, you get hanged. Enough of this five out of six fluffy ducks love our toilet paper best or Australia's favourite or any of the other bullshit they use. Let's see how eager they are to make stuff up when it's their neck on the line... Oh yes!! Today, I'm having a hard time telling my kids not to lie, while all the TV ads do is blatant lying. They can keep the cannes ad awards, though; if only as a hobby. Check out any movie from the fifties, and all of a sudden you aren't old anymore: you can actually hear what they say. Without burning the amp or your nerves! Probably because it was when they still gave a rats about quality and not annoying the crap out of the viewer. I guess this is all endemic of the media industry these days. I mean, I got so furious with all the bullshit going on that I just completely stopped buying/renting movies and music. I've actually thought of buying a 5.1 sound system, for the sole purpose of turning everything else down, except the dialog speaker. (The one on top of the TV.) But I've been too lazy to go to a store and test if it actually would work. Does anybody know? See, I just turn on subtitles. I guess I got used to them from watching Anime with Japanese language and English subs, so it really doesn't bother me. Well, I learnt all my English from watching and listening while reading local subtitles. I'd hate to turn off the volume. Sometimes, I wonder how far above my own the general public's tolerance for being treated like cattle is. Just how far do the media and TV companies have to push people before society at large turns around and hacks their hands off with a blunt spoon... Well, if folks download movies and music, the industry sure makes them have less of a bad conscience. And soon more people will do it, just to get even with the industry. Most of my TV watching is either recordings, or time-shift, where I can skip commercials even when I watch live.
Re: Keeping a list of instances and garbage-collection
grauzone: First, I doubt this actually works. [...] To actually hide the pointer from the GC, you could XOR the size_t value with a constant. This is may be a stupid idea: Can't the OP just allocate with std.c.stdlib.malloc a block of void* pointers (plus keep an int length too), fill them with the object references and and then cast one of them back to object reference when necessary? Objects of such class can keep a similarly C-heap pointer to the cell of the block that contains its reference, and set it to null when they are removed. It's not a general solution yet and it looks a bit messy. Weak references may just need to be added to Phobos/Tango GC, if not present. Bye, bearophile
Re: [OT] [I mean totally OT] Re: What can you new
Andrei Alexandrescu wrote: Speaking of which (damn ranting and subject changing!) I think the Medieval Ages were a stain on our history. I read somewhere how at the beginning of that dark time there was actual *loss* of technology: they had these aquaducts and pumps and mechanisms and whatnot from the Romans and didn't know how to repair them anymore, so they just let them go decrepit. Very scary. I seem to remember reading from science mags that the ancient Greeks were close to building, if they hadn't already succeeded to, mechanical calculators. I also remember reading about some kind of batteries, but can't remember which ancient civilization it was that had discovered them. Scientists are only now managing to piece out pre-Dark Ages technology and how advanced it really was. Now, if only the ancient times had continued to develop scientifically... who knows where we'd be now? It's not hard to imagine the computer being invented around 500 AD or so, if the current theories of ancient times hold up. For some reason, the scientific development seems to have halted and even taken steps back in areas christianity spread to in ancient times, and only in the last about half a millenia has technological progress resumed.
Re: [OT] [I mean totally OT] Re: What can you new
Hello Christopher, It was quite annoying, but I found a solution: don't watch broadcast television. There are friendly people on the internet who have already removed the commercials for me. hulu.com grand total of about 2 minutes of non show tops. I don't even own a TV.
Re: [OT] [I mean totally OT] Re: What can you new
Joel C. Salomon wrote: Jerry Pournelle defines a Dark Age as a time when not only is the knowledge of how to do things forgotten, but even that these things are possible. Usually folks’d ascribe some large construction (like the pyramids, the walls of Crete, c.) to magic or the gods or some such. I remember one of those idiot In Search Of... type shows in the 70's saying that the fit of stones in South America was so tight you couldn't put a knife blade between them. Therefore, the stone walls must have been made by aliens. Never mind why would aliens with such advanced tech would build a crooked lumpy stone wall like that anyway. But a few years later, some archeologist demonstrated how to make such a fit by banging a couple stones together. Took him 30 minutes per surface. No aliens or even tools were required.
The Case for D
I am writing an article for a programming magazine entitled The Case for D. Would anyone be interested in reviewing it before publication? Please send me private email if so. I will need to limit the number of reviewers to a fraction of the responders, and one hard requirement is that they must be regulars on this group. It's a rather long read but also light. Please let me know. Thanks! Andrei
Re: [OT] [I mean totally OT] Re: What can you new
Walter Bright wrote: Joel C. Salomon wrote: Jerry Pournelle defines a Dark Age as a time when not only is the knowledge of how to do things forgotten, but even that these things are possible. Usually folks’d ascribe some large construction (like the pyramids, the walls of Crete, c.) to magic or the gods or some such. I remember one of those idiot In Search Of... type shows in the 70's saying that the fit of stones in South America was so tight you couldn't put a knife blade between them. Therefore, the stone walls must have been made by aliens. Never mind why would aliens with such advanced tech would build a crooked lumpy stone wall like that anyway. But a few years later, some archeologist demonstrated how to make such a fit by banging a couple stones together. Took him 30 minutes per surface. No aliens or even tools were required. I've not heard about that, any good links on the subject? Some of the rocks at Sacsayhuaman were pretty dang huge, though.
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: Hello Christopher, It was quite annoying, but I found a solution: don't watch broadcast television. There are friendly people on the internet who have already removed the commercials for me. hulu.com grand total of about 2 minutes of non show tops. I don't even own a TV. Only a valid point if you happen to live in the US. -- Daniel
Re: [OT] [I mean totally OT] Re: What can you new
Rioshin an'Harthen wrote: Andrei Alexandrescu wrote: Speaking of which (damn ranting and subject changing!) I think the Medieval Ages were a stain on our history. I read somewhere how at the beginning of that dark time there was actual *loss* of technology: they had these aquaducts and pumps and mechanisms and whatnot from the Romans and didn't know how to repair them anymore, so they just let them go decrepit. Very scary. I seem to remember reading from science mags that the ancient Greeks were close to building, if they hadn't already succeeded to, mechanical calculators. I also remember reading about some kind of batteries, but can't remember which ancient civilization it was that had discovered them. Scientists are only now managing to piece out pre-Dark Ages technology and how advanced it really was. Now, if only the ancient times had continued to develop scientifically... who knows where we'd be now? It's not hard to imagine the computer being invented around 500 AD or so, if the current theories of ancient times hold up. For some reason, the scientific development seems to have halted and even taken steps back in areas christianity spread to in ancient times, and only in the last about half a millenia has technological progress resumed. It seems the major purpose of religion is to retard the progress of science [1]. Just look at the intelligent design movement. Or hell, Scientology. Every time I can begin to hope that humanity has reached the point where everyone is free to believe whatever they choose without being set upon by people who believe differently, some group of insane gits comes along and just has to spoil it. Disclaimer: I'm an atheist who believes everyone should be free to believe whatever they like. -- Daniel [1] Which is a diplomatic way of saying to keep people stupid and gullible. No offence to any religious people on the NG; it's not individuals I have problems with, it's *institutionalised* belief.
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to
Yigal Chripun Wrote: That is why there are many successful companies that base their business model on free licenses like the GPL and zero companies that use the BSD. The Apple OS X is a BSD derivative: http://en.wikipedia.org/wiki/Mac_OS_X Mac OS X is based upon the Mach kernel.[7] Certain parts from FreeBSD's and NetBSD's implementation of Unix were incorporated in Nextstep, the core of Mac OS X.
Re: Eric S. Raymond on GPL and BSD licenses. Microsoft coming to Linux
Yigal Chripun wrote: On 29/03/2009 08:26, Mike Parker wrote: Yigal Chripun wrote: How many companies do you know that use the BSD for their products? BSD is used by universities and non-profit organizations not companies. claiming that BSD GPL in a corporate environment is simply wrong. That's not the point. Plenty of companies use open source libraries in their code, even if they don't open source the end product. BSD is friendlier to them because they aren't forced to open up everything that touches it. GPL is viral. Use one GPL library and your whole project is tainted. Philosophically, GPL gives freedom to the end user. BSD leaves freedom with the developer. IMO, the latter is where it should be, as it is the developer who expends the resources to create the product in the first place. you contradict yourself. if a company uses open source libraries in their products than they are the *users* of the code, and the *developers* are those who *created* the library. what you meant to say is that many companies _exploit_ non free open source code (BSD and such) in their closed source products. You do all the hard work, give away your library for free, and those companies exploit that to enlarge their profit margins, after all they invested much less time/money in the product. if you really intended this outcome, you just robbed someone's job at that same company. When someone release a under a library under a more generous license like the BSD, they know full well that anyone can use that source in closed-source, proprietary software. Companies who do so are not *exploiting* anyone or anything. They are given permission by the developers of the library, who consciously made that choice, to do so. The GPL gives freedom to both the developers and the end-users while the BSD doesn't give any freedoms at all, to no one. That is why there are many successful companies that base their business model on free licenses like the GPL and zero companies that use the BSD. and that is the point. No, it gives no freedom to developers at all. Using any GPL code in your project /forces/ you to open your source. It takes the decision of whether to open or not out of your hands and puts it in the hands of the whomever create GPLed product you use. That's why you won't find bindings for any GPL libraries in Derelict, because then Derelict and any project that uses it would have to be GPL. You call that freedom?
Re: [OT] [I mean totally OT] Re: What can you new
Ellery Newcomer wrote: Walter Bright wrote: I remember one of those idiot In Search Of... type shows in the 70's saying that the fit of stones in South America was so tight you couldn't put a knife blade between them. Therefore, the stone walls must have been made by aliens. Never mind why would aliens with such advanced tech would build a crooked lumpy stone wall like that anyway. But a few years later, some archeologist demonstrated how to make such a fit by banging a couple stones together. Took him 30 minutes per surface. No aliens or even tools were required. I've not heard about that, any good links on the subject? Sorry, saw it on TV long ago. Some of the rocks at Sacsayhuaman were pretty dang huge, though. The same principle should work.
Re: [OT] [I mean totally OT] Re: What can you new
Daniel Keep wrote: I have this long list of what I'd do if I was made Prime Minister. One of the entries relates to outlawing advertising firms and anything other than plain text ads with maybe a voice at a sensible volume over the top. (Rivers does this, bless 'em, and I always make a point of paying attention to their ads if I happen to see one.) I'd be happy with removing the stupidest ones for now. I hate the Geico ads with the idiotic wad of cash. Apparently they decided the gecko and the cavemen were too subtle for the public. Andrei
Re: [OT] [I mean totally OT] Re: What can you new
Hello Daniel, [1] Which is a diplomatic way of saying to keep people stupid and gullible. No offence to any religious people on the NG; it's not individuals I have problems with, it's *institutionalised* belief. I'm a cristian, but even so I'll *almost* go with you there. it's not institutionalised belief that is the problem but where faiths systems get the *power to force* people to beleave and not to question. And it's not just in theology that I find this a problem; take a look at the (not unbiased) documetery Expelled (http://www.expelledthemovie.com), people are getting ostrosized for questionig the party line on evolution. Some of these people aren't even getting past maybe without getting shot down. Faith done right is the greatest power for good man will ever see. Faith done wrong is the greatest power for evil that can ever be.
Re: [OT] [I mean totally OT] Re: What can you new
BCS wrote: And it's not just in theology that I find this a problem; take a look at the (not unbiased) documetery Expelled (http://www.expelledthemovie.com), people are getting ostrosized for questionig the party line on evolution. Some of these people aren't even getting past maybe without getting shot down. This is hardly limited to religious beliefs. It happens with political correctness, too. Look at the recent slashdot article where Dyson dares to question global warming: http://news.slashdot.org/article.pl?sid=09/03/28/1558225 My own theory is that the shriller a person cries to suppress wrong beliefs, the more that person fears their own beliefs might be the ones that are wrong. Or perhaps everyone just enjoys a public stoning now and then :-(