Hacker Newsnew | comments | show | ask | jobs | submit | myelin's commentslogin

Are you warming up properly? I get the same stabbing pain in my elbows when I try to bench press anything over 115 lb, and an experienced powerlifter friend suggested it might be because I'm not adequately warming up my joints before I start -- it can be tight muscles pulling on tendons, or a bunch of things. I haven't had a chance to experiment, unfortunately, as I injured my wrist (not while lifting) and am waiting for that to heal, but...

To warm up for squats, try some or all of the following:

- using a rowing machine

- running for a little bit

- "high knee" jogging -- on the spot, lifting your knees up to your chest

- doing lots of bodyweight squats, then lots of squats with just the bar

- kettlebell swings (making sure to bend your knees and throw your butt back at the bottom of the swing)

- cycling (taking care with knee position if you get knee pain there -- I get knee pain cycling if I throw my knees out sideways; trying to lift them vertically works much better)

-----


I second this -- if lifting heavy things makes you nervous, try lifting lighter things. There's a lot of small stabilizer muscles in your body that will be really weak if left unused, and lifting any free weight will help build them up.

-----


Kettlebells are compact, safe-ish, and pretty fun. I regularly work out with barbells now at the gym (roughly following Starting Strength), but before I started that, I spent a lot of time swinging a 35 lb kettlebell at home, which firmed up my back and shoulder muscles a lot. I recently added 20 lb and 60 lb kettlebells to the set, as 35 lb isn't a challenge to swing, but I can't yet consistently control it with one arm above my head.

-----


+1 for kettlebells. They are particularly great since they are really economical (mostly since you do not need many). I've been using a 35lb one for my morning workouts. The coverage you can get with a kettlebell in a short amount of time just can't be beat.

-----


My hometown in New Zealand has been working to ban open fires for over a decade, due to their contribution to the city's terrible winter-time air quality. (Not helped by a temperature inversion that causes the smoke to stay near the ground rather than rise and blow away.)

-----


Boo -- someone changed it to the much less informative "The Next 1,000 Start-Ups" :(

Mods, please prioritize informative versions of titles!

-----


Yeah, I clicked on this expecting a piece about the medium-term future of startups (the next 1,000 startups, say). A title indicating it was a promotion targeted at startups would've been more informative...

-----


Blast from the past! I worked on this project, mainly on the associated Facebook app, "Friends on Fire". The original crew has scattered around the place - several work at Twitter now, one is running a dev shop in Uruguay, one is freelancing in SF, a couple are at various startups down the peninsula.

Easter egg: All the little pixel characters on the homepage are members of the dev team. I'm the one on the left in blue jeans and a dotted shirt :)

-----


The original title ("Light Table Playground released") was significantly more informative.

-----


I'm guessing it's a hacker status thing. We care a lot about seemingly trivial things, but not nearly as much about other things, that might appear more important. We're easily appeased entitled whiners :)

-----


Slight difference here. There are actually two types of errors in the Java code:

1. int foo = (int) Math.random() * some_max_value;

The error here is assuming that the multiplication takes place before the truncation. This isn't happening in the Python code because int(expression to truncate) is unambiguous. (+1 to Python here for making it hard to shoot yourself in the foot).

2. int foo = (int) Math.random();

The error here is assuming that Math.random returns something outside [0.0, 1.0). This is the error that all five of the Python examples are showing. (Boo to Python AND Java programmers.)

-----


Third error: This is not the correct way to randomly pick a number in a set range. The proper way is actually quite complicated. Imagine you do (int) (Math.random() * 10), this could give you numbers from 0 to 10. However, you only get 0 if Math.random() * 10 is less than 0.5, but you get 1 if the value is between 0.5 and 1.5. You are half as likely to see a zero!

I can't speak for Python, but in Java it's quite simple to do it right; Random#nextInt(int) "Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive)" (also consider using SecureRandom).

-----


We're all aware that casting to an integer does truncation, not rounding. Right?

-----


At least in Java and other languages, when casting as int truncates, and doesn't round the number, so: ((int) (0.9999999)) == 0 But then there's Math.floor and Math.ceil for what you're describing which can be used as well.

-----


  public class example
  {
      public static void main(String[] JAVA_LOL) throws Throwable
      {
          // prints "6"
          System.out.println((int)6.99999);
      }
  }

-----


You (and everyone else) are of course right. I remembered the wrong thing, what I said doesn't apply to that method in Java. What does apply is that there are lots of subtleties in generating random numbers, and there's rarely a reason to re-invent the wheel. There's a good example of how subtle pseudorandomness is in the Java documentation, so I will link that instead of embarrassing myself further: http://download.oracle.com/javase/1.4.2/docs/api/java/util/R...

-----


I actually struggle to understand why people even use Math.random() when the Random class exists.

-----


Don't need an import for Math.random(). Random is in java.util, while Math is in java.lang.

-----


Alot of people probably look for Random but find Math.random().

-----


> I can't speak for Python, but in Java it's quite simple to do it right

http://docs.python.org/library/random.html#random.randint

-----


Actually the python equivalent of "Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive)" would be random.randrange(0, n, 1)

random.randint(a, b) returns a uniformly distributed int value between a (inclusive) and b (inclusive).

</nitpick>

-----


import random # will print an integer between 0 and 10 inclusive print randint(0,10)

-----


In that case you can always use floor or ceil.

-----


I'm getting 404s on all the .exe files. Gone already?

-----


Sadly, I got the same.

-----

More

Applications are open for YC Summer 2015

Guidelines | FAQ | Support | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: