[https://developer.nvidia.com/cuda-downloads]
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub
as root not sudo
public static IEnumerable<TResult> Map<in TSource, TResult>(IEnumerable<TSource> sources, Func<TSource, TResult> mapper) | |
{ | |
foreach (var source in sources) | |
{ | |
yield return mapper(source); | |
} | |
} |
import random | |
class TicTacToe: | |
def __init__(self, playerX, playerO): | |
self.board = [' ']*9 | |
self.playerX, self.playerO = playerX, playerO | |
self.playerX_turn = random.choice([True, False]) | |
def play_game(self): |
import logging | |
import os.path | |
import sys | |
from gensim.corpora import WikiCorpus | |
if __name__ == '__main__': | |
program = os.path.basename(sys.argv[0]) | |
logger = logging.getLogger(program) | |
# -*- coding: utf-8 -*- | |
import logging | |
import os.path | |
import sys | |
import multiprocessing | |
from gensim.corpora import WikiCorpus | |
from gensim.models import Word2Vec | |
from gensim.models.word2vec import LineSentence | |
if __name__ == '__main__': |
# -*- coding: utf-8 -*- | |
# อ่านบทความได้ที่ https://python3.wannaphong.com/2017/02/wordnet-ภาษาไทยกับ-python.html | |
from __future__ import print_function | |
import sqlite3 | |
from collections import namedtuple | |
conn = sqlite3.connect('tha-wn.db') | |
Word = namedtuple('Word', 'synsetid li') | |
Synset = namedtuple('Synset', 'synset li') | |
def getWords(wordid): | |
words = [] |
""" | |
Functions for converting dates to/from JD and MJD. Assumes dates are historical | |
dates, including the transition from the Julian calendar to the Gregorian | |
calendar in 1582. No support for proleptic Gregorian/Julian calendars. | |
:Author: Matt Davis | |
:Website: http://github.com/jiffyclub | |
""" |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Example of `builder' design pattern | |
# Copyright (C) 2011 Radek Pazdera | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
# ทำนายจำนวนประชากรของไทยด้วย Scikit-learn ใน Python | |
# เขียนโดย นาย วรรณพงษ์ ภัททิยไพบูลย์ | |
# https://python3.wannaphong.com | |
# อ่านได้ที่ https://python3.wannaphong.com/2017/05/thailand-population-scikit-learn-python.html | |
# 14 พ.ค. 2560 | |
''' | |
สร้าง dataset ข้อมูลประชากร | |
''' | |
thai = [20986780, | |
21550597, |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
time = pd.date_range('1951', periods=67, freq='A') # สร้างช่วงเวลา โดยจะเรียงจาก ปี 1951 ไล่ต่อมา 67 ปี A คือ ปี | |
listtime=time.tolist() | |
plt.plot(listtime,thai) | |
plt.show() # แสดงข้อมูลประชากรจากอดีต | |
data=pd.DataFrame({'date':time.values,'value':thai}) | |
data['date_ordinal'] = data['date'].apply(lambda x: x.toordinal()) # แปลงวันเดือนปีไปเป็น proleptic Gregorian ordinal |
[https://developer.nvidia.com/cuda-downloads]
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub
as root not sudo