- 浏览: 295324 次
- 性别:
- 来自: 佛山
最新评论
-
jacklin2015:
挺好用的 就是 多音字 有待改进 比如 重庆
python 汉字按拼音排序 -
Yunba云巴:
我们(https://yunba.io/)是基于MQTT协议实 ...
mosquitto 基于MQTT消息推送 -
ycong2525:
不行............................. ...
input file选择多个文件 -
huakaizizai623:
对选择的文件个数是否有限制?
input file选择多个文件 -
xuliuliu:
addEventListener方法找不到
input file选择多个文件
文章列表
>> SV = actxserver('SAPI.SpVoice');>> invoke(SV,'Speak','hello , 何企业来说,中层管理人员都是极为关键的,因为中层是执');---matlab 2012a win7 ,原来matlab调用语音朗读就两行代码啊.
修复系统引导 0c000000f (具体忘记是不是这个错误代码了)
之前在笔记本上装了两个系统,一个win7,一个ubuntu,但ubuntu一直很少用,于是决定将其删除,没想到弄了半天才将它修复好。
删除ubuntu,我是在win7上直接打开分区软件PM,将ubuntu所在的分区删除,且将它们格式化用NTFS。
由于原先是用grub引导,所以重启无法进入系统。
于是用系统装(DOS工具进入系统),运行 fdisk /mbr,重启后出现0c000000f,网上说是mbr修复了,但是需要重新建BCD.
(无用功:网上说要用bootsect,bootr ...
matlab 在灰度图像上画一个透明的矩形
- 博客分类:
- matlab
matlab 在灰度图像上画一个透明的矩形
im=rgb2gray(imread('pad.jpg'));
imshow(im);
hold on;
fill ([300 400 400 300 300],[200 200 400 400 200],'r','facealpha',0.5);
其中,fill是画一个多边图形
参数[300 400 400 300 300] 表示在X轴上的五个点,矩形的四个顶点,最后一个点表示回到原点
参数[200 200 400 400 200] 表示在Y轴上的五个点,意义同上
'r'表示红色
'facealpha' ...
python 代码实现四则运算 (前缀表达式)
计算表达式如下:
(+ 1 2 )
(+ 1 (+ 2 3))
(* (+ 1 2) (*3 4))
第一个函数cal_1 是使用递归的形式;
第二个函数cal_2 是使用非递归的形式--堆栈, 且第二个支持多个参数(2个或以上)
#calculator expression
def cal_1 (s):
s = s.strip().replace('(','',1)[::-1].replace(')','',1)[::-1].strip()
if ' ' not in s :
...
k-means python代码
def fun_dis (x,y,n):
return sum (map (lambda v1,v2:pow(abs(v1-v2),n), x,y))
def distance (x,y):
#return fun_dis (x,y,2)
return fun_dis (x,y,1)
def min_dis_center(center, node):
min_index = 0
min_dista = distance (center[0][1],node)
for ...
ubuntu 1204 server xp 下硬盘安装
主要是参考这里 张刚博客
步骤
1.下载 ubuntu 12.04 server ISO文件, 提取 install 目录下的 vmlinuz 和 initrd.gz 文件,放到C盘要目录
2.下载Grub4dos,将其中的 grldr 文件复制到C盘根目录 ,修改 boot.ini文件,添加一行 c:/grldr=Install Ubuntu server
3.重启,选择Install Ubuntu server, 按C进行命令行
4. root (hd0,0) //相当于进入c盘, ...
matlab 2012a win7 下,从摄像头中获取数据
原文出自 matlabworks
vid = videoinput('winvideo', 1);
set(vid, 'ReturnedColorSpace', 'RGB');
img = getsnapshot(vid);
imshow(img)
在Matlab 2012a win7下, 使用Matlab从麦克风中获取音频数据.
原文出自 matlabworks
% Record your voice for 5 seconds.
recObj = audiorecorder;
disp('Start speaking.')
recordblocking(recObj, 5); %保存5秒
disp('End of Recording.');
% Play back the recording.
play(recObj);
% Store data in double-precision a ...
pymmseg windows下中文分词, 下载附件, 直接 import 目录就行了。
#coding=utf-8
from pymmseg import mmseg
mmseg.dict_load_defaults()
text = '今天的天气真好啊,我们一起出去玩一下吧'
algor = mmseg.Algorithm(text)
word = []
for tok in algor:
word.append(tok.text)
print ' '.join(word).decode('utf8'). ...
在一个网页中,嵌入一张图片,通常的做法是<img src="http://xxx.com/aa.png"> ,但是这样当页面加载时,如果url属于当前域名,则先开一个 http请求; 否则就要先建一个TCP连接了。 能否将一张图片的数据直接嵌入到html 中呢? 答案是可以的。
方法:
生成一个a.html文件,内容如下:
<h3>hello html5</h3>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAAD ...
将单链表中的字符串逆序输出
- 博客分类:
- 算法|数据结构
/* 测试将单链表中的字符串逆序输出
* 本程序默认输入的字符串长度大于2
* 2012-2-28
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef char elem;
typedef struct node {
elem data;
struct node* next;
} *pnode;
//将字符数组转换为单链表模式
pnode create_string (elem * origin ...
去面试时,被问到用一条SQL语句删除重复的记录,当时做不出来,回头想想,方法如下:
新增一个表,用于测试
create table table1 (id int primary key, name char(20) );
添加样品记录
insert into table1 values (1,'hello') , (2,'world'), (3,'hello'), (4,'hello'), (5,'world'), (6,'python');
删除name相同的记录(保留第一条)
delete t2 from table1 t1, table1 t2 wher ...
今天去笔试个java职位,要求写个统计不同词的出现次数,我java写不出来,写了几句py代码上去。回来后,在群上讨论了一下,写了以下三个方法,前两种我写的,最后一种是别人写的三种方法用时的比较:0.405999898911--------------------------------1.32800006866--------------------------------
0.905999898911
import random
import time
def make_case (n):
library = ['aa','bb','cc','ee','dd' ...
看到网上的算法面试题,觉得很有趣。
输入一个单向链表,输出该链表中倒数第k个结点。链表的倒数第0个结点为链表的尾指针。
弄法楚题目后,想了几种方法:
一。先遍历一次单链表,求其长度length,再第二次遍历 length-k 次
二。设置两个指针p1,p2 (p1=p2= p-> head 指向单链表的开始位置),让第一个指针跑k次 p1 = p1->next, 再一直让p1,p2 执行next,直到p1到达尾部:
p1 = p2 = head;
for (int i=0;i<k;i++,p1=p1->next);
...
有时看到一些文字由左而右,或是从下而上 显示,现在我来实现这个功能。
从左到右,控制 text-indent就行了;
从下而上,控制 margin-top就行了。
以下是一些代码:
从左到右<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>background position</title>
<style type=& ...