在Matlab中对已经被表示成数字矩阵的图片进行处理

一、 灰度拉伸变换

把图像中每个像素点的灰度值,按照希望达到的效果,以线性变化的形式,进行变换。
如下图,就是一种分段函数形式,把输入的X轴灰度值变换为输出的Y轴灰度值,只是将灰度值做分段线性变换。分段函数控制点(r1,s1)和(r2,s2)

Raspberry pi 定时天气播报

操作步骤:

  • 简单的写了python脚本
  • 添加定时计划里执行

百度的天气接口:http://api.map.baidu.com/telematics/v3/weather?location=city&output=json&ak=api_key

百度的语音合成接口:http://tsn.baidu.com/text2audio?tex=text&lan=zh&cuid=cuid&ctp=1&tok=token

Tomcat 启用 HTTPS

Tomcat 启用 HTTPS

最近在阿里云购买了一个云服务器ECS,简单的部署了个人网站,使用ip地址访问一切正常,我之前在TK上申请了一个免费域名,就绑定了二级域名到阿里云,第一天正常访问,第二天就不行了,访问站点直接提示域名未注册(未备案.....),无法访问,显然被阿里云拦截了,通过IP地址访问还是正常的。

后来GOOGLE了一下,一般是备案域名和主机。。。,还有一种方式是启用HTTPS,http是明文传输,阿里云能够看到我访问的域名,发现在域名未注册然后拦截,但HTTPS是加密的,所以可以正常访问(哈哈)。

引用链接:

https://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html

http://www.oschina.net/question/12_23148

http://www.cnblogs.com/f1194361820/p/4748590.html

Raspberry Pi 整点报时

完整的音频文件及脚本: Github

参考链接:

http://blog.sina.com.cn/s/blog_6d1aef300100qta0.html

http://linuxtools-rst.readthedocs.org/zh_CN/latest/tool/crontab.html

  • 安装Mplayer
  • 下载语音文件(解压到/{home})
  • 创建脚本文件TimeAudio.sh(/usr/local/bin)
#!/bin/bash

filePath=/{home}/TimeAudio
Time=`date +%H%M`
audioFile="$filePath/$Time.mp3"
#echo $audioFile
player=/usr/bin/mplayer

$player $audioFile

Windows Mysql zip 安装及配置

说明:简单记录windows 下,mysql zip包的安装及配置,方便以后参考及查阅

  • 官网下载相应的mysql数据包http://dev.mysql.com/downloads/mysql/
  • 解压到相应位置, eg:C:\Program Files (x86)\mysql-5.7.12-winx64
  • 拷贝my-default.ini 重命名为my.ini,添加如下代码
basedir="C:\Program Files (x86)\mysql-5.7.12-winx64"
datadir="C:\Program Files (x86)\mysql-5.7.12-winx64\data"
port=3306
server_id=1

Coding in Windows - Setting Up Git & Cmder

https://www.awmoore.com/2015/01/14/setting-up-git-and-cmder/ (已挂)

If you're going to be getting into coding, especially Front End, Node.js, or Angular.js development, you're likely going to need (or want) to use Github and version control in your workflow. In this article I'm going to go over how to set up Github for your Windows system, and how to get it to work with the excellent console emulator, Cmder.

Until you start using it, you never really learn how awesome version controlling your projects can be. Without version control, you're working with static files in a generally fixed location, and if you want to back up your project at a certain point in time, you have to manually create a copy of your project and store that somewhere. When you work in teams, this can quickly become convoluted and difficult to manage. With version control, you can automate the process a bit more, and you gain the flexibility to be able to work in multiple locations and with other developers without needing to transfer files over email, thumbdrives, or ftp.

Raspberry pi 2 finalspeed auto start

preview

为了更好的体验FQ,大神开发了fianlspeed(不过有一点这个是双边加速的),对于bandwagon小机来说再好不过了,

参考

finalspeed 项目地址(好像原作者已经删除了源码):https://github.com/d1sm/finalspeed

finalspeed CLI项目地址:https://github.com/wholeworm/finalspeed

目标

finalspeed server/client GUI 在这里不再累述.
这里主要说明一下无GUI版本在raspberry pi 2 上开机自启服务
在raspberry pi 上运行finalspeed client CLI:

#运行CLI版
sudo java -jar finalspeed.jar -b 

Raspberry PI 自动发布天气信息到QQ空间/微博

参考链接

https://aoaoao.me/951.html/comment-page-1

http://www.ipip5.com/today/api.php?type=json

http://www.eoeandroid.com/thread-331843-1-1.html

说明

天气信息来自于百度地图API,历史上的今天来自于网络API(见上).

准备工作

安装python(没有的,自行下载安装)
安装requests

git clone git://github.com/kennethreitz/requests.git
cd requests
python3 setup.py install

历史上的今天 API (数据来自维基百科)

git commit -m 注释中的换行

原文链接:http://www.cnblogs.com/sn-dnv-aps/p/3296886.html

今天在git提交代码写注释的时候发现在注释不能换行?

命令如下:

git commit -m"fix issues:
    1.blog update error.
    2.logging to file not work."

Viagle Blog

欢迎来到我的个人博客网站