HNHacker News
TopNewBestAskShowJobs

Oatmeat

44 karma · joined August 15, 2007

submissionscomments
Oatmeat··on Eigenvectors and eigenvalues explained visually
If you can draw a line through the three points: (0,0), v, and Av
Oatmeat··on Why can you turn clothing right-side-out?
I was able to do it with my jeans, so I expect it's possible with any trousers. You should note that the inversion is not symmetrical. You are basically pulling one pant leg into the other one. In the end you are left with one pant leg which is inside-out and straight and the other pant leg is inside of the first.

The inversion of the parameters is now noticeable. You started with basically a donut with a very wide hole (formed by the pant legs -- I'm ignoring the hole where your waist goes). After the inversion, the pant legs form a donut which is very narrow (just the width of the inside of the pant leg) and is very tall (the height of the pant leg).

Oatmeat··on Hacker Monthly #2 is out
* a page of curated pithy/insightful/fun comments from hacker news

This is on pages 28-29 of this issue.

Oatmeat··on For loops help - comp.lang.c
The program is drawing on a grid 9 wide by 10 high. The loop is going over each space in this grid. It puts a * in each cell that falls within the equations described by the four inequalities. Here's a slightly more simplified version.

    int putchar ( int ) ;
    
    int main ( void )
    {
        int z;
        int width = 9;
        int height = 10;
    
        for (z = 0; z < width * height; z++)
        {
            int x = z % width;
            int y = z / width;
    
            putchar (
                x + y > 3 &&   /* top left */
                x + y < 14 &&  /* bottom right */
                y < x + 6 &&   /* bottom left */
                y > x - 5      /* top right */
                 ? '*' : ' ' );
    
            if (x == width - 1)
                putchar ( '\n' );
        };
        putchar ( '\n' ) ;
    
        return 0;
    }
It would be clearer to separate the main loop into nested loops for x and y, but I've left it as is to show a closer resemblance to the previous version.

The fun part is that you can now play with the various settings. Try increasing the height and width and scaling the equations appropriately. Replace x by 2 * x or x * x for more interesting shapes. You can bound the picture by any equations you like. Example: http://ideone.com/53Qh3

Oatmeat··on More weight, fewer reps works best.
Just exercise 3 times a week and eat more or less than your calorie needs according to what you're trying to do.

Right, eat less if trying to lose weight and eat more if trying to bulk up. But what if you are trying to lose fat and gain muscle?

Oatmeat··on Find your birthday (or any other number) in pi ...
It is conjectured that pi is normal: http://en.wikipedia.org/wiki/Normal_number

If the conjecture is true then any finite sequence of numbers can be found in the digits of pi. As others have noted, infinite sequences are not guaranteed or even likely to appear. As zackattack points out, for example, the decimal expansion of 1/9 does not appear in the digits of pi.

Oatmeat··on Professional Hacks: Tricks of the Trade
From the article it appears that in "rechtub klat" the letters in a word are reversed, but the words have the same order in the sentence. So it would be:

  "gniog ot yrt siht tuo txen keew"
Oatmeat··on Papers Every Programmer Should Read
For the lazy:

pdf: http://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thomps...

html: http://cm.bell-labs.com/who/ken/trust.html

Oatmeat··on Git: the minimum you need to know (sorta like a cheat or nutshell)
Thanks for the reply.

Regarding the push command, it currently does not allow both the --all and --tags options to be used together (very strange).

Regarding not pushing temporary branches, this seems contrary to one of the reasons I started using git: it makes branches cheap and easy to throw away when you are done with them.

I can understand the way git works regarding each developer using only the branches they are interested in, but I can't seem scale this philosophy down to a single developer. I want all my working copies to be the same. I want new branches to propagate. I want branch deletions to propagate.

I've thought about scripting some of this, but for some pieces I am not sure how to proceed. Consider branch deletion. The problem here is that I can delete the branch from the main repository, but that doesn't force deletion for each of the clients. Instead, I would need to write a custom "git pull" style command that I run in a working directory before I start my work. Should this command delete all remote branches so that actual deletions are propagated, and then "git pull" restores the remote branches which still exist?

[edit: I've discovered that "git remote prune" will delete remote tracking branches that are no longer in the repo]

Don't other git users have this issue? Presumably there are others who work from more than one location and want a consistent view from each, yet I can't seem to google for any help on these issues.

Oatmeat··on Git: the minimum you need to know (sorta like a cheat or nutshell)
I'm a single developer who has recently switched from subversion to git and I'm having a few problems adjusting. My setup is that I work on my code from various places (home, laptop, school) and I want to a consistent view of my code from each place. That is, if I create a git branch at home and write some code in it, I want to see that branch right away when I start working from school.

Right now, I have a main server set up where I push my changes to after finishing work for the day. But now suppose I create some new tags and branches. I need to do

  git push --all
  git push --tags
Then when I start working from a different location next time, I do

  git pull
  git checkout --track -b <new-branch> origin/<new-branch>
Where I have to do the last command for each new branch that I want to see in my working copy. Things are even worse when I want to delete a branch (after having merged it into the mainline). I do

  git branch -d <branch-name>
  git push origin :<branch-name>
And this will remove the branch from the local repository and my main repo, but at each of the other repositories I still need to delete the remote tracking branch.

Does anybody know a way to simplify this workflow with git?

Oatmeat··on MIT prof's notorious talk on How to Talk
http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/01-pre... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/02-int... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/03-sta... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/04-big... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/05-tim... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/06-bla... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/07-ove... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/08-pro... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/09-sty... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/10-sto... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/11-que... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/12-que... http://ice.fas.harvard.edu/~bok_cen/booksvid/vids/hts/13-pos...