Slashdot Mirror


User: vidarh

vidarh's activity in the archive.

Stories
0
Comments
3,183
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 3,183

  1. Re:Standard C++ Easier on GCC Gets PCH Support And New Parser · · Score: 2
    You are NOT overriding the rules of the language. A non const value can ALWAYS legally be made const. This has a lot of value for instance in implementing const member functions that operate on STL containers. Example:

    class Foo { typedef std::map<std::string, std::string> Data; Data m_data; public: std::string getBar(const std::string & key) const { Data::const_iterator i = m_data.find(key); if (i == m_data.end()) return ""; return i->second; } };

    This is a common and useful idiom (btw. for people less experienced with C++: using [] to check for existence of a value in a map is a BAD thing, as the [] operator always create a new element if it can't find an existing matching element).

    Personally I find that I use const_iterator all over the place, most of the time with non-const containers, as I tend to keep the number of operations that mutate data members to a minimum, and const_iterator serves the dual purpose of protecting me from accidentally introducing bugs and making my const member functions correct.

    Personally I don't see much value of auto in the first place, and in this case I'd be unable to use it most of the time, while a proper typeof operator give the flexibility of auto and work with my case and provide lots of other benefits without the problem of overloading the meaning of yet another keyword (it's bad enough with static).

  2. Re:Standard C++ Easier on GCC Gets PCH Support And New Parser · · Score: 2

    But this is not always what you want. I often use const_iterator's when iterating over a non-const container, because the iteration in question have no need to change the container - it helps reducing the chance of accidentally calling functions that would change the container in places where you don't want to change it.

  3. Re:This is just the first battle. on 'DVD Jon' Acquitted On All Counts in DeCSS Case · · Score: 2

    From day one. EU directives in most areas except for external tarrifs, security, foreign policy and agriculture are binding on all EEA member states, but non-EU EEA members (Norway and Iceland) does not have a vote when the EU directives are decided on.

  4. Re:This is just the first battle. on 'DVD Jon' Acquitted On All Counts in DeCSS Case · · Score: 2

    Norway is a member of the EEA (European Economic Area), and hence is obligated to implement it regardless of not being a member of EU.

  5. Re:Nice and all on Genetic Algorithm Improves Shellsort · · Score: 2
    You're confusing GA and GP (genetic programming). GA usually refer to a case where the program is fixed, and the genes only consists of parameters to the program. With genetic programming, your issues are valid, however they can be worked around:

    - A lot of simplification of a program can be automated. Some of that simplification work will require significant work to implement, but it's doable. Other parts of the simplification can be done by changing the fitness function once you have an efficient algorithm: In addition to performance or whatever criteria used, you add measurements for program size and complexity as secondary influences on the fitness.

    - Robustness of the language the program is generated in can be strengthened. Typically GP uses custom domain specific languages. This both simplifies understanding, and prevent crashes.

    - The experiments can be rerun with additions to the language used that group constructs that are complex but understood in order to attempt to simplify the solutions. The population can be steered towards using these constructs by rewarding them in the fitness function.

    All in all, GP is very promising for certain types of problems, but it shouldn't be understood at "press this button and out comes a polished working program", rather as a tool to approach problems that are hard to analyse (especially where there is no 100% "correct" solution, or a correct solution is extremely hard to find, but gradual approximation has the potential of working well enough). GA and GP also has great potential wherever requirements change slowly over time and the software needs to adapt, as a way of preventing manual tweaking.

    Imagine a lift control GA, for instance (actually used as an example in Dr Dobbs some time ago), where a near optimal solution could be used as a starting point for the lifts behavior. However "traffic patterns" in a building change - new tenants move in, old ones move out, departments move and create changes in which floors have the heaviest traffic, and which floors the traffic is between, and a GA could quite possibly be used to automatically adapt to such changes.

    On a sidenote, before anyone raise concerns over letting a "random" program run a lift, the whole point here is that a GA isn't random. You use a hard coded algorithm that enforce rules for what is acceptable and what not. For a lift, of course, you'd have low level requirements such as breaking at a specific speed, and high level requirements such as newer changing direction before all the floors requested in the current direction have been visited.

    The GA will only adapt the parameters you choose to surrender control of, such as whether or not the lifts should move when not requested (some of them moving to a specific floor for lunch time, for instance), and how long to wait before doing so.

  6. Re:I don't get this "refund" thing. on Windows Refund Day II · · Score: 3, Insightful
    Whether you agree with me or not doesn't matter, and how a "dumb end user" look at a computer and an OS doesn't matter. The facts of the matter is that most countries have laws determining when tying is legal and not, and in practically any such countries a vital part of the test for when products should be available separately is that there is an identifiable demand for the separate product that is large enough that a manufacturer may provide the products separately in a reasonably efficient manner.

    In the case of computers, that demand is provably there, as several manufacturers do sell reasonable quantities of computers without operating systems, and the cost of doing so is low.

    Whether or not the OS or the computer "do much" without the other isn't relevant. A card doesn't "do much" without fuel, yet you don't consider a car and fuel to be one product and allow the auto industry to sell cars bundled with a lifetime supply of petrol. In fact, if GM tried that, their dominant position in the US car market would mean they'd instantly get slapped with an antitrust lawsuit for violation of the tying provisions in US antitrust law if they tried a stunt like that.

    Actual laws regarding tying wary quite a bit between countries, but I'd be willing to be you'd be unable to find any country where the courts wouldn't agree that a bare computer and an OS are two separate products.

    Whether or not you deserve a refund, however is more complicated than that. In the Windows case, your purchase is essentially defect unless you agree to contract terms (Microsofts EULA) that you likely weren't informed about at the point of purchase). Defect in the way that you will be unable to legally use a part of the bundle that you paid for (Windows). Again, depending on where you live that may give you the right to a refund for the OS, or it might "only" give you a right of refund for the whole system, or if you're unlucky none at all.

    However all of this is a digression from the point of the message you replied to. My only point was that believing that manufacturers are free to include whatever they want is naive. There are lots of regulations restricting what manufacturers may do - in particular with regards to tying of products that there is separate demand for as long as they don't offer the products unbundled as well.

  7. Re:Is it good on bandwidth tho... on CodeWeavers Release Server Version Of CrossOver · · Score: 2

    Other way around, AFAIK. Instead of transmitting the changes to the screen pixel by pixel (though compressed), they intercept the Windows GUI functions at a higher level to get the changes in a more abstract form. Think transfer "draw this rectangle at x,y with width w,h" instead of transferring every damn pixel that change. This is essentially what X does as well, except that the X protocol can be quite bandwidth hungry with modern apps unless you run an app in between to do compression and caching of data.

  8. Re:I don't get this "refund" thing. on Windows Refund Day II · · Score: 5, Interesting
    Actually, the manufactorers are NOT free to choose which pieces their system is made up of. Most countries have laws restricting when tying of two separate products is legal and not. In this case a bare computer and Windows are clearly in the general case two separate products, as both are available for sale separately from a wide range of manufacturers.

    In general tying laws restrict when a manufacturer may tie in two products without offering the individual products for sale separately as well.

    However, as long as we look at "a computer" as the product, a manufacturer may get away with tying without providing a bare box as an option in many countries by pointing to the fact that a consumer has many alternate sources of bare hardware.

    On the other hand, though, a manufacturers offering a hardware platform with unique capabilities would have bigger problems doing this, as a consumer could claim that the manufacturer was utilizing it's monopoly in the manufacture of that specific hardware to pressure him/her to buy a product they don't want or need.

    Various countries have wildly different laws here, but assuming that manufactureres are automatically free to decide what their system is made up of is wrong almost everywhere.

    (ObDisclaimer: IANAL)

  9. Re:Maybe in your country on Cable Companies Despise PVRs · · Score: 2

    Sky isn't a cable provider, but a satellite TV feed provider... Come on, even if you didn't bother reading the article, you could have at least read the blurb about how the cable providers dislike PVRs because they think it lets satellite providers compete better with the cable companies VOD offerings.

  10. Re:they will just install windows on Wal-Mart Lindows PCs Selling Well · · Score: 2

    The majority of people who have no idea of how to run anything without Windows on it won't know how to install Windows.

  11. Re:French approximation :-) on William Shatner Replies · · Score: 4, Funny

    Either that, or he was very serious about his poor performance as a student...

  12. Re:No offense but these were some boring questions on William Shatner Replies · · Score: 5, Informative

    Regarding question 9, "Wil" is Wil Wheaton, who played Wesley Crusher on ST:TNG Does it make more sense to you now? :)

  13. Re:Hasn't the story/theme been ripped-off too ofte on Will Smith as I, Robot · · Score: 3, Informative
    I, Robot is a short story and also the name of an antology of various robot stories Asimov wrote. So just like AI (based on the Brian Aldiss short story Supertoys last all summer long) and Bicentennial Man (also an Asimov short story, not a full novel) they're bound to have to fill in lots of extra material to expand it to a full feature.

    In fact CNN has an article that seem to indicate that the script originally didn't have anything to do with I, Robot, but has been merged with elements from the book, and other ideas (a detective trying to solve a crime that may have been comitted by a robot) that seem like it may have been taken from The Naked Sun.

    I loved AI though, except for the last 20-30 minutes or so, which IMHO should have just been removed (there was a period of several minutes I was sitting in the cinema thinking "great, it should end here" every couple of seconds until I finally realized that they'd ruin it all with an attempt at a soppy Hollywood style ending), and Bicentennial Man was OK even if completely changed the focus of the story (from a thought provoking story about what it means to be human, that was much toned down in the movie, to an attempt at a Hollywood style love story).

    Hopefully I, Robot will be true to the original concepts and ideas, but I've long ago learned to look at Hollywood adaptations as original works that share the name and basic plot with the story or stories they "adapt", not true translations of the original stories into movies.

  14. Re:Something I didn't think about... on Linux Spurs MS Price Cuts · · Score: 2
    Yes, but it also means that a whole lot of people that wouldn't consider Linux before will now look at it again thinking "if it's good enough to scare Microsoft into offering such hefty discounts maybe it's ok after all", and another large group will be thinking "hmm, a great way of lowering our license costs".

    In other words, yes this makes MS more competitive, but by cutting their per unit profits. Due to the size of the market share they already have, they aren't likely to increase their sales volume much, so the net result is likely a cut in overall profitability if many enough customers start pushing for these cuts.

  15. Re:What They Didn't Say on CA Supreme Court Saves LiViD, Pavlovich · · Score: 2
    The judges were considering whether to grant jurisdiction or not - they did NOT consider the merits of the case itself, nor should they. Note also that they have considered only the application of law and nothing else.

    In their opinion they were very specific about what matters would be relevant to a decision regarding jurisdiction and adressed only evidence entered in the original hearings relevant to that.

    In other words they were very careful to address the specific issue they had been asked to rule on, and rely on the specific findings of the trial courts relevant to their decision - nothing more and nothing less.

    They were also very careful to back up their decision with a wide range of case law.

    If anything, to me the opinion seemed very well written (IANAL, though ;) and thorough.

  16. Re:Would be nice..... on Segway HT Starts Selling · · Score: 2
    The reasons for the laws is that many states have already banned various forms of vehicles on sidewalks. The laws in question either explicitly makes an exception for the Segway and similar devices or in some cases prohibits local regulations that could keep the Segway off sidewalks.

    In addition to the states that have explicitly made it legal, 7 more doesn't have restrictions that would stop the Segway from being used on sidewalks. So it's really only 11 states where it may still be prevented from using the sidewalks.

  17. Re:Legislation and other vehicles on Segway HT Starts Selling · · Score: 2
    First of all, with a Segway the user doesn't need to react before initiating braking. On impact, you are being pushed back, shifting your center of gravity, and the Segway will detect that and reverse it's engine. That is, unless your reflexes have already unconsciously made you shift backwards and start braking.

    Since the Segway is leaning forwards initially, you also don't take the full impact right away. You get hit by the first part of the device, it starts reversing, and as the rest of you starts hitting you it will already be braking.

    On the other hand, a person running or cycling at the same speed will likely hit you full on at full speed and will be leaning forward and have their center of gravity well in front of their feet, leaving you to take their entire momentum.

  18. Re:eh? on Segway HT Starts Selling · · Score: 2, Informative

    No. The Segway balances itself. All you need to do is hold on to the handlebars and lean forwards to accelerate, or move your hands to turn.

  19. Re:Would be nice..... on Segway HT Starts Selling · · Score: 3, Insightful

    Uhmm. You have it the wrong way around: 32 states have so far passed legislation that explicitly allow it on sidewalks.

  20. Re:For that price.. on Segway HT Starts Selling · · Score: 2

    I don't have a problem with getting reasonable excercise (though I must admit to not liking it). What I like about the HT is the possibility of using it reasonably safely on a crowded sidewalk, and at the same time extending the effective range I'd be able to travel without going by tube etc. 2-3 times. If you've ever been on the tube in London during rush hours, you might understand why ;) Then you might also understand why I wouldn't want to be on a bike - London traffic is horrible.

  21. Re:Microsoft Good at Business? on Microsoft Loses $177m on Xbox in Three Months · · Score: 3, Insightful

    They are pouring money into several divisions because of long term strategies, not for immediate profit. Their goal is to build dominance in these new (for MS) areas, regardless of whether they make money on it now or not, by spending extreme amounts on marketing etc.. In other words, the losses in those divisions are so big because MS can easily afford it, and they think it will be a worthwhile investment in the end.

  22. Re:Worst. Acronym. Ever. on Microsoft Loses $177m on Xbox in Three Months · · Score: 2

    I have serious doubt that it would be any of the IRS' business whether or not the loss was created on purpose. Practically any large startup will lose money in their first year or three, and it's certainly standard practice in most countries that such losses are brought forward. In fact, in the case of acquisitions of young startups by more mature companies, such accumulated losses often help bring the price of the startup up, as the aquiring company can often realize tax benefits from it by restructuring their business.

  23. Re:Yay for Environmetal Pollution! on In Stores Soon: Perishable DVDs · · Score: 2
    You are making a whole lot of assumptions, and the point of my message was exactly that instead of making assumptions like these, you need to carefully look at the environmental costs, because it's far from being as simple as you assume.

    First of all, you are assuming that everyone will return the disc to the video store while you're running errands. From personal experience I know for a fact that not everyone does it as part of other errands. I don't know how many people do it as part of other errands, how many do it on foot or by other non-polluting means, how many use ridiculously polluting cars, how many use electric cars or other less polluting vehicles (electric cars pollute too, both in that there's likely to be pollution involved in power plants supplying the energy, and because driving one will wear it, shortening the lifespan and thus contributing to pollution in the creation and disposal of more electric cars) etc. And neither do you. In other words we can say nothing about how much pollution will be generated from people returning discs.

    And can you tell me exactly what amount of pollution is generated from pressing a disc? What about this new type of disc? No? Didn't think so.

    You are also assuming that no recycling is in place, and that these new discs can't be made in a bio degradable way - considering that these discs are designed to become unusable, everything would point to possibilities for using materials that will decay quickly for the rest of it as well if possible and cheaper than the alternative. Do you KNOW what the time for degrading this new type of disc is?

    You are further assuming that the volume of non degradable material created will be large enough to more than make up for the effect of reduced pollution in returning discs. Considering that this new disc doesn't need to be well protected (it's unusable after a few hours after use, after all), they might not supply them in big bulky plastic boxes etc., do you know how much larger this volume will be in reality? Truth is, you are unlikely to even know how many more discs will need to be manufactured compared to a normal disc.

    The above is exactly why I say you need to carefully look at the impact before you can know whether something has a positive or negative environmental impact.

    A good example is cars. Cars have been improving steadily, and a few years ago there was intense discussion in many countries about whether to give people heavy incentives to replace their old polluting cars with less polluting more modern cars. Some people immediately assumed that that would be a better approach, but several environmental groups and other organizations bothered to do the calculation.

    Depending on methods used, they came out with everything from immense gains from replacing cars quicker, to immense gains from making people keep their older cars as long as possible (thus polluting more from usage of the vehicles, but less from the manufacturing of new cars).

    Regardless of who you think are right, it's a good example that it's seldom as cut and dried as it seems at first glance. There are negative ecological side effects to almost everything we do, and positive effects from some things, and if you want to get an accurate picture of how something, for instance a change in behavior, affects the environment, you need to take all changes that this change in behavior causes into account, not just make simplifying assumptions based on the most blatantly obvious ones.

  24. Re:Yay for Environmetal Pollution! on In Stores Soon: Perishable DVDs · · Score: 2
    Of course. The point is that it is not a given that one is worse than the other, and you can't automatically assume that something is worse because it generates more trash until you've looked at what, if any, improvements it makes other places.

    More trash in the landfill is only worse if the environmental impact of manufacturing, distributing and disposing of that extra item and having it on the landfill add up to be worse than the environmental impact of anything it replaces - in this case potentially extra trips to hand the discs back.

    As a general rule reducing the amount of trash is good, but when you're reducing it by replacing the trash with something else (like travel with a polluting vehicle) then you need to factor that in as well.

  25. Re:Yay for Environmetal Pollution! on In Stores Soon: Perishable DVDs · · Score: 4, Insightful

    The question is whether the discs will pollute more or less than the average pollution of people travelling to the rental outlet to return discs. It's not automatically a given that creating waste is a bad thing if it has positive effects that outweigh the problems it cause. I'm not saying that it is good, just that automatically assuming it's bad because it create waste isn't very constructive.