HNHacker News
TopNewBestAskShowJobs

maxs

108 karma · joined September 19, 2011

submissionscomments
maxs··on Std::string half of all allocations in the Chrome browser process
It's called the short string optimization. It was used once but I am not sure if it is any more. C++11 move semantics may help a lot with string churning...
maxs··on Perfect forwarding and universal references in C++
These days I am writing a lot of C++11 code. I find that I write two different kinds of objects:

1. copyable objects like

    class RGB { int r, g, b };
2. big complex things that should never copy but can move

    class Foo { Foo(const Foo&) = delete; };
In case of (1), I don't care if move or copy constructors are used and I am happy that the compiler will decide. In case of (2), if by accident I invoke a copy constructor, I end up getting a compile-time error.
maxs··on Qake: GNU Make-based build system with a different approach
I've been recently using Tup [0] with great success in a project. It is interestingly different from other build systems in the sense that it defines dependencies in the opposite direction (from source file to product, not the other way around). It is incredibly fast and simple.

[0]: http://gittup.org/tup/

maxs··on Ask HN: Freelancer? Seeking freelancer? (November 2014)
SEEKING WORK - Remote

I am a full-stack software developer and a data scientist. I have a background in applied statistics, mathematics, physics and quantitative finance. I have written production systems dealing with big data, analytics, prediction and interactive visualization.

I have extensive experience with C++, Java, Python (Twisted, Cython), Javascript (including Node): high-performance back-end as well as dynamic front-end services.

Please contact me for references and additional information.

My site: http://kpartite.com

My LinkedIn: https://www.linkedin.com/in/maksimsipos

maxs··on A better Java: Scala or Xtend?
I'd like to use any of the alternative JVM languages out there.. However, as someone who already has a great deal of code in JARs, it seems like it would increase complexity for little benefit.

What I am saying is that I don't like the costs of investing into a whole another ecosystem (say Scala or Clojure), with an unproven future, and a smaller market (compared to pure Java). Of course, you can call any JAR from Scala and Clojure, but it seems to me that a Scala/Clojure JARs are not equally callable from Java (or other JVM languages). You start getting into runtime JARs and the basic "impedance-mismatch" of different language abstractions. (For example, for languages with traits, what do those correspond to in Java -- interfaces, abstract classes?)

Ideally, I would like to have a language that can compile a Java class that seamlessly interacts with other Java stuff. The problem is that it seems to me you don't get any of the benefits of Scala, Clojure, in that setup, because the runtime adds a lot of value. Most that you could get are nice syntax for lambdas (which are a bit verbose in Java, but not really a problem for me), but those are anyways coming in JDK 8.

Have people on HN thought about this? People who use alt JVM languages, I am curious about your opinions. Honest question, I am not interested in language flamewars.

maxs··on Pass: The Standard Unix Password Manager
If you're still looking for a password manager for Ubuntu, I really liked using KeepassX. It has password categories, lots of metadata. However, it doesn't unlock with the system.. :(
maxs··on Darpa Has Seen the Future of Computing ... And It's Analog
You're off by 3 orders of magnitude. 5269 barrels a day did sound too little to me. In the link you cited the quantity is given in thousands of barrels. The daily use is 5269000 barrels a day.
maxs··on The PhD Movie
I saw it a few months ago at a screening at my university. It's quite funny, and quite accurate too :). It is definitely an indie production, but that doesn't take away from the fun.
maxs··on Can JIT be Faster?
One example of where this is used in practice is the fftw library (fastest Fourier Transform in the west). At runtime you can run a trial of FFT algorithms for your data size and architecture, and it will pick the fastest.
maxs··on Are jobs obsolete?
A relevant short sci-fi novel about robotics, economic and societal change brought about from change in value of labor:

http://marshallbrain.com/manna1.htm

maxs··on Why software sucks?
Regarding IDEs: I completely agree with you. And I say this as someone who's used Emacs and REPL for 10 years.

I find that I am generally faster in development (at least with new libraries) in Java, than I used to be in Ruby and Python. This is all thanks to the "discovery" ability of IDEs. (I admittedly never tried a Python or Ruby IDE.)

And I have the same feeling regarding refactoring. It is not merely limited to renaming a method. I find myself very often making major structural changes to my code. Moving packages around, introducing interfaces, changing type signatures. In this regard working with an IDE makes me feel like a "software architect", I get a big-picture of the project in a much faster and better way than I used to with purely a text editor.

I also feel I waste no time on boiler-plate code (which admittedly Java has a lot of). In Netbeans (I am sure it's the same in Eclipse and IDEA) the code generation abilities are terrific. For instance, I can just write "class C implements Interface", press Alt+Enter+Enter and see all interface methods written out and ready for me to fill in the implementation.

Regarding the REPL: I've found that with strict typing, I just end up knocking out the code that _I think_ should work, and then I test if it works. I can sometimes type for 200-300 lines without running the code, then test it and see that it actually works. Of course, sometimes it fails too: luckily Java debugging is easy and incredibly capable.

However, if you really want a Java REPL, you can have something a little bit similar with BeanShell (you can even embed it into NetBeans).

maxs··on Best Ultrabook for Linux?
Another vote for ASUS U31SD!!! (I am also excited like a teenage girl about this laptop!)

I bought it for $650 from Amazon almost a year ago. It is not really an Ultrabook. But, I think it is perfect. The screen size is a 13", it is incredibly light, yet still has a full-size keyboard, all ports you will ever need, and quite A LOT of power (4Gb RAM expandable to 8Gb, 2 cores, 4 hardware threads). I use Ubuntu with Unity, with a lot of browser windows, a heavyweight IDE (NetBeans), lots of terminal windows and it works very snappy. It also never gets hot. The battery life is terrific.. 7-8 hours!

I didn't buy an SSD yet, but I intend to, in a few years when they get cheaper.

I dual boot Windows for gaming, and I've even played some relatively recent video games (like Just Cause 2, Mass Effect 3), with maxed-out resolution on an external monitor. Works like a charm.

maxs··on Using Git with Dropbox
Just to correct you: the probability is _much_ bigger than (N-1)/2^32.

See the birthday problem: http://en.wikipedia.org/wiki/Birthday_problem

maxs··on Boxing with Java
This is an example of a bug that FindBugs would catch ( http://findbugs.sourceforge.net/ ). FindBugs is a static source analysis tool for Java. It's free and open source, no reason not to use it on your codebase :).
maxs··on Science Code Manifesto
Great thought behind this manifesto. I wish more authors would attach their source codes to their manuscripts. Even when the code is not clean (academic codes usually aren't written with extensibility in mind), it would be very useful to be able to verify precisely what the code is computing.

Many times I've had occasions where the paper doesn't clearly explain parameter values, order of updates in the simulation, etc.

A tip I've discovered: you may have a chance to get access to the source code if you email the corresponding author (if they're still alive!).

maxs··on But the question is: will it recurse? Part 1: fibonacci(40)
Don't want to get into the language shootouts here. But this seems like a horrible way to compare language performance.

There are many more interesting real-life programs tested on computer language shootout website.

In particular, you can't compare C and JVM performance on programs that run for such a short time. The JVM time will be dominated by the time to start up the the JVM and to do the first JIT optimization. I think it is very likely that for a larger fibonnaci number, the JVM performance will come asymptotically close to optimized C's.

maxs··on Pyrasite - Inject code into a running Python process
Java (well, JVM) has method hotswapping. It's very useful for debugging and development. Because of static typing, you can't change classes to add new methods, but you can modify existing methods. (There is something called JRebel which does allow you to change classes but I find it a little hacky.)
← PreviousPage 2 of 2