为 UTF-8 编码的文本文件添加 BOM
-
在 macOS 和 Windows 下同步 Cocos2D 项目
Cocos2D 项目,在 macOS 下用 Xcode 编辑后,UTF-8 编码文件保存时不带 BOM,导致在 Windows 下用 Visual Studio 编译期报错,给这些文件添加 BOM 后,可以解决这些编译期错误,并且不会导致 Xcode 中编译有问题。
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Le codage de Huffman | |
| # Théorie de l'information et du codage | |
| # Etudiant: Boubakr NOUR <n.boubakr@gmail.com> | |
| # Universite Djilali Liabes (UDL) de Sidi Bel Abbes | |
| import heapq | |
| from collections import defaultdict |
| find . -name "*.md" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done |
| # 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 |
在 macOS 和 Windows 下同步 Cocos2D 项目
Cocos2D 项目,在 macOS 下用 Xcode 编辑后,UTF-8 编码文件保存时不带 BOM,导致在 Windows 下用 Visual Studio 编译期报错,给这些文件添加 BOM 后,可以解决这些编译期错误,并且不会导致 Xcode 中编译有问题。
WGS-84 坐标系,是 GPS 系统所采用的坐标系。一切正常工作的 GPS 或 GPS 芯片所返回的坐标值都是这个坐标系下的数值。Google 地图采用的卫星图也是按照这个坐标系摆放的。
GCJ-02 坐标系,是我天朝政府搞出来的加密坐标系,也常常被称为“火星坐标系”。包括(但可能不限于)高德地图在内的国内地图服务商采用它来绘制地图。Apple、Google等国外公司在其道路地图中使用的也是高德的数据。BD-09 坐标系则是百度地图专用的坐标系。
在开发一些 LBS 应用时,如果不加处理,很容易出现几种形式的地图之间出现偏移的情况。因此在这几个坐标系之间进行转换非常重要。以下代码就是网络上泄露出的从 WGS-84 转 GCJ-02 的算法,以及 GCJ-02 与 BD-09 的互相转换算法。
| Step 1 - Create .crt file | |
| cat domainname.crt domainname.ca-bundle > domainname-ssl-bundle.crt | |
| Step 2- | |
| Add lines for ssl_certificate in nginx configuration | |
| server { | |
| listen 80 default_server; |
| Step 1 - Create .crt file | |
| cat domainname.crt domainname.ca-bundle > domainname-ssl-bundle.crt | |
| Step 2- | |
| Add lines for ssl_certificate in nginx configuration | |
| server { | |
| listen 80 default_server; |