配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。
显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]
| sudo apt-get install python-software-properties | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
| sudo apt-get update | |
| sudo apt-get install gcc-4.9 | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 | |
| sudo apt-get install g++-4.9 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50 |
| SELECT history.*, history1.id AS h_id, (history1.retail_price - history.retail_price) AS t_price FROM product_price_histories AS history | |
| LEFT JOIN product_price_histories AS history1 ON history1.product_id = history.product_id | |
| LEFT JOIN products AS sku ON sku.id = history.product_id | |
| LEFT JOIN standard_products AS spu ON spu.id = sku.standard_product_id | |
| WHERE NOT EXISTS ( | |
| SELECT t_h.id, t_h.created_at FROM product_price_histories AS t_h | |
| WHERE t_h.id != history.id | |
| AND t_h.product_id = history.product_id | |
| AND t_h.created_at >= '2016-03-29 08:28:54' | |
| AND t_h.created_at > history.created_at |
| Getting started aws ses | |
| http://codechannels.com/video/amazonwebservices/cloud/getting-started-with-amazon-ses/ | |
| 1. Verify email address | |
| In the sandbox you can send email only from emails yiu have verified. | |
| Go to email AWS SES then on the left clcik on 'verified senders' | |
| to start the verification process: | |
| a. click 'verify a ne sender' | |
| in the dialogue box add your email and click submit. you will receive |
| require "redis" | |
| puts <<-EOS | |
| To play with this example use redis-cli from another terminal, like this: | |
| $ redis-cli publish one hello | |
| Finally force the example to exit sending the 'exit' message with: | |
| $ redis-cli publish two exit | |
| EOS | |
| redis = Redis.new |
| /*********************************************************************************** | |
| /* Genetic Algorithm implementation | |
| /***********************************************************************************/ | |
| var GeneticAlgorithm = function(max_units, top_units){ | |
| this.max_units = max_units; // max number of units in population | |
| this.top_units = top_units; // number of top units (winners) used for evolving population | |
| if (this.max_units < this.top_units) this.top_units = this.max_units; |
| module LivingsmartApi | |
| module Rpc | |
| class Callback | |
| def initialize(response) | |
| @response = response | |
| end | |
| end | |
| end |
| --[[ | |
| A lua rate limiter script run in redis | |
| use token bucket algorithm. | |
| Algorithm explaination | |
| 1. key, use this key to find the token bucket in redis | |
| 2. there're several args should be passed in: | |
| intervalPerPermit, time interval in millis between two token permits; | |
| refillTime, timestamp when running this lua script; | |
| limit, the capacity limit of the token bucket; | |
| interval, the time interval in millis of the token bucket; |
| First run polipo with parent proxy set to Shadowsocks: | |
| apt-get install polipo | |
| service polipo stop | |
| polipo socksParentProxy=localhost:1080 | |
| Then you can play with the HTTP proxy: | |
| http_proxy=http://localhost:8123 apt-get update |
| pragma solidity ^0.4.10; | |
| contract Ownable { | |
| address owner; | |
| function Ownable() public { | |
| owner = msg.sender; | |
| } | |
| modifier Owned { | |
| require(msg.sender == owner); |