Please create an account to participate in the Slashdot moderation system


Forgot your password?
Take advantage of Black Friday with 15% off sitewide with coupon code "BLACKFRIDAY" on Slashdot Deals (some exclusions apply)". ×

Comment Re:instant disqualification (Score 1) 648

What a non-sensical reply.

Actually that example is not even valid Python code, you'll get an 'n not defined'.

It's certainly valid code. It's an algorithm for finding all prime numbers up to n. If you don't supply n it will not work. There's no way around that in any language whatsoever in any way.

Furthermore you need to indent it properly

If you need to indent it properly it's really, really not a oneliner.

And VB6 you can actually do this on one line :)

Sub Eratost() : Dim sieve() As Boolean : Dim n As Integer, i As Integer, j As Integer: n = InputBox("limit:", n) : ReDim sieve(n) : For i = 1 To n : sieve(i) = True : Next i : For i = 2 To n : If sieve(i) Then : For j = i * 2 To n Step i : sieve(j) = False : Next j : End If : Next i : For i = 2 To n : If sieve(i) Then Debug.Print i : Next i : End Sub 'Eratost

By this logic, s/\n/; would make any VB6-script into a one-liner. You're really supposed to use one statement, or atleast find something that fits on one line. That code is just a complete algorithm without lineshifts. A one-liner it is not.

Comment Meh (Score 5, Informative) 185

Statistics major who programmed Python professionally for a few years (and have a MsC in Comp.Sci) ...

... this is all posturing and drama, but good on Prof. Norm Matloff for getting some attention. R is rather usefull, has quite a few extremely usefull features as a language, including some of the best list/indices handling I've seen anywhere. Excellent libraries for statistical work, but it also has quite a few the most downright abhorrent language decision I've seen anywhere ever, with the amazingly poor string handling (for a scripted language) topping that list ( )

Python, C, Mathematica and R all have different strengths for mathematical work / numerical calculations though, and using the best tool for the job is what it's about. As always, what the best tool actually is, is also rather subjective, as which tool will best solve a specific task is always dependent on your skill with the different tools. I do agree with professor though, even though there's quite abit of Python hype (python + scipy/matplotlib is amazing) R is not being replaced anytime soon. It's too good at what it's good at.

Comment Re:Theft from an Unprotected Site is Still Theft (Score 1) 248

Downloading from a NAS on a local network is substantially different from downloading from a webserver on the internet.

The first one is obviously intended for local use, and unless one has good reasons to believe otherwise one should assume it's private content.

.. a fucking webserver on the fucking internet following a link from fucking google? That's tree separate reasons for assuming it's public content intended for sharing, so that's what any reasonable person should assume it is.

Comment Holy crap (Score 5, Insightful) 268

Holy crap. Up until now I thought all the 'beta sucks' comments where just 'I hate new stuff'-type comments...

.. but I just got served my first beta-page and well, it sucks. It sucks on so many levels I actually think this design isn't salvagable. It's so hard to read, navigate and use that it is, well, useless. I am honestly curious how anyone would think it's a good idea to push anything like this out to users.

Seriously, this is even worse than Windows 8 (the first windows version, including Vista, I hated enough to not even keep as a dual-boot alternative). What's wrong with people?

Comment Re:The real issue: U.S. government corruption. (Score 1) 555

