IoT – Concerns
Management,
Security
Mobility
Longevity
Application Design
Malta
Hard day at work!
Boracay diving
JS Performance: 10 Commandments
- Don’t touch the DOM
- Cache DOM reference in local vars
- Use selectors API
- Cahce the length when looping collections
- Update the DOM offline
- Batch style changes
- Don’t ask for layout info excessively
- Minimize reflow areas
- Use event delegation
- Don’t touch the DOM
Interview Questions – ES6 Questions
- What is traceur?
- ES6 -> ES5
- Traceur is a JavaScript.next-to-JavaScript-of-today compiler that allows you to use features from the future today. Traceur supports ES6 as well as some experimental ES.next features.Traceur’s goal is to inform the design of new JavaScript features which are only valuable if they allow you to write better code. Traceur allows you to try out new and proposed language features today, helping you say what you mean in your code while informing the standards process.JavaScript’s evolution needs your input. Try out the new language features. Tell us how they work for you and what’s still causing you to use more boilerplate and “design patterns” than you prefer
- What are the required node_modules to makes traceur working properly
-
$ npm install traceur $ npm install traceur-runtime
-
- Why do you need traceur-runtime?
- What is the node command to compile ES6 to ES5?
Java examples: Enhanced For Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void enhancedForLoop(){ | |
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9}; | |
System.out.println("\nEXAMPLE: Enhanced For Statement"); | |
for (int temp: arr){ // Create a temporary variable, same type as array values. For | |
// loop assign array value to the temporary variable | |
System.out.println("Enhanced = " + temp); | |
} | |
} |
Java examples: Switch Statement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void witchStatment(int num) { | |
System.out.println("\nEXAMPLE: Switch Statement"); | |
switch(num){ //Check the value | |
case 0: | |
System.out.println("Case = " + num); // Execute this if 'case' matches the 'value' | |
break; // Stop the statement | |
case 1: | |
System.out.println("Case = " + num); // Execute this if 'case' matches the 'value' | |
break; // Stop the statement | |
case 2: | |
System.out.println("Case = " + num); // Execute this if 'case' matches the 'value' | |
break; // Stop the statement | |
case 3: | |
System.out.println("Case = " + num); // Execute this if 'case' matches the 'value' | |
break; // Stop the statement | |
case 4: | |
System.out.println("Case = " + num); // Execute this if 'case' matches the 'value' | |
break; // Stop the statement | |
default: | |
System.out.println("Default = " + num); | |
} | |
} |
Java examples: While Loop vs ‘do’-while loop
While Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void whileLoop(){ | |
System.out.println("\nEXAMPLE: While Loop"); | |
int num = 0; | |
while(num <= 20) { // Check the while condition first, Then execute the loop | |
// Then while 'l' is less than or equal to '0' | |
System.out.println("num = " + num); | |
num++; //increment 'l' by 1 | |
} | |
} | |
‘do’-while loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void doWhileLoop() { | |
System.out.println("\nEXAMPLE: Do While Loop"); | |
int num = 0; | |
do { | |
// DO the work... Execute the loop first | |
System.out.println("num = " + num); | |
num++; //increment 'l' by 1 | |
} while(num <= 20); // Check the conditions | |
} |