Skip to content

Instantly share code, notes, and snippets.

@seogi1004
seogi1004 / ubuntu16_tensorflow_cuda8.sh
Created August 25, 2017 02:17 — forked from ksopyla/ubuntu16_tensorflow_cuda8.sh
How to set up tensorflow with CUDA 8 cuDNN 5.1 in virtualenv with Python 3.5 on Ubuntu 16.04 http://ksopyla.com/2017/02/tensorflow-gpu-virtualenv-python3/
# 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
function MyClass() {
}
var MyClass = function() {
}
// -- 위의 두 구문은 동일하게 MyClass 클래스를 선언한다.
// -- 필자는 가독성 측면에서 두 번째 방식을 선호한다
var Student = function(id, name) {
var id = id;
this.name = name;
}
var my = new Student("Seogi1004", "Moon-Hak-I");
alert(my.id + ", " + my.name);
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() {
function isAdult(age) {
if(age > 19) return true;
else return false;
}
function viewMyInfo(name, age) {
if(isAdult(age)) {
return name + "님은 성인이 맞습니다.";
} else {
return name + "님은 성인이 아닙니다.";
var MyClass = function() {
this.show = function() {
return "MyClass";
}
}
var MyStaticClass = new function() {
this.show = function() {
return "MyStaticClass";
}
}
function Person(firstName, lastName) {
// 객체 생성시 증가
this.constructor.population++;
// **********************************************************************
// PRIVATE VARIABLES AND FUNCTIONS
// 'PRIVELEGED METHODS'만 읽기/쓰기/수정 가능
// **********************************************************************
var alive = true;
function getFullName() {
String.prototype.trim = function() {
return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""));
};
var sObj = new String(" Prototype Test ");
sTxt = sObj.trim();
alert("--" + sTxt + "--");
var sObj = new String(" Prototype Test ");
sObj.trim = function() {
return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""));
};
sTxt = sObj.trim();
alert("--" + sTxt + "--");
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);
});