HNHacker News
TopNewBestAskShowJobs

tcas

445 karma · joined November 22, 2011

submissionscomments
tcas··on Canada ditches the penny
Stealing is a bit of a loaded word. The HFT algos provide immense liquidity to the market by, well, executing tons of transactions every second. This means when you decide you want to purchase 100 shares of a stock, one of the automated machines will try and sell you those shares for a slightly increased price to make a profit. Now the guys doing HFT would love to increase the price by 10% to sell you those shares, but since every single HFT computer sees that buy order, they quickly scramble to try and fill it. As a result, they focus on making a penny or two per share but executing the transaction in microseconds. By lowering their per share profit they can guarantee they will get the trade since otherwise another market maker will step in and offer the shares a penny lower. By executing tons of transactions a second they can make money doing this since they focus on buying/selling a large volume every day.

Back when all trades were performed by people it would be very difficult to trade with high precision numbers, but since the market makers all work on an automated basis, penny precision increases the resolution an algorithm can decide on the price to buy/sell a share. Since the algorithms are focusing on low profit but high volume, they will lower their profit to try and win the trade against the other market makers.

Why is this good for you? Unless you're trading thousands of times a day, you will only pay a tiny premium to the HFT guys as it's a race to the bottom for them (aka the current share price). They are focusing on speed, and as a result they can't spike up the price suddenly as the other algorithms will jump and and take the trade from them. This is the liquidity they provide to the market and also why when you place your order through your broker it goes through in seconds. If the minimum resolution was fractions of a cent that would be the resolution the algorithms would work at, so instead of paying a $0.01 per share premium you're paying a $0.125 per share premium since that's the minimum they can go while still selling for a profit. Before automated trading a real person would have to go out on the trading floor and try and find you some shares to buy. I can guarantee that you would pay a higher premium per share doing that vs having computers race each other to fill the order in microseconds.

Note: I glossed over a lot of information here and tried to simplify it a lot. It should give you a good idea why HFT is good for the individual investor though.

tcas··on x86 Assembly Primer for C Programmers
Wow, those examples took me a while to go through and understand; it's amazing the level you can optimize a piece of code to hardware. I'm curious to benchmark the implementations and see the performance difference.

Maybe you or someone else knows the answer to this though: it seems like they are processing 4 bytes of the string at a time. If they read over (i.e. the NULL byte is in byte position 1 2 or 3), isn't that technically undefined behavior? They are only reading in the memory, but I feel like valgrind or another tool would spit out an error if that happened. It's aligned, so it won't trigger a page fault, but it seems like an unsafe optimization.

tcas··on A fast paced stock exchange trips over itself
Yup, there's usually a primary exchange, but a stock can be traded on many exchanges. Years ago people could make money via arbitrage between exchanges. Essentially if stock ABC costed $50 at one exchange, but people were willing to buy ABC at $55 on another exchange, a quick trader could buy the stock at $50 on one exchange, and sell the equivalent on the other exchange for $55, making a "free" $5 without any change in their holdings. Now that we have computerized trading solutions the price difference between exchanges is essentially nil and cannot be taken advantage of unless you have ultrafast computers and access to fiber optic networks.
tcas··on The future of computers: 3D chip stacking
Xilinx's Vertex 7 FPGA uses a stacked design for the interconnects. The FPGA logic is all 28nm, but sitting under it is a completely passive 65nm interconnect layer.

http://www.xilinx.com/products/technology/stacked-silicon-in...

tcas··on Absolute Beginner's Guide to Bit Shifting
I've used bit shifting a lot when dealing with any sort of audio/video applications. Specifically, when muxing audio and video into a container (i.e. MPEG transport streams) you need to set up a bunch of bit flags that are packed very tightly and also need to frequently need to write data into non-byte boundaries. The result is a couple hundred lines of code of all pointer arithmetic and bit shifts to convert between verbose data structures and the format in question.
tcas··on Lthread - C coroutine lib with multicore support
Looks really cool.

