News for hackers. Stuff that matters.

voidiac

Re:Static types in Python on Friday October 14, 2016 @06:50AM (#12707236)
Python's implementation of sum doesn't care about types, the function looks something like:

    def sum(iterable):
        r = 0
        for v in iterable:
            r += v
        return v

it always starts with an integer, and since int.__add__(str) returns NotImplemented it tries str.__radd__(int) instead, which raises an AttributeError because str has no method __radd__, so no summing of strings and integers.
Re:An Unconventional Look at the European Map on Sunday May 29, 2016 @02:50PM (#11797660)
Dividing Europe based on language would make more sense: romance languages in the west, germanic in the centre and slavic in the east.
Re:Snowden’s Rubik’s Cube on Saturday April 30, 2016 @05:50PM (#11603773)
Most cubes I've seen seem to have metal springs.
The name is confusing, the first thing i thought of was an SMTP-server.
Re:So Long, and Thanks for All the Fish on Monday May 11, 2015 @09:03PM (#9528908)
Ireland and Great Britain are islands. On these two islands are two sovereign states: Ireland and the United Kingdom of Great Britain and Northern Ireland (also known as UK). The UK consists of four parts: England, Wales and Scotland on the island of Great Britain and Northern Ireland on the island of Ireland.

.ie is the domain of the state Ireland. .uk is the domain of the UK.

Re:Implementing a Virtual Machine in C on Saturday May 09, 2015 @05:43PM (#9517798)
Branching would be something like:

  case JMP: {
    ip = program[ip + 1] - 1;
    break;
  }
Re:Implementing a Virtual Machine in C on Saturday May 09, 2015 @04:34PM (#9517609)
Register based VMs are not more complex than stack based VMs. You can even have a stack and the only difference is that your instructions operate on registers and not directly on the stack. I only consider generating code more complex with a register based VM.

If you are interested here is a toy vm I wrote myself: https://github.com/byo3rn/ire

PS: I suck at documentation.

There are some more problems with the flags. The colours of the french and german flag are in the wrong order. The icelandic and norwegian flags are missing the white line around the cross. The class for the netherlands shouldn't be lb-flag-holland.
Re:Places to Go in 2015 on Friday January 09, 2015 @07:49PM (#8865371)
You can still go there.
Re:Je Suis Charlie on Wednesday January 07, 2015 @12:56PM (#8852010)
That would be "Nous sommes Charlie".
Re:How to program computers (kOS) on Friday December 12, 2014 @07:16PM (#8743487)
The free version of K can be downloaded at http://kx.com/software-download.php
Re:What the color? on Tuesday March 25, 2014 @09:03AM (#7465546)
Should be working now.
Re:GOTO (Still) Considered Harmful on Tuesday March 04, 2014 @07:57AM (#7339878)
Goto is quite common among c-programmers when it comes to error handling.
Or you could encrypt your e-mail. It doesn't matter where the server is, since the whole communication with it is probably intercepted by some intelligence agency. The only thing you can do is encrypting your e-mail and telling everyone you know to do so too.
Re:Schwartz: A Python Shell for Quartz 2D on Saturday October 12, 2013 @08:50PM (#6540999)
Is it really necessary that this application is only running on OS X 10.8+?
Re:The State of eGovernment in Germany on Sunday September 01, 2013 @02:08PM (#6311374)
Why not run your Windows in a VM and get rid of the PC?
They are blurring the answers. If you search for something and end up on quora, it can get a bit frustrating , due to the fact, that you can't read the answers and are forced to sign up. That's just rude.
If you have been on any answer with ?share=1 they're setting a cookie and you get no blurred answers until you remove the cookie or it expires.
At least there are no spaces in the directory names.
Re:Soylent: Operations Update on Tuesday August 27, 2013 @10:16AM (#6283527)
I think there is a third type in between your two types of people.
Re:Ask HN: What are your favourite free web fonts? on Monday August 26, 2013 @07:13AM (#6276283)
Source Sans Pro
Re:Mono 3.2 on Thursday July 25, 2013 @05:46AM (#6101640)
.NET is not standardised but C# and the CLI are.
Re:IFrame loop on Sunday June 16, 2013 @01:26PM (#5889143)
No it's just funny.
Re:NSA Prism logo is a copyright infringment on Wednesday June 12, 2013 @11:13AM (#5868505)
It says "requirement to credit and link" in the article with a link to http://gallery.hd.org/terms.html
Re:obamaischeckingyouremail.tumblr.com on Monday June 10, 2013 @09:41AM (#5854228)
Same here in germany. I've never seen a captcha on Facebook before.
Re:"Hackathon" Has Been Trademarked in Germany on Friday May 03, 2013 @10:59AM (#5650422)
I can't see any connection to the Samwers or any of their companies in this case.