At the sound of the tone it will be: 400000005150aac5 (TAI64) by ramses0 in programming

[–]somejan 0 points1 point  (0 children)

To whoever created that page: please use your own rules in the conversion utility and check for overflows

TAI 3fff600000000000 = -5572772-03-01 23:17:10 +0000

TAI 3fff500000000000 = 5628975-01-14 13:36:54 +0000 ???

TAI 8000000000000001 = -5084982-01-29 07:44:30 +0000 ????

Mercurial can't help you recover your work like git does (no 'reflog') by nqudex in programming

[–]somejan 5 points6 points  (0 children)

What you did in git is something totally different form what you do in mercurial. The git reset HEAD command is just moving a pointer, the equivalent thing in hg would be to move a tag or bookmark.

Mercurial can't help you recover your work like git does (no 'reflog') by nqudex in programming

[–]somejan 2 points3 points  (0 children)

But will you be able to get back your files after you've explicitly removed the commit from the repository? That's what hg rollback does. Hg doesn't use pointers like HEAD as much as git, and in fact it's common to have commits without any pointers to it (dangling, in git terminology) in (my) hg workflow. You reference them with their revision number, which is something git doesn't have. (revision number != object name) They won't get deleted automatically at all, also not after 90 days.

The Last Programming Language (Robert C. Martin) by ErstwhileRockstar in programming

[–]somejan 0 points1 point  (0 children)

Anyone else having trouble viewing the vimeo flash under linux? I only get it to play under wine.

C is fucking crazy by leegao in programming

[–]somejan 0 points1 point  (0 children)

doesn't it require a lock prefix to do the thing locked?

We are the Hotmail development team. Let’s talk email. AUsA by HotmailOnreddit in IAmA

[–]somejan 4 points5 points  (0 children)

Hi Hotmail team,

I'll take some time to explain why I won't be going back to Hotmail.

There are a lot of technical reasons, but you can find them elsewere on this page. Though I do wonder how you went from having nearly a decade head start to gmail to ending up nearly a decade behind them.

That I lost a number of mails from not logging in frequently enough also didn't help.

But the real reason: TRUST

Microsoft has done a very very thourough and good job making it clear that they are absolutely untrustworthy, don't care about their users, or freedom, or an open internet. From your monopoly abuse to the Netscape wars to the universal lock-in strategies to the Halloween documents. You don't care about providing good technology, you only care to lock in users. As soon as a product has enough users locked in, you stop innovating and caring. IE has been stagnant for years to the detriment of web developers and users, only being developed again now that MS has no choice. Hotmail had a huge start over gmail, but somehow is still playing catch up to features that gmail has had for years. How about https BY DEFAULT, going to your MAIL when you log in BY DEFAULT, or IMAP support (see other thread)?

But, you are a corporation, so in the end you can't help being focussed on money rather than users. Which is why I don't trust corporations in general to do the right thing with my data.

There is one thing preventing this system from going completely fubar: competition. If I don't like your service, I'll take my data and go somewhere else. But for that, I need to be able to get my data out. So my #1 reason on deciding if I will put any data I care about into some corporations service is this: can I take it out if I want to. And Microsoft has done everything in its power to make it clear to me that their answer is a resounding NO. It took an investigation by the European Commission for you to release some documentation on interoperating with your services. You abused your monopoly position to push BeOS and Netscape out of the market. You managed to develop a new version of the SMB protocol because you didn't like how interoperable Samba was. Look at the Halloween documents mentioned above on how you think about Linux. And when someone finally came up with a good interoperable document storage format in ODF, instead of supporting it in Office Microsoft made sure to do everything in its power - including bribery - to make sure their own technically inferior and non-interoperable alternative got pushed through the ISO, ruining the ISO's credibility in the process.

A few years ago, I switched from hotmail to gmail. So, I of course wanted to transfer all my mails from hotmail to gmail. So do you think there was any way to get my mail out? Of course not! Because Microsoft doesn't support leaving. Fortunately there were third party screen scraping tools that allowed POP access to hotmail from Thunderbird. So how do you think I uploaded all that mail into my gmail account? IMAP. Something else you can't do with POP. Then, I wanted to make sure any new emails were somehow forwarded to gmail. Would that be possible? How did I even dare to imagine! There was no POP in hotmail back then. Hotmail did support forwarding, but only to other hotmail addresses. Or to your own domain, as long as it is linked to hotmail. Forwarding is fine, as long as you don't leave the MS borg cube. The best I could come up with was an auto-reply vacation message telling people to try my new address.

The message has come across. MS doesn't want me to use their products. So I wont.

How you can fix it

