News for hackers. Stuff that matters.

jackson_1

Anyone care to share neat C tricks?

Here's a C99 trick I learned recently, known as compound literals. Say you have a function that takes a struct as a parameter:typedef struct {int x; int y;} Point;void plot(Point p);Normally, to call this function, you have to create a Point first:Point p = {1, 2};plot(p);But, with compound literals, you can declare p anonymously:plot((Point){1, 2});Does anyone else have neat C tricks to share?

( Read More... | no comments | on HN )

How essential is Maths?

I'm in my final year of studying computer science/programming in university. I'm pretty good at programming, infact I'm one of the top in my class. However, I struggle with my math classes, barely passing each semester. Is this odd, to be good at programming but be useless at maths? What worries me the most is what I've read about applying for programming positions in places like Google and...

( Read More... | 4 comments | 6 points | on HN )

Why does everyone here seem to dislike C++?

So I'm a 3rd year electrical engineering student at university and so far we've been taught how to code in ones and zeros, assembly, C and C++. Out of all of these I like C++ the best. I wouldn't say I'm great with it, but I can use it to get what I need done. But every time I come onto this subreddit everybody always makes fun of C++. Apart from school I'm kinda interested about getting into...

( Read More... | 42 comments | 33 points | on HN )
Re:MitM Attack against KeePass 2’s Update Check on Wednesday June 01, 2016 @04:49PM (#11818039)
The indirect costs of switching to HTTPS (like lost advertisement revenue) make it a inviable solution

This doesn't entirely make sense. I'm sure it's possible to serve adverts on a HTTPS page, and let's encrypt is hardly expensive

Re:TensorFlow – Consise Examples for Beginners on Tuesday May 31, 2016 @03:24PM (#11809370)
In the most compact way possible:

TensorFlow is like Numpy, only it is capable of working symbolically and can work more easily with your GPU in a highly parallel manner. For those two reasons, it is vastly superior to numpy for tasks like deep learning / machine learning.

Theano is another symbolic numerical library, coming before TensorFlow, though TensorFlow has seemingly gained more popularity and people have more general faith in it.

Re:Ideas for Game Clones to Code (2012) on Monday May 30, 2016 @04:50PM (#11803113)
This is a great list, I've tried to order them into what I think would be easiest to hardest, so you can work through all of them whilst improving your skills! If you think the list could be ordered better let me know and I'll edit it! 1:Pong 2:Minefield 3:Tic-tac-toe 4:Memory Puzzle 5:Simon 6:Sliding Puzzle 7:Duck Hunt 8:Yahtzee 9:Maze 10:Typespeed 11:Lunar Lander 12:Nibbles 13:Katamari Damacy 14:Tron 15:Asteroids 16:Arkanoid 17:Flood It 18:Quoridor 19:Space Invaders 20:Scrabble 21:Othello 22:Quarto 23:Fruit Ninja 24:Tetris 25:Minotaurus 26:Connect Four 27:Missile Command 28:Abalone 29:Sokoban 30:Dr. Mario 31:Kirby’s Avalanche / Puyo Puyo 32:Checkers / Draughts 33:Pipe Dream 34:Blackjack 35:Grid Lock / Traffic Jam 36:Last Stand 37:Bloxorz 38:Bejeweled 39:Zoop 40:Rampart 41:Mancala 42:Snood / Bust-a-Move 43:Scorched Earth / Worms / Gorillas / Angry Birds 44:Stratego 45:Risk 46:Go 47:Diner Dash 48:Fire ‘N’ Ice 49:Chess