HNHacker News
TopNewBestAskShowJobs

lifebeyondfife

536 karma · joined November 24, 2011

Life Beyond Fife is my tech blog where I write random articles and applications about all sorts of software development subjects. http://lifebeyondfife.com/
submissionscomments
lifebeyondfife··on A CP Solution for XKCD NP Complete Restaurant Order
No, you're not overestimating it but it very much depends on the problem and constraints. It's good to do the d^n search space check to give you a feel for the starting size of the problem but if your problem is heavily constrained i.e. the constraints make finding a solution hard, then propagation is very powerful.

Consider variables a[1:1000] and b[1:10] and constraint a + b = 10. A good solver will use propagation to reduce that to a[1:9] and b[1:9] because there is no support for a >= 10 or b >= 10. Even reducing one extra value from a variable's domain is reducing the search space by a factor so propagation over tight constraints is extremely powerful.

Most arithmetic constraints like those used in your program will use bounds consistency (find support for the lower and upper bound values). Special constraints such as "all different" have their own propagation algorithms that efficiently remove potential values from the domains of multiple variables. These are known as Global Constraints.

lifebeyondfife··on A CP Solution for XKCD NP Complete Restaurant Order
There are three phases to Constraint Programming: (1) Model (2) Constraints (3) Search & Propagation.

The first step in solving a problem with CP is to come up with a representation for a solution. This involves deciding what your variables will represent (in this case, "How many orders of each appetiser") and what is their possible domain of values (in this case, "0 to 10" has been chosen, quite arbitrarily).

The solver itself is generally dumb. It will propagate some constraints sensibly but mostly it will just search over the entire space - equal to the size of the domain to the power of the number of variables. 11^6 = 1.8 million, quite a small CP problem.

There's a bit of an art in creating a good model for a CSP (Constraint Satisfaction Problem) to keep the search space as small as it needs to be.

EDIT: Just to be clear...

The way constraint solvers work is to make a decisions in a Depth First Search manner and judge the validity of the new state after each choice. So after fruit > 7 and salad > 2, bounds consistency on the constraint will rule out the possibility of reaching a solution from that node in the search tree.

lifebeyondfife··on Designing your wedding ring with 13 year old code
http://lifebeyondfife.com/images/oldcode/bear1.png http://lifebeyondfife.com/images/oldcode/bear2.png

I completely respect your position, Java is disabled in my main (Firefox) browser.

lifebeyondfife··on Dear HN "Who's Hiring" responders
Because it was lunchtime and I wanted to make sure I was still employable...

static MyLinkedList<T> ReverseLinkedList<T>(MyLinkedList<T> linkedList) { if (linkedList.Next == null) return linkedList;

  var newTail = linkedList.Next;
  var reversedList = ReverseLinkedList(linkedList.Next);
  newTail.Next = linkedList;
  linkedList.Next = null;

  return reversedList;
}
lifebeyondfife··on Intro to Group Theory
I launched into a rant about this in a recent blog post[1]. The maths lecturer I had said, "A group theorist aims to classify and categorise the whole world..." and then he went straight into writing the four axioms of a group.

[1] http://lifebeyondfife.com/the-difference-between-mean-and-me...

lifebeyondfife··on Intro to Group Theory
My AI doctorate used a lot of group theory. I use came up with the following analogy for explaining what it is and what it's used for to fellow non-mathematicians:

If you want to measure and describe the number of occurrences of something, use an integer. If you want to measure and describe the amount of something, use a rational number. If you want to measure and describe the symmetry of a structure, use a group.

When programmatically dealing with objects that contain symmetry - e.g. physical objects like a cube, a set of identical resources like a fleet of lorries - having an understanding of group theory allows you another layer of abstraction in your computation, potentially greatly reducing runtime or memory consumption.

lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
Just realised, the comments section is broken for that link: http://lifebeyondfife.com/98-whats-new-music.html
lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
I always take critism constructively, regardless of how it's presented. Comments like this help from getting me down though, thanks.
lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
Thanks. I knew I had some issues with data (artists and albums) so that's going to be a future development area if this takes off.
lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
An image upload site I know of used the same approach to 'login' and I quite liked it - I suppose the ideal configuration would be to give the user a choice. I had to nail down on feature creep at some point or I was never going to ship anything.

