配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。
显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]
| ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}✘" | |
| ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}✔" | |
| ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[red]%}➦" | |
| # ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈" | |
| # ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭" | |
| # ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗" | |
| # ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦" |
About my endeavor to automatically retrieve grammar of CPython .pyc-files bytecode from Python's sources itself (success) and build parser on them (failed).
Most recent version of this article is always on GitHub
In 2011 as part of my diploma thesis I came up with an assembler language for .pyc files and wrote a simple proof-of-concept assembler for it based on ANTLR3 parser generator. Back then I stumble upon the issue that CPython bytecode is somewhat not stable and differs from version to version. I.e., as of Python from 3.0 to 3.4 there are 28 incompatible bytecode versions (you may find all bytecode versions with their descriptions in Python34/Lib/importlib/_bootstrap.py).
So, if we aim to devise an assembler or disassembler not for one bytecode version but for many, we face a routine of retrieving out these bytecode differences. This task strikingly
| """ | |
| Inserts C code directly into Python files, which can then be dynamically linked | |
| in and called via ctypes. | |
| """ | |
| import atexit | |
| import ctypes | |
| import os | |
| import shlex | |
| import sys | |
| import tempfile |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| class ApiLogger < Grape::Middleware::Base | |
| def before | |
| Rails.logger.info "[api] Requested: #{request_log_data.to_json}\n" + | |
| "[api] #{response_log_data[:description]} #{response_log_data[:source_file]}:#{response_log_data[:source_line]}" | |
| end | |
| private | |
| def request_log_data |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |