Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root797675ydating_pool = World.people.where(idiot: false, gender: :female).group(:country).sort(country: :desc, iq: :desc)
dating_chance = dating_pool.count / World.people.count.to_f -
@NoToJavaScript I use that all the time because
i = i * 5;
just looks silly IMO. Funny thing is that most people still don't use the shorthand syntax whith bit shifts. Not sure why, I strongly prefer
i >>= 4;
over
i = i >> 4; -
@Fast-Nop I use += every time. But still can’t bring my self for *=, -= and /=. I guess personal preference.
-
Hazarth95215ya simple function to find out if B is twice the value of A
bool isSecondDouble(int a, int b) {
return (a/b) == 0.5;
}
but it will never work in C nor Java. Probably will in JavaScript tho...
Related Rants
Hey guys!
I am looking for good "whats wrong with this code" snippets with as little lines of code as possible!
question
error
code
bug