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
# This is shorthened version of blog post | |
# http://ksopyla.com/2017/02/tensorflow-gpu-virtualenv-python3/ | |
# update packages | |
sudo apt-get update | |
sudo apt-get upgrade | |
#Add the ppa repo for NVIDIA graphics driver | |
sudo add-apt-repository ppa:graphics-drivers/ppa | |
sudo apt-get update |
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 MyClass() { | |
} | |
var MyClass = function() { | |
} | |
// -- 위의 두 구문은 동일하게 MyClass 클래스를 선언한다. | |
// -- 필자는 가독성 측면에서 두 번째 방식을 선호한다 |
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 Student = function(id, name) { | |
var id = id; | |
this.name = name; | |
} | |
var my = new Student("Seogi1004", "Moon-Hak-I"); | |
alert(my.id + ", " + my.name); |
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 People = function(name, age) { | |
var name = name; | |
var age = age; | |
var isAdult = function() { | |
if(age > 19) return true; | |
else return false; | |
} | |
this.viewMyInfo = 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
function isAdult(age) { | |
if(age > 19) return true; | |
else return false; | |
} | |
function viewMyInfo(name, age) { | |
if(isAdult(age)) { | |
return name + "님은 성인이 맞습니다."; | |
} else { | |
return name + "님은 성인이 아닙니다."; |
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 MyClass = function() { | |
this.show = function() { | |
return "MyClass"; | |
} | |
} | |
var MyStaticClass = new function() { | |
this.show = function() { | |
return "MyStaticClass"; | |
} | |
} |
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 Person(firstName, lastName) { | |
// 객체 생성시 증가 | |
this.constructor.population++; | |
// ********************************************************************** | |
// PRIVATE VARIABLES AND FUNCTIONS | |
// 'PRIVELEGED METHODS'만 읽기/쓰기/수정 가능 | |
// ********************************************************************** | |
var alive = true; | |
function getFullName() { |
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
String.prototype.trim = function() { | |
return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "")); | |
}; | |
var sObj = new String(" Prototype Test "); | |
sTxt = sObj.trim(); | |
alert("--" + sTxt + "--"); |
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 sObj = new String(" Prototype Test "); | |
sObj.trim = function() { | |
return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "")); | |
}; | |
sTxt = sObj.trim(); | |
alert("--" + sTxt + "--"); |
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
Array.prototype.each = function(callback) { | |
for(i = 0; i < this.length; i++) { | |
callback(this[i]); | |
} | |
}; | |
var test = [ { name : 'a' }, { name : 'b' }, { name : 'c' } ]; | |
test.each(function(elem) { | |
alert(elem.name); | |
}); |
OlderNewer