HNHacker News
TopNewBestAskShowJobs

aleyan

3,898 karma · joined February 20, 2012

I, programmer.

You can also see some of the pastels I drew and animated here: http://fooladder.com

Email me at yankov.alex at the popular electronic mail service from Google.

submissionscomments
aleyan··on Volvo Gave Away the Most Important Design They Ever Patented
I am rather certain if I was designing an across the shoulder seatbelt without having seen a modern 3-point seat-belt, it would end with the seat belt strangling or decapitating people.
aleyan··on The Evolution of Direct3D
[1] This October 97 article by Alex St John in Boot Magazine talks about origins of DirectX and about the HR Giger ship.

[1] http://www.maximumpc.com/article/features/old_school_monday_...

aleyan··on PayPal accidentally credits man $92 quadrillion
We once had an error that booked quintillions of dollars notional position with a client. It was caught the same night and the client never saw it. Here is how it happened.

An end of day aging process was supposed to look at all positions marked "old" and trade into ones marked "new". Some positions may go through several transition until all the resultant positions are "new", so the process recurses until it finds a fixed point for the day.

This day the aging process for this very bespoke trade went a bit haywire and instead of booking "-1 old position, +1 new position" it booked "+1 old position, +1 new position". Seeing that is still has +2 old position, the process booked "+2 old position, +2 new position", it then booked "+4 old position, +4 new position". This went on for 16 iterations until the auto breaks kicked in and stopped the process. A quant on watch saw the process fail and restarted it causing the positions to double 16 more times.

This was billion dollar deal that grew by 2^32 times plus now existed in old and new variants for a total notional in quintillions of dollars. It was 7pm when the quant called me over because I was the only other guy still there and by happenstance I heard of similar issue happen on my old team. I fixed the position for the night but the permanent solution was made later in normal business hours.

