+ -

Pages

Monday, February 23, 2015

What I learned today!

Learned: More Node.JS syntax, Telnet Chat Server (workings), TCP/UDP, Reading Speed, Programming logic, socializing, avoid freelancing.

Opened a new book 'Node: Up and Running' and started reading it, what I loved about this book is that right away it let's you do interesting things.

1.So I learned how to build a basic telnet chat server, I'll add more features later tonight, like choose your own username, and some chat commands.

Pag. 15: Building a chat server:
var net = require('net');

var chatServer = net.createServer(),
  clientList = {},
  i = 0,
  x;

chatServer.on('connection', function (client) {
  client.name = client.remoteAddress + ':' + client.remotePort;
  client.write('Welcome ' + client.name + '!\n');

  clientList[i++] = client;

  client.on('data', function (data) {
    broadcast(data, client);
  })
})

function broadcast(message, client) {
  for (x in clientList) {
    if (client !== clientList[x]) {
      // Do nothing
      clientList[x].write(message);
    }
  }
}

chatServer.listen(9000);
2.As a result I learned more about tcp, udp by searching on Google.

3.I learned how many words per second you can read so I could estimate the time it would take you to read this article:

$(document).ready(function () {
  var contentRT = "";
// div:nth-child(2) > ul:nth-child(1) > li:nth-child(2) > a:nth-child(1)').text(est);
});
// ]]>

3.1.From this experience I also learn how much blogspot.com sucks when it comes to customizability, if you know a better solution for calculating the reading time on blogspot I would be grateful, cause now, before I post or update a post I have to check for double quotes and replace them with single ones, if I don't do this everything goes to hell, for now I am using:Text to HTML.

Edit: I solved the problem with the double quotes, it was so simple, just replaced blogger's <data:post.body/> with $('.post-body').text();, I'm so ashamed.

4.After contacting an experienced JS developer on Quora I learn three things:

4.1.That if I want to be a real developer, a future software architect, project manager or if I want to start my own business someday that I have to know about how the internet works. He was referring that you have to grasp the general concepts of programming and algorithms, you have to catch the logic that is behind programming. You have to train your problem-solving abilities.

4.2.That I should look in the future and avoid freelancing for as much as I can.

4.3.If I want to advance faster as a programmer I have to connect with more programmers/developers, the easiest way to do this is by social media (by using twitter, quora, github and by starting a blog [this is the real reason that I started a blog today and I write this article right now], as an alternative to social media he told me about going to university (but I'm thinking of learning programming on my own and take philosophy as universitar studies [I'll think more about this in the future].)..

Yeah, I believe those are the things that I learned today.
Have a good night, I'll just be here for you! :D
5 Tao[X]: What I learned today! Learned: More Node.JS syntax, Telnet Chat Server (workings), TCP/UDP, Reading Speed, Programming logic, socializing, avoid freelancing. Op...

No comments:

Post a Comment

< >