I'll look into the missing album though, edge cases like that are handy to know about for data quality.

lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
I wish I'd known about this a year ago ;)
lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
The FAQ addresses some of these points. If you keep your username sufficiently unique and secret then no-one can edit your list. I wanted a really low barrier to entry for trying out the site i.e. no email addresses or login via a social media service.

The service shows you albums from the last 5 years but that could also include re-releases (which might explain the Slayer weirdness).

Thanks for trying it out and the compliments.

lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
The first tab is for your username, the second is where you add the artists you want to follow (that's where you add Atmosphere), the third is where the recent releases are shown.

A UI fail though, is my fail. Possibly more work required.

lifebeyondfife··on Show HN: What's New? Music - an enterprise coder's first ever website
Full details of how someone who knew almost nothing about web development managed to piece this thing together: http://lifebeyondfife.com/98-what%27s-new-music.html

This side project though nothing revolutionary has been a bit of an obsession and labour of love for most of this year. I would just like to thank the HN community because, whether or not I read any of your blog posts, links or comments, coming here and getting motivation and mental stimulation has really dragged me up and kept me going. Cheers.

lifebeyondfife··on Are You Doing Research?
One of the reasons I left immediately after finishing my PhD. If I wanted to jump endlessly from platform to platform, I had Sonic the Hedgehog for that.
lifebeyondfife··on NoSQL: The Love Child of Google, Amazon and ... Lotus Notes
Used it back in 2006 for company email, policy documents and software issue tracking - both enhancements, bugs etc. raised by product management, development and client facing services.

It was a mess. A slow, grinding mess of unusable screens and panels. If you end up typing things in an external text editor simply to copy-and-paste it in just to guarantee you don't lose your work, you know something has gone terribly wrong.

Got a friend whose company were recently bought by IBM and they "eat their own dog food". He's not happy to be now using Lotus Notes.

lifebeyondfife··on Are You Doing Research?
Doing research for a company has the end goal of benefitting that companies' shareholders. Doing research for a publicly funded institution has the end goal of benefitting society.

Look at the decoding of the human genome. No company has a patent on that because public institutions did it first.

lifebeyondfife··on Are You Doing Research?
Based on the conditions listed at the end of the article, I think a lot of people in academia aren't doing research/science. --former scientist.
lifebeyondfife··on Job Posting for Amazon.com Before it Launched
That's a really interesting snapshot of 1990s nettiquette. On Usenet or Email you generally selected a pithy quote for your email footer. The trend went out of fashion I'd say around the turn of the century.
lifebeyondfife··on Codersumo - Challenge your inner sumo coder.
Pitching a slow ball just begging to be hit out of the park. Nice hook ;)

The interesting thing for me was which language to do it in. I hovered over JavaScript and Python before finally opting to do it in "safe" Java... a language I haven't programmed in for ten years but whose C-style syntax I could write in my sleep.

Attempting challenges could be helpful for keeping me on my toes in other languages.

lifebeyondfife··on Show HN: My C# Tutorial Series: Coding Basics. How am I doing so far?
^this

There's bad indentation e.g. a for block not indented, and a mixture of C and Java style indentation. I recommend following the standard Microsoft style indentation which is place the opening brace on a new line on its own.

Also, "it will compile and run, then ask the user to press a key go back". One missing 'to' doesn't seem so bad but the accumulation of these little details really adds up.

Really nice though, I like taking the user back to the console and command line and walking them through everything. Best of luck.

lifebeyondfife··on How to Get Startup Ideas
Cheers, currently working on some write-ups for my blog about how I - as a pure desktop/server developer - found my first web project. http://whatsnewmusic.com/
lifebeyondfife··on How to Get Startup Ideas
This has given me a little shot of confidence. I've just finished my first mini-site with potential revenue stream. From the few places I've marketed it thus far, not many have really "got" what problem I'm trying to solve. But it's a problem I genuinely have and am thrilled to have a solution to it. I just need to find the others who'd like to drink from the well.

