HNHacker News
TopNewBestAskShowJobs

Tinned_Tuna

422 karma · joined September 14, 2010

submissionscomments
Tinned_Tuna··on Arrow: Better dates and times for Python
There are too many ways to do something, best implement the One True Way.

There's an obligatory xkcd somewhere on this...

Tinned_Tuna··on Programming is not math?
I agree, programming is not mathematics, however, the author seems to have mixed up the act of calculation and mathematics.

Bering a good human calculator is unlikely to result in stellar programs. Having a good grasp of how to arrange and communicate your ideas, as is required in mathematics, will help your programming hugely.

Yes, there's a large gap between what is acceptable in mathematics and what's acceptable in programming, and the types of problems you're likely to encounter, but fundamentally, you'll be communicating ideas to other people and to your compiler.

Source: Computer Science and Mathematics degree, now working as a researcher.

Tinned_Tuna··on Show HN: Pastor generates and stores passwords without storing any passwords
Hi, building on what a lot of other commenters have said, there are some major improvements you should consider:

  * Do not use plain SHA-256. Use a KDF, like PBKDF, bcrypt or scrypt.
  * There must be some efficient method by which I can re-issue compromised passwords.
  * For convenience, allow me to have different character sets for different sites, and different lengths.
  * Make the default to be going directly into my clipboard.
  * A way to recover from the compromise of the master passphrase
The way I would do this is to have a small file, detailing, for each door_id:

  * Random seed. The is effectively a version number. Change this, and get a new password for only that door_id.
  * Character set
  * Length
