Slashdot Mirror


User: dgatwood

dgatwood's activity in the archive.

Stories
0
Comments
14,277
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 14,277

  1. Re:so what - it doesn't do innovation for you? on Hard Truths About HTML5 · · Score: 1

    Why not? It makes porting to C (and other languages) a lot easier later when you realize you can't get the performance you want out of PHP. The most portable style of quoting is double quotes. That's the only style in which the rules for backslash escaping are fairly consistent across most programming languages. With single quotes, the rules are inconsistent. Heck, in some shell script dialects (not all, to make things even more fun), to echo a single quote inside a single quote container, you have to leave the single quote container entirely, e.g. 'It'"'"'s a beautiful day' or 'It'\''s a beautiful day'. Ugh. With double quotes, pretty much every programming language from shell scripts and C up through the latest Ruby goodness handles things the same way. This alone makes double quotes vastly preferable to single quotes when defining a string.

    Also, I would argue that using quotation marks consistently (whether you're working in PHP or JavaScript or whatever) makes programming a lot easier. If you always use double quotes, you won't have to redo all the quotation marks (either replacing them, adding escaping backslashes, or some combination of the above) later when you need to add a variable into that statement. Also, if you consistently use double quotes, you won't have the risk of adding a variable, then swearing when you realize that you didn't notice the single quotes, your code just wrote gibberish into your test database, and you now have to rebuild a dozen records by hand. Or worse, your production database.

    Finally, the snippet above has quotation marks within quotation marks. Using double quotes on the outside and single quotes on the inside is just as valid as the reverse, and is a lot cleaner than using \' or whatever. Reserve that for the annoying case where you need a string with both single and double quotes inside it (e.g. print "<a onclick=\"dosomething('blah')\">...".

    Above all, though, the most important rule in coding is to use a consistent style throughout your code. Therefore, since some of your strings will almost certainly contain variables that you want expanded, you should consistently use double quotes (unless, of course, you consistently use string concatenation because you don't believe in interpolation at all).

    In short, Mr. or Ms. Anonymous Coward, whoever taught you programming taught you wrong.

  2. Re:WTF on SpyEye Trojan Source Code Leaked · · Score: 2

    Please explain exactly how "human stupidity" leads to malware infections.

    User is presented with a web site banner ad for a fake antivirus product. User downloads the antivirus product and installs it. User gets hosed.

    I'm sure I can come up with a simple technical solution for every one.

    Good luck with that. (BTW, solutions that bring with them a host of other problems, e.g. walled gardens, don't count, as they aren't simple.)

  3. Re:pay people a living wage in a western country on Which Company Is the Largest? · · Score: 1

    US corporations sending jobs overseas but keeping the profits here seems wrong on two levels, and I suspect it only benefits corporations (or rather a small number of individual people who call themselves a corporation).

    Not really. It benefits the general public in the U.S. by significantly lowering the cost of goods and services, too.

    Given that the US likes to not tax corporations either, it -really- only benefits those few people, and screws the rest of us over.

    Ultimately, taxing corporations boils down to a federal sales tax. The corporations just pass the costs on to the people buying their products or services. Thus, corporate taxes are really a regressive tax when you get right down to it. If your goal is to tax the rich people at the top, you have to tax the rich people at the top. Taxing the corporate entity is utterly useless; the only way to see any real redistribution of wealth is by taxing capital gains above a certain dollar threshold as ordinary income.

  4. Re:pay people a living wage in a western country on Which Company Is the Largest? · · Score: 1

    No, it isn't. "Do what I say or I'll kill you" gives you only two options:

    • Do what I say.
    • Die.

    By contrast, unless you are on death's door already, "Do what I say or I'll leave you to die" gives you three options:

    • Do what I say.
    • Die.
    • Go look for someone else who will give you another option.

    The difference between slavery (and indentured servitude and other coerced labor systems) and any non-coerced labor system is that in the latter case, there is always the fundamental right to leave. I'll grant you that it is not always possible to leave because of other commitments, a weak labor market, lack of transportation, or for various other reasons, but that doesn't really mean that the other options aren't possible or survivable. By continuing to work at a company that exploits you, you are choosing that over not just one alternative, but a plethora of alternatives.

  5. Re:Don't go cheap! on Ask Slashdot: Laptop + DSLR Backpacks · · Score: 1

    Look for a backback with good padding that will spread the load across a large portion of your shoulders. If it feels like it's pulling back on your shoulders while using the contact spot on your spine as a fulcrum, don't get it.

    Well, that's probably good advice in spite of the rest of the message.... However, I don't think it goes nearly far enough. My advice would be to not use a backpack at all except for carrying the laptop. If you're carrying around a bunch of lenses in a bag on your back, you're going to be throwing your balance way off, and that's just plain not good for your back.

    Instead, invest in a large fanny pack and wear it in front of you. Wear the backpack on your back with the laptop, and put your DSLR camera, flash, a couple of spare batteries, some disposable lens wipes, and two or three of your most commonly used lenses into the fanny pack. Leave everything else at the hotel or at home. This is how I travel when I'm shooting (minus the laptop—I leave that at the hotel, too). It's easier to deal with than a shoulder bag, but without the problems of having all that extra weight so far from your center of gravity.

    Alternatively, use a rolling backpack and get all the weight off your back.

  6. Re:Stay Put on Ask Slashdot: Am I Too Old To Learn New Programming Languages? · · Score: 1

    There's really no risk of us not being able to pay the interest on our debt. In 2010, it was a paltry $164 billion out of a $3.55 trillion budget. That's only about 4.6 percent of the federal budget. Sure, we shouldn't have a $3.55 trillion budget on a regular ongoing basis, but it's utterly absurd to even suggest that we're anywhere close to the breaking point as a nation.

    More to the point, political grandstanding in order to try to force changes to Medicare, Medicaid, and Social Security under threat of default sends signals to the market that our elected officials don't know what the **** they're doing and that at any point in time, the stupid morons could screw things up so badly that we default on our bonds. That's what blew the credit rating, period—not the worry that someday, decades from now, we might not be able to pay off our bills, but the worry that someday, a few months from now, a handful of asshole senators and representatives could force our country to default just to score a political "win" against somebody else. And the Tea Party is right at the center of that foolishness.

    The bottom line is that there's a right way and a wrong way to do things; getting your way by shutting down the government is always the wrong way, and is the quickest way to get us into very real trouble.

    We need a real third party, and we need to cut the size of our government, but we need to do it through policy changes passed down from the top that cause the government to become more efficient from the bottom up. It's a problem that simply cannot be solved from the top down.

  7. Re:Stay Put on Ask Slashdot: Am I Too Old To Learn New Programming Languages? · · Score: 1

    Both parties would have increased it without giving it a second thought. And we wouldn't have lost our AAA credit rating.

    Just saying.

  8. Re:US cell system on Leaked AT&T Letter Damages Case For T-Mobile Merger · · Score: 1

    If there were no government to distort the free market, we would currently have hundreds of competing carriers with excellent service, speeds, *and* price.

    And they would provide that service by bulldozing random people's houses to put cell towers in... without permission or compensation.... And they would use frequencies that jam emergency responder communications... and TV... and radio.... And some new company would come through and trench across your driveway every three months laying new cables.

    There's a reason for regulation in the telecom space, and it's not to make competition harder. Read up on the tragedy of the commons to understand why an unfettered free market can't work.

  9. Re:US cell system on Leaked AT&T Letter Damages Case For T-Mobile Merger · · Score: 1

    So your answer to bad politicians is to give them even more power?

    Nationalizing doesn't necessarily require the politicians running it. The government could buy the telecoms, combine them into a single, nationwide LTE infrastructure, and then spin it off into a government-owned nonprofit corporation, subsidizing it periodically with infusions of tax money the same way they do with the existing telcos today, but subsidizing a nonprofit corp that can't (by design) overcharge its customers.

  10. Re:Stay Put on Ask Slashdot: Am I Too Old To Learn New Programming Languages? · · Score: 4, Insightful

    Republicans, as a whole, are not true conservatives. Your point?

    The only difference between Republicans and Democrats is in their method of taxation:

    • The Democrats tax directly and above the board.
    • The Republicans tax stealthily in a way that doesn't look like a tax to people who don't really understand how the economy works—specifically, by borrowing money, causing the Federal Reserve to increase the money supply, resulting in inflation on the price of goods and services.

    The net effect is exactly the same except that the tax that the Republicans favor tends to disproportionately affect the poor. It's basically equivalent to a sales tax or a corporate tax, except that it is achieved in such a way that you can't pedantically call it a tax.

    Anybody who says the current crop of so-called conservatives don't tax is... well, to roughly quote Futurama, "Bureaucrat CoolHand2120, you are technically correct—the best kind of correct."

  11. Re:Obvious... on How Does GPS Change Us? · · Score: 1

    Both my Garmin and my TomTom do things like that at times. It's not configuration, and it's not the device sucking. It's poor maps that don't know anything about traffic lights.

    Case in point, if you ask for directions to Holy Cross in Santa Cruz from the South Bay, the Garmin directs you to take the left exit onto Ocean Street, take a right at Water, and turn right onto Emmett St. If you don't know what you're doing, that avoids an awkward, light-free left turn at Emmett, but it takes about ten minutes longer because A. it's 30 MPH city streets (I think) instead of 45 MPH for most of Chestnut, and B. the traffic lights on Water at Center and Pacific conspire to make you wait a small eternity, plus the light on Water at River, plus three or four lights on Ocean, for a total of six or seven lights, all of which you will almost invariably hit red, statistically speaking. BTW, Google Maps also gives the same set of awful directions.

    You can avoid most of those lights and still avoid the awkward left turn by taking the right fork and turning left at River St and right where Pacific branches off, but that's still five traffic lights (one of which you're turning right at) instead of two if you had taken the right fork and turned left at Mission instead. So it's not a lot slower, but it is a little slower most of the time.

  12. Re:Wrong, Apple shot first on Sale of Samsung Galaxy Tab Blocked in the EU · · Score: 1

    That article says that Apple sought injunctions. That's not necessarily the same thing as seeking an import injunction. There are any number of things Apple could be trying to enjoin Samsung from doing. They could be enjoining them from using Apple-like packaging, using Apple-like ads, or any of the other thousand things they're doing that are blatant rip-offs of Apple's style.

  13. Re:supposedly obsolete tech on PC Designer Says PC "Going the Way of the Vacuum Tube" · · Score: 1

    Oh, you'll get no disagreement about that part from me. Tubes definitely produce a different character of sound, though which one sounds better is subjective. The lower THD part, however, strikes me as kind of dubious.

    Also, if favoring certain harmonics results in a more musical tone, then lower THD would inherently eliminate that effect, as it is the harmonic distortion that they are arguing makes it more musical. So it is certainly possible in theory that a tube mic preamp could have lower THD than any chip-based amplifier, though I'm not aware of any that actually do, and it is certainly possible for one to sound more musical, but it is not possible for a single tube mic preamp to do both at the same time. :-)

  14. Re:Wrong, Apple shot first on Sale of Samsung Galaxy Tab Blocked in the EU · · Score: 1

    The proportional response is suing. Samsung asked the ITC for an import injunction. That's what made their reaction the nuclear response.

  15. Re:Even and odd harmonics on PC Designer Says PC "Going the Way of the Vacuum Tube" · · Score: 1

    Another pet peeve of mine is the "44kHz means we can replicate 22kHz signals!" guff. NO IT WON'T. It will allow you to discriminate and reproduce the FREQUENCY up to the Nyquist limit, but you need to know the amplitude as well. Two samples won't do it, you really need three and even then you are going to have a large discrepancy in the amplitude (because your DAC isn't 100% accurately linear). So you may have the frequency right, but you have the strength wrong.

    Yeah, but you're going to have a brickwall filter that takes out most of the upper frequencies that even approach the Nyquist limit before they even get to the ADC, thus largely eliminating the affected signals anyway.... :-) So you're not even remotely reproducing signals up to half the sampling rate in practice....

    In other news, the move from 96 kHz to 192 kHz sampling rate is still pointless. :-)

  16. Re:supposedly obsolete tech on PC Designer Says PC "Going the Way of the Vacuum Tube" · · Score: 1

    A tube mic preamp can be much cleaner and musical with less THD than any amplifier on a chip.

    [Citation needed]

    I've seen solid state preamps with ~0.0007% THD. Even the best tube preamps I've heard of have THD that's almost an order of magnitude greater than that. Many tube preamps have THD that's about three orders of magnitude greater than that.

  17. Re:Wrong, Apple shot first on Sale of Samsung Galaxy Tab Blocked in the EU · · Score: 2

    I'm not arguing that Apple was necessarily right for filing the initial suit (as I don't know enough about the discussions leading up to it to make that call). I'm just pointing out that Samsung had the opportunity for proportional response, and instead chose the nuclear option. Up until that point, AFAIK (unless the mainstream media just hasn't reported on the case adequately), the lawsuit from Apple was asking for financial damages, which probably could have turned into an out-of-court settlement if Samsung had offered some sort of concessions. I have no idea what Apple would have actually asked them to do in exchange for dropping the suit, but I'd be surprised if the two parties were not well aware of the other side's demands.

    As soon as Samsung took it to the next level and started trying to block importation, that's when things got ugly. Samsung made that choice. The decision to jump from a patent violation lawsuit to blocking the other company's ability to do business was entirely Samsung's, as far as I can tell. That's why I referred to it as mutually assured destruction in the best case, self destruction in the worst case. Taking such drastic steps is almost always counterproductive.

  18. Re:Why can't Samsung do the same? on Sale of Samsung Galaxy Tab Blocked in the EU · · Score: 3, Informative

    I'd be a lot more broken up about it except that Han shot first. AFAIK, Apple only started filing suits to block Samsung's hardware sales after Samsung began ITC proceedings to block Apple's hardware sales in the U.S. Even in the best case, trying to block import of a major company's devices via the ITC is a case of mutually assured destruction, and in the worst case, it's throwing the hand grenade soon enough for the enemy to throw it back.

  19. Re:Mac SCSI display on External Thunderbolt Graphics Card On Its Way · · Score: 1

    AFAIK, you could ostensibly pass arbitrary protocols in a Thunderbolt packet. The fact that TB currently only provides for two standard packet types (DisplayPort data and PCIe) doesn't inherently prevent a USB packet type.

  20. Re:Thunderbolt = dead in two years. on External Thunderbolt Graphics Card On Its Way · · Score: 2

    Anybody else think thunderbolt is a technology looking for a solution?

    Actually, I think that USB 3.0 is a technology in search of a solution. The only thing USB 3.0 does better than 2.0 is move large quantities of data. This pretty much means that its utility is limited to storage devices such as hard drives, SSDs, etc. (Printers are already served much better by Ethernet, IMO, and most other devices don't need that much bandwidth.)

    For storage purposes, eSATA utterly spanks USB 3.0 because of the lower protocol overhead, and is cheaper because of the lower silicon requirements. Further, with the (unofficial standard) combination eSATAp ports, USB 3.0 provides no real benefit over eSATA.

    As far as I can tell, by the time USB 3.0 finally made it into silicon, the only reason for USB 3.0 to even exist is to push manufacturers to build enough power handling into their USB ports to make eSATAp possible. I don't expect a USB 4.0. Ever. By contrast, eSATA will continue to get faster.

    USB is cheaper, almost as fast, and ubiquitous.

    If everything is perfectly optimal, USB 3.0 is half as fast as a single Thunderbolt channel. On most Macs, each cable has two channels, for a total of four times as fast. So no, it's nowhere near as fast.

    The reason for Thunderbolt is actually pretty obvious if you look at Apple's history. Apple has consistently looked for ways to allow a single cable to connect from your monitor to your computer and still provide USB and FireWire ports on top of your desk. Prior to Thunderbolt, this required either an Apple-proprietary video cable (the ADC connector) or running a bundle of wires that broke out into multiple connectors near the computer end. With Thunderbolt, they can do the same thing with a single, industry-standard cable. And have. It has FireWire 800, Gig-E, and USB (2.0—Apple hasn't gotten on the USB 3.0 bandwagon) ports.

    I'd bet a month's pay that Apple will start removing Thunderbolt ports from Macs in 2014

    If I were placing bets on what ports Apple will lose by 2014, my money would be on pretty much all the other ports. With Thunderbolt, Apple could provide a single USB port, a headphone jack, and a single Thunderbolt port, and it would take care of everyone's needs. Apple or a third party could provide FireWire, Ethernet, and USB breakout dongles for the few people who really need those other ports in the field, and Apple could sell its existing monitors for the 99% of people who only need them while tethered to a desk.

    Given how much more flexibility Thunderbolt gives Apple, someone would have to be crazy not to take you up on your 2014 bet if you weren't posting as an A.C. Even if no one but Apple adopted Thunderbolt, and even if no non-Apple Thunderbolt peripherals made it to market, it would already be as successful as necessary to all but guarantee long-term relevance.

  21. Re:If only Americans had heard of parks. on The Mathematics of Lawn Mowing · · Score: 1

    If you really care about privacy while you are outdoors, this is what tree rows are for. :-)

  22. Re:I don't know much about electronics.. on Science Fair Entry Shuts Down Airport Terminal · · Score: 1

    Heck, if I could FedEx myself, I'd never take a commercial jet again.

  23. Re:Security Theater on Science Fair Entry Shuts Down Airport Terminal · · Score: 2

    except that this actually isn't security theater. It's the useful kind of security procedure that actually prevents bad stuff happening.

    Up until the point where they shut down half the airport, I'd have agreed. This is the sort of situation where you could ask the person to describe the contents of his/her luggage, then open the luggage, inspect the contents to verify that the story was plausible, and you're done.

    If you don't have people smart enough to figure out how to verify the safety of the device, then that's half your problem right there. Hire smarter people. But I digress. In the absence of such intelligent people, you pull the person into a screening area, and you pick up your radio and you call for somebody smarter than you.

    As soon as the words "shuts down airport terminal" appear arising out of a kid's science project, it's an epic fail. Either it means that they overreacted or it means that they don't have even one single secure storage area where they can place a dangerous device without risk to the public. Either one is a sign that these people know about as much security as the average Slashdotter knows about women....

  24. Re:Get ye some 802.11a. on Ask Slashdot: Overcoming Convention Hall Wi-Fi Interference? · · Score: 2

    Actually, it helps a lot. Remember that most traffic is downloading, so the base station statistically does a lot more transmitting than the clients. Even if transmit and receive were equal, though, cutting the shouting in half would still be a big improvement in total noise.

    Also, you're forgetting that clients usually reduce their transmit power when possible to maximize battery life. By increasing the station density and lowering the power of the base station, you are significantly reducing the chances of any client talking to a station that is too far away, thus significantly reducing the power that those clients use to talk.

  25. Re:The scam will always win -- its all about the s on Ask Slashdot: Does SSL Validation Matter? · · Score: 1

    Your arguments have not pointed out any fundamental technical problems with using SSL to verify the server-side.

    The fundamental technical problem is that the SSL certificate cannot prove that the server has not been compromised, and is therefore not truly proving the identity of the server, but merely proving that the server has a copy of the private key registered for the domain. This basically makes the identity aspect of the cert no more valuable than a self-signed cert or bare public key stored in the DNS record, assuming that DNS is sufficiently secure.

    Let's step forward a couple of years into a world where every root is signed with DNSSEC. You have a verifiable path for determining that a domain record was not altered in transit, and that domain record could trivially contain a public key record. Therefore, the only way someone could compromise it is by actually hijacking control of the domain at the registrar level.

    Now, if you can hijack control of the domain at the registrar level, you can also get a domain validation cert.

    Congratulations. In the world of DNSSEC, non-EV certs are completely and utterly vestigial anachronisms that provide no additional security.

    Thus, the only question that remains is whether EV certs provide any real value. Every study I've ever seen on the subject suggests that the answer is no.