seivadmas
Joined 12 years ago
Joined 12 years ago
Rust is a unique language in that it deallocates memory on the heap
without requiring the writer to call free,
while at the same time having no need for a garbage collector.
Someone correct me if I'm wrong but surely this is not unique - don't Objective C and Swift have automatic reference counting which accomplishes much the same thing?However, metaprogramming is a power that should be used wisely. When implemented unnecessarily it reduces readability (and probably performance) for no real gain.
The devise source contains some great examples of metaprogramming used properly:
https://github.com/plataformatec/devise/blob/master/lib/devi...
Metaprogramming has a place in Ruby but for the examples in the article there are far more readable ways to implement it.
Readability > cleverness every single time.
Not saying it isn't useful, in fact I have a project in which this would be a very good fit and I might even implement it there.
There are a tonne of average-to-poor looking girls on Tinder who have very good photos of themselves that paint them in a much more flattering light than they really deserve. Take a leaf out of their book.
Tinder is the most superficial distillation of dating out there, your entire judgement of the person is based on a few photos (and often just the first one).
You need 4 photos, show them in this order:
One full body shot of you with a clear image of your face, one of you topless (if you have the body for it), one of you looking cool with your friends, and one of you doing something you like, preferably some sort of adventurous hobby like climbing or diving
PAY TO GET PROFESSIONAL PHOTOS DONE. I can't emphasize this enough, more than anything else this will drastically improve your results.
The 'about me' field is almost irrelevant. Keep it to 3 sentences or less. When you get a match, push for a meetup at a bar (or your house if you feel bold) as soon as possible, preferably within 24 hours. Get their actual phone number within the first five messages. THE GIRL ALREADY LIKES YOU, there is no need to play silly games at this point.
I also use a Tinderbot to automatically like all the girls. I wrote my own version based off the work of somebody who reverse-engineered the API, my repo is here https://github.com/samphilipd/tinderzapper . When I feel like going on some dates, I just run that for a few days, unlike all the unattractive matches and push for meetups with the rest. It's a pure numbers game.
BELIEVE ME there are girls out there who will find you attractive and want to meet up with you, you simply have to sift through the junk to find them.
The above is pretty much exactly what I do. I'm only slightly above-average looking and very below-average height (5ft4). I do workout so I have a somewhat decent body. I've been on countless dates this year and got laid with 10-15 girls just through tinder.
Anyone can get a date on Tinder with professionally taken photos. In fact, most of the girls on there already know the importance of photos and are very skilled at showing photos that present them in the best possible light.
Don't get me wrong, I think Ruby is a great language and I use it every day to get paid, but it is not a speed queen. Ruby's strengths lie in flexibility, fast iteration, readable code and permitting a functional style.
In most practical web applications the big bottlenecks will be either view rendering or database. Choosing to put any focus at all on performance of something like parallel vs serial assignment (unless you are doing something truly pathological) is a complete waste of time.
It will have no noticeable difference to the end user and distracts from the far more important job of making your code modular, extensible and readable.
If need your code to be fast and you are running Ruby, you already lost. Use Java or a compiled language instead.
Ever wonder why it itches in those first couple of weeks if you decide to grow your beard out?
Look at that picture.
Shaving with a straight-blade razor basically leaves a bunch of tiny little hypodermic needles behind. When those suckers start growing out, they curl back into your face and start jabbing you, resulting in that annoying itching sensation.
If you want to grow your beard out, take my advice and make your last shave with an electric razor, it's a lot more comfortable.
https://github.com/bbatsov/rubocop
Fast enough to integrate into a continuous integration build process and catches a lot of dumb mistakes/typos before deploying to production.
So what then is the CORRECT way of doing this comparison in C, avoiding potential overflow pitfalls?
x = 1987654321 and y = -1987654321? Then the difference between them is -319658654 (negative) which proves that x is less than y. That’s less than correct.
Which is completely 100% wrong. Surely the difference would be x - y i.e (1987654321 - (-1987654321)) = (1987654321 + 1987654321) = 3975308642.Which is perfectly ok, because that's positive and so proves x is greater than y. So this comparison works just fine for negative integers...