HNHacker News
TopNewBestAskShowJobs

ntoshev

3,065 karma · joined March 12, 2007

nik@t1mr.com

http://www.underengineering.com

[ my public key: https://keybase.io/ntoshev; my proof: https://keybase.io/ntoshev/sigs/-piodh_N3Iz_KHRDy9q8DwzUm8hyzhfGYMQHzguhJhI ]

submissionscomments
ntoshev··on I don't understand Python's Asyncio
I disagree that the code can't know what will switch with green threads. They switch on I/O and when explicitly requested. An example of using this to get rid of concurrency control: http://www.underengineering.com/2014/05/22/DIY-NoSql/

If you want to make sure that there are no context switching in certain part of your code, you can do it ASSERT-style, something like:

    # enable this only if you use atomic, so a new module that should be imported before gevent
    in_transaction = False
    if __debug__:
        import greenlet
        old_switch=greenlet.greenlet.switch
        class _greenlet(greenlet.greenlet):
            def switch(*args, **kwargs):
                if in_transaction:
                    raise Exception('Switching context during / atomic')
                old_switch(*args, **kwargs)
        setattr(greenlet, 'greenlet', _greenlet)

    @contextmanager
    def atomic():
        """
            Ensure that a function or a block of code is atomic, raise exception if it's not

            Usage:

            @atomic()
            def myTransaction(...):
                ...

            or 

            with atomic():
                ...
        """
        global in_transaction
        in_transaction = True
        yield
        in_transaction = False
ntoshev··on Debunking Misleading Benchmarks Of Redshift vs BigQuery
No link to the original comparison by Google? It was only presented on a private event?

Well, it's impossible to know the context in which this comparison was made. BigQuery is very different from the rest of the data warehouse solutions, I wouldn't think a standard benchmark suite would be appropriate for it.

ntoshev··on Applying machine learning to Infosec
It's not just security - I'd expect cache eviction algorithms, schedulers, constraint solvers and many others to also benefit from ML. Anything dealing with hairy problems.
ntoshev··on Why we challenge Microsoft’s battery test
It may not be fair to enable adblocking if you want to compare other engineering components, but these results still mean users in the real world will see more battery time with Opera than with Edge.
ntoshev··on On Chomsky and the Two Cultures of Statistical Learning (2011)
There is a problem with the simple economic models that don't claim to predict real world behavior because they capture only one aspect of reality (everything else being equal...). They are not really scientific because they are not falsifiable. Math works and it seems to reflect reality, but we have no epistemic mechanism to verify this.

If we can do this eventually, then perhaps we can make our way to models that capture a larger fraction of the truth and can be tested against reality.

ntoshev··on On Chomsky and the Two Cultures of Statistical Learning (2011)
I wish there was a follow-up to this, Peter Norvig has hinted a few times he is going to write one.
ntoshev··on English Syntax Highlighting
I've experimented with this for a while, the goal being easier comprehension of new text. I found highlighting parts of speech and syntactic groups didn't work for me. The only thing that did work was highlighting keywords (that are specific to the text) and maybe named entities that refer to the same thing. Interestingly, there is some research indicating highlighting keywords may help people with dyslexia.

I've written a chrome extension for highlighting keywords, too bad I don't currently have time to give it the love it deserves:

https://chrome.google.com/webstore/detail/highlit/cooahmcpma...

ntoshev··on Why I Still Use Python for High Performance Scientific Computing
The diff between Haskell and Python is not functional programming, I program functionally in Python, it is the type system.

This is subjective, but having tried Elm with its Haskellish type system, it seems that the type system makes me think hard about things that ultimately don't matter much. It might depend on your problem, but I doubt it. Even doing numerical computation with Theano I find myself better off just executing subexpressions and seeing results and the shape of the tensors interactively is more useful than thinking really hard how the operations transform the shape.

ntoshev··on The impact of syntax colouring on program comprehension [pdf]
English is better as I'd have to run Spanish through Google Translate. Email is in my profile if you don't want to post it here.
ntoshev··on The impact of syntax colouring on program comprehension [pdf]
I've tried part-of-speech tagging and subjectively it doesn't seem to help much. POS taggers for English are a solved problem, so it can be done automatically, but for prototyping I tried marking up some text myself. Indeed what helped the most were the verbs (vs other parts of speech), but it still didn't seem to be worth doing.

Also marginally helpful was to delimit noun / verb phrases with 2 spaces instead of one.

ntoshev··on The impact of syntax colouring on program comprehension [pdf]
That's interesting! Can I see such an essay of yours?
ntoshev··on The impact of syntax colouring on program comprehension [pdf]
I think of it as a space to explore. Punctuation is another preexisting visual aid in parsing. However, printed text is rather limited compared to the ways a computer can style text dynamically for you.

Edit: The fact that this capitalization disappeared suggest the returns from the effort of capitalization weren't so great. But now the investment per word is much lower because the process can be automated.

ntoshev··on The impact of syntax colouring on program comprehension [pdf]
Having monospaced / proportional font test as a sort of control would have been nice.

I've been wondering what is the analogue of syntax highlighting for natural languages. Still experimenting with it, but most promising is simple keyword highlighting. I've written a Chrome extension that does this:

https://chrome.google.com/webstore/detail/highlit/cooahmcpma...

Interestingly, keyword highlighting apparently helps some type of dyslexic people focus their attention on the text. With the web full of distractions, I've noticed similar effect myself. Keywords also seem to help skimming, when you're reading the text with a specific purpose in mind.

ntoshev··on Cache-friendly binary search
vEB layout has expensive index calculation though, BFS might still be faster.
ntoshev··on Don't use Hadoop – your data isn't that big (2013)
Yup, I'm actively using this architecture, in Python, with gevent (so that calls to external services don't stall your web server). I spawn long running computations in separate processes. I've described it here:

