welcome


  • 首页

  • 归档

  • 标签

  • 关于

  • 周易

  • 修仙

  • 搜索

Linux-fcitx

发表于 2018-04-28


调试了很久,很麻烦,很难受。开始一直失败,因为系统按键影响了fcitx的按键设置,所以先要关闭系统快捷按键,如图:

ficitx键盘设置如图:

排序算法

发表于 2018-04-27

选择排序

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void sort (int a[],int n){
int i,j,t;
int term;
for(i=0;i<n;i++){
t =i;
for(j=i+1;j<n;j++){
if(a[j]<a[t]){
t =j;
}
}
term = a[i];
a[i] = a[t];
a[t] = term;
}
}

快速排序

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#include<stdlib.h>
#include<stdio.h>

int cmp(const void *a,const void *b){
return (*(int *)a-*(int *)b);

}

int main(){
int i=0;
int a[]={4,3,2,1};
qsort(a,4,sizeof(a[0]),cmp);
for(i=0;i<4;i++){
printf("%d",a[i]);
}

}

冒泡排序

1
2
3
4
5
6
def maosort(a):
n=len(a)
for i in range(0,n):
for j in range(0,n-i-1):
if a[j]>a[j+1]:
a[j],a[j+1]=a[j+1],a[j]

文件(I/O)

发表于 2018-04-27

c语言

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 100


int main(){
FILE *fp1=fopen("input.txt","r");
FILE *fp2=fopen("output.txt","w");

if(fp1==NULL||fp2==NULL){
printf("打开文件失败!");
}
int a[MAXSIZE];
int b[MAXSIZE];
int i=0;
int n=0;
fscanf(fp1,"%d",&n);
i=0;
while(i<n&&fscanf(fp1,"%d",&a[i])!=EOF){
i++;
}
i=0;
while(i<n&&fscanf(fp1,"%d",&b[i])!=EOF&&i<n){
i++;
}
int k;
k = fun(a,b,n);

fprintf(fp2,"%d",k);
fclose(fp1);
fclose(fp2);

return 0;
}

input.txt

3
5 15 18
3 14 21

牛顿插值

发表于 2018-04-27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#include<stdio.h>
#define MAX 50

void input(double x[MAX],double f[MAX][MAX],int n);

int main(){

double x[MAX],f[MAX][MAX],_x,_y;
long i,j;
int n;
printf("请输入插值点个数:");
scanf("%d",&n);
input(x,f,n);
printf("\n请输入插值点:");
scanf("%lf",&_x);
for(j=1;j<=n-1;j++){
for(i=j;i<=n-1;i++){
f[i][j] = (f[i][j-1]-f[i-1][j-1])/(x[i]-x[i-j]);

}
_y = f[n-1][n-1];
}
for(i=n-2;i>=0;i--){
_y = f[i][i]+(_x-x[i])*_y;
}
printf("\n插值点(x,y)=(%lf,%lf )",_x,_y);
return 0;

}

void input(double x[MAX],double f[MAX][MAX],int n)
{
int i;
for(i=0;i<=n-1;i++){
printf("\n请输入插点x[%d],y[%d]:",i,i);
scanf("%lf%lf",&x[i],&f[i][0]);
}

}

New artcle in Linux

发表于 2018-04-25

You know? I am so happy now, because I just finish the config of the hexo in Linux. I spent 2 days working for it, however I failed one time and one time.The sudupid machine always talk someings like I don’t have permission to do that, and the github don’t access my requests. But, you know,I am a so clever boy, and I can figure it in quickly.I am so happy. Byebye, the supid Operation System windows and Linux.

git-命令

发表于 2018-04-17
1
2
3
4
5
6
7
8
9
10
11
git  init                            #初始化仓库
git add test.txt #添加文件到暂存区
git commit -m "add red line" #提交到仓库
git reset --hard head^ #回到上一版本
git reset --hard id #回到id版本
git status #检查目录是否有什么更改
git checkout text.txt #恢复和仓库一样的状态
git log #显示当前版本之前的信息
git reflog #显示最近改的信息,可包括版本前
clear #清屏
cat test.txt #显示文件内容