This file, although not advisable, is not enough to break the other passwords generated. Given a strong enough passphrase (I'd say... a 5 or 6 word diceware password), it can be synced to all sorts of places, kept on a USB stick, etc.

I cannot, off the top of my head see any way to re-issue the master passphrase effectively.

As it stands, I could not, in good conscience recommend anyone use pastor as it stands. Although a few, relatively minor, modifications, could make it quite an interesting tool.

Using a file on disk to keep track of version numbers, lengths, and character sets seems quite extreme, given the aim is to remove the need for files on disk!

Perhaps some other way of keeping track of these, without the user needing to remember them could be devised?

Tinned_Tuna··on Ask HN: What is the most difficult tech/dev challenge you ever solved?
In a product that effectively boils down to CRUD in many places, the most time consuming thing for me so far has been one of two things:

  * Complex reporting requirements with an extremely vague specification on a completely normalised database. The sheer quantity of various joins was fun. There must've been a better way
  * Optimising certain read operations which operated over a potentially large dataset.
  * Providing an efficient full-text search based around lucene which had some pretty interesting requirements, that came down to lucene filters in the end.
Overall, it's mostly been about optimisation. And that is simply measure, measure, measure. Doing things blindly gets you no-where.
Tinned_Tuna··on OpenBSD has started a massive strip-down and cleanup of OpenSSL
The SSL/TLS protocol unfortunately uses some known-bad constructions, which lead to intractable issues (see: BEAST, Lucky13 for examples)

NaCl's goals are vastly different to those of SSL/TLS. SSL/TLS aims to provide a simple, clean interface with sane defaults for the majority of simple use-cases, whereas SSL/TLS aims to provide an interface with near-infinite flexibility for the case of providing an encrypted, authenticated tunnel.

NaCl also deliberately does not support lots of ciphers, as that makes it easy for developers to choose poorly, for example, (Alleged) RC4, as is supported in OpenSSL.

Tinned_Tuna··on Openssl: uses only 32 bytes (256 bit) for key generation
This thread seems to be generating a lot of fuss, so let me weigh in quickly.

This seems to be expected behaviour for generating RSA keys. An RSA key of length 4096b does not provide you with a security level of 4096b. That is, you don't have to straight-up guess the keys, you work at it via factorisation.

The issue is arising from the fact that entopy and key length are both commonly measured in bits. The entropy of an RSA key is much lower than the key length. 256b of entropy seems to be more than reasonable at first glance.

Normally, I would not defend openSSL, but I will do so here, having not even looked at the responsible code (nor has the submitter of this bug), and not even looked at the mailing list link.

Seriously, do not panic, let the cryptographers look at this and decide if it's really an issue. It's probably good that they're getting 256b of entropy from urandom, it's likely that they're seeding a CSPRNG for prime generation & testing.

I would wager some small sum on this being closed by the end of the week, and us looking back on this and shaking our heads at the uninformed knee-jerk reaction of people in here:

"If I ask for a 4096-bit key, I should get one, or an error message. I shouldn't get a 256-bit key that looks like a 4096-bit key." -- taejo, 15 minutes ago

Tinned_Tuna··on Poll: Do you download copyrighted media illegally?
Nice try, RIAA/BPI
Tinned_Tuna··on Chrome's insane password security strategy
If we're up for changing the standard, why not go with something that's significantly better than pass the hash, like some form of public-key crypto?

Having <input type='challenge' algo='xxx' challenge='reallylongrandomchallengetoken'> would work better than yours, I think?

There's also nothing stopping the user using a "password", where that password is fed through a KDF and then used to generate the relevant private key (all done client side) -- but this is only as strong as the password used, so a really savvy user would just generate the private-key really well, and store that in a similar way to the way SSH keys are stored (i.e. passphrase). Non-savvy users can generate it a-fresh every time.

But aren't we just re-implementing client-side SSL certifications?

Tinned_Tuna··on Ask HN: What's the oldest piece of software still in use?
I know that some of the British Ports systems are running something written in Delphi 5 that's around 20 - 25 years old for their tickets.
Tinned_Tuna··on Fifty Shades of Grey Would Be Banned in UK?
It's an intentional exploration of the concept, from TFA:

"... thus bringing this absurdist tirade to a close and showing the law for what it really is: Propaganda codified as law."

The clue is in the "absurdist tirade" -- this is a reduction of the current media coverage of the law into implications which seem technically plausible.

Tinned_Tuna··on Fifty Shades of Grey Would Be Banned in UK?
Rape is sex without consent. Force and coercion are related, but not actually required for rape.
Tinned_Tuna··on Perspectives on Encrypted Media Extension Reaching First Public Working Draft
Why not just fork the W3C's specifications, and pressure FireFox and the makers of other browsers & rendering engines to never incorporate DRM?

My personal issue here is that it seems that W3C is going against it's own founding principles, running a committee that's biased towards the content-industry.

Tinned_Tuna··on Show HN: MailRubber, a condom for your email address
And here I was thinking I'd be able to order condoms via email! Neat app.
Tinned_Tuna··on Python.org Wiki has been Attacked
> our most recent backup dates back to June 24 2012

And therein lies the problem of disaster recovery. Even if you have a catastrophic bug, you should not be losing 6 months of data.

Tinned_Tuna··on Security Vulnerability in popular mobile app, what do?
The "Standard" responsible disclosure technique is as follows:

1. Discover vulnerability 2. Inform vendor, tell them they'll have x weeks before general disclosure 3. After x weeks, post it to the relevant place on seclists.org

Tinned_Tuna··on Apple posts its UK apology to Samsung
Well. That left a bad taste in my mouth. It was low and base, sounded like Apple clutching at strings -- trying to make the convince the public through almost-smear tactics.
Tinned_Tuna··on My Brain Can’t Handle OOP Anymore
I would argue that in this case, the author is technically wrong with his argument.

You do not need to know the entire history of the foo object, only the intrinsic state and the arguments to the current method call to determine it's behaviour. This means that a method on an object can be modeled as add :: (foo, integer) -> integer.

That is not to say that this is necessarily easy, and yes, singletons do complicate this by making it difficult to know exactly what the intrinsic state of an object is as they essentially hold a reference to something which may be modified by something other than the foo object.

I fully agree that functional programming seems like a good idea right now, but I would also say that this particular problem is mainly due to the programmer failing to adequately control and rein in extra, unnecessary state.

Tinned_Tuna··on Somebody please, for the love of god, fix shipping/couriers
I will point out that at least #5 is "solved" by DPD and Interlink Ireland to a reasonable level of accuracy.
Tinned_Tuna··on Poll: Do you test your code?
I really wish automated testing was significantly better for Java and the ilk. To steal from the Haskell world, I want to augment JUnit/TestNG with Small and QuickCheck.

The tests would go something like this: 1: SmallCheck exhaustively tests the small cases 2: JUnit/TestNG tests the main use-cases. 3: QuickCheck produces a lot of random tests and hammers the APIs.

Sadly (for Java at least) this appears to be a rather difficult ask.

Tinned_Tuna··on Taking a Step Back from ORMs
I would argue that an ORM does get in the way in a good way. A decent ORM can do things such as extra full-text indexing behind the scenes (Thing Hibernate and Lucene) to provide a much better search over almost any database. You only have to tell it to do so (i.e. configuration) and it springs to life.

Similarly, if you decide that you don't like PostgreSQL and want to move to MySQL. You can go through your code and change all of your SQL to match the PostgreSQL dialect. Or (with Hibernate) you change one configuration parameter (the hbm2ddl one) to use the MySQL dialect as opposed to the PostgreSQL one.

Hibernate (I'm using Hibernate a lot, because it's the one I use at work, so I'm quite familiar with it) can also be configured to check the database schema at start, update it to match your models, create a new schema or create a new schema and schedule it all to be dropped when your application terminates. This is useful, because your test configuration can be create-drop, and your live can be validate. When upgrading the live system, you can just redeploy with "upgrade" as the configuration.

In short, ORMs do have a lot of behind the scenes magic going on, but they can also offer developers a heck of a lot. Not to mention that they're thoroughly tried and tested bits of code. Hibernate even has the capacity to take on various transaction managers (Bitronix allows you to do one transaction over two databases, even if those databases are from different vendors).

Tinned_Tuna··on Every Linux screen locker bypassed with a keypress
I attempted to replicate this (attempted being the operative word, I could've been doing it wrong) with Ubuntu 11.10 and a GB keyboard layout. It didn't seem to work.

Key combos:

Ctrl+Alt+* (num pad) Ctrl+Alt+Shift+8

Both with numlock on and off.

Tinned_Tuna··on PayPal forces buyer to destroy $2500 pre-WWII antique violin in dispute
On the one hand, I can see why that particular clause (10.1b) is in their TOS. They don't want you (be you the buyer or the seller who got the item back) to re-sell the counterfeit item, costing PayPal the fees, and all of the lost time on the dispute.

However, there should be a reasonable limit, whereby if the item is >£x value, or is claimed to be an antique (or similar), an independent professional who can identify it will be hired -- and charged to whoever they side against (i.e. whoever made the false claim).

Tinned_Tuna··on Plan 28: Babbage's Analytical Engine project gets underway
Does anyone think that these plans in conjunction with 3D printers would result in a lot of fun?
Tinned_Tuna··on Ask HN: Advice for a young, self-taught programmer
You don't learn French just by trying to write letters and articles in a vacuum, you learn by reading articles, letters and books in French.

Similarly, to become very proficient with code, read other people's code. Read code written with the help of a framework, read code written in Python, try to read some in a functional language, try to read some C for an embedded system (FreeRTOS, perhaps?).

But similarly, don't just read. You need to be practicing your writing of code too. Write small things, an AVL or Red-Black tree in C, a small web server in Python, an IRC bot in Objective-C are all semi-decent pedagogical projects. You don't need to devote your life to a small project, just knock it out over the course of a couple of weeks to become familiar with the idioms.

Investigate asymptotic complexity, basic data structures (Arrays vs. Linked lists, Hash Tables vs. Binary Trees (balanced and unbalanced), various methods of queuing, stacks), you'll need to know the standard algorithms (binary search, various sorting algorithms, some search algorithms, etc.)

The only way to improve is to continually try to improve. Write code, read code, read books, try to implement the ideas from the books. AI, compiler design and implementation, functional programming, hardware (all the way down to signal processing and digital electronics, see if you can't design a programmable analogue computer!)

Tinned_Tuna··on Exceptions are monadic
It's a common theme in mathematics to show an equivalence between two structures. We don't do it because it's fun, it's because if there exists an equivalence or some other relationship, we can use the existing body of work in one field in another.

For example, group and ring theory often starts with the concept of symmetries, but it can then be shown, through an equivalence (or in mathematical terms, an isomorphism) that these have a relationship to polynomials. From that, we then easily show that there is no general formula for polynomials of degree greater than 5. Two vastly different fields, actually sharing something, and having a very useful result. Similarly for finite state machines and monoids.

If you can express something as something else, you have the opportunity to shed light on it's structure and hence learn something new about it. Yes lots of things share that structure, it just so happens that monads are quite a general structure, that doesn't mean that no interesting results are attached to them.

Tinned_Tuna··on The music industry finds another way to shoot itself in the foot
They're running out of feet to shoot.
Tinned_Tuna··on Must Read CS Books For Self Self-Taught Programmers
I can't remember who said it, but

"If you can write a compiler, you can write any program."

Hence, I'd get compiler books. Modern Compiler Implementation in Standard ML, SICP has a couple of sections on compilation, there's a computational theory book that I don't have on hand which would be useful to this end too.

Tinned_Tuna··on Ask HN: What do you want to tell Microsoft?
The Xbox (bar it's heating issues) is a damn good product. The advertising still has a little way to go, but over all it's a nice package and it is a good user experience start to finish.

Similarly, C# is a nice language, but I'm not (personally) overly keen on Visual Studio, I like smaller IDEs (personal preference here!).

The main issue that I see is the obsession with integrating everything with Windows. Notice how iTunes is cross platform(ish)? Python is cross platform? Apache is cross platform? Chrome & FireFox are cross platform? I don't think that it's an accident that those are fairly popular -- any one who uses them is not in inherently tied down to Windows, Mac or any other operating system.

I've said this about IE9, cross platform is generally better. Broaden your application's user base and correct the issues with advertising and you'll stand a real chance at turning things around, in my opinion.

Contrary to popular belief, throwing money at an issue does not correct an issue. With the creative markets, you'll need to get hold of genuinely creative people -- scout university campuses, advertising agencies (and anywhere else) and find those who are really passionate about creating something special.

← PreviousPage 2 of 2