Slashdot Mirror


User: cerberusti

cerberusti's activity in the archive.

Stories
0
Comments
326
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 326

  1. Re:Reminds me of an old RPS contest... on Robot Hand Beats You At Rock, Paper, Scissors 100% of the Time · · Score: 1

    His solution seems reasonable to me, and the kind of thing someone with at least a couple of years of systems programming experience might do as a for fun side thing over the weekend (or a student who actually likes to learn, the note about losing points for time implies the implementation was not optimal as run time to make that determination should be very small, although I also do not know the contest criteria regarding run time.) The only thing that would likely impact the run time a lot is if they are restarting the program each time they want a result, as there is a bit of start up overhead (as opposed to just passing round results to the program.)

    Your analysis is the kind of thing I would expect from a CS student (maybe a professor), or someone who slings Java for business apps all day. It takes years to become a decent C programmer, and being one of the simplest languages in existence, it is not the language itself that gives people trouble.

    The amount of pattern matching is only intractable if you make no assumptions. That would be incredibly foolish in this case, as there are many assumptions you can make about their program that will frequently be accurate. No approach will give you a perfect answer here, and trying for perfection will probably lead to failure.

    The ones that are serious competition probably are not using the rng much if at all anyway, they probably use the first few rounds to try to determine your algorithm based on pre-defined patterns representing all of the various strategies the programmer can come up with (if the prize is much money, maybe there will be randomness in the probe order too... although you are not likely to guess that.)

    1) This is an optimal strategy on the first round at least, as you have nothing with which to predict outcomes (so your choice is going to be essentially random anyway.) Your choices are random or static to start it, and I bet the vast majority of entries chose random. This can probably be extended for many programs to choosing randomly until a prediction can be made under the algorithm in use (although when it switches you stop winning if you are counting on prediction of their random values, and if it switches before you narrow the seed choices down you may gain no benefit.)

    2) Pseudo-random is not true random, exploiting the non-random part is exactly what he is doing. This has absolutely no ability to predict the outcome of a true random number generator, as that is unpredictable by definition.

    What they are really doing is returning results from a random point in a somewhat long list. He has a copy of the potential lists used, and only needs to determine the starting point (or that none are in use.)

    3) Many implementations of the C standard library have freely available source (especially popular ones.) Even if this was not the case, source code is not necessary for this task.

    Most C standard library implementations can be dynamically linked (or loaded at run time), so it is basically just a matter of loading several and calling srand / rand from each to get the values you will check. Minor revisions to the library version are not likely to change the behavior of rand (even major ones probably will not.)

    Even if this is not the case in their environment most decent C programmers are familiar with assembly language, and rand() is going to be a rather simple function. You just fire it up under a debugger and trace execution through rand (or disassemble libc and look at the listing for rand.)

    The language of the other entry matters less than you think, as nearly all scripting interpreters are written in C. It is a reasonable assumption that they generally will call C library functions rather than coding their own version. It is also unlikely that there will be other calls to rand by the interpreter, so it should still give you the correct sequence (unless they start up a bunch of these concurrently and several are using the same instance of the scripting interpreter, in which case y

  2. Re:Interval Training on Scientists Study How Little Exercise You Need · · Score: 3, Informative

    I passed a jogger the other day while walking (I walk anywhere I can, in all weather, and was carrying 50 lbs of groceries at the time.)

    In any sort of traffic condition I tend to beat cars rather badly on distance over time (yes, I live in the city.) If you walk with the purpose of covering distance quickly under load, you can get pretty substantial exercise. If you walk daily and do so at speed this is all the exercise you really need to be healthy (assuming a reasonable diet.)

    I do try to ensure that I can run (not jog) 5 miles or so without too much issue a couple of times a year. If it is too hard, I invest the effort to correct this.

    As it turns out, humans do not need all that much exercise to maintain health. You do need some, and your diet must balance calorie intake with expenditure, but it is not hard at all to maintain physical health. If you are reasonably healthy to begin with, maintaining that is very easy.

    I do watch my diet to some extent, and make my own bread daily (I have a loaf baking before my coffee finishes brewing, bread machines kick ass.)

  3. Re:And what else have to to say Mr Dell? on Apple-Approved Fair Labor Inspections Begin At Foxconn · · Score: 1

    Apple is by far the most reasonable and effective target for this.

    Other companies may have the same practices, or even far worse, but it does not change that fact...

    Why? If you are out to buy a $300 bargain PC it is very unlikely that brand factors in at all. These companies (such as dell, etc) compete on low margins and prices. Apple competes mainly on brand recognition, and does not really compete on price (you can argue that you get something more... but it is basically the same general product at a huge markup.)

    As apple mainly works off of their image, they need to care what people think of what they do. This could be a general industry scandal, but it would be very ineffective vs anybody except apple (again, do you really care if the logo on your product says dell over acer?)

    If you are looking to change practices in the industry, apple is really the only target for two reasons:

    1) Their profit margins allow them great flexibility in terms of what they do (they can afford it.)

    2) A bad image could absolutely destroy apple, while it is at worst a minor inconvenience to anyone else (taking no action would very likely reduce their profits more than correcting it.)

    Not really sure why it is surprising that they are the target. Competing on public image makes you more susceptible to this kind of thing, they can either better their practices (in which case others may as well, which is a large positive) or they can lose the image, and compete on price like everyone else.

    Competing on price instead of image would cause them to lose a huge amount of money, which means they must do something about the image instead (which is exactly what those pushing these stories want them to do.)

  4. Re:C/C++ is pretty bad place to start learning on NYC Mayor Bloomberg Vows To Learn To Code In 2012 · · Score: 2

    When teaching people to program I start with an introduction to binary and hexadecimal, making them do a few things like note the patterns various various numbers contain, and add up a couple of things (which illustrates why powers of two are important and convenient, etc.)

    From there it is a brief introduction to logic gates. I demonstrate simple addition, and make them construct a circuit that will do add with carry.

    Then I do a brief introduction to assembly (x86 these days, I used to choose Alpha.) I do not really expect them to become proficient, but I do think an intro and vague understanding is important. I also go over character sets and how to directly manipulate pixels on the screen to produce an image.

    Then I teach C (not C++.) They need to demonstrate some knowledge of how to use basic constructs such as loops, structures, and functions, as well as an understanding of memory management and pointers (including function pointers.) C gives an understanding as to why most modern APIs behave the way they do, and allows one to infer the consequences of various choices in the higher level languages. I will usually throw in a large data set to process at some point (few hundred GB, with file access through a wrapper I provide to allow them to just specify a 64-bit offset directly), to demonstrate how various choices in program structure can have a large impact on speed and memory usage (and show the point of things like qsort and bsearch.) If they get it quickly I will go into the reasons why qsort tends to beat other sorting algorithms in run time even though it frequently performs more operations, and how to make a quick assessment as to if you are going to blow the L2 cache.

    I usually stick with the standard C library, not going into something like win32. I honestly think C is one of the finest languages ever created, it offers quite a bit of control, can be easy to read if written well, and contains most of what you need to create a program quickly. It does not contain all the fluff that has been added to many modern languages, which just tends to get in the way of understanding the basics.

    Once they have a fair handle on C I teach JavaScript / HTML, which makes it easy to produce a program which creates a decent UI and can handle whatever logic they need with little work (I used to give a brief introduction to classes and load up a copy of borland C++ for their decent visual UI design, but I think javascript and HTML is just a better way to do it these days.)

    From there it is up to them, if they want to learn Java, C#, or C++ I will go over how classes work (and show how to quickly implement a basic class system in C), if they want to use windows as a platform I will cover win32 and directx (although honestly opengl is much better, and I will at least touch on that as an intro to 3D before hitting direct3D.)

    This seems to work fairly well, although I am a programmer by profession and not a teacher (CTO really, and I mostly use C for what I do.) The important point is to show how a computer works, how to program it is a natural consequence of that. I have also found that programmers who just know something like Java or C# tend to be rather poor, and get confused when asked to do something that may not be trivial (which also leads to me generally refusing to hire anyone without C or C++ somewhere on their resume.)

  5. Re:Terrain?? on Tesla To Build a Rapid-Charging Station Between LA and SF · · Score: 1

    So... you were wrong then.

    10 m/s is about 20 MPH, which is kind of slow.

    At some point you can go slow enough that moving the car is not the major battery drain, but at some point you are also moving slowly enough to make it not worth trying to drive (or in an extreme case, die of old age before arriving.)

    Or are you saying you would be willing to make a 400 mile drive at a speed of under 20mph? That would take you almost a full day.

  6. Re:flight control systems are already regulated tw on Outlining a World Where Software Makers Are Liable For Flaws · · Score: 2

    A flight control system will be a combination of hardware and software, and will have very strict usage limitations.

    I find it very unlikely that someone would produce a flight control system that runs on the average windows computer and accept liability for anything that may happen.

    If you control the entire solution, ensuring that it will work reliably is much easier.

    Start modifying the flight control system, and I bet liability goes very quickly.

  7. This is already done, but there are downsides. on Outlining a World Where Software Makers Are Liable For Flaws · · Score: 1

    It is not always hard to create liability, it is just done through contract.

    I produce software which you can get this assurance on, however it comes with a few restrictions the general use version does not.

    1) It will cost you far more than otherwise (think the 100x range), the exact usage scenario and liability is explicit in a contract.
    2) We provide the computer, you may not use your own. You additionally may not use it for any purpose other than the one we provide it for (and have no easy ability to do so anyway, as you would need to open it and void the warranty in order to do so.)
    3) No network access (easy if using an alternate operating system with no included network stack.)

    It is not hard to assure that a piece of software will pretty much always work when used for its intended purpose, just expect it to behave more like your toaster than your general purpose computer.

    Making a guarantee that the device will always work when used for its intended function means the intended function becomes clearly defined. I bet you void all sorts of provisions of the warranty on your car if you replace the engine, or start moving parts around between vehicles.

    If full liability becomes commonplace you will suddenly end up with a large collection of computing devices, all of which will refuse to talk to anything not explicitly approved by the vendor. This is not usually worth the tradeoff, but would be the realistic way what you ask for is accomplished.

    Be careful what you wish for.

  8. Re:My CRT on Are CRTs History? · · Score: 1

    ummm... it looks fine because it can just use a block of four pixels as a single pixel and be completely accurate. Try it at 1024 x 768 and see what happens.

  9. Re:No on Are CRTs History? · · Score: 1

    For an even better (in my opinion) CRT try the Mitsubishi Diamond Pro 2070SB. This is the monitor of choice around here (and what I use.)

    I have never seen a monitor with a better picture, they exist (especially for satallite imaging) and are probably pretty impressive, but outside the price range of mere mortals.

    No LCD comes close to the picture quality of a good CRT, the size and price were not really a concern, as if you are going to spend most of your day in front of a monitor, it is nice to have a good one.

    The cheaper LCDs are much better than the cheap CRTs though, getting a headache from staring at a cheap CRT for hours sucks.

  10. Re:Can Spam Act as defense on Spammers Sue Spamee · · Score: 1

    He never said it was in the US. There are places this could happen.

  11. Re:Extensible? on Are Extensible Programming Languages Coming? · · Score: 1

    The speed difference between C++ and C is real. It varies wildly depending upon the specific problem and the specific implementation but in my experience it is usually in the 10% - 50% range, with the occasional large difference.

    You can only really reduce it by not using objects, at which point you are basically writing C anyway (and on some compilers even this does not help.)

    The reason for this is not so much the difference in the implementation as you write it but, the difficulty with which a compiler can perform certain optimizations. This is especially true for compilers which support the C99 restrict keyword (which C++ does not have) as it allows a C compiler to perform certain optimizations which simply cannot be done with C++ code.

    The obligatory link to the Results from the Computer Language Shootout (with the default weightings.) It shows about a 30% difference over all of the programs, which seems about right.

    The reason people are constantly say that their favorite language is faster than C is that C is the fastest of the popular portable programming languages.

  12. Try this one on EA Trying to Buy Ubisoft Shares · · Score: 1

    It is a game called Strange Adventures In Infinite Space. Excellent game, and done by a really small studio.

    This is their site.

  13. Re:This just in! on P2P Not Dead, Just Hiding · · Score: 2, Informative

    They did actually, we got an MPAA letter about six months ago as the result of a download from suprnova.

  14. Re:6 year old view of the computer world on Solaris Systems Programming · · Score: 1

    Yes, but Windows implements them poorly. There are many areas of it that do not work correctly, behave in a slightly different way than the spec says, or take different parameters. I ended up writing a library controlled by an #ifdef to call my own version of the POSIX functions which are implemented directly in the win32 API. Believe it or not, it is actually much easier that way (although I do have to implement every POSIX function the first time I use it) this retains the normal portability of POSIX, it just handles Windows as a special case. POSIX as Windows does it is horrible though.

  15. Re:Contrast ratio? on Sony Begins OLED Mass Production · · Score: 1

    Perhaps there is some current leakage into pixels that should not be lit. Who knows, but if they could say infinite, they probably would.

  16. Re:For those of you who don't yet know... on Sony Begins OLED Mass Production · · Score: 2, Interesting

    An LCD has to have a much higher brightness in order to maintain an acceptable contrast ratio. There are CRTs on the market that support really bright images, but since a higher brightness generally means more eye-strain, this is not the default.

    A good CRT still produces the best image quality, and can be had for about the same price as an LCD of equivalent dimensions. The image quality of a low end CRT does not even compare with an LCD, although they are much cheaper.

    The glare is less on an LCD because it produces more light, and is therefore not affected as much by ambient light sources. Most good CRTs do have a fairly effective anti-glare coating, although they are not perfect. A polarizing screen filter will eliminate glare almost completely (although my personal solution is to keep the lights off.)

    The OLEDs are better than anything currently on the market. They beat LCDs and CRTs in every way that matters. The image quality is excellent, and they can be run at low brightness levels without sacrificing image quality. Kodak (who owns the patents on most of the OLED technology) really made a breakthrough in display technology with these. I look forward to getting one to replace my (fairly new) CRT.

  17. What this means for the standard on Apache Rejects Sender ID · · Score: 5, Informative

    In less than a week, IETF Last Call for this standard will be over. As of the moment, there is no consensus on the Microsoft patent issue. This will almost certainly prevent the standard from moving forward. The IETF is too divided on this issue for the standard to progress as it is.

    Also, a clarification of how the IETF handles patent claims seems to be in order.

    Patents are allowed in IETF standards under any terms that the working group feels are acceptable. In most cases, since the goal is to produce a standard which is useful to the largest group possible, patented methods are only used if the patent holder is willing to grant a very permissive license.

    For example: The latest working group I was part of was SEND (SEcure Neighbor Discovery), a part of IPv6. SEND makes use of Cryptographically Generated Addresses, which are patented by Erricson. Erricson agreed to license the patent on the terms below:

    In addition, for the CGA submission, if said submission is included in the IETF SEND standard and Ericsson has patents that are essential to the implementation of such included submission in said standard, Ericsson shall not assert any such patent against any company or legal entity using said patents in the IETF SEND standard. The Ericsson non-assertion is conditional upon such company or legal entity not asserting any patents within the IETF SEND standard against Ericsson. For all other purposes Ericsson's general patent license statement as referred to above, shall apply.

    This is a fairly normal license for the IETF and was found to be acceptable. In almost every case where a patent is relevant to one of our standards, a licence statement such as this one is provided.

    The Microsoft license is different, and has sparked quite a bit of discussion. Since this standard has a very large intended audience and there is significant concern over the terms of the license, unless Microsoft changes the terms of their license, this will stop the standard from progressing as is. Either the standard will be restructured to avoid using the methods claimed in the Microsoft patent, or the working group will terminate without a standard.

    A lot of people are irritated about this.

  18. Re:That was appropriate on Alabama IT Whistleblower Fired For Spyware · · Score: 1

    He reported the abuse, nobody was interested in hearing his complaint. He should not have taken further action. If they had asked him to document the abuse, he would have been justified in doing what he did, although he probably should have specifically asked if he could do this even then. His decision "to take matters into his own hands" is why he was fired.

    A systems administrator has the ability to look at pretty much anything they want to. It is required in order to do the job they must do. This does not mean it is ethical to do things like read a users mail, or watch what they are doing on their computer, even though the technical capability is there.

    People do not like being watched. They resent it, and it tends to create tension when it is done. Installing a piece of software to monitor someone in your office is an invasion of their privacy. This can sometimes be justified, but he was not in a position to make that call.

    What he did was a gross abuse of his position. I would have fired him for doing this, whether to a normal employee or a manager. It appears that whomever was in charge in that office has the same opinion I do.

    He is extremely unlikely to win his case. Apart from having to convince a jury that he was justified in spying on an employee, whistleblower statues are designed to protect those who report criminal activity (unless the circumstances are exceptional.) At worst, his boss violated office policy and is a bit lazy.

    Since it was probably not possible to remove his access to do things like this while still allowing him to do his job, and he had just demonstrated that he could not be trusted with this access, it is my opinion that firing him was absolutely appropriate.

    I expect many people will disagree with me on this.

  19. That was appropriate on Alabama IT Whistleblower Fired For Spyware · · Score: 1, Insightful

    Firing him was an appropirate response. He abused the power he needed to do his job, and could no longer be trusted with it.

  20. Re:Great Engineers on Paul Graham On 'Great Hackers' · · Score: 1

    That was hilarious... I was thinking that I had never seen so many buzzwords in a slashdot post before when I read your reply.

  21. Re:Arrogant Obnoxious Jerk on Paul Graham On 'Great Hackers' · · Score: 1

    I believe he is quite correct about Java, but I think you missed his point. It forces everybody towards mediocrity. If you are a terrible programmer, Java helps. If you are great, Java hurts. This is sometimes desirable for a large team, as there are more bad programmers than good ones.

    Of course, that is just my opinion, I think most people would disagree with me.

  22. Re:Well shit. on BitTorrent Beats Kazaa In Traffic Numbers · · Score: 2

    The MPAA already does, we got a letter as a result of a bittorrent download about two months ago.

  23. Re:Technically, its illegal on Where Do Dummy Email Addresses Go? · · Score: 1

    Simply falsifying your identity is not illegal (in the US at least), only in very specific circumstances is it prohibited, such as in a court of law, on most legal documents, etc. If you were to ask me my name, I could respond with whatever I wanted without running afoul of the law. One could make a case that if the website has some sort of EULA it could qualify, but unless it accepts a signature (digital or otherwise) it is very unlikely for a court to consider it so, as it is not a legally binding contract.

  24. Re:C, still the best starting place on Programming For Terrified Adults? · · Score: 1

    I totally agree. C has a simple syntax, is quite powerful, and is used as a basis for more languages than any other. It also teaches a lot about how the computer actually operates, which is useful when using any language. I teach people C as well.

  25. Re:article in Seattle Times: IRS okayed time barte on Best Results From Bartering Computer Services? · · Score: 1

    From the IRS:

    http://www.irs.gov/taxtopics/tc420.html

    or to quote the top paragraph:
    Bartering occurs when you exchange goods or services without exchanging money. An example of bartering is a plumber doing repair work for a dentist in exchange for dental services. The fair market value of goods and services exchanged must be included in the income of both parties.

    It also specifically addresses Internet bartering exchanges lower on the page

    The Internet has provided a medium for new growth in the bartering exchange industry. This growth prompts the following reminder: Barter exchanges are required to file Form 1099-B for all transactions unless certain exceptions are met. Refer to Barter Exchanges for additional information on this subject.


    There are exceptions, as with most tax laws, however, it is the opinion of both my accountant and my lawyer that if you work in a field related to the service you are trading, it is income, and not exempt (as in, if you hold a job in the computer industry you cannot barter this service without reporting it.)

    It probably also kills the informal exemption if you advertise the service (as you would on a website) although I am not sure of this.

    I know the IRS did send a letter in November to a lot of these types of sites reminding them that they need to report all of the transactions to the IRS. I would not be suprised if customers of these sites get a 1099 at the end of this year (it is generally unwise to ignore a warning from the IRS.) It is also possible to be penalized for failing to file quarterly reports.

    Of course, they have to know you are doing it first, and that might be a little bit difficult for them to find out if the site does not report it.