If I understand it correctly, the first call to lthread_create() in the main thread will create a new pthread with a local scheduler. Each call to lthread_create() in that lthread will create local lthreads in that scheduler, so in essence each lthread pool is actually single threaded unless there is a non exclusive or blocking operation you can run lthread_compute_begin()/lthread_compute_end() on. This is opposed to something like Grand Central Dispatch where you can assign "tasks" to the scheduler which will schedule them on an available thread pool.

tcas··on Google Music: The Best Service That Nobody’s Using
Interesting. I know in x264 there's a non-deterministic option when using multithreading that can speed up encoding and quality sometimes, otherwise it always produces the same output.
tcas··on Apple didn't revolutionize power supplies; new transistors did
> Establish 2-way communication

The middle pin on a magsafe power supply is used to send data two ways. It uses the 1-wire protocol and passes along (among other things), the serial number of the charger, the amperage of the charger, the power type (so the computer won't try and charge using an airplane adapter). Negotiation happens between the charger and computer for power and the LED color.

tcas··on Open Source VLC media player 2.0.0 is out
I'll see what I can do, unfortunately generating a sample sliding window playlist isn't the easiest thing in the world to do (I can't post the feed I'm testing it with). Looking at access logs it appears to have something to do with reloading the playlist, as the access intervals don't look like Quicktime's or an iPhone's.
tcas··on Open Source VLC media player 2.0.0 is out
Interesting new look. I was excited about getting HTTP Live Streaming support in VLC, however, it seems to be broken for sliding playlists, which is surprising since I thought it hooks into libav* for a lot of that stuff, which does have support.
tcas··on Open Source VLC media player 2.0.0 is out
I don't think so. According to the FAQ they don't think it'll change (http://www.videolan.org/press/lgpl-libvlc.html). The LGPL requires dynamically linking the library or providing the raw object files if statically linked to allow the end user to change the LGPL library in the code. I've read that the app store's code signing + pay wall to get a signing certificate violates this exception, so it looks like a no go. It would have been nice if they added in a static linking exception.

Hopefully this will allow for other open source software to link to libVLC without having to fully upgrade to GPL however.

tcas··on The machine's view of time, if nanoseconds were seconds
Back when I took a VLSI class my professor showed an awesome animation of clock distribution at various frequencies. http://www.research.ibm.com/people/r/restle/Animations/DAC01...

Check out the animations under "Clock Distributions" (numbers 19 to 25. It shows how the propagation of the clock across the die is affected by frequency (When a part of the fabric/tree is up or down it represents 1 and 0 respectively).

My favorite is the SymTree and Non-Uniform SymTree (23 and 24) which shows how having a non uniform load at various parts of the chip and a fixed tree structure affects how long each part of the chip is at a 1 or 0 state (i.e. a low load part of the chip will spend more time at a stabilized 1 or 0, while a heavy capacitive load at one part can not even reach a true 1 or 0).

tcas··on Show HN: Very low footprint JSON parser in portable ANSI C
I've used cJSON (http://sourceforge.net/projects/cjson/) in the past, which worked very well for what I needed (simple 1 file JSON parser for config files). Maybe I'll give this a shot the next time I need to do some simple JSON parsing.

You should get the project listed on http://www.json.org/

tcas··on O2 statement on the mobile number issue
This seems like a possible security hole. I wonder what will happen if you forge the HTTP header to pretend your someone else.
tcas··on Saudi Arabian Hackers Leak Credit Card Details of 400,000 Israeli Citizens
Does anybody know the legality of checking these lists? I'm always concerned that the access logs are sent to various authorities.
tcas··on New Year's Resolution: Full Disk Encryption on Every Computer You Own
Pretty minimal. If you have TrueCrypt installed you can run a benchmarks of various algorithms. It's especially fast if you have a modern processor with AES-NI (hardware AES instructions) -- I get around 1GB/s Encrypt/Decrypt using AES on a Core i5.
tcas··on Supercolliding a PHP array (inserting 65536 elements takes 30 seconds)
Running php -a will give you an interactive shell as well, however, if you do a lot of php development phpsh http://www.phpsh.org/ is a lot more feature rich and can be a huge timesaver.
← PreviousPage 6 of 6