[python]Display image with matplot
import matplotlib.pyplot as plt #plt.figure() img = plt.imread(image_path) plt.imshow(img) plt.show()标签: python
[python]Python to read directorys and write sheet (excel)
import os import xlwt def file_name(file_dir): for root, dirs, files in os.walk(file_dir): list_files(files) def list_files(files): workbook = xlwt.Workbook(encoding = 'utf-8') worksheet = workbook.add_sheet('Nicholas') lines = 1 for item in files: ...标签: python
[DL]MNIST handwritten digit processing by TensorFlow Version 2
import tensorflow.examples.tutorials.mnist.input_data as input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) import tensorflow as tf sess = tf.InteractiveSession() def weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1) return tf.Varia...标签: DL
[DL]MNIST handwritten digit processing by TensorFlow
import tensorflow.examples.tutorials.mnist.input_data as input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) import tensorflow as tf x = tf.placeholder("float", [None, 784]) w = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zeros([10])) y = tf.nn.softmax(tf.matmul...标签: DL
[linux] Install gcc
wget http://ftp.gnu.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.gz tar -zvxf gcc-6.1.0.tar.gz --directory=/usr/local/ cd /usr/local/gcc-6.1.0 sudo ./contrib/download_prerequisites sudo mkdir build cd build sudo ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib...[html]css限定文字行数
以下给出样式,能够使文字限定显示两行,并且超出部分加省略号. overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;标签: html
数组越界fopen时程序奔溃
历史上最奇葩的bug,一运行到fopen语句程序就挂了,按理说就算文件打开失败也就是反回个空指针,为什么这里会直接导致程序奔溃呢,一点一点地把代码删减后定位到数组越界。标签: C
[python]Gather all URLs from a certain web
# encoding=utf8 import sys reload(sys) sys.setdefaultencoding('utf8') import urllib from bs4 import BeautifulSoup import urlparse import time import urllib2 url = "http://log.anycle.com" domain = "log.anycle.com" deep = 0 tmp = "" sites = set() visited = set() #local = set() ...标签: python
[C++]Introduction to C++
#include <iostream> #include <iomanip> using namespace std; class Shap{ private: int fulfill; int color; double pi; /* Mutable data member can be exchanged in const object. */ mutable int count; /* Const data member will handicape the copying of object, * and the c...标签: C++
[Data structures]Hanoi
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 1024 char stack[MAX][255]; int top = -1; void printStack() { int i; for(i=top; i>=0; i--){ printf("%s\n", stack[i]); } printf("\n"); } void hanoi(int n, char x, char y, char z) ...日历
最新微语
- 有的时候,会站在分叉路口,不知道向左还是右
2023-12-26 15:34
- 繁花乱开,鸟雀逐风。心自宁静,纷扰不闻。
2023-03-14 09:56
- 对于不可控的事,我们保持乐观,对于可控的事情,我们保持谨慎。
2023-02-09 11:03
- 小时候,
暑假意味着无忧无虑地玩很长一段时间,
节假意味着好吃好喝还有很多长期不见的小朋友来玩...
长大后,
这是女儿第一个暑假,
一个半月...
2022-07-11 08:54
- Watching the autumn leaves falling as you grow older together
2018-10-25 09:45
分类
最新评论
- Goonog
i get it now :) - 萧
@Fluzak:The web host... - Fluzak
Nice blog here! Also... - Albertarive
In my opinion you co... - ChesterHep
What does it plan? - ChesterHep
No, opposite. - mojoheadz
Everything is OK!... - Josephmaigh
I just want to say t... - ChesterHep
What good topic - AnthonyBub
Certainly, never it ...