Linux 安装

发表于 2018-04-16

制作启动盘

UItraISO软件将iso镜像文件刻入进u盘

磁盘分区

win + x ,进入磁盘管理,将某个盘转化为未分配

secureboot

进入bios,将secure转化为Disable

nomodeset

对于7559电脑来说,还需要在install ubuntu按e键,将倒数第二行的Quick ... -- 改为nomodeset

设置分区

* 分区 大小
/ 主分区 15,000MB
/boot 逻辑分区 300MB
/ swap(交换空间) 逻辑分区 2,0000MB
/home 逻辑分区 100,000MB

hexo1-搜索

发表于 2018-04-15

真是蛋疼的要命!
参考了许多文章,终于成功了,总结一下。

algolia方面

github登陆进去后,选择indices,然后新建一个index:
123

之后点击ApiKeys,三个keys待会会用到:
123
之后来到这个页面,勾选一下:
123

hexo方面

在hexo文件夹内右键gitbrash,输入命令下载algolia搜索插件(据说免费)

1
npm install hexo-algolia@0.2.0

在hexo _config.yml 中添加代码(对齐很重要,开始由于没对齐,花了很长时间寻找问题)
代码需要填写之前页面的ApiKey:

1
2
3
4
5
6
7
8
9
10
11
algolia:
applicationID: xxxxxx
apiKey: xxxxxx
adminApiKey: xxxxxx
indexName: xxxxxx
chunkSize: 5000
fields:
- title
- slug
- path
- content:strip

在next文件夹的_config.yml找到相应代码修改为:

1
2
3
4
5
6
7
8
algolia_search:
enable: true
hits:
per_page: 10
labels:
input_placeholder: "输入关键词"
hits_empty: "没有找到相关内容.-_-."
hits_stats: "${hits} 条相关记录,共耗时 ${time} ms."

之后,运行代码使信息同步到algolia.com上面:

1
hexo algolia

应该就可以了。。。。

但是我还遇到了问题,能成功搜索出来信息,点击却无法反应?
因为path信息没有同步到algolia网站上,我之前用的这条命令:

1
npm install --save hexo-algolia

然而,手机端无法进行点击,应该是阴影覆盖了,修改文件中的z-index就好了。路径themes\next\source\css_common\components\third-party中的algolia-search.styl

1
2
3
4
5
6
7
8
.algolia-pop-overlay
position: fixed
width: 100%
height: 100%
top: 0
left: 0
z-index: 2080 //这一行删除
background-color: rgba(0, 0, 0, 0.3)

花了很长时间才发现0.2.0版本有妙解,也就是前面所用的命令。
终于能享受一波搜索乐趣了, 表情逐渐稳定~~

hexo2-图片

发表于 2018-04-15

安装插件:

1
npm install hexo-asset-image --save

修改hexo _config.yml为:

1
post_asset_folder: true

之后,运行hexo n “xxxx”,会产生一个xxxx.md,同时还会产生一个xxxx文件夹,把图片放入xxxx文件夹内。
markdown调用图片:

1
![可不填,图片代替的文字](xxxx/image.png)

注意gitpages是区分大小写的,image.png与image.PNG 是不同的!
但是在localhost:4000内不区分大小写,有点意思。

《了不起的盖茨比》

发表于 2018-04-14

一个男人通过奋斗变得有钱,而他爱的女人却变了。
感触不是很大,也许英文原版会好一些。
那以理解这种书为什么这么有名,感觉很无聊,剧情很弱。

1234…6
weihuan

weihuan

55 日志
11 标签
© 2026 weihuan
由 Hexo 强力驱动
主题 - NexT.Muse