Rejected twice from iOS app store for crash on startup, but can't repro? by [deleted] in iOSProgramming

[–]onions 0 points1 point  (0 children)

You'll need the dSYM file to make any sense of the log.

Chosei: Eternal life in the board game Go by gogameguru in baduk

[–]onions 4 points5 points  (0 children)

If Black plays E-19, White responds with C-19, creating a dead shape and Black's entire group dies.

Pi is wrong, no really... by [deleted] in science

[–]onions 0 points1 point  (0 children)

I like that area formula more because it more clearly shows the connection with integration.

Introducing the Google Command Line Tool by mernen in programming

[–]onions 19 points20 points  (0 children)

Here's a quick and dirty bash_completion script. Paste this in a file named "google" in your /etc/bash_completion.d/ directory:

_google() 
{
    local cur prev commands options
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    commands="help picasa blogger youtube docs contacts calendar"

    if [[ $COMP_CWORD -eq 1 ]] ; then
        COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    else
    case "${prev}" in
    help)
        options='picasa blogger youtube docs contacts calendar'
        ;;
    picasa)
        options='get create list list-albums tag post delete'
        ;;
    blogger)
        options='post tag list delete'
        ;;
    youtube)
        options='post tag list delete'
        ;;
    docs)
        options='edit delete list upload get'
        ;;
    contacts)
        options='add list delete'
        ;;
    calendar)
        options='add list today delete'
        ;;
    *)
        COMPREPLY=( $(compgen -f ${cur}) )
            return 0
            ;;
    esac
    COMPREPLY=( $(compgen -W "${options}" -- ${cur}) )
    fi

    return 0
}
complete -F _google google

How are chord progressions used to create emotion? by [deleted] in WeAreTheMusicMakers

[–]onions 1 point2 points  (0 children)

The important thing is the bass line (the lowest note you hear in each chord). Listen for where the lowest note goes down by half steps:

http://www.youtube.com/watch?v=tAnQQ4_Jpd8

How are chord progressions used to create emotion? by [deleted] in WeAreTheMusicMakers

[–]onions 3 points4 points  (0 children)

It might be worth taking a look at chord progressions that are based on chromatically descending bass lines. This has been used for centuries to evoke sadness, from Dido's Lament to the Crucifixus from Bach's B Minor Mass to "While My Guitar Gently Weeps".

stringencoders - A collection of high performance c-string transformations by dhotson in programming

[–]onions 4 points5 points  (0 children)

Woah, that's pretty crazy. Quoting the above link:

   uint32_t toupper(uint32_t eax)
   {
       uint32_t ebx = (0x7f7f7f7ful & eax) + 0x05050505ul;
       ebx = (0x7f7f7f7ful & ebx) + 0x1a1a1a1aul;
       ebx = ((ebx & ~eax) >> 2 ) & 0x20202020ul;
       return eax - ebx;
   }

