What is Gzip and JavaScript compression at all:
http://wrzasq.pl/blog/serving-static-content-css-and-javascript-with-gzip.html
http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
http://stackoverflow.com/questions/16883241/how-to-host-static-content-pre-compressed-in-apache
https://gtmetrix.com/enable-gzip-compression.html
Monday, June 13, 2016
Friday, June 10, 2016
WEBPACK - what is it Hot Module Reload, flags, process.env etc
Here is a good explanation what is Hot Module Reload:
http://matthewlehner.net/react-hot-module-replacement-with-webpack/
If you’re interested in a more in depth explanation of how it works, check out the answer to What exactly is Hot Module Replacement in Webpack on Stackoverflow.
http://webpack.github.io/docs/hot-module-replacement-with-webpack.html
http://stackoverflow.com/questions/24581873/what-exactly-is-hot-module-replacement-in-webpack#answer-24587740
http://matthewlehner.net/react-hot-module-replacement-with-webpack/
If you’re interested in a more in depth explanation of how it works, check out the answer to What exactly is Hot Module Replacement in Webpack on Stackoverflow.
http://webpack.github.io/docs/hot-module-replacement-with-webpack.html
http://stackoverflow.com/questions/24581873/what-exactly-is-hot-module-replacement-in-webpack#answer-24587740
webpack-dev-server --progress --inline
--progress
displays the compilation progress when building--inline
adds webpacks automatic refresh code inline with the compile application
--profile
--colors
--watch
--display-error-details
--display-cached
--content-base /src
Profiling
If you wish to have a more in-depth idea of what is taking how long, you can use the --profile
switch. This will cause WebPack to display more detailed timing informations. Combine this with the switches above to get a very detailed message and information set, which will contain the timings of your modules.
The timing "keys"
factory
: The time it took to build the module information.
building
: The time that was spent building the module (loaders, for example).
dependencies
: The time that was spent gathering and connecting the dependencies
Process.env:
Webpack configuration can be a CommonJS module and can pick up on environment variables via Node's process.env
object.
AMD
https://webpack.github.io/docs/amd.html
Sunday, June 5, 2016
Wednesday, June 1, 2016
CARS - cars fuel consumption comparison web sites
http://www.fuelly.com/car/volkswagen/passat/2013/zcontest/432851
2013 Volkswagen Passat TDI SE
2.0L L4 DIESEL Automatic Dual Clutch 6 Speed
VW Jetta, Golf, Passat
5.6 L/km2013 Volkswagen Passat TDI SE
2.0L L4 DIESEL Automatic Dual Clutch 6 Speed
BMW 320 ds only DISELS
7 L/km
Tuesday, May 31, 2016
AUTH0 ANGULAR 2 - github links
Steps in creating and running demo Angualr2 + Auth0:
1. Create account on Auth0
2. Create Application (download Angular2 + Auth0 sample code)
3. Add Allowed Callback URLs separated by comma for Prod and Dev e.g http://localhost:3000/, http://localhost:8080/, http://localhost:8081/ (if it is not set you will got an error on login: error invalid origin)
4. Create User with login password
4. Build for prod: npm run watch:prod
5. Build for prod: npm run server:prod
C:\Users\Andre\Downloads\AUTH0\auth0-angular2-sample\webpack>npm run server:prod
> auth0-angular2-webpack@0.0.0 server:prod C:\Users\Andre\Downloads\AUTH0\auth0-angular2-sample\webpack
> http-server dist --cors
Starting up http-server, serving dist
Available on:
http://93.126.95.40:8081
http://127.0.0.1:8081
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
auth0 pricing
https://auth0.com/pricing
auth0-angular2
https://github.com/auth0/auth0-angular2/blob/master/webpack/package.json
angular2-jwt
https://github.com/auth0/angular2-jwt
Real world Angular 2 app authentication
https://auth0.com/blog/2015/05/14/creating-your-first-real-world-angular-2-app-from-authentication-to-calling-an-api-and-everything-in-between/
JWT - JSON Web Token for auth0 authorization
https://jwt.io/introduction/
1. Create account on Auth0
2. Create Application (download Angular2 + Auth0 sample code)
3. Add Allowed Callback URLs separated by comma for Prod and Dev e.g http://localhost:3000/, http://localhost:8080/, http://localhost:8081/ (if it is not set you will got an error on login: error invalid origin)
4. Create User with login password
4. Build for prod: npm run watch:prod
5. Build for prod: npm run server:prod
C:\Users\Andre\Downloads\AUTH0\auth0-angular2-sample\webpack>npm run server:prod
> auth0-angular2-webpack@0.0.0 server:prod C:\Users\Andre\Downloads\AUTH0\auth0-angular2-sample\webpack
> http-server dist --cors
Starting up http-server, serving dist
Available on:
http://93.126.95.40:8081
http://127.0.0.1:8081
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
auth0 pricing
https://auth0.com/pricing
auth0-angular2
https://github.com/auth0/auth0-angular2/blob/master/webpack/package.json
angular2-jwt
https://github.com/auth0/angular2-jwt
Real world Angular 2 app authentication
https://auth0.com/blog/2015/05/14/creating-your-first-real-world-angular-2-app-from-authentication-to-calling-an-api-and-everything-in-between/
JWT - JSON Web Token for auth0 authorization
https://jwt.io/introduction/
Monday, May 30, 2016
Thursday, May 26, 2016
WEBPACK vs ANGULAR-CLI
Straggling with Angular-CLI
https://medium.com/@martin_hotell/angular-cli-and-real-development-productivity-4ba3c1865eda#.wj4u6hjeh
Webpack with Sean T. Larkin (John Papa etc)
http://podplayer.net/#/?id=15461508
Yakov Fain
https://yakovfain.com/2016/05/06/starting-an-angular-2-rc-1-project/
Webpack vs Grunt & Gulp
https://medium.freecodecamp.com/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8#.3r2ikrwzq
https://medium.com/@martin_hotell/angular-cli-and-real-development-productivity-4ba3c1865eda#.wj4u6hjeh
Webpack with Sean T. Larkin (John Papa etc)
http://podplayer.net/#/?id=15461508
Yakov Fain
https://yakovfain.com/2016/05/06/starting-an-angular-2-rc-1-project/
Webpack vs Grunt & Gulp
https://medium.freecodecamp.com/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8#.3r2ikrwzq
Friday, May 20, 2016
TYPESCRIPT - my notes on Pluralsight TypeScript Fundamentals by Dan Wahlin and John Papa
Pluralsight TypeScript Fundamentals by Dan Wahlin and John Papa
Arrow Functions => (actually it is a "fat" arrow :)
It is a Lambdas.
TypeScript Key Features
Dynamic vs Static
Optional parameter
x? : number
Type and Ambient Declaration
Type declarations: http://definitelytyped.org/
Look for different *.d.ts types files: typescript.codeplex.com
Other 3rd party types files: https://github.com/DefinitelyTyped/DefinitelyTyped
Object Types
Function
Function can take in its parameter object type like this:
var someField = function (rect: {h: number, w?: number}) {
if (rect.w === undifined) {
rect.h * rect.h;
} else {
rect.h * rect.w;
}
}
Class
Every class in TypeScript can have:
Constructor, Fields, Properties, Functions
Make variable of whole class and call from that variable static methods:
let greeterMaker: typeof Greeter = Greeter;
TypeScript is a superset of JavaScript
It is a Lambdas.
TypeScript Key Features
Dynamic vs Static
Optional parameter
x? : number
Type and Ambient Declaration
Type declarations: http://definitelytyped.org/
Look for different *.d.ts types files: typescript.codeplex.com
Other 3rd party types files: https://github.com/DefinitelyTyped/DefinitelyTyped
Object Types
Function can take in its parameter object type like this:
var someField = function (rect: {h: number, w?: number}) {
if (rect.w === undifined) {
rect.h * rect.h;
} else {
rect.h * rect.w;
}
}
Class
Every class in TypeScript can have:
Constructor, Fields, Properties, Functions
Make variable of whole class and call from that variable static methods:
let greeterMaker: typeof Greeter = Greeter;
greeterMaker.standardGreeting = "Hey there!";
Properties
Properties are the private members of the class exposed to the exterior by get and set key words.
Check this post: http://blogs.microsoft.co.il/gilf/2013/01/22/creating-properties-in-typescript/
Using a class as an interface (!!!)
As we said in the previous section, a class declaration creates two things: a type representing instances of the class and a constructor function. Because classes create types, you can use them in the same places you would be able to use interfaces.
class Point {
x: number;
y: number;
}
interface Point3d extends Point {
z: number;
}
let point3d: Point3d = {x: 1, y: 2, z: 3};
Rest parameter in TypeScript is what we know like Varargs in Java
someMethod(...someArgs: string)
Using a class as an interface (!!!)
As we said in the previous section, a class declaration creates two things: a type representing instances of the class and a constructor function. Because classes create types, you can use them in the same places you would be able to use interfaces.
class Point {
x: number;
y: number;
}
interface Point3d extends Point {
z: number;
}
let point3d: Point3d = {x: 1, y: 2, z: 3};
Rest parameter in TypeScript is what we know like Varargs in Java
someMethod(...someArgs: string)
Wednesday, May 18, 2016
SPARK - pluralsight course Apache Spark Fundamentals, my notes
Resources about the use of Spark:
https://amplab.cs.berkeley.edu/for-big-data-moores-law-means-better-decisions/
https://www.chrisstucchio.com/blog/2013/hadoop_hatred.html
http://aadrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html
https://github.com/rozim/ChessData (PGN source) https://en.wikipedia.org/wiki/Portable_Game_Notation (PGN wiki)
https://spark.apache.org/examples.html
Spark installation's issues on Window 10:
The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rw-rw-rw- (on Windows)
How to fix it:
Be sure you have the right version of winutil.exe (its size should be > 100kb). The download link of it is here: http://letstalkspark.blogspot.com/2016/02/getting-started-with-spark-on-window-64.html
find out this line: e.g. - Download winutils.exe ( Put in C:\BigData\Hadoop\bin ) -- This is for 64-bit
Then execute this command:
C:\pathToWinutils\winutils.exe chmod -R 777 \tmp\hive
First task in Spark
(count word and sort them from default file e.g. README.md of spark package):
val textFile = sc.textFile("file:///spark/README.md")
val tokenizedFileData = textFile.flatMap(line => line.split(" "))
val countPrep = tokenizedFileData.map(word => (word, 1))
val counts = countPrep.reduceByKey((accumValue, newValue) => accumValue + newValue)
val sortedCounts = counts.sortBy(kvPair=>kvPair._2, false)
sortedCounts.saveAsTextFile("file:///PluralsightData/ReadMeWordCount")
Then checkout the files part-00000.txt and part-00001.txt stored in ReadMeWordCount folder in your FS.
Try other function on data set
tokenizedFileData.countByValue
Monday, May 16, 2016
Angular 2 - ngConf notes
Codelyzer
Checks your code against A2 Styleguid
Angular.io/resources
Angular Augury
Checks your code against A2 Styleguid
Angular.io/resources
Angular Augury
Saturday, May 14, 2016
JAVA 8 - My notes on Streams, Collectors, and Optionals for Data Processing in Java 8 [Course]
Pluralsight course:
Streams, Collectors, and Optionals for Data Processing in Java 8 by Jose Paumard
SPLITERATOR
Is the object on which a Stream is based.
It is a kind of iterator for a collection.
Collection access its data through Iterator, Stream - trough Spliterator.
Streams, Collectors, and Optionals for Data Processing in Java 8 by Jose Paumard
SPLITERATOR
Is the object on which a Stream is based.
It is a kind of iterator for a collection.
Collection access its data through Iterator, Stream - trough Spliterator.
INTERVIEW - data structure problems that are hard to solve (answer from quora.com)
A good book about tech interviews by Gayle Laakmann McDowell:
https://www.quora.com/Where-can-I-find-difficult-algorithm-data-structure-problems
Cracking the Coding Interview, 6th Edition: 189 Programming Questions and Solutions 6th Edition
https://www.quora.com/Where-can-I-find-difficult-algorithm-data-structure-problems
Where can I find difficult algorithm/data structure problems?
Links to interview questions or any practice problems.
Answer Wiki
Sites that contain algorithmic question. These sites are useful if one has little preparation time (a few days to one or two weeks).
- http://courses.csail.mit.
edu/iap... - InterviewBit
- GeeksforGeeks - A computer science portal for geeks
- http://www.qubeet.com/
- http://everything2.com/ti
tle/har... - http://www.intertechtion.
com/ans... - http://algomuse.appspot.c
om/archive - Interview Questions | CareerCup
- http://www.dsalgo.com/
- Coding Interview Questions
- We Help Coders Get Hired
Sites that have online judges, and are useful for longer term growth (think 2 months or more):
- HackerRank - by Interviewstreet
- http://www.topcoder.com
- InterviewBit
- http://code.google.com/co
dejam/c... - http://www.codeforces.com
- http://www.codechef.com
- http://www.spoj.pl
- http://www.projecteuler.c
om - http://www.leetcode.com
The wiki is incomplete. Please add to it as necessary.
17 Answers
Less Time for preparation
If you just want to know the questions and answers for interview questions, the following are some good places to visit. These will be useful in a situation where there is not much time for preparation.
More than 2 months for preparation
If you have lot of time for the interview it is better to improve your coding skills, Here are a few useful sites for practicing algorithmic programming.
Feel free to suggest edits
If you just want to know the questions and answers for interview questions, the following are some good places to visit. These will be useful in a situation where there is not much time for preparation.
- MyCareerStack
A sub domain of Hackerearth . The website looks clean and seems to have fairly good community. - www.geeksforgeeks.org
- I like the algorithms section. (http://www.geeksforgeeks
.org/fun...) - Apart from that it is more or less similar to careercup.
- I like the algorithms section. (http://www.geeksforgeeks
- Stack overflow questions tagged with algorithms.
http://stackoverflow.com/questio... - www.careercup.com
Read only the questions.People post shitty brute-force solutions in the comments. It would be a total waste of time to read the answers in the comments. - http://www.dsalgo.com/
- Others
More than 2 months for preparation
If you have lot of time for the interview it is better to improve your coding skills, Here are a few useful sites for practicing algorithmic programming.
- HackerRank (previously www.interviewstreet.com )
- No-so-easy questions, most of them are challenging.
- Solving one question requires multiple concepts.
- Companies come for hiring via codesprints in interviewstreet
- Sphere Online Judge (SPOJ)
- Use www.problemclassifier.app
spot.com to search for problems of a concept and then solve the questions - Contains more than 10K questions
- has questions of all levels.
- Use www.problemclassifier.app
- Codechef
- Contains questions of all levels.
- There will be monthly contests.
- http://algomuse.appspot.c
om/archive - They conduct non-programming contests once a while (may be around 3 months)
- Moderate and difficult questions.
- http://community.topcoder
.com/tc - Very good community.
- High quality tutorials.
- There will around 2 contests per month.
- Contains questions of all levels(archives).
- http://www.codeforces.com
(similar to topcoder) - projecteuler.net
- Contains many easy questions in the beginning. But the questions after the 200th are challenging.
- One can start with this (questions numbered <100) and move on to other sites once he/she gets confidence.
Feel free to suggest edits
Related Questions
1.Geeks for Geeks
This is one of the best computer science portal for geeks, mainly focus on Data structures and Algorithms. Analysis of algorithms,Searching and Sorting, Greedy Algorithms, Dynamic programming, Pattern searching, Backtracking, Divide and Conquer and Bit algorithms are explained clearly.
2.Top Coder
Top coder is one of the coding contest site mainly focus on algorithmic questions. Here is the good collection of algorithmic topics by various topcoder members.
3. OpenclassRoom- Stanford University
Here is the collection of video tutorials by Prof. Tim Roughgarden from Stanford univ. Topics discussed here are Introduction to fundamental techniques for designing and analyzing algorithms, including asymptotic analysis; divide-and-conquer algorithms and recurrences; greedy algorithms; data structures; dynamic programming; graph algorithms; and randomized algorithms
4. Introduction to Algorithms – Massachusetts Institute of Technology
Here is the collection of lecture slides,code on various algorithmic topics by Massachusetts institute of technology
5. Stanford CS Education Library
This online library collects education CS material from Stanford courses and distributes them for free.
Here are few more sites that might help you to learn data structures and algorithms:
1. CSE 214 - Lecture Notes
2.http://courses.csail.mi t.edu/6.8...
3. CS 61B: Data Structures
4.https://www.coursera.or g/course/...
5. Coursera
6. Algorithm Interview Questions
7.http://www.careercup.co m/page?pi...
8 LeetCode
9 Newest 'data-structures' Questions - Stack Overflow
10. Newest 'algorithm' Questions - Stack Overflow
11 Introduction to Algorithms Course Online
12 Manish Kumar: September 2013
Quora questions:
1. What are some good resources for learning about data structures?
2. Data Structures: What is the best resource to learn Data structure and algorithm (must contain practice assignments too)?
3 What are some of the best resources for learning advanced data structures like segment trees and binary indexed trees (Fenwick trees)?
Facebook group : https://www.facebook.com/ groups/...
This is one of the best computer science portal for geeks, mainly focus on Data structures and Algorithms. Analysis of algorithms,Searching and Sorting, Greedy Algorithms, Dynamic programming, Pattern searching, Backtracking, Divide and Conquer and Bit algorithms are explained clearly.
2.Top Coder
Top coder is one of the coding contest site mainly focus on algorithmic questions. Here is the good collection of algorithmic topics by various topcoder members.
3. OpenclassRoom- Stanford University
Here is the collection of video tutorials by Prof. Tim Roughgarden from Stanford univ. Topics discussed here are Introduction to fundamental techniques for designing and analyzing algorithms, including asymptotic analysis; divide-and-conquer algorithms and recurrences; greedy algorithms; data structures; dynamic programming; graph algorithms; and randomized algorithms
4. Introduction to Algorithms – Massachusetts Institute of Technology
Here is the collection of lecture slides,code on various algorithmic topics by Massachusetts institute of technology
5. Stanford CS Education Library
This online library collects education CS material from Stanford courses and distributes them for free.
Here are few more sites that might help you to learn data structures and algorithms:
1. CSE 214 - Lecture Notes
2.http://courses.csail.mi
3. CS 61B: Data Structures
4.https://www.coursera.or
5. Coursera
6. Algorithm Interview Questions
7.http://www.careercup.co
8 LeetCode
9 Newest 'data-structures' Questions - Stack Overflow
10. Newest 'algorithm' Questions - Stack Overflow
11 Introduction to Algorithms Course Online
12 Manish Kumar: September 2013
Quora questions:
1. What are some good resources for learning about data structures?
2. Data Structures: What is the best resource to learn Data structure and algorithm (must contain practice assignments too)?
3 What are some of the best resources for learning advanced data structures like segment trees and binary indexed trees (Fenwick trees)?
Facebook group : https://www.facebook.com/
There are couple of websites that post interview questions along with its solutions:
http://www.leetcode.com
http://xorswap.com/
There are also websites that host algorithm problems used for programming competitions. These problems are not actual interview question but excellent problems to practice solving algorithm problems:
Peking University Online Judge:
http://poj.org/
Google Code Jam:
http://code.google.com/co dejam/c...
TopCoder (Registration required to view the problems):
http://community.topcoder .com/tc...
The websites listed above are the ones I have used before, but there are a lot more websites that host programming competitions and most of them have archive of problems used on their previous matches. I will list some of them below but I cannot guarantee of their quality (since I have never used them):
Sphere Online Judge:
http://www.spoj.pl/proble ms/clas...
Codeforces:
http://codeforces.com/pro blemset
http://www.leetcode.com
http://xorswap.com/
There are also websites that host algorithm problems used for programming competitions. These problems are not actual interview question but excellent problems to practice solving algorithm problems:
Peking University Online Judge:
http://poj.org/
Google Code Jam:
http://code.google.com/co
TopCoder (Registration required to view the problems):
http://community.topcoder
The websites listed above are the ones I have used before, but there are a lot more websites that host programming competitions and most of them have archive of problems used on their previous matches. I will list some of them below but I cannot guarantee of their quality (since I have never used them):
Sphere Online Judge:
http://www.spoj.pl/proble
Codeforces:
http://codeforces.com/pro
This is a good set http://everything2.com/ti tle/har...
And a few I like:
1) You are given a read only array of n integers from 1 to n. Each integer appears exactly once except A which appears twice and B which is missing. Find A and B using less than O(n) space in O(n) time.
A read-only array of length n, with address from 1 to n inclusive,
via http://domino.research.ib m.com/C...
3) Given a stream of n integers between 1 and n find one number that repeats in linear time using less then O(n) space and traversing the stream sequentially O(1) times.
4) What's the hardest puzzle question asked at PayPal?
5) Given a tree where nodes have integer labels, find a path that goes down in the tree such that the sum of labels equals S. O(n) algorithm. source: Cracking the Coding Interview ( http://www.amazon.com/dp/ 098478280X ).
6) You're given a read only array of n integers. Find out if any integer occurs more then n/3 times in the array in linear time and constant additional space.
7) Do a stable merge of two arrays in place faster than O(n^2).
8) Build a sparse set datastructure that takes O(m) space to keep m integers in the range 1 .. n such that add-member(i) and is-member(i) take O(1) time. sourcehttp://research.swtch.com /sparse
9) http://gurmeet.net/puzzle s/firin...
10) Test if two trees are isomorphic.
And a few I like:
1) You are given a read only array of n integers from 1 to n. Each integer appears exactly once except A which appears twice and B which is missing. Find A and B using less than O(n) space in O(n) time.
A read-only array of length n, with address from 1 to n inclusive,
contains entries from the set {1, 2, ..., n-1}.
By Dirichlet's Pigeon-Hole Principle there are one or more duplicated
entries. Find a linear-time algorithm that prints a duplicated value,
using only "constant extra space". (This space restriction is important;
we have only a fixed number of usable read/write
memory locations, each capable of storing an integer between 1 and n.
The number of such locations is constant, independent of n.
The original array entries can not be altered.) The algorithm should
be easily implementable in any standard programming language.
via http://domino.research.ib
3) Given a stream of n integers between 1 and n find one number that repeats in linear time using less then O(n) space and traversing the stream sequentially O(1) times.
4) What's the hardest puzzle question asked at PayPal?
5) Given a tree where nodes have integer labels, find a path that goes down in the tree such that the sum of labels equals S. O(n) algorithm. source: Cracking the Coding Interview ( http://www.amazon.com/dp/
6) You're given a read only array of n integers. Find out if any integer occurs more then n/3 times in the array in linear time and constant additional space.
7) Do a stable merge of two arrays in place faster than O(n^2).
8) Build a sparse set datastructure that takes O(m) space to keep m integers in the range 1 .. n such that add-member(i) and is-member(i) take O(1) time. sourcehttp://research.swtch.com
9) http://gurmeet.net/puzzle
10) Test if two trees are isomorphic.
Subscribe to:
Posts (Atom)