Tuesday, October 30, 2012

Github.com won't reliably resolve when pulling/pushing

It started a couple months ago, it was confusing at first, I thought maybe my remote address was screwed up, or I had the wrong public key on github... but it just seems really unreliable.  The message looks like this a lot of the time:
[nak@arch Guru]$ git pull origin development
ssh: Could not resolve hostname github.com: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 Then I press up-arrow, enter... over and over again until I'm able to get a connection, and then it works fine...

I figured I'd write about this in case others are googling around, you're not alone, but I don't know the solution yet.  Maybe I'll do a wireshark session to see if I can dissect anything.

Until next time,
Eternally Confused,
Naked Proof~

Blog of confusion

This really seems to be a blog documenting my confusion, and then what proceeds from that confusion:
A lot of the time more confusion, or confusion disguised as revelation, and then maybe if I am lucky, true revelation.

Like my last post on coffeescript -cw, I'm not sure if there's still an issue with that anymore, did vim patch something? Was I really confused and blaming something that wasn't having problems? Eesh!

Wednesday, October 17, 2012

Coffee script `file removed` while using compile/watch switches with vim

I thought it was just my main Arch system, but I've recently been forced to use my clunky old laptop to develop and have found that there is a race condition in coffee-script when saving with vim on there too.

I fixed the problem with this simple patch (a hacky 100ms setTimeout to add a short pause), I was hoping the CPU on my laptop was slow enough that the logic would line up without the patch.  This was not the case.

Here's what I did since that patch link is now broken:

in command.coffee I have this:

# Watch a source CoffeeScript file using `fs.watch`, recompiling it every
# time the file is updated. May be used in combination with other options,
# such as `--lint` or `--print`.
watch = (source, base) ->

  prevStats = null
  compileTimeout = null

  watchErr = (e) ->
    if e.code is 'ENOENT'
      return if sources.indexOf(source) is -1
      try
        vimTimeout = wait 100, ->
          rewatch()
          compile()
      catch e
        removeSource source, base, yes
        compileJoin()

    else throw e



ALSO: This blog entry seems to have a good suggestion, I may try it myself!

When I brought the issue up in the coffee-script IRC channel a few months ago, there were some very defensive people (person?) saying the problem wasn't with coffee-script and the -cw switch works fine with vim.

This has not been the case for me.

I hope this helps some people, because I don't think I'm the only one who's experiencing this, or will experience this.

Please let me know if this issue gets patched, I submitted a pull request, but I deleted it due to lack of response and the embarrassingly nasty little hack (although similar hacks are used throughout the compiler to deal with race conditions!).

Anyway, much love to coffee-script for now, good luck fellow hackers.

Friday, October 5, 2012

Rant to Self: Arduino Development of Haptic Compass on Arch Linux

Poni Halp Me
Yesterday I was able to get the arduino development environment setup on Arch Linux AND get the compass module talking to the arduino over I2C (yay pre-existing code).

A lot of the haptic compass projects I see are driving the vibrator motors directly from the digital pin on the arduino, naughty!

I'll post how I used a transistor to switch each motor, even though I haven't done it yet :-P

So now the hard part where I'm sort of flabbergasted at the moment.  I have 6 registers of data spilling out magnetic field strength data for 3 axis, oh yeah the module I have exposed the DRY (data ready) pin from the compass chip, so I altered the sparkfun code to update continuously when that pin is high... high ... heh.

Anyway. When the data is inspected as a signed integer, I seem to see values from -700 to 700 for each axis.  I'll probably have to do something called 'vector addition' heh made that up, maybe, but like... I know I can't directly add or subtract the vectors, x and y are on the same plane and z is sticking out, and it seems like the higher the number the more aligned to north the axis is, negative is when the axis is "pointing" south.

Also when an axis is pointing down towards the ground its a positive, when it's pointing towards the sky it's negative. Not too sure about this behavior yet.

I should really read the data sheet more in depth now. Until next time!