How to setup DigitalOcean's Droplet with Ubuntu 16.04 + UFW + NGINX + SSL + F2B
This file contains hidden or 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
| // Warning: maximum value for a variable of type int: 2,147,483,647 | |
| #include <stdio.h> | |
| int main(int argc, char *argv[]){ | |
| if(argc == 2){ | |
| int x = atoi(argv[1]); int n = 0; printf("%i %i\n",n,x); | |
| if(x < 1){ | |
| exit(1); | |
| } | |
| else{ | |
| while(x != 1){ |
This file contains hidden or 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
| // Warning: maximum value for a variable of type Number (no bitwise or shift operators allowed): 9,007,199,254,740,991 | |
| let x = parseInt(process.argv[2]); | |
| if(isNaN(x)) process.exit(1); | |
| else{ | |
| if(x < 1){ | |
| process.exit(1); | |
| } | |
| else{ | |
| let n = 0; console.log(`${n} ${x}`); | |
| while (x !== 1){ |
This file contains hidden or 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
| /* | |
| * Assume s is a string of lower case characters. | |
| * | |
| * Write a program that prints the longest substring of s | |
| * in which the letters occur in alphabetical order. | |
| * | |
| * For example, if s = 'azcbobobegghakl', then your program should print | |
| * "Longest substring in alphabetical order is: beggh" | |
| * | |
| * In the case of ties, print the first substring. |
This file contains hidden or 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
| var work = process._getActiveHandles().length + process._getActiveRequests().length; | |
| foo(); | |
| var newWork = (process._getActiveHandles().length + process._getActiveRequests().length) - work; | |
| if(newWork > 0) { | |
| console.log("asynchronous work took place."); | |
| } |