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
// In your controller | |
var w = angular.element($window); | |
$scope.$watch( | |
function () { | |
return $window.innerWidth; | |
}, | |
function (value) { | |
$scope.windowWidth = value; | |
}, | |
true |
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
var a = {}; | |
(function(){ | |
a.hello = 'hhh' | |
}()); | |
console.log(a); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title><%= title %></title> | |
<link rel='stylesheet' href='/stylesheets/style.css' /> | |
</head> | |
<body> | |
<h1><%= title %></h1> | |
<p>Welcome to <%= title %></p> | |
</body> |
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
function aaa(){ | |
var str=''; | |
return { | |
aaaa: function(l){ | |
str+=l; | |
//console.log(str); | |
return this; | |
}, | |
bbbb: function(){ |
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
// input.txt | |
// 6 | |
// 21+(3-4)*(8-3)*(3+1)/2 | |
// (3+4)*8-(3+7)/2 | |
// (11-8)/3+7*2 | |
// 11+(14-3+2)*2-3+(1+6-5) | |
// (1+2+3+4+5+6)/3+4+5 | |
// 1*2+3/2+4-4+5+6+6+5-(5*7-5) | |
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
#include <stdio.h> | |
#define NUM_SCORE 15 | |
void merge(int arr[], int start, int q, int end){ | |
int temp_arr[end-start+1]; | |
int i=start, j= q+1; | |
for(int k=0; k<(end-start+1); k++){ |
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
/////////// Server Part | |
var stdin = process.stdin; | |
var express = require('express'), | |
app = express(); | |
var server = app.listen(55555,function(){ | |
console.log('Port:',this.address().port); | |
}); | |
var io = require('socket.io')(server); |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>Mirror</title> | |
</head> | |
<style> | |
#content{ |
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
var _ = require('underscore'), | |
async = require('async'); | |
var funcs = []; | |
for(var i=0; i<56; i++){ | |
funcs.push( | |
(function(index){ | |
return function(cb){ |
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
var util = require('util'); | |
var err = new Error('Error occurred!!'); | |
var temp = 123; | |
console.log( util.isError(err)); | |
console.log(err.message); |