[https://developer.nvidia.com/cuda-downloads]
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub
as root not sudo
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import zipfile | |
from BeautifulSoup import BeautifulSoup, Tag # Better for HTML | |
from lxml import etree # Better for XML |
<?xml version='1.0' encoding='UTF-8'?> | |
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0"> | |
<rootfiles> | |
<rootfile media-type="application/oebps-package+xml" full-path="content.opf"/> | |
</rootfiles> | |
</container> |
from keras.models import Sequential | |
from keras.layers.core import Dense, Dropout, Activation | |
from keras.optimizers import SGD | |
import numpy as np | |
X = np.array([[0,0],[0,1],[1,0],[1,1]]) | |
y = np.array([[0],[1],[1],[0]]) | |
model = Sequential() | |
model.add(Dense(8, input_dim=2)) |
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): |
""" | |
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. |
[https://developer.nvidia.com/cuda-downloads]
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub
as root not sudo
# ตาม guru.sanook.com/1520 | |
import re | |
t1 = str.maketrans("กขฃคฅฆงจฉชฌซศษสญยฎดฏตณนฐฑฒถทธบปผพภฝฟมรลฬฤฦวหฮอ", | |
"กกกกกกงจชชชซซซซยยดดตตนนททททททบปพพพฟฟมรรรรรวหหอ") | |
t2 = str.maketrans( | |
"กขฃคฅฆงจฉชซฌฎฏฐฑฒดตถทธศษสญณนรลฬฤฦบปพฟภผฝมำยวไใหฮาๅึืเแโุูอ", | |
"1111112333333333333333333444444445555555667777889AAABCDEEF") | |
def LK82(s): | |
res = [] |
# -*- coding: utf-8 -*- | |
"""Print most frequent N-grams in given file. | |
Usage: python ngrams.py filename | |
Problem description: Build a tool which receives a corpus of text, | |
analyses it and reports the top 10 most frequent bigrams, trigrams, | |
four-grams (i.e. most frequently occurring two, three and four word | |
consecutive combinations). |