So, yeah, you may eventually leave the interrogation room after the maximum legally-allowed eight hours and fifty nine minutes later (depending on jurisdiction and assuming they haven't found some pretext to "indefinitely detain" you), having missed your flight, your luggage thoroughly ransacked, your every last piece of electronics down to and including the xbox controller confiscated, your name permanently engraved on their hassle lists, your house searched, your neighbours and employers queried and your every phone call tapped for the next two years, but hey, you sure showed them, right?

Well, that's proof of a highly dysfunctional society atleast.

However, given the two alternatives using truecrypt with a hidden volume or leaving all sensitive data at home, the former is still strictly better. If they suspect you have a hidden volume you will get shit for both options, and if they don't you won't. The only difference is that in the former you will actually have access to your data.

Comment Re:Here we go... (Score 5, Informative) 918

Here is a question: What the hell is going on in Syria? So far as I can see it is one group of idiots who are being destructive and killing innocent people attacking another group of stupid idiots who are also being destructive and killing innocent people, with a whole bunch of people who have no voice at all caught in the middle not knowing what the hell is going on and just trying to get out of the way.

If this was correct, it wouldn't actually be that bad. You could atleast start bombing and force the two sides into talking to eachother Balkan style..

What you do have is Assad on one side, Al Nusra (batshit crazy muslim fundamentalist officialy al-qaeda affiliated) with some strongholds in south, you have various fundementalist groups roaming the less populated (north) east and the so called Free Syrian Army which try really hard to present itself as being "the opposition", while in reality the FSA are made up of many groups who barely talk to eachother. As seen from the number of fighters who have recently changed from FSA to Al Nusra it is also clear the FSA has strong fundamentalist ties.. although they are playing to "get in a position of power when the west goes in and wins the war"-game rather expertly. Syria was fragmented before this war, with several major groups with different religious and ethnic/political ties. Damascus and the south was always closer to Libanon and the it was the rest of Syria, and Aleppo was always close to Turkey and the Kurds.

In short, the entire situation is a fucking nightmare. I can't see any solution to this conflict, and getting involved in it will fuck us over too. I honestly see Assad winning as the least horrible solution to this conflict now... and that's one pretty horrible alternative.

The Military

United States Begins Flying Stealth Bombers Over South Korea 567

skade88 writes "The New York Times is reporting that the United States has started flying B-2 stealth bomber runs over South Korea as a show of force to North Korea. The bombers flew 6,500 miles to bomb a South Korean island with mock explosives. Earlier this month the U.S. Military ran mock B-52 bombing runs over the same South Korean island. The U.S. military says it shows that it can execute precision bombing runs at will with little notice needed. The U.S. also reaffirmed their commitment to protecting its allies in the region. The North Koreans have been making threats to turn South Korea into a sea of fire. North Korea has also made threats claiming they will nuke the United States' mainland."

White House Petition To Make Cell Phone Unlocking Legal Needs 11,000 Signatures 193

On January 26th, unlocking a cell phone that is under contract became illegal in the U.S. Just before that went into effect, a petition was started at to have the Librarian of Congress revisit that decision. "It reduces consumer choice, and decreases the resale value of devices that consumers have paid for in full. The Librarian noted that carriers are offering more unlocked phones at present, but the great majority of phones sold are still locked." The 30 days time limit on the petition is almost up, and it's about 11,000 signatures shy of the amount necessary to ensure a response from the Obama administration (100,000 total, recently increased from 25,000). The creator of the petition received a Cease & Desist letter from Motorola in 2005 for selling software that would allow users to unlock their phones, and he thinks it's only a matter of time before such legal threats begin again. This is part of a larger battle to protect the way consumers can use their devices. While it's still legal for people to root their phones, the Librarian of Congress failed to expand that legal protection to tablets, even though the devices are incredibly similar. The Librarian's decision (PDF) needs further review, and if the White House petition doesn't get enough signatures by February 23, such a review may not happen.

Comment Re:Wrong language (Score 2) 180

R is a statistical programming language. It has lots of neat methods and functions implemented, and is rules the world of statistical analysis.. which is kinda cool, since it's also open source.

It sits pretty much halfway between Matlab and Python.. It's pretty usuable and convenient because of the huge library, but as a programming language it just, well, sucks ball. Building up the objects some of the methods there need, if you get data from an unexpected source, is just an utter pain in the bottomhole.

Comment Scandinavia, the great country! (Score 4, Interesting) 376

Seriously, this so-called article doesn't even state which country it happended in.. nor does any of the links in it.

I live in Norway, in this certainly hasn't hit the news here.. and if it did, you can be damn sure there would be hell to pay for somebody. Our authorities are so fucking nice that even after Breivik blew up our government headquarters and shot around 80 kids.. one by one.. we still hadn't scrambled the military or even gotten choppers in the air. I honestly suspect if our police (who don't have guns) tried to take a 9 year old girls laptop they would comply when she kicked them and told them go away :)

I was playing poker the other night... with Tarot cards. I got a full house and 4 people died. -- Steven Wright