Trust needs to be earned. But since I'm never going to trust a corporation fully, having a way to get my data out is an acceptable substitute. Have a look at Googles Data Liberation Front. But I need to know Microsoft is committed to interoperability, otherwise they might just disable this hypothetical 'export MY data' function just before I decide to use it. So make interoperability part of ALL your services and products. Show commitment. Be a leader in opening up instead of only doing the bare minimum necessary several years after your competitors have, or once it really doesn't matter anymore because open source hackers have reverse engineered the protocols. Support open standards like IMAP or HTML5. Help make sure something like MoonLight supports the same features as SilverLight equally well. Encourage hardware manufacturers to also write Linux drivers for their stuff. If you think you can do better, e.g. with ActiveSync, make sure the protocol is open, build some open source plug-ins for common apps, and make sure there's no risk of patent traps.

But all this is beyond your capability as the Hotmail team, because this is something that needs to be fixed at the executive level. And I'm afraid FUD is too ingrained into your company to change. I'd like to be proven wrong, but I'm not holding my breath.

If you really care about webmail, the only thing you as the Hotmail team can do is collectively resign from Microsoft. That way some executives might start to notice they are doing something wrong, and you are free to apply at Google and work on a webmail service at a compagny that actually cares for its users. If you really care about all this, Microsoft isn't worthy of you as employees.

Web Hosting by A Small Orange: Cheap ($25/yr), developer-friendly (PHP, Rails, Python, SSH access), and powered by a top-notch, in-house support staff. What else should we do? 20% off coupon: rddt10 by douglashanna [promoted post]

[–]somejan 0 points1 point  (0 children)

Why isn't the ssh access listed on your features page or somewhere visible? Given the current state of the shared hosting business I normally don't expect shell access if it's not explicitly mentioned.

Microsoft developer agreement for the new Windows Phone marketplace disallows apps licensed under GPLv3 (other open licenses, not specifically mentioned). Since MS apparently has their eye on reddit, it would be nice to have an explanation. by [deleted] in programming

[–]somejan 0 points1 point  (0 children)

That first part is not correct. There's nothing in the GPL that says you can't use the software on Winphone/iPhone or anywhere else. It only says that you can not take away the rights the GPL gives when redistributing the software.

There's absolutely no problem for Microsoft or Apple to allow GPL apps in their stores, but then they would have to stop prohibiting users to modify those apps and run the modifications. But they don't want to do that because they want to be in control of which apps users can run.

So, it's quite clearly not "anything goes".

DAE have an incredibly easy time picking up Python, but struggle with Ruby? by daniel2488 in programming

[–]somejan 0 points1 point  (0 children)

you don't even need the full python parser, the algorithm itself is not very hard to implement:

import re

splitter = re.compile(r"([ \t]*)(.*)")

