top Justified: Visual Basic Over Python For an Intro To Programming
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.
top R Throwdown Challenge
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 ( http://www.burns-stat.com/page... )
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.
top Winning Algorithms For Rock, Paper, Scissors
Well, I don't know. Let's get a game started to test this..
top Blogger Fined €3,000 for 'Publicizing' Files Found Through Google Search
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.
top Fracking Is Draining Water From Areas In US Suffering Major Shortages
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?
top Microsoft Research Uses Kinect To Translate Between Spoken and Sign Languages
I'd love to see a blind person use sign language.
top The Legal Purgatory at the US Border: Detained, Searched, and Interrogated
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.
top US Forces Ready To Strike Syria If Ordered
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.
about a year and a half ago
top Cause of LED Efficiency Droop Finally Revealed
I'm literally about to piss myself from this news.
I would have been more comfortable if that sentence was at the end of your post, rather than at the start.. it now leads to two possible conclusions:
1. You don't know what literal means, or
2. You now smell funny.
top Nikon Buckles To Microsoft, Will Pay "Android Tax" For Smart Cameras
Yes, American companies being sued in the US can risk standing up for themselves in court, as they have a fair chance of getting a fair trial...
.. a japanese company, not so much.
top Python Gets a Big Data Boost From DARPA
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.
top Police Raid Home of 9-Year-Old Pirate Bay User, Seize "Winnie the Pooh" Laptop
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
Oh, and I wouldn't have it any other way.. damn proud of it in fact.
top Police Raid Home of 9-Year-Old Pirate Bay User, Seize "Winnie the Pooh" Laptop
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
top US Army To Train Rats To Save Soldiers' Lives
I actually worked in demining in South Sudan for a while, so just figured I could share a little bit of info:
As far as machines and how stuff is done now, check out
minewolf. They're the de-facto producer of mine-clearing equipment. Basically, you have three sorts of methods for clearning an area. Machine, manual with detectors or dogs. As often as you can, you use a machine to do it quicly, and then use dogs/manual for verification. Dogs are not considering good enough for primary search, only verification.. and some organisations have trouble pulling that off even. Dogs are difficult, but a lot cheaper and faster than humans.
As far as using mice goes, they need to be very good. The UN does accredition for most humanitarion demining, so the mice will need to find all the mines in a training field before they're allowed to do real work. I really don't see that happening anytime soon.
As a low-cost solution for the army, or if you need something quick-n-dirty in a disaster zone I'm sure they have their uses though.. but with humanitarion demining, you kinda need to be able to tell people that they will not blow up if they start farming the land you just cleared.. which makes it a very slow process which takes a lot of effort, a whole different beast than military demining.
Also, on that note: fuck the US for dropping shitloads of cluster munitions on Laos, when you weren't even at war (Laos is the country next to Vietnam) and then having the fucking balls to not even attempt to help clean it up afterwards. FYI Canada and Europe are there now cleaning your mess.. some people consider less innocent children being blown up in pieces a good thing. Some people are, as a collective, not fucking assholes.
If you had any sort of decency you'd sign the Ottawa Treaty.
top The Oslo Massacre and Violent Video Games: the Facts
Personally I think Monopoly is the root cause of all the financial problems we're having for the past years.
2.5% unemployment, 520$ billion dollars stashed away in a goverment fund for later spending, universil healthcare and ridicilously good unemployment benefits (80% of your last salary, available for 100 weeks as long as you're looking for a job). Apart from the odd massacre and a holier-than-thou-attitude we're fine thank you.
top The Oslo Massacre and Violent Video Games: the Facts
If your media makes a big deal out of him gaming, read better media. If you can't find any, stop reading. You're probably better off.
His manifesto actually (readily available in english) makes a big deal out of how pretending to have a gaming addiction is really usefull for hiding nefarious activities. He wasn't a gaming addict, he was using it as a cover.
Also, if your media is one of those who kept harping on about this being muslims long after it was clear he was Norwegian you're probably better off without them either (I'm looking at you NY Times). The american coverage of this incident has been pretty much abysmal, and I'm sorry for being able to read english. I wish I couldn't.
However, while his gaming certainly didn't affect him, it's pretty clear that the fact that he was taking a coctail of anabolic steroids did. He even described it himself in his manifesto. To which extent we won't know until later, but we'll figure it out. There's plenty of time, and we have to grieve a bit of first.
(Also; Glenn Beck; May you burn in hell)
top When the Internet Nearly Fractured
Take a look at
.COM for example. DNS is now basically flat, despite the original intent
Well, being Amercan you're missing half the web
All the different native language sites out there are hiding under
.no, .sp, .de etc, and there really is quite a lot of them. About half the websites I visit are from .no, so I think it's more a matter of saying what language they use and where they do business. Basically, I think the American companies messed up, while the rest are behaving themselves... but given your view of the world that's hardly surprising (ever considered inviting other countries to the world series of baseball?)
top Google Drafts Cloud Printing Plan For Chrome OS
Fine, alot of you don't see the need for this. Don't use it, and more importantly, don't complain about it.
I work as teacher, mostly for fun, and got suckered into supposedly being admin for the school network. In reality I'm a general janitor / IT-support though. I have next to no time to spend on actually setting infrastructure. If anybody gives me a simple solution for printing any document, from any operating system on any computer easily to our public printers I'd give them a big, wet kiss. I certainly don't know any easy way of doing it now, because adding printers to students laptops is a f***king bother, and there's always some weird problem.
I'm certainly sure there's lots of other uses for this, aswell as lots of places it won't be usefull.
top Every British Citizen To Have a Personal Webpage
We have a single website for this in Norway already (norge.no), it's bloody usefull. Everything you need from the government is either there, or linked to from it. They even run free phone/sms/e-mail support.
There's nothing sinister about it, it certainly hasn't magically removed the bourecrazy, but it is another of the many small reasons I'm slightly smug to be norwegian; The land where stuff for the most part just works (which still doesn't stop people from whining though).
top Math Anxiety Affects Skills As Basic As Counting
I'm a high-school teacher (16-18 year olds) and can confirm this.
When I get my students I work really hard on teaching them to relax during math tests. Mainly by going around chatting, drawing stupid stuff on the whiteboard and just generally being bored. I estimate this improves math grades by around half a point (on a scale from 1 to 6, where the entire scale is actually used).
Grades jump up by atleast 1 grade when I take over classes though. The rest I attribute to me being awsome.