Slashdot Mirror


User: swillden

swillden's activity in the archive.

Stories
0
Comments
18,006
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 18,006

  1. Re:Why do we bother with the barbarians? on Saudi Justice: 10 Years and 2,000 Lashes For Internet Video of Naked Dancing · · Score: 3, Insightful

    But whatever politicians may have been saying, AFAICT, we didn't, in fact, get any sweetheart deals on oil from Iraq. Perhaps we kept Hussein from cutting us off, but I don't see any evidence he was going to do that.

  2. Re:C/C++ operator = on The Linux Backdoor Attempt of 2003 · · Score: 2

    Truely 0 = uid, while also quite bad yet legal C*, doesn't reassign the UID.

    * I always thought this was legal, but now that I try it, I find this gives a compile time error - "error: lvalue required as left operand of assignment". Currently gcc is the only compiler I have on hand, so i can't check some of the much older ones.

    No, assigning to a non-lvalue (where lvalue is defined, essentially, as "something that can be assigned to") has never been legal C or C++.

    What would it even mean?

  3. Re:You mean basic stuff? on What Are the Genuinely Useful Ideas In Programming? · · Score: 1

    If you have that many cases, you shouldn't implement them as a switch. A hashtable of function pointers, or functor objects, or command pattern instances, or similar, depending on your language and context.

    I'm not too familiar with the implementation details, but isn't a switch statement basically a lightweight hash table without the hashing? (since everything is already an int)

    Yes, the compiler is going to turn the switch into a function pointer lookup table. The reason for doing this yourself is to decompose the cases into small, understandable and testable functions, plus to make it easier to add and remove them. From a performance perspective there will be very little (if any) difference.

  4. Re:Gov't project on Administration Admits Obamacare Website Stinks · · Score: 1

    How does Mongo help prevent stupid amounts of javascript files to transfer?

    In case you missed the reference: http://www.youtube.com/watch?v=b2F-DItXtZs

  5. Re:You mean basic stuff? on What Are the Genuinely Useful Ideas In Programming? · · Score: 1

    If the most easily understood way to express a concept is as a 5,000 line function, then you should write a 5,000 line function.

    There is no such concept, because that would imply that it's a concept that is simultaneously complex enough to require 5000 lines of code and yet simple enough to be fully grasped, in all its details, as a unit by the human brain. That's a contradiction.

    For example, my record is almost 5,500 lines. The entire function is basically a giant switch statement in a parser (post-tokenization). The only way you could make that function significantly shorter would be to shove each case into a function, and all that would do is make it harder to follow the program flow through the function for no good reason.

    I disagree that would make it harder to follow the flow. Moving the relationship between the tokens and the bits of code to a map or other initialization structure would make it easier to modify and maintain.

    Also, how do you write unit tests for that function? How would you write unit tests if all of the cases were functions that you could test individually? Keep in mind that proper test coverage should address every possible path, not just every line of code.

    having each case in a separate function just adds execution overhead without improving readability, and it makes debugging harder because you now have to pass piles of flags around everywhere instead of just using a local variable.

    Execution overhead? Have you looked at what your compiler produces for a big switch like that? It almost certainly produces exactly that structure: A hashtable lookup of a function pointer. Or did you think that finding the right branch was free? As for having to pass piles of flags around, it seems to me that you have another structural problem. Remember that local state is just as evil as global state if the scope of the local state is large.

    One of the data structures for the function in question is almost 1200 lines long by itself (including anywhere from two to fifteen lines of explanation per field, because I wanted to make sure this code is actually maintainable).

    This sounds like yet another structural problem in dire need of refactoring. The need for so many comments is a strong clue that the code is not sufficiently clear. Decomposing the large data structure into smaller ones would provide lots of opportunities for using well-chosen names to avoid the need for explanatory text... and nearly always has the benefit of making the client code (code that uses the data structure) more readable and maintainable as well.

    In short, those sorts of rules simply don't make sense once the problem you're trying to solve becomes sufficiently complex.

    This is not true, but the reason it's not true is subtle and important.

    What you're saying is that the problem you're solving is complex, so the solution is complex. This means that the next programmer that comes along is not going to be able to work effectively on the code until he or she fully groks the entire problem and solution. This implies one of two things:

    1. The problem is inherently complex; or

    2. You have not worked hard enough at finding a way to decompose the problem into more tractable sub-problems.

    In my experience, it's almost always case 2. And if the problem can be decomposed then there are large and obvious benefits, even if doing the decomposition makes the initial work take five times as long, because maintenance consumes a lot more hours than initial development, and because bug counts will be lower, partly because it's easier to grok in pieces, but mostly because a complex solution is untestable.

    Reading your comment, I imagine you debugging problems by stepping through the code as you run it on various inputs. If that's the case, it's a recipe for many deep and hard-to-find bugs that hang ar

  6. Re:You mean basic stuff? on What Are the Genuinely Useful Ideas In Programming? · · Score: 1

    Basically, you'd need a switch with over a thousand cases to end up at 5500 lines.

    If you have that many cases, you shouldn't implement them as a switch. A hashtable of function pointers, or functor objects, or command pattern instances, or similar, depending on your language and context.

  7. Re:Voice activated check split app on Google Wants Patent On Splitting Restaurant Bills · · Score: 1

    Yes, servers often earn more in tips than actual wage. That doesn't change the fact that servers used to be paid more in past generations. My brother earned minimum wage + tips in the 1980s, but his daughter currently earns $2.75 / hour + tips.

    I still don't think there has been any change in law or practice, your anecdote notwithstanding.

    The Fair Labor Standards Act

    ... which was passed in 1938. It has been amended many times, but none of them substantially changed the fact that as long as the employee receives at least $30 per month in tips, and as long as the net pay (hourly wage + tips) is at least the minimum wage, then employers don't have to pay minimum wage. The have been some tweaks to how tip pools are handled, mostly clarifying who may or may not be included, but the basic handling of minimum wage has not changed since 1938.

    Because the social norm is 15-20%, employers can pay servers a lower wage and still not run amok of minimum wage laws.

    As it has been for a very long time.

    However, if restaurant owners can convince everyone that tips now need to be higher (e.g. 20% rather than 15%), then they can continue reducing hourly wages and still be able to attract good waitstaff. By tipping more you're working to decrease waitstaff wages, though in the long run not affecting waitstaff income at all. Essentially, you're just moving more of the cost of your meal service from the price on the menu to the tip. Well, not if you're the only one that does it, but that'll be the result if everyone does.

    Personally, I wish we could adopt the European approach: Do away with the standard tip. Tipping should still be an option to reward exceptional service, but waitstaff should be compensated primarily through their wages. It ultimately doesn't change the cost of eating at a restaurant because lower tips will drive higher wages which will demand higher prices on the menu. But it removes a lot of complication, and eliminates the aggravation caused by cheapskates who don't tip well.

    Moving the customary tip percentage upward is entirely the wrong thing to do, IMO.

  8. Re:Exactly! It's also an escape from taxes. on Sick of Your Local Police Force? Crowdfund Your Own · · Score: 1

    What's the difference between an armed neighborhood watchman, and an armed police officer?

    Well, here are some: 1. The police officer has the legal authority to act on behalf of the government. In theory at least, they are carrying out the collective will of the citizens as determined by the politicians. By contrast, the armed neighborhood watchman has no more legal authority than I do.

    If you look into your state law, you'll likely find that the police have very little more legal authority than you do.

    2. The police officer has the right to do things that citizens do not. For instance, a police officer can forcibly detain someone against their will if they have a reasonable suspicion that person is engaged in criminal activity, whereas a neighborhood watchman can only use force against someone who is presenting an immediate threat to people or property.

    Not true in any state I'm familiar with. Among the half dozen states whose laws I know well and, I suspect, most others, individual citizens have the right to make an arrest if they have probable cause to believe that a felony was committed by the suspect, or if the suspect has committed a misdemeanor in their presence. Police can usually arrest for PC of a misdemeanor, and they usually have a little more legal latitude in use of force in making an arrest, for example, in many states police can employ deadly force against a fleeing felon, but those are the edge cases. In practice, police have a lot more latitude because the system treats them with kids gloves, but that's not based on any actual legal difference.

    Regardless of those differences, arresting people isn't the purpose of security guards.

    3. The average police officer has considerably more training than your average security guard. Most of that training is not about using violence, but rather about how to read and control people's emotions.

    I think you'd be surprised how little training police get. Many of them do have a great deal of experience, however.

    4. The police officer is supposed to protect and serve anyone and everyone. The armed neighborhood watchman is supposed to protect those who pay him. That makes a big difference for those who can't afford to pay for the security guard.

    Police have no legal obligation to protect anyone. The Supreme Court has ruled this repeatedly. Sure most cops are good guys and will try to protect people, but that could be said of the watchman as well.

    5. The police officer that covers your neighborhood coordinates his/her efforts with other police officers and other police departments in a way that armed neighborhood watchman simply can't do. For example, if someone is running from the cops, the various departments will work together to keep the chase going even if the suspect runs from one jurisdiction to the next. Your neighborhood watchman, on the other hand, might have to deal with trouble he never knew was coming, rather than knowing in advance, planning, and coordinating with the other neighborhood watchmen around him.

    Meh. Neighboring groups of watchmen could do the same thing. In any case, from a public safety perspective, the primary goal isn't to catch the bad guys but to deter them. Watchmen can leave the catching and prosecution to the police, and focus on the deterrence.

  9. Re:Better searches no good if they're too slow on Could IBM's Watson Put Google In Jeopardy? · · Score: 1

    Ah, so you're one of the developers working on Google+!

    No, I work deep in the infrastructure.

  10. Re:Voice activated check split app on Google Wants Patent On Splitting Restaurant Bills · · Score: 1

    When did the customary 15% become 20%?

    It used to be that a gratuity was meant as a bonus to the server.

    When was that? It wasn't the case when my grandmother was waiting tables in the 30s. AFAICT it's always been the case that the waitstaff makes a significant portion of its income from tips. At really high-end restaurants, the waitstaff is compensated purely by tips.

    That doesn't change the fact that the customary 15% is just fine, unless service is truly outstanding.

  11. Re:Better searches no good if they're too slow on Could IBM's Watson Put Google In Jeopardy? · · Score: 1

    I work for Google but not on anything related to this article or thread

    Oh, please focus on fixing bugs

    Hehe. I doubt that you are affected by any of the bugs I fix, though. Not that you notice, anyway :-)

  12. Re:Better searches no good if they're too slow on Could IBM's Watson Put Google In Jeopardy? · · Score: 2, Interesting

    And you can be certain that Google is working on their own 'Watson' tech, so when the hardware is ready, they'll be able to do it.

    Not just working on... has deployed, in a small way, to the degree that current capabilities can support on a massive scale.

    That's what Google's Knowledge Graph work is about, and its work on natural language processing of search queries (including spoken queries). Google web search doesn't have Watson-level understanding, yet, but it has already moved well beyond the string matching + page ranking that the article supposes and is continuing to progress. Indeed, that progress is the source of many of the complaints about Google search here on slashdot. It has gotten much smarter, which makes it more effective in general, but means that it's less effective when what you want is a simple string search (though you can turn on verbatim mode to fix that).

    (Disclaimer: I work for Google but not on anything related to this article or thread.)

  13. Re:Bubble? on US Now Produces More Oil and Gas Than Russia and Saudi Arabia · · Score: 3, Insightful

    I have read several articles and reports by economists and geologists claiming this fracking boom is a bubble. The estimate of 100 years worth of gas is overstated. It seems 25 years worth of gas is more likely, less if gas exports are allowed.

    I don't really have an opinion on the issue as a whole, but it's worth pointing out that similar reports have been telling us for decades that the end was nigh, and yet we continue finding new deposits and/or new ways to exploit known deposits. Obviously that can't continue forever, and it seems pretty clear that there are other issues that have to be considered (e.g. climate change), but I'm pretty skeptical of anyone projecting near-term resource exhaustion.

    It's always possible, of course, that this time the wolf really is here, but...

    Besides that, I think anyone predicting a sudden collapse of supply is silly. That's not how the world works; you don't see all of the fields simultaneously ceasing production, instead many fields begin to decline at differing rates. The result -- when we near exhaustion -- will be that available supply gradually tapers off, which will cause prices to gradually rise in order to limit demand to available supply. Rising prices will eventually move us off of fossil fuels, if we haven't already done it for other reasons.

  14. Re:What happens in the real world on Slashdot Asks: How Does the US Gov't Budget Crunch Affect You? · · Score: 1

    Government is NO DIFFERENT. If you are going to obviously be screwed over every time the Government needs to figure out a yearly budget (hint: they can't) or bump against the debt ceiling (hint: very often), then you need to LEAVE.

    Additionally, you should ask yourself whether it was wise to go to work for an employer that is $16 trillion in debt in the first place. Sure, that massive cloud of debt hasn't created too many problems in the past, but it seems unlikely the chickens can stay aloft forever.

  15. Re:What exactly is the point of the furlough anymo on Slashdot Asks: How Does the US Gov't Budget Crunch Affect You? · · Score: 1

    real wages always tend, in the long run, toward the minimum wage necessary to sustain the life of the worker

    Though what constitutes "sustaining life" has significantly increased over time. When the "law" was first proposed, it really meant the wage necessary to prevent starvation and/or death from exposure. Our definition of poverty is much more generous today, and I fully expect it will continue to rise. In the west it may take a short-term hit as wealth levels equalize across the globe, however.

    It's also worth pointing out that the Iron Law of Wages is not really accepted by modern economists as even a strong tendency, much less an iron law.

  16. Re: Solar plus stored energy on World Solar Challenge Underway · · Score: 1

    Many people are concerned about the range of an electric car. Currently the Tesla S has a range of 480km. If you can use solar panels to add 50% to that range, then it is 720km. That is some serious distance.

    I don't think that much range extension is likely. What I think may be achievable, though, is to make it possible to commute a 100 km round trip on small batteries that only hold enough charge for 70 km, without access to charging facilities at work. Being able to recover a significant part of your charge just by parking the car outdoors is valuable.

    Our second car rarely travels more than 10km from home, so personally I'd be happy with a range of 100km and a price of under $30,000.

    You should take a look at the Nissan LEAF. I have one (2012), and I really like it. The price of the low-end model is under $30K. Given how fast technology is changing in this area I opted to lease. I pay just over $200 per month on the lease payment, but I calculate that the car saves enough on fuel costs that my net cost to drive a very nice new car (I have the $36K model) is ~$80.

    If I drive it very carefully (and stay off of freeways), I can get about 100 miles range out of a full charge. If I'm not careful, drive fast, use the heater, etc., the range drops to 70 miles, which is the ballpark of your 100 km range requirement.

    IMO, an EV is a perfect second car today. It's not a good choice if it's your only vehicle, unless you can spend the money to get a Tesla with the big battery ($85K), or if your long-range driving needs are sufficiently rare that it's feasible to rent or borrow a car. But, if we can improve batteries (lighter / more energy density / cheaper), make the cars more efficient, add some integral solar recharging capability as a range extender when there's some non-driving time, etc., that will change. It doesn't even require improvements in all of those areas, but multiple small improvements are just as good as one large improvement, and we're getting close.

  17. Re:The Classes on World Solar Challenge Underway · · Score: 1

    Cruiser: Sort of road worthy cars, judged on practicality as well as the race placement.

    This is the class that interests me. Sure, they're still a long way from being something that anyone could use as a day-to-day vehicle, but they're moving closer to that goal. A goal that is unlikely to ever be fully achieved, but what we learn from making mostly-impractical pure solar cars will eventually help us to build usable electrics which are light enough and efficient enough that they can be usefully powered in part by integral solar panels -- and which will require very little grid power and need much smaller batteries than current EVs.

  18. Re:Also for a lot of things on DOJ Hasn't Actually Found Silk Road Founder's Bitcoin Yet · · Score: 1

    If you need a criminal defender, why would you hire someone who does estate planning and whatnot? Most private criminal defense attorneys are former prosecutors, which means they a great deal of trial experience and know the criminal court process inside and out. And if they've been doing criminal defense for a substantial amount of time, they've acquired yet more experience with it.

    Agreed that you shouldn't use a corporate or estate lawyer for criminal defense... and your corporate or estate lawyer knows the same thing and 99% of them will refuse to take a criminal defense case and instead refer the client to an attorney with the right experience and expertise.

  19. Re:Voice activated check split app on Google Wants Patent On Splitting Restaurant Bills · · Score: 1

    When did the customary 15% become 20%?

  20. Re:Fine Print on Google Wants Patent On Splitting Restaurant Bills · · Score: 1

    And the not-so-fine print is that anyone who is that creepy about itemising his/her expenses to that extent at a social gathering will be the individual who will not be invited again.

    OTOH, if the detailed itemization is completely automatic, except for people voluntarily marking the items on the bill that were theirs, there won't be any socially-awkward discussion about it. In just a few seconds everyone pays their proper portion. If someone fails to claim their items on the bill then that may lead to some awkwardness, which will motivate everyone to do the right thing.

    I can see the system working very well.

  21. Re:"Innovation" on Google Wants Patent On Splitting Restaurant Bills · · Score: 3, Interesting

    This is the most anti-competitive, anti-science and anti-progress way to do R&D that I can imagine.

    That's because it has nothing to do with R&D. Fairly few patents generated by engineers in tech companies even have anything at all to do with their day to day work, and aren't things that they actually build.

    Incentives like the ones you mention (and, yes, Google does the same thing, except IIRC the bonus amounts are higher) do accomplish exactly what they're intended to accomplish: to build up a massive quantity of low-quality patents as inexpensively as possible. This is because the companies incenting this patent mania don't actually intend to use the inventions in any products, or really to use them directly at all. The goal is merely to build up a warchest of patents to increase the odds that if the company is sued for patent infringement that it can find something in its warchest with which to countersue.

    In a nutshell: These patent incentives are about building legal capabilities, not technical capabilities.

    For much of its existence, Google eschewed this patent arms race because it (rightly) viewed it as irrelevant or even harmful to actual progress. But the reality of the system in which we live eventually caught up with Google, and after finding itself at the mercy of other companies who did play the game, Google realized that it also has to play. Google bought Motorola to acquire a pre-packaged patent warchest, and also began incenting its engineers to produce patents.

    Not many Google engineers do, actually, because outside of the bonuses there's little or no internal incentive to do it. Getting a bunch of patents that everyone knows are silly and useless won't get you promoted, or even a raise, and it won't increase your peers' estimation of you (which is why it won't get you promoted; promotions are based almost entirely on peer review). Nor will it lower your peers' opinions of you. It's just irrelevant, except for the extra cash.

    IMO, this is exactly the right response by Google's management. The reality is that Google must have and continue accumulating a patent warchest, because that's how the world works. Google is also lobbying for patent reform, but that's a slow and uncertain prospect. But it's also true that while being able to survive legal battles is critically important to a tech company's survival, a company's success comes from its technology, so it would be a bad idea for Google to build a culture that actually glorifies patents. So, promotions and status are based on impact, but Google engineers who want to can earn a little extra cash by coming up with patentable ideas.

    It's not ideal, but within the context of the litigious world we inhabit it's the best approach.

  22. Re:Racial discrimination? on Scientists Boycott NASA Conference Because of Ban On Chinese Participants · · Score: 1

    Federal laws prohibit discrimination not just on race, but also "national origin"

    But not on citizenship. A Chinese national who acquired, say, Swedish citizenship could attend. A Swede who moved to China and became a Chinese citizen could not. Therefore, it's not discrimination on race or national origin.

  23. You know what kills heat transfer? Scale. This system will die (i.e. drop to not so fancy smancy levels) as soon as the scale builds up. - a chem. eng.

    Will scale accumulate on superhydrophobic surfaces? I would think the water should move off the surface too fast to evaporate.

  24. Re:That doesn't follow on Lavabit Case Unsealed: FBI Demands Companies Secretly Turn Over Crypto Keys · · Score: 1

    I don't think so. There's a big difference between the legal firepower available to a small service provider like Lavabit and someone like Yahoo or Google -- and handing over the ability to read everything is definitely not something that a simple warrant can legally require. Nor even an NSL.

    There's also a difference in the willingness to fight of someone like Yahoo or Google, as already well demonstrated. Neither company would shut down rather than comply if faced with such an order.

    Lavabit wouldn't shut down rather than comply with the original warrant, either. In fact, Lavabit eventually decided to comply, but given the nature of their system and the way they'd tried to obstruct the warrant initially, the feds didn't trust them to comply and do demanded total access, with the support of the court. Lavabit chose to shut down rather than throw the doors open.

    Google and Yahoo would have complied with the initial, narrow request, so the sweeping demand would never have come up. But if it had, I really doubt they'd have rolled over. I'm certain Google would have refused, at least.

  25. That doesn't follow on Lavabit Case Unsealed: FBI Demands Companies Secretly Turn Over Crypto Keys · · Score: 4, Informative

    if the FBI can force Lavabit to hand over their SSL key or face shutdown, they can do it to anyone.

    I don't think so. There's a big difference between the legal firepower available to a small service provider like Lavabit and someone like Yahoo or Google -- and handing over the ability to read everything is definitely not something that a simple warrant can legally require. Nor even an NSL.

    In fairness, in this case the FBI's original request did ask for just specific metadata about one user. I haven't read it closely enough to understand how the scope was broadened so dramatically, except that I understand that Lavabit refused to comply early on, and then eventually the FBI decided that they didn't trust Lavabit to comply correctly due to Lavabit's obstructionism, and so decided that they just wanted to be able to read all the traffic and extract the bits they needed themselves.

    Lavabit, of course, decided to shut down instead. That way there would be no traffic to read.