News for hackers. Stuff that matters.

brihat

Re:Ask HN: Best IRC channels? on Saturday February 01, 2014 @06:15AM (#7161398)
Freenode #emacs, ##linux, #nimrod, #julia and #d.

Nimrod's gang (including Araq) are very friendly and welcoming.

#julia and #d are very quiet though (except for the bots).

And #emacs -- well, that one channel which is lenient towards off-topic chats!

Re:A glimpse of undefined behavior in C on Saturday November 30, 2013 @06:08PM (#6825096)
Isn't this actually called "implementation-defined" behaviour in the std rather than "undefined" behaviour? I generally get a segfault for undefined behaviors
Re:An example of fast numerical computation using Haskell on Saturday November 30, 2013 @12:29PM (#6823746)
A naive implementation in Nimrod:

     proc main(max_a0: int): int =
       var a, longest, len, max_len : int
     
       for a0 in countup(1, max_a0):
         a = a0
         len = 0
     
         while a != 1:
           len += 1
           if (a mod 2 != 0): a = (3*a + 1)
           a = a div 2
     
         if len > max_len:
           max_len = len
           longest = a0
     
       return longest
     
     # Main program starts here
     echo(main(1000000))
Takes 0.76s (the C program in TFA takes 0.58s)
Re:The string type is broken on Wednesday November 27, 2013 @12:55PM (#6809806)
The author intentionally chooses decomposed form. Indeed all of them work with Python 3. Here:

    Python 3.3.2+ (default, Oct  9 2013, 14:50:09) 
    [GCC 4.8.1] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> noel="noël"
    >>> noel[::-1]       # reverse
    'lëon'
    >>> noel[0:3]        # first three characters 
    'noë'
    >>> len(noel)        # length
    4
The point is, defining what is a character based on how it is displayed is flawed. Just precompose the string ifg you want and carry on. Like I said in my other comment, making automatic conversion of decomposed -> precomposed wrecks havoc with Indian languages.
Re:The string type is broken on Wednesday November 27, 2013 @12:43PM (#6809711)
This article is mostly written from a European language perspective. For Indian scripts, storing combining characters as a separate code points is the right thing to do.

For example, कि (ki) is composed of क and ि When I'm writing this in an editor, say, I typed ku (कु) instead of ki (कि) and I press backspace, I indeed want to see क rather than deleting the whole "कि".

Re:Julia for Numerical Computation in MIT Courses on Tuesday November 26, 2013 @01:35AM (#6799541)
I am very impressed with Anaconda's Free edition. Works well in Linux and has more packages [2] than Enthought's free edition. Anaconda is the commercial offering from Travis Oliphant, the creator of Numpy.

[1]: https://store.continuum.io/cshop/anaconda/

[2]: Packages: http://docs.continuum.io/anaconda/pkgs.html