News for hackers. Stuff that matters.

jhawthorn

Re:ARM immediate value encoding (2014) on Tuesday January 30, 2018 @02:37PM (#16268260)
You would use the LDR instruction to load the word from RAM. So just one instruction, but with some slower memory access.

When writing ARM assembly, the assembler (at least the ones I've seen) abstract this detail away from you.

You can use

    ldr    r0, =0xff000000
and the assembler will emit a MOV if it can, and if it can't it will put the value somewhere in RAM and use LDR to load it up.

ARM is fun.

Re:Bill Gates: AMA on Reddit on Monday February 10, 2014 @08:00PM (#7214955)
I made a small rails app which presents reddit AMAs nicely

http://ama.hawth.ca/1xj56q

Here's the source https://github.com/jhawthorn/riama

Re:What's New in Ruby 2.1 [pdf] on Wednesday November 27, 2013 @02:59PM (#6810687)
The f suffix has been removed in favour of the existing "foo".freeze (which is now recognized and optimized in the parser)

https://www.ruby-lang.org/en/news/2013/11/22/ruby-2-1-0-prev...

https://bugs.ruby-lang.org/issues/9042

Re:New Debian Project Leader elected: Lucas Nussbaum on Sunday April 14, 2013 @10:02PM (#5549327)
I would argue the opposite: you should always use rvm (or similar) in production. I've done this for many projects, it's great to have the same ruby version and patchset in development, CI, staging, and production. rvm is also well supported in capistrano and jenkins.
Re:Updated Packages – Python 3.3 on Friday April 05, 2013 @08:51AM (#5498052)
Not saying python 3 should have been compatible with 2. Just that this was not an apt comparison.
Re:Jedi Knight 2 And 3 Source Code Released on Friday April 05, 2013 @08:49AM (#5498038)
I would guess error handing (freeing memory, closing fd's). A goto lets you avoid deeply nested if statements.
Re:Updated Packages – Python 3.3 on Friday April 05, 2013 @07:37AM (#5497728)
Difference being that new versions of java, windows, c++ compilers work with the existing software.
I wouldn't use god. It's had issues crashing or misbehaving in the past. I've found monit very stable if a little awkward to configure correctly.

Today I would use systemd with monit for additional monitoring. systemd ensures that the same environment is used regardless of how it is invoked, and the units are extremely simple. Monit can ensure a running server is behaving (memory limits, CPU limits, testing HTTP) and rely on systemctl for restarting processes.

Re:Postgres: The Bits You Haven't Found on Saturday March 02, 2013 @01:44PM (#5310498)
These are clearly slides, meant to be fullscreen on a projector. Up/Down, Left/Right, PgUp/PgDown all work, much like they would in powerpoint. I'm a little baffled by this threads hostility towards the lack of a friendlier design.
Re:From Python to Ruby: Taking a Step Backward on Sunday December 09, 2012 @12:48PM (#4895295)
You will not run into this problem. Linux is almost always used for production servers and is popular for development as well.
Re:Bacon Ipsum, because Unicode is hard on Monday June 25, 2012 @04:27AM (#4155615)
I've been using fullwidth characters. Due to their simplicity to convert to and read. This page of course has the advantage of more variety in characters.

Fullwidth conversion code in ruby:

  "string".tr(' !-~', "\u3000" + (0xFF01...0xFF5f).to_a.pack('U*'))
Re:Sqeezing performance out of CUDA on Saturday April 21, 2012 @07:51AM (#3871563)
Oh, no! Missed noticing my first link from HN for a few days. Hopefully I can clarify some of this.

First, this is in no way faster than cuSPARSE or cusp. I wrote this for an originally for a school assignment (hence older cuda version) and was hoping to convey what I had learned my first time using cuda.

The size of the shared memory is so the reduction has no buffer overflow without using conditionals. However I am using more than needed, it should be set to 32+16. I don't expect this to affect performance as the kernel already reaches 100% theoretical occupancy.

Could you explain the desire for more threads/blocks per row? I can't immediately think of one, having more additions per thread sounds good so long as all are running.

Thanks very much for the read and the reply!

Re:Functional Programming With Ruby on Tuesday July 26, 2011 @10:53PM (#2810529)
Other than recommending #map, #select, et al, the rest is poor advice. Consider the following recommendation

  input.inject({}) do |hash, item|
    hash.merge(item => process(item))
  end
Far, far slower, more memory intensive (big deal, given ruby's gc), and uglyer than the sane (and commonly accepted)

  Hash[input.map do |item|
    [item, process(item)]
  end]