HNHacker News
TopNewBestAskShowJobs

1337Coder

26 karma · joined November 30, 2012

submissionscomments
1337Coder··on Why do credit card forms ask for Visa, Mastercard, etc.?
If anyone is curious about the luhn algorithm, here is one I made in C# from the example in the question:

static bool IsValidLuhn(string numbers) { if (numbers == null) throw new ArgumentNullException("number", "number must have a value.");

var allNumbers = numbers .Where((c) => c >= '0' && c <= '9') .Reverse() .Select((c, i) => (i % 2 == 1) ? ((Convert.ToInt32(c) - 48) * 2).ToString() : c.ToString());

return allNumbers.Count() > 0 ? allNumbers.Aggregate((x, y) => x + y).Sum((c) => Convert.ToInt32(c) - 48) % 10 == 0 : false; }

Edit: Can sum one link me to HackerNews markdown?

1337Coder··on Functional Programming 101 with Haskell
For anyone trying to go to the Erik Meijer link, the correct url is: http://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Func...

I think vasquez put an extra right angle bracket by mistake.

1337Coder··on A Hacker's Replacement for Gmail
This is the exact reason I created this: https://privatemsg.matthew-dove.com/
1337Coder··on Private Message. Secure communication, anyone, any device; NSA free.
Yes, it is encrypted on the server. That hash is just a key to get your message. Its not the message itself.
1337Coder··on Private Message. Secure communication, anyone, any device; NSA free.
Last weekend when the NSA news was a big deal, I was angry, I wanted my privacy back. I use all the standard stuff (like opt-out, Ghostery, etc). Using https for my emails with Google is great, unless they just send my plain text data to the NSA on request. So I looked around for a safe way to email. OMG was it hard. I had to install all kinds of stuff, find out how it works, and alot of them required the receiver of the message to also have said software. Yeah, if its that hard, no thanks. So I made this in one weekend. Alas I didn't have SSL (encryption) on my domain. And it took a week to change servers, get a dedicated IP and install the SSL. Anyway here it is. Create your message, send your friend the link to your message however you normally would, and they (only them) can see the message. No Google saving your data, and once your message has been viewed its deleted. Nothing for the NSA to even ask for. I realise the message creator is geared towards web developers, version two would ideally contain a more friendly text editor.
1337Coder··on "Cruises were priced similarly to assisted living centers and more efficacious"
Well would you believe that it is not uncommon for one or two people to die on a cruise? I went on a 10 day cruise a few years ago and three people died on it. They chucked 'em in the fridge and carried on the trip like it was normal.
1337Coder··on Poll: How many programmers don't know about bit-wise operations?
I use "&" and "|" when i use enums, that act as options. I.e. var myCarExtras = Extra.Radio | Extra.PowerWindows;

Where Extra = { Radio = 1, PowerWindows = 2, Tint = 4, Rims = 8 };

Then I can do: if (Tint | powerWindows) { return totalPrice + 1000; }

1337Coder··on How I Busted a Thief Who Tried to Sell My Camera on Craigslist
Oh yes you are correct.

In this case the merchant only loses the cost to the vendor ($7,000). Good catch.

1337Coder··on How important is it to reduce the number of lines in code?
sorry for being pedantic, but should'nt it be shouldn't?
1337Coder··on How I Busted a Thief Who Tried to Sell My Camera on Craigslist
You would think so but no. Visa etc and the banks don't want that kind of trouble. To charge cards you need a special bank account called a merchant account.

A condition of this merchant account is that if someone issues a charge-back on their creditcard, if the merchant can't prove that the card owner brought the service/product then the funds are taken directly form their merchant account by the bank and then given back to the card-holder.

This is why anti-fraud systems are so important to merchants.

Case: I steal your creditcard, I buy a tv worth $10, 000. You notice this, and chargeback the merchant. The merchant has to pay you $10, 000 and he lost teh cost price of the tv he sold me (say $7, 000).

So by accepting your stolen card as payment, the merchant just lost $17, 000!

Source: I build payment gateways.

1337Coder··on Show HN: My HTML5 Game for Github Game Off
{MyScore:'1837';}