(Well idea: as I've gotten older I no longer care to keep up on all music related media and there are too many bands I like releasing music I don't want to miss. I've made a service that allows you to keep track of releases from your favourite artists chronologically so you don't miss out on any.)

lifebeyondfife··on Do You Really Want to be Doing this When You're 50?
Interesting.

I remember an industry teacher once saying to me that "You'll probably never put '10 years experience in Technology X' on a CV." because by the time it's been around for that long it will be pretty much obsolete. The fundamentals of computer science won't change (big-O, synchronised distributed systems, logic etc.) so I suppose it will just come down to re-learning the modern day tech.

But that's the same for lawyers (fundamental laws / processes unchanged, need to be up-to-date on modern rulings and changes), doctors (fundamental human physiology unchanged, need to be up-to-date on modern techniques and drugs) sales assistants (knowing how to greet and assist a member of the public never changes, need to know how to use the latest cash register / Square-up card reader terminal).

I suppose you can't escape it in another industry. I still stand by my point that your skillset as you get older will make you more appropriate for other duties.

lifebeyondfife··on Do You Really Want to be Doing this When You're 50?
It's not so much the field but rather your role within it. Someone with many years experience as a programmer working within a specific industry might have the experience necessary to make sound, informed technology decisions.

Not saying that would be an easy job or not stressful but it's a better use of that persons skills and experience.

lifebeyondfife··on Do You Really Want to be Doing this When You're 50?
The point is you have to be prepared to re-select the 'few great tools' you know every decade or so and invest time getting to know them inside out. That can get very tiring as you get older.
lifebeyondfife··on Do You Really Want to be Doing this When You're 50?
I know and have worked with coders in their 50s, even 60s. They were very much what I'd call 9-to-5 coders though. They were never given big, important or new projects but as a consequence were never expected to burn the midnight oil.

The main thing that looks unappealing to me about being a hacker decades from now is the constant cycle of learning. I'm on probably my 3rd generation upheaval. I've worked on a daily basis in a team of programmers with C, C++, C#, Java and Python. Getting familiar enough with those languages to do more than just tinker took a lot of effort - even for the languages that are pretty similar e.g. C# and Java. I'm now looking to do more front to back website coding (away from pure desktop/server stuff) so I'm trying a few things out before choosing on the main stack of technologies I need to master.

In my early thirties I still have the enthusiasm to do this but I find it hard to picture doing the same ten years from now with the same smile on my face.

lifebeyondfife··on 15 Years after the First Slashdot Post
Before HN, before Digg, before any kind of social networking or all encompassing tech news sites, there was Slashdot. I still remember when one of the first questions to ask a fellow programmer was, "You on Slashdot? What's your number?"
lifebeyondfife··on Virgin Mobile leaves six million subscriber accounts wide open
I know the branding can act as a mask over different companies e.g. Sony VAIOs http://www.pcpro.co.uk/news/357289/sony-announces-division-t.... As you point out we're going from US mobile to UK broadband. But the point of the brand is to give consumers confidence in a consistent level of service and I thought it vaguely relevant to mention my experience.

Yes, by password for their service I mean the password chosen for my @virginmedia.com login where I can access/pay bills, look at phone calls made etc. I imagine if I had a TV package with them there would be other things I could do via their website.

I was pretty shocked that anyone - staff or otherwise - had access to my password.

lifebeyondfife··on Virgin Mobile leaves six million subscriber accounts wide open
I'm a Virgin Media customer in the UK. My home internet connection stopped working recently and (long story short) in dealing with trying to fix it, it turns out my main login password for their service can be accessed by support staff. This means the password is being stored in plaintext.

I was contacted to ask about how customer services dealt with me and I stated how unbelievably insecure their (my!) data must be. This was the straw that finally broke my password insecurity camel's back - I now use KeePass to generate all my passwords.

I wonder if any big telcos actually treat customer data appropriately?

← PreviousPage 4 of 5Next →