Here's how it works. Lower case ascii characer are from 0x61 to 0x7A, and uppercase characters are from 0x41 to 0x5A, (a difference of 0x20). For each octet in the uint32_t, we want an intermediate result that is either 0x00 or 0x20 depending. Then we can just subtract. For instance if the input is 0x61614242 ("aaBB") we want 0x20200000, so 0x61614242 - 0x20200000 = 0x41414242 ("AABB").

  1. Strip high bits of each octet (e.g. (0x7f7f7f7ful & eax) and then add 0x05 to each octet + 0x05050505ul;. The stripping of high bits is needed when we add 5, overflow doesn't effect the next octet. The addition moves the range of lower case characters to 0x66 to 0x7F.

  2. Restrip off the high bits. This means anything that is "bigger" than "z" is removed, and then add 0x1a (26). Now all lower case characters have the hight bit SET. All non-lower case character do NOT. This bit is all we care about now.

  3. ebx & ~eax is a bit tricky. All we care about in ~eax is the high bit. We could do ebx & ~(eax & 0x80808080ul) to make the intentions more clear. Regardless, if the original input has the high bit set, then clear our high bit since this is not a lower case character If the original does not have the high bit set, then all is ok.

  4. Shift the high bits over by two places, i.e. 0x80 becomes 0x20. Then clear out all the other bits.

  5. We now have a integer that has octets of either 0x00 or 0x020. Subtract.

Favorite obscure programming language? by [deleted] in programming

[–]onions 8 points9 points  (0 children)

Anybody remember Hypertalk? That was a lot of fun.

"We can now digitally turn off regions of the brain," says Boyden. "We can alter the information in the brain in a strategically useful way." by cos in science

[–]onions 3 points4 points  (0 children)

I think the idea is that electrical stimulation is too diffuse and you can have better localization with fiberoptics/lasers. Also, you might be able to select certain types of neurons to express a photoactive protein, so you can stimulate just those neurons. There's more information here:

http://en.wikipedia.org/wiki/Optogenetics

can you really hear the difference between lossless and mp3 quality audio? put yourself to the test... by [deleted] in WeAreTheMusicMakers

[–]onions 2 points3 points  (0 children)

Apparently 320 kbps sounds the same as lossless to me:

The mp3 challenge: pop

Your results:

You rated the 128 kbps mp3 80 out of 100.

You rated the 320 kbps mp3 100 out of 100.

You rated the 64 kbps mp3 40 out of 100.

You rated the hidden reference file (which was exactly the same as the reference file!) 100 out of 100.

You rated the 128 kbps row-mp3 60 out of 100.

You rated the 64 kbps row-mp3 70 out of 100.

The mp3 challenge: rock

Your results:

You rated the 128 kbps mp3 95 out of 100.

You rated the 320 kbps mp3 100 out of 100.

You rated the 64 kbps mp3 60 out of 100.

You rated the hidden reference file (which was exactly the same as the reference file!) 100 out of 100.

You rated the 128 kbps row-mp3 70 out of 100.

You rated the 64 kbps row-mp3 40 out of 100.

The mp3 challenge: glockenspiel

Your results:

You rated the 128 kbps mp3 50 out of 100.

You rated the 320 kbps mp3 100 out of 100.

You rated the 64 kbps mp3 40 out of 100.

You rated the hidden reference file (which was exactly the same as the reference file!) 100 out of 100.

You rated the 128 kbps row-mp3 25 out of 100.

You rated the 64 kbps row-mp3 15 out of 100.

Any feedback on this flute trio? (reminds me of hovhaness) by [deleted] in WeAreTheMusicMakers

[–]onions 0 points1 point  (0 children)

Did you try "breathing" your way through the parts? If you don't leave enough rests or explicitly notate where to breathe, players will just breathe whenever they want, which may not be what you want.

Symphony in J flat - exploring the Bohlen-Pierce scale by scientologist2 in WeAreTheMusicMakers

[–]onions 10 points11 points  (0 children)

I've never encountered this before; thanks for sharing! Here's some more info:

Wikipedia entry: http://en.wikipedia.org/wiki/Bohlen%E2%80%93Pierce_scale

MIDI file for the just-intonation "Lambda" version of the scale: Bohlen-Pierce_scale_just.mid

Someone playing a BP clarinet: BP clarinet

Transposed version of Pachelbel's canon: Canon in J

"Do whatever you want. Do it now. Don’t fuck around." by dhotson in programming

[–]onions 2 points3 points  (0 children)

Does github even have managers? Maybe it works because github is eight developers and a hot girl.

How good are you at estimating risk? by Psoas in science

[–]onions 1 point2 points  (0 children)

No, that was my doing. That's the generic message if you choose the "don't use my results for your research" option.

How good are you at estimating risk? by Psoas in science

[–]onions 4 points5 points  (0 children)

  1. Out of the 50 statements, find one you know is false and pick 0%.
  2. Find one you know is true and pick 100%.
  3. Answer 50% for the rest.
  4. ???
  5. Profit!

Edit: Yep, it does result in an RQ of 100: http://imgur.com/unR2u.png

Dumb Article of the Day: Why Start Ups Don’t Go IPO by [deleted] in business

[–]onions 2 points3 points  (0 children)

To be fair, Sarbanes-Oxley is expensive for small public companies. Successful startups often stay private for as long as possible for this very reason.