As an aside, when a similar error happened on my old team, the recursion continued until the process ran out of stack. That was when the 16 recursion limit was put in. (The position didn't grow huge that time because it was booking "+0 old position, +1 new position", so the growth was arithmetic and not geometric)

aleyan··on Obama: No warrantless wiretaps if you elect me (2008)
> There's no such thing as a "Union" at all if each state could simply walk out when the Federal government passed a law the state didn't like, or the country elected a President the state didn't like.

A member state of the European Union can do that, yet it is still a union. There are quite a few anti-EU parties in Europe, yet none have mustered enough support to leave yet.

At the end of the day each state does a calculus of what the benefits of staying are and what are the maluses of EU laws they don't like. If the cons outweigh the pros, the state should leave; forcing them to stay in a bad marriage is tyrannical.

> You shouldn't get to simply join when the going is good for you, and stab the rest of the nation in the back only when the going is bad. Relationships should be maintained while they are mutually beneficial, if the benefits are once sided, there is no reason to keep it.

aleyan··on Notes from MPUG: "Python one-liners" talk
Doesn't quite work as expected. From "python -m calendar 1752 9" I get:

     September 1752
  Mo Tu We Th Fr Sa Su
               1  2  3
   4  5  6  7  8  9 10
  11 12 13 14 15 16 17
  18 19 20 21 22 23 24
  25 26 27 28 29 30
"cal 9 1752" on the other hand gives:

      September 1752
   S  M Tu  W Th  F  S
         1  2 14 15 16
  17 18 19 20 21 22 23
  24 25 26 27 28 29 30
Maybe python doesn't auto recognize the timezone?

EDIT: Actually this is pretty bad because python gets all the days of the week before September 1752 in North America wrong.

aleyan··on Why do professional photographers charge so much?
The default case, yes. Here we are arguing of what the correct way of doing things should be. It is widely accepted in programming contracts to transfer the copyright to the client and in photography contracts it is otherwise.

bradly's case, like darkarmani pointed out is a communication issue. His wife assumed that since she is paying for the shoot she would own the resultant work. The photographer probably though otherwise and had a contract to back this up. For a contract to be considered legal there must be a "meeting of the minds" and clearly it didn't happen here. I blame the photographer here, because they usually have their own contract templates that they know well. They should correct any asymmetric of information that may result. Having the client hire a lawyer to examine the photo contract would be more expensive than hiring a photographer in the first place.

TL;DR If photographers don't want lawyers fees cutting into their service fees, they should be upfront about what they are peddling.

aleyan··on Why do professional photographers charge so much?
If you hire a programmer to do some work for you, who owns copyright to result of the labor?
aleyan··on Unbelievable
The the site is blocked in Russia? Can anyone else confirm? It may just be poor connectivity. Hackerfactor would be an interesting addition to the known Russian blacklisted sites[1] though.

[1] http://en.wikipedia.org/wiki/Russian_Internet_blacklist#Know...

aleyan··on PEP 435 Accepted – Adding an Enum type to the Python standard library
The permutations will continue until the PEP improves.
aleyan··on Dear Apple, let's talk about photos
"This" when used by itself means the poster agrees with a parent poster; it's an obnoxious upvote really. "This" when used with a preceding quote means that the poster agrees with the quote in particular. Such usage is more of an upvote for select part of the comment.
aleyan··on The //* /*/ //*/ comment toggle trick
If code reviewers were just for checking mistakes, then unit tests would be enough.

Code reviews are invaluable in education other developers about your code, how to support it and how to develop on it. But information should also flow the other way and the give the reviewers the opportunity to present the accepted practices to the developer. In the long term, this saves developer time as the code base stays coherent. Code is read many times and needs to be understood by many developers even though it is written only once.

aleyan··on Pony ORM - Use Pure Python to Speak to Your Data
Duh, of course. This is what happens when I don't read the explanation and just grab on to the first pieces of code I see.

Thanks.

aleyan··on Pony ORM - Use Pure Python to Speak to Your Data
From the sample on the front page

  SELECT "c"."id"
  FROM "Customer" "c"
    LEFT JOIN "Order" "order-1"
      ON "c"."id" = "order-1"."customer"
  GROUP BY "c"."id"
  HAVING coalesce(SUM("order-1"."total_price"), 0) > 1000
is translated into

  select(c for c in Customer
           if sum(c.orders.price) > 1000)
How does the python version handle nulls? They are explicitly coalesced into 0s in SQL. In python sum([1,numpy.NaN]) evaluates to nan. I think this code will do something wrong.

I am not sure what flavor of SQL is beind used, but why are the table names and the field names surrounded by double quotes? They make the query look unnecesierily hairy.

Good job otherwise. Always glad to see people contributing to the community.

aleyan··on Will Google Hang Up on Voice?
Why something called 'phone' has a map, a tv, a calendar, an internet browser, and a bunch of games built in at all is dumbfounding to me.

Yet that is the world we live in. Phones are expected to have all these features and phone numbers are expected to be able to accept text messages.

Just two weeks ago I wasted an hour waiting for my friends because GV silently dropped MMS multi-person chat messages sent to me. Not ok.

aleyan··on Bitcoin exchange rate reached $100 USD per BTC
Let me paraphrase that the way I understood you.

In a case where monetary supply is fixed (ie gold), if you hold on to it for a period of time, you will get more goods for it than now. That 'more' will correspond to economic growth over the period. You will have the same fraction of the purchasing power pie as before, but now the pie is larger. Does not look like a win to me, but this is the judgement call for the reader.

PS. Yes, I am simplifying and ignoring some thing like velocity of money and fluctuations in economic output, and growth of capital, human resources, and technology.

aleyan··on Take pride or fuck it
Great article. One nit though. When making a 2d Cartesian graph with the two axis there are accepted quadrant labeling practices [1]. Quadrant I is positive on both axis, Quadrants II and IV positive on just one axis, and Quadrant III is negative on both. What you described as Quadrant IV should really have been Quadrant III. You can flip axis any which way, but the opposite quadrants will always have 1 step in between them. No big deal, but will make little sense if somebody actually tries to visualize your model.

[1] http://en.wikipedia.org/wiki/Quadrant_(plane_geometry)

aleyan··on Show HN: Optimized trading algorithms using IPython parallel and ec2
Unfortunately I wasn't able to attend February's Big Data Meetup, so I missed your talk. EDIT: (I did just view it online, my comment takes what you said into account.)

My point about intraday data with corporate actions wasn't really about the difficulty with corporate actions, but rather the leaky abstraction of trading present in the slides. To give you credit, I don't know what issues Quantopian addresses. On the other hand, has any one tried running Zipline-backtested strategies in real life? Does any one know what issues aren't addressed by Quantopian? Corp actions was one part, T-cost model was hinted at in the slides, but was any though given to borrow costs and availability? There leaks everywhere. It is not that you don't seem like smart guys who made this cool thing freely generously available to everyone, but that you seem like you spent too little time downtown NYC.

PS. Fully adjusted bars are nice, but they have an epoch to be adjusted to. Unfortunately having an epoch that is not today() means you can't add today's data to it. If you can't add today's data to it, you can use this system to generate real trades to trade. Now you need two sets of data and two sets of code to work with. Good luck.

aleyan··on Show HN: Optimized trading algorithms using IPython parallel and ec2
I noticed you got close prices from Yahoo that you are using for your backtest. If you get the close prices in real life and optimize, when are you going to trade?

You have to deal with intraday prices now. Got those? Well they are not split or dividend adjusted. Good luck.

aleyan··on Vanguard conditioning users for phone phishing atttempts
I thought it was the Vanguard Communist Party. They should really be concerned with their security or risk having the Tsarist police ship them off to Siberia.
aleyan··on Examples of beautiful Go?
Go is quite a bit faster and memory efficient than Python3? No unexpected. Curious how it stacks up with PyPy.

Looking at the Benchmark Game Go vs Java7[0], why is Java 2x to 8x faster than Go for many benchmarks? Is the jvm that optimized these days or are those Java7 programs super tweaked for performance?

[0] http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...

aleyan··on Doctor 'used silicone fingers' to sign in for colleagues
While having "ghost employees" is troubling and lowers work ethics for other people, it could have been worse. The doctor could have been using the "silicone fingers" to sign drugs out of the drug cabinet. If biometrics were the only protection there, the patsy doctors would have very little recourse to defend themselves.
aleyan··on Reverse Engineering OKCupid
I was surprised by his recommendation. I found lxml, with it's weak xpath implementation to be a poor tool for parsing XML. How can it be a good tool for parsing non conforming HTML?

Perhaps my reply to Linus was snarky, but in my experience Beautiful Soup was easy to use for parsing HTML, where lxml for parsing XML was not. Granted the XML I had to parse used name spaces, but there was no reason for it to be difficult and there was no reason for poorly documenting which xpath features are supported.

aleyan··on Could the ancient Romans have built a digital computer?
Considering the abacus is finger operated, it is digital.
aleyan··on Petition to make unlocking phones legal again passes 100,000 signatures
I am glad this thing is happening. Unlike most other petitions that require changing law through Congress, this rests on a single individual. DMCA exemption can be made, and in case of phone unlocking have been made, by the Librarian at Library of Congress. He is appointed by the President and works at the behest of the Congress. The decision to allow the exemption to DMCA is completely up to him, and could be potentially influenced by such a petition.
aleyan··on Ten predictions (2004)
The definition of average[1] is not narrow. It could be mean, median, or mode or something else.

[1] http://en.wikipedia.org/wiki/Average

aleyan··on The Future of Excel
"Excel is like a user-friendly nuclear power plant. An amateur operator might be able to keep it running most of the time, and most of his mistakes won't be serious. But the wrong mistake can blow up your business."

Yeah, running huge Excel sheets is a risk. Running huge Excel sheets with VBA is a risk and a pain. Powering Excel with python is a step in definitely a step in the right direction and would save me personally a lot of pain and boost my productivity right now.

Unfortunately it is a step I can not take. Excel is supported by Microsoft and Excel Bloomberg plugin is supported by Bloomberg. DataNitro is supported by a company founded last year that doesn't have single person's name in their About Us or Contact Us pages. If I was to build a sheet depending on their technology, would a wrong misstep two years down the line blow up my business?

aleyan··on Open source html5 roguelike 'Wayward' goes beta
Looks pretty cool.

Stamina seems to replenish only when moving the character. Used up all stamina digging at a rock? Take a jog around the block and come back.

aleyan··on Civilized Discourse Construction Kit
The non-programmers aren't going to want to ditty around with copying files from a CD, they will just want to run setup.exe.

If someone is going to setup and run a forum figuring out how to deploy a RoR should be a minimum barrier to entry worth an hour of research.

aleyan··on Someone got the natural gas report 400 ms early
Some back of the envelope calculation for UNG (ETF in the top Nanex graph) profits for the early mover.

In the second before the announcement UNG was trading at $18.72 High and $18.55 Low. According to some minutely data I saw 400,000 shares where traded between 10:29:00 and 10:30:00; I believe this ties out with the first Nanex chart where there are 490,000 shares traded, with majority of it coming in 400 ms before the 10:30:00 mark. 4 Seconds after the 10:30:00 report release the price had stabilized at around 18.51. I will consider this $18.51 the fair price with all resonably fast algos having made their post release moves.

Let us assume that there was a single trader/algo who got the report early and executed all of the 400,000 share sells 400ms before 10:30:00 and all other market participants only bought. Additionally assume that the average fill for these sell trades was the average of the High and the Low at (18.72 + 18.55)/2= $18.635. I believe this fair because looking at the first Nanex graph the early trades are somewhat uniformly distributed between the high and the low. In a simple arb on UNG, where the trader went short 400ms before the the announcement and closed the position at the fair price a few seconds after the announcement he stands to make a profit of (18.635 - 18.51) * 400,000= $50,000.

For a trade that lasts 5 seconds, making $50,000 is nothing to sneeze at, it is not that much in grand scheme of things. Additionally other ETFS and futures were impacted and could have made more or less money.

TL;DR: If one guy captured all the profit from the early UNG trade, the max he made was roughly $50,000.

aleyan··on For 40 Years, This Russian Family Was Cut Off From All Human Contact
The first and the last time I have observed satellites in the sky was about 20 years ago in Kirov Oblast (Russia). They were fainter than the brightest stars but still distinctly visible with a few crawling across the sky at a given time. The area was rural then but not completely desolate with several villages within 10k radius. There should be large areas of the US where there is comparable or lower level light pollution than in Kirov Oblast. Depending on where you live such an area might be only a few hours drive away.
← PreviousPage 5 of 7Next →