Uncategorized

Node notes : on require with no js file in local path

Posted on

if you require, for example  “greet”, and greet.js is not found, node will look for folder called “greet” and then look for a file called index.js

 

 

io.emit vs socket.emit

Posted on

io.emit lets the server send an event to all the connected clients at once. This is useful when you need to send some data to everyone. This is something we want everyone to be able to see.

socket.emit sends an event to a single socket. This is great when you need to send an event to a single user. Example: This is why we use socket.emit when sending out a greeting message. It only needs to go to that one user.

 

socket.io notes

Good advice on learning programming from scratch

Posted on Updated on

 

 

I see similar advice over and over, learn one core language, C++ or Java; Learn one scripting language, python, etc; Learn Linux; Build Code; Get job: Im reposting this here because out it’s well layed out

 

 

I am 100% sure that if you are intelligent you can do this, and that it will likely be financially worth it.

I will teach you how to obtain the skills to get a job at an amazon or google type company (at LEAST 90k starting salary):

  1. You must be a competent programmer in a main stream lower level language (say c++ or java) as well as a scripting language (python, bash, etc.).

    -Learn C++ from C for dummies follow by something like “accelerated c++” or Stanley Lippman, Essential C++, or Absolute C++ -Learn python similarly and by simply reading the python docs online. -You must also practise using these languages which you will do by doing your own simple projects as well as programming solutions to contest problems as I outline in further steps.

  2. You must understand the unix operating system. -Install linux (say ubuntu) and use it as your primary operating system. Start using the command line as often as possible. -Read a basic book about unix “teach yourself unix in 24 hours” and “unix in a nutshell” should get you going. Make sure you know about grep and chmod
  3. Data structures. Understand and be able to describe: -binary search trees (including self balancing such as red-black and AVL) -hash tables -stack, queue, array, priority queue.

    -Read the relevant sections in Sedgwick’s “Algorithms in C” or any data structures in C book. (Internet reviews should help).

  4. You must be able to solve ‘difficult’ algorithmic problems using techniques such as: -dynamic programming -divide and conquer

Buy Algorithm Design Manual and Introduction to Algorithms by Cormen, et al (CLRS). Work through these books slowly. You will have to take time to master everything in them and ask questions as necessary. They are not simply understood.

  1. Understand basic networking (how the internet works). Key concept examples: DNS, tcp/ip

There’s probably an article on how stuff works or just get a book about this stuff if you have to.

  1. Understand how a program is built. What an assembler, compiler and linker are. Just google this stuff. To truly understand this fully you should disassemble a program. Ollydbg is a program that can do this. A good place to try out your skills is osix.net . They have a series of ‘reverser’ challenges that will teach you about this (passing even the first level or 2 is good enough).
  2. Object oriented Design and design patterns:
  3. You should have some sense of OOP (object oriented programming) from learning C++ through the books above. Learn more if necessary by finding an OOP specific book. -Read ‘head first design patterns’ (CRUCIAL BOOK)
  4. Other tidbits: SQL helps (a language used to query a database) sqlzoo.net should get you started. Functional programming (a language like Scheme or Haskell) is usually helpful in learning how to program well. Structure and interpretation of programs is a good book.

Projects I’d implement: -A simple mysql backed website. Just make it so you can click a button and that will initiate a python script which will insert something into your db as an example. Simple, but shows you how everything works together. -Work through the ‘geek’ challenges on osix.net as well as the ‘reverser’ challenges. -Try to work through about 1/5 or 1/10 of the challenges in ‘algorithm design manual’ -Enter a few programming contests online the ‘google ai challenge’ was really good. -Try to make a simple version of anything you are interested or anything you have ever wondered how it could/would work.

Remember practise, practise, practise. Everyday read and implement.

https://www.reddit.com/r/learnprogramming/comments/13mo6u/im_30_with_a_liberal_arts_degree_and_no_coding/c75kw2d

Free up space Mac OS X

Posted on Updated on

Someone asked if I could assist with getting some space back. They had 256mb free. WOW.

Looked at finder and they had 11gb of pics, but 36gb of other stuff

used the link below to free up space.

removed some stuff from ~/Library/Caches

deleted downloads

 

ended up having enough space to make the laptop usable.

 

 

 

http://osxdaily.com/2012/11/11/tips-free-up-disk-space-mac-os-x/

Samsung watch brings down AIX servers on network

Posted on

Op connects his samsun watch to his wireless network, AIX servers stop working.

 

Problem 1: seems watch names itself “localhost”

Problem 2: DHCP overwrote localhost DNS entry of 127.0.0.1 to samsung watch’s IP

 

Problem 3: Oracle changed the order of how they look up the local host by going to DNS first rather than it’s own host file entry.

 

 

https://www.reddit.com/r/sysadmin/comments/3x8skg/tifu_by_connecting_my_samsung_watch_to_our/

Find what SQL server features and components are installed

Posted on Updated on

There is a feature in SQL installer that can tell you what you have installed

Check your install media or SQL Server Installation Center if it is installed locally, then run the link for “Installed SQL Server features discovery report”.

 

 

sql1

sql2

Thanks to:

http://blogs.msdn.com/b/samlester/archive/2013/06/13/sql-server-2012-discovery-report-determining-what-sql-server-components-are-installed.aspx