http://www.underengineering.com/2014/05/22/DIY-NoSql/

It really achieves 10k simple requests/transactions per second on a single core (or a $5/month VPS). The software support for it might have been better though. I should really release some code that helps with things like executing a function in another process, or verifying that some code executes atomically.

ntoshev··on “DBus is seriously screwed up”
COM sort of works, on Windows, when when one or preferably both sides of the connecting components are made by Microsoft. You never see non-Microsoft code talking to non-Microsoft code from a different vendor via COM. This is not a successful component interface standard.
ntoshev··on Expired SSL certificate
Our website monitoring service https://t1mr.com will warn you before your certificate expires (in addition to warning you when your site is down, and giving you reports of inbound and outbound dead links).
ntoshev··on Coding is not the new literacy
The author explained a very useful analogy (reading : comprehension = writing : composition = coding : modelling) but didn't push it as far as he should. The important thing about coding as modelling is that the results are not just external to the author's head, they are formal models that automatically infer or do things. The other way to do that - in one's head and via his actions - simply doesn't scale beyond a point. Historically the ways people scale such models are human organisations. That's why IT is so exciting today: not only it helps an individual think, it helps groups organize at scale that wasn't practical before because of the friction inherent in implementing formal models in people's heads.
ntoshev··on “Implement text editor DOM updates manually instead of via React”
They saw an improvement when they introduced React too... http://blog.atom.io/2014/07/02/moving-atom-to-react.html

So React taught them how to update the DOM manually ;) I suspect the case of a text editor is systematic enough so that they can have a specialized and minimal DOM update algo, without too much maintenance cost (which would be high if you try to implement specific minimal DOM update in a random app).

ntoshev··on How to pick startup ideas
I am yet to read that blog post, but it seems to me that this problem should be solved at a different level.

The issue is that modern application need to work on mobiles and browsers, and be responsive. To be responsive you need to bring the part of the state that can be reached via the UI to the device. This suddenly makes your database distributed among your servers and your client devices.

The device may be a mobile phone or a laptop in an airplane, and it needs to work offline and on networks with high latency. This means you need to have an eventually consistent AP database across servers, browsers and mobiles.

Currently databases assume they live on servers and we hack our way with distributed state on the clients, but I hope this won't last.

ntoshev··on How to pick startup ideas
The shift from spinning hard drives to SSDs is an environmental change like the ones you describe in the article. What made it hard to exploit? Not enough improvement, compared to legacy databases on SSD?
ntoshev··on High-reproducibility and high-accuracy method for automated topic classification
What is the user supposed to learn from the visualization? Is it high level understanding what the text is about? Is it some support to make the text easier to read and understand (like syntax highlighting is for programmers)? Is it something in between, something else?
ntoshev··on Practicing Programming (2005)
I think practicing programming should be about:

1. trying many new things

2. in a very tight feedback loop

So, code little ideas, but make sure you start from the essence of the problem - not the registration/login process, not the new API - start directly from the part that's new and challenging and risky. In this way, when the idea fails, you wouldn't have wasted time building support infrastructure for it.

Also, pick light and flexible tools for exploratory programming - dynamic languages, REPL, etc.

ntoshev··on Forbes 30 under 30 2015
4.2% are related to YC! I wonder how many are related to Stanford or another institution?
ntoshev··on The Second Wave of Blockchain Innovation
Every user might verify just a random sample of all calculations and the system would still work.
ntoshev··on How You Know
Google's +1 is pretty cool in this respect. If you +1 articles you read, their search scores will be boosted for your subsequent searches, so you'll be more likely to stumble upon them if you are looking for something related (but have forgot about what you read).
ntoshev··on Show HN: Addict – a Python dict whos values can be get and set using attributes
This doesn't trigger autocompletion of attributes in dreampie / bpython / ipython - the original implementation does.
ntoshev··on Deep learning for chess
CUDA is used to learn the evaluation function, at play time it uses a Python implementation of Negamax that uses this evaluation function to estimate how good are the leaf positions.
ntoshev··on Binary Search Is a Pathological Case for Caches (2012)
I wish the author included data sorted in a van Emde Boas layout, which should be the cache-friendly equivalent of a sorted array to be searched with binary search.
ntoshev··on London’s Legendary Taxi-Driver Test Puts Up a Fight in the Age of GPS
It is a trivial problem. Track how anyone with a smartphone and your app on it moves around the city. Aggregate which paths they choose and which turn out to be faster / better. Then propose those paths to other users asking for routing instructions.

I work on a software for routing deliveries (https://www.fleetnavi.com), and although we don't have this functionality built into the platform yet, it's the first thing to do when we get volume.

← PreviousPage 2 of 34Next →