Monday, December 14, 2015
node dot js
Great presentation on researching performance with node dot js:
http://techblog.netflix.com/2015/12/debugging-nodejs-in-production.html?imm_mid=0dd808&cmp=em-web-na-na-newsltr_20151209
I really liked how he had talked about performance troubleshooting in general, and then dives into explicit scenarios.
Tuesday, June 23, 2015
Manning Book Reviewers
Recently I have been very active reviewing new books for Manning:
http://www.manning.com/about/reviewer.html
Currently I'm reviewing a couple of books for them. One on Probabilistic Programming, and then another on salesjs.org
Both are very interesting subjects that I'm really excited about how these two technologies can be used.
http://hapijs.com/
Also reviewed a book on sails dot js, nice javascript framework to build sites.
http://www.manning.com/about/reviewer.html
Currently I'm reviewing a couple of books for them. One on Probabilistic Programming, and then another on salesjs.org
Both are very interesting subjects that I'm really excited about how these two technologies can be used.
http://hapijs.com/
Also reviewed a book on sails dot js, nice javascript framework to build sites.
Git and Linus Torvalds
I've seen articles regarding how Linus Torvalds made git in just 2 weeks. It is amazing how in 2007 no one was using Git, and now in 2015 everyone is using it (MicroSoft, Apple, Google, etc.)
What I thought was really interesting was the Google Talk Linus gave in 2007 to Google Engineers:
What I thought was really interesting was the Google Talk Linus gave in 2007 to Google Engineers:
https://www.youtube.com/watch?v=4XpnKHJAok8
Here he states anyone who likes any other revision control system is stupid and ugly. Which at first I thought was very condescending. But as he goes into the reason why, I felt that level of confidence is amazing. It is amazing how one person can completely focus on one thing, and then do it really well.
Here are the main salient points he gives in his presentation that are crucial to how Git has changed how work is done:
1. Performance - Branching, merging, updating is done in milliseconds, rather than minutes/hours with any other revision control system. That is a game changer in regard to productivity and how we do work.
2. Distributed - Network of Trust - Two terms used in his presentation that are fundamental to Linus philosophy on life, and being able to create unique value to something we all care about and inherently do naturally in our day to day lives.
3. Sha1 Hash Function - I've used this encryption often, but hearing him discuss it really makes the information hit home.
---
Recently I've become a big fan of git. Specifically for showing minor differences between the code I've been working on. This is because I'm working on multiple projects with the same code base. And I have to test and simulate different environments and different versions quickly. To download git:
https://git-scm.com/downloads
I download a lot of software all the time, so if you plan to run git on windows. I recommend also downloading cygwin and winmerge. And then learn how to manage your command line environment variables. Specifically your PATH environment variable. I'm continuously changing it all the time for different software I'm running.
git init
Initialize a git repository of the current directory and sub-directory files
git status
Display the current modified files and new files that haven't been added to the git repository.
Thursday, January 29, 2015
AngularJS Interview Questions
Write a directive
If you have a million records, how do you display on a web page
Q: What is a scope in angularJS?
If you have a million records, how do you display on a web page
Q: What is a scope in angularJS?
$scope is the application object (the owner of application variables and functions).
The concept of a scope in Angular is crucial. A scope can be seen as the glue which allows the template, model and controller to work together. Angular uses scopes, along with the information contained in the template, data model, and controller, to keep models and views separate, but in sync. Any changes made to the model are reflected in the view; any changes that occur in the view are reflected in the model.
Q: What is the difference between a service and a factory?
When used within a module, a service function call will return a new value each time it is calls. While a factory function call will return a consistent value each time it is called.
Q: What is bootstrapping?
This code downloads the angular.js script and registers a callback that will be executed by the browser when the containing HTML page is fully downloaded. When the callback is executed, Angular looks for the ngApp directive. If Angular finds the directive, it will bootstrap the application with the root of the application DOM being the element on which the ngApp directive was defined.
This code downloads the angular.js script and registers a callback that will be executed by the browser when the containing HTML page is fully downloaded. When the callback is executed, Angular looks for the ngApp directive. If Angular finds the directive, it will bootstrap the application with the root of the application DOM being the element on which the ngApp directive was defined.
Javascript Interview Questions
Question: What are Promises?
Promise is a proxy object for an event that is not necessary yet happened. A success and failure callback functions can be given to a promise, and once the promise is resolved (i.e. the 'promised' event happens successfully) or rejected (the 'promised' event fails), the corresponding callback gets called.
To access an object's promise, the then method is called.
Question: What does setTimeOut() do?
Question: What is closure?
Question: Write a function that combines two arrays into one?
Q: What is a callback? Callbacks are a more traditional way of handling asynchronous execution in JavaScript. A callback is a function that is passed to another function as a parameter, and the execution of the callback happens inside the function that it was passed to.
Promise is a proxy object for an event that is not necessary yet happened. A success and failure callback functions can be given to a promise, and once the promise is resolved (i.e. the 'promised' event happens successfully) or rejected (the 'promised' event fails), the corresponding callback gets called.
To access an object's promise, the then method is called.
Question: What does setTimeOut() do?
- setTimeout() - executes a function, once, after waiting a specified number of milliseconds
Question: What is closure?
This will always alert 16, because
bar
can access the x
which was defined as an argument to foo
, and it can also access tmp
from foo
.
That is a closure. A function doesn't have to return in order to be called a closure. Simply accessing variables outside of your immediate lexical scope creates a closure.
Question: Write a function that combines two arrays into one?
Q: What is a callback? Callbacks are a more traditional way of handling asynchronous execution in JavaScript. A callback is a function that is passed to another function as a parameter, and the execution of the callback happens inside the function that it was passed to.
How data is persisted
OMG! Please start using MongoDB now! It is fun and easy to use. But hard to troubleshoot once the level of complexity of your data grows. Keep it simple! KISS
How the web works
Another place holder blog entry. There are a bunch of great articles that discuss performance on the web and other networks. The information if always changing. So I hope to post the most relevant links I can find.
In my humble opinion (IMHO) I believe the best way to track such information is to track people. Google has the brightest and nicest folks who share that information:
Matias Niemela
In my humble opinion (IMHO) I believe the best way to track such information is to track people. Google has the brightest and nicest folks who share that information:
Ilya Grigorik
https://www.igvita.com/Matias Niemela
algorithms
Another placeholder blog post. Khan Academy is a great site for learning algorithms: https://www.khanacademy.org/computing/computer-science/algorithms
During the study of such things, it'll be good to have working examples of their implementations to do actual useful things. Things that actually provide return on investment (ROI) for companies. Remember that if you have a programming job, the company you are working for is really spending 4 times more than that on infrastructure to have what you're writing actually be used for your companies customers.
During the study of such things, it'll be good to have working examples of their implementations to do actual useful things. Things that actually provide return on investment (ROI) for companies. Remember that if you have a programming job, the company you are working for is really spending 4 times more than that on infrastructure to have what you're writing actually be used for your companies customers.
Data Structures
This is a placeholder for data structures. You know data structures! Oh wait! You may want to know the type of interview questions that are often asked regarding them. Knowing something, and the ability to actually communicate what you know in a job interview are two different things. Googling data structure interview questions is a good first step. But to be ready for interviewing, you'll need to think about the Q and A provided on interview question websites.
core java
What is core java? Well, basically all the javadoc for JDK 1.6, 1.7, and now 1.8. Need to learn a large majority of the classes documented. As well as the difference between versions 1.6 to 1.8. Right now most companies are bound to one of those 3 versions. And so if you want to work for a company that is using one of these JVMs, you need to have a lot of the fundamentals mesmerized.
For Example, java.lang.Object, which has the basic methods used for creating your own collections. These need to be understood and how to overwrite them.
Also, need to know Collections class and all of its implementations. When you would want to use one over the other, etc.
Also sorting algorithms, you should know how to write binarysort, bubblesort, and mergesort on a whiteboard really fast. I suggest practicing it in the evening, a couple of days before an interview.
Java to Javascript
I have a been a java developer for over 10 years. Which I think is 3 life times in silicon valley. During that time I have worked on J2EE, EJB 1, 2, and 3. Spring Frameworks. Struts 1.0, 2.0. JSP. JMS. JMX, etc. etc. All the acronyms at some point.
At the beginning of 2015 I found that there are still a lot of java positions. Many of which want people with core java skills. Those skills are tied to:
1. core java
3. algorithms
If you know these 5 things, you can get any java programming job. And I think someone graduating from college that has actually learned what was in the classes taught by computer science departments, should do just fine. BUT! And there is a big BUT, actually having the knowledge, and being able to communicate that knowledge to an interviewer at Google is something different.
practice, practice, practice
The interview books that have 100’s of java examples is amazing. They really help. Also the new websites that teach you programming skills and have test areas on their sites is also very good.
javascript
Now knowing java, and knowing javascript I consider two totally different beasts. There is very little ‘java’ in javascript. The runtime environments are very different. The life cycle of objects in client and server are different. They have different design patterns. They have different ways of implementing OOAD, etc. From someone who has been paid for 10 years to write java, switching to javascript has a learning curve. Many enterprise developers may feel that it is a waste since only a small amount of code is being used.
But with node.js and angularJS becoming performant and fully supported by Google. You can have all your usual enterprise stack re-written using NoSQL (MongoDB), nodes, and AngularJS at the front end. And now with complete packaging such as meteor. You can go enter the next hackathon and kick ass over others attempting to use Spring boot, etc.
Wednesday, January 21, 2015
Stay Hungry
Humble, Honest, Happy, and Hungry! 4H!
Here are some sites I been using that really help with learning specific technologies.
This site is great for answering questions regarding technologies I use at work:
http://www.stackoverflow.com
Great for posting code that I've been working on:
http://www.github.com
Great site for getting some code time under your belt:
https://www.hackerrank.com/domains/algorithms/arrays-and-sorting
Here are some sites I been using that really help with learning specific technologies.
This site is great for answering questions regarding technologies I use at work:
http://www.stackoverflow.com
Great for posting code that I've been working on:
http://www.github.com
Great site for getting some code time under your belt:
https://www.hackerrank.com/domains/algorithms/arrays-and-sorting
Subscribe to:
Posts (Atom)