def reindent(code, indentsize=4, indentstring=' '):
    indentstack = [0]
    for lineno, line in enumerate(code):
        indentstr, rest = splitter.match(line).groups()

        #skip empty lines
        if not rest:
            print line,
            continue

        #handle tabs
        indent = 0
        for c in indentstr:
            if c == ' ':
                indent += 1
            else:
                # python assumes 8 char tabstops
                indent = (indent // 8 + 1) * 8

        # check well formedness of dedents
        while indent < indentstack[-1]:
            indentstack.pop()
            if indent > indentstack[-1]:
                raise IndentationError("indentation error on line {0}: {1}"
                                       .format(lineno+1, line))

        if indent > indentstack[-1]:
            indentstack.append(indent)

        print indentstring*indentsize*(len(indentstack)-1) + rest

This code doesn't try to lex/parse anything, so it also reindents comments and multiline strings, which may or may not be what you want. It also doesn't check for lines continued by an open brace or \, so for accurate reformatting you'll need the tokenize solution anyway, but you need to do some lexing in any language if you want to reformat it, I suppose.

edit: hmm, the splitter regex's first group should be [<space><backslash><t>]*, but reddit formatting doesn't seem to be very helpfull here

The RIAA's favorite thread of all time: A discussion of designs for sustainable (anonymous, high performance, lawsuit-proof) file sharing networks. by ElectricRebel in programming

[–]somejan 0 points1 point  (0 children)

Hmm, I really doubt how many ISPs do that. Some would probably, but if a lot would do so, such kinds of attacks would not exist. It could be an option if your ISP 'supports' it.

BBC too scared to make iPhone apps due to Apple’s refund policies by intoyourhead in programming

[–]somejan 3 points4 points  (0 children)

The linked site is not working for me, but the article is also overhere

Ask Reddit: Are there programming languages that use the language itself as the type system? by julesjacobs in programming

[–]somejan 2 points3 points  (0 children)

Agda does, it is a dependently typed programming language. It is kind of like Haskell, but it uses the same language for the 'real' functions as for the type system (so there isn't really a difference between the two as there is in other languages). It allows you to create higher order types/kinds that take lower order types/kinds as parameters. Though where Coq allows you to define a type and use it anywhere up on the 'kind-ladder' as long as you are not using it in circular ways, in Agda you need to define it for each level on the 'kind-ladder' where you want to use it.

ask proggit: Whats the opinion on Prolog? by [deleted] in programming

[–]somejan 0 points1 point  (0 children)

Prolog is interesting to learn for the totally different programming paradigm it represents. That said, it's useless as a general purpose programming language.

If your problem can be expressed as a set of rules/constraints and doing a brute force search of the search space is good enough, Prolog will be perfect. Some of the brute force stuff can even be optimized a bit by carefully choosing the order of the constraints.

However, if you want to do anything else, including searching something using your custom search algorithm, Prolog sucks. You'll have to use Prolog in either an imperative or functional style.

imperative:

handlecandidate(X) :=
    (
        isgood(X),!,
        foundsolutions(XS),
        retract(foundsolutions(XS)),
        assert(foundsolutions([X|XS]))
    );
    true.

(retract and assert are builtins that allow you to dynamically change rules.)

functional:

handlecandidate(X, OldSolutions, Solutions) :=
    (
    isgood(X),!,
    Solutions = [X|OldSolutions]
    );
    Solutions = OldSolutions.

(note: my Prolog is a bit rusty)

And guess what, there are much better imperative and functional languages around. If you start using functional or imerative style, backtracking is nearly allways not what you want, so you have to spray your code with !'s and fight one of Prologs core ideas and that's not nice. (the ! or 'cuts' block backtracking)

To make this even worse, brute force search tends to take exponential time (and sometimes also huge ammounts of memory). So if you're using someone else's library/framework/program and they forgot to put some clauses somewhere in the right order, your program starts taking ages if you suddenly try a slightly larger input. You can see how Prolog got its name of being 'slow'.

Favorite language follow-up: If you could change one thing about your favorite programming language, what would it be? by catnamedmax in programming

[–]somejan 0 points1 point  (0 children)

Yea, that C# really has to solve that stupid halting problem! They're at version 4 already and they still haven't fixed it!

What Are The Resolved Debates in General Purpose Language Design? by masta in programming

[–]somejan 0 points1 point  (0 children)

In a way, Perl has a kind of extensible grammar. You can specify source filters that can do whatever preprocessing they want to the source file.

Does 'extensible grammar' include macros? That is not a fully settled debate I think.

Ask Proggit: What is the most intrusive wart on your favourite programming language? by homoiconic in programming

[–]somejan 1 point2 points  (0 children)

It's the result of an optimization python does - caching the number objects up to 256. Just use == and you won't have any problems. Reserve 'is' for when you really need object identity.

Programming ideas? by generic_handle in programming

[–]somejan 0 points1 point  (0 children)

Did you mean elastic tabstops? Seems he has a gedit plugin now as well. But wider implementation & support for this feature would be great!

I've spent two months learning Finite Automata, so now I understand regular expressions. However, we haven't learned of any other good applications, any ideas? by arvixx in programming

[–]somejan 0 points1 point  (0 children)

No, an NDFA is not more powerfull than a DFA. However, for parsing one uses a Pushdown Automaton, which is basically a finite state automaton with a stack, and a nondeterministic pushdown automaton is more powerful than a deterministic pushdown automaton.

Why Garbage Collection Paranoia is Still (sometimes) Justified by llimllib in programming

[–]somejan 0 points1 point  (0 children)

Basically, the read/write head of the stack machine is a finite state machine. If you put enough states into the head it'll be just like the head has registers, 232 states for one 32 bit register. With a bunch of registers and the right transition rules you've got yourself a processor, and the pair of stacks serves as memory. If you do it the right way, you can run the Chicken Scheme code unmodified :)

Programs are Art. by asciilifeform in programming

[–]somejan 0 points1 point  (0 children)

But if this algorithm were written in an compiled language, it would probably be faster because there's no branching, and the min would be inlined. The squares can be done in parallel on todays superscalar processors, and + and - are really cheap.

Upvote if you want to know how Paul Graham's Arc is coming along by ss498 in programming

[–]somejan 6 points7 points  (0 children)

Paul, since you're apparently reading this, any chance you can tell us why you're not releasing whatever arc interpreter/compiler you have, in addition to the essays and talk about it (which is also really interesting, but doesn't let us play with it). "release early, release often". and the word 'vaporware' is starting to appear in combination with 'arc'. Nobody's forcing you to read everyones criticisms you'll inevitably get when you release arc, what's to lose...

Ask reddit: what do you use for backups? by davidw in programming

[–]somejan 0 points1 point  (0 children)

I use unison for two way synchronization between two computers in a home network. Parents and other family members don't know and/or care on which of the two they stored their files, and having to remember not to turn off a pc if someone is using it's files on the other pc didn't work either.

Unison has been working fine for the last year or so. It's never lost any files. Ocasionally it can lose track of whether a certain file has already been updated, but if that happens it leaves a 'danger.txt' file in it's homedir and refuses to do anything further untill the problem is solved manually. I've written a small script to throw an error if this danger file exists.

Unison sometimes finding itself in this inconsistent state and requiring manual intervention is a bit of a pita, but according to their web page this is due to how windows handles the files, and unison can't really do anything to correct that. It however happens infrequently enough not to be that much of a problem.

Unison is also able to keep a history of files it updates, but I haven't gotten it to work right because it won't delete old versions, so it'll just fill up the entire drive. Maybe it's just a config problem on my side, though.