Use Handler and send Message.
Force to run on UI thread.
new Thread() {
public void run() {
runOnUiThread(new Runnable() {
@Override
It can be implemented as following, but why?
String[] checkedToDeleteStringArray = checkedToDeleteHashSet.toArray(new String[0]);
public final int getWidth() Return the width of the your view. Returns: int The width of your view, in pixels.
getWidth()得到的是view在父Layout中布局好后的宽度值,如果没有父布局,默认的父布局是整个屏幕。
Like getMeasuredWidthAndState(), but only returns the raw width component (that is the result is masked by MEASURED_SIZE_MASK).
canvas.drawText(text, x, y, paint)
第一个参数是我们需要绘制的文本,第四个参数是我们的画笔。主要是第二和第三个参数的含义,这两个参数在不同的情况下的值还是不一样的, x默认是这个字符串的左边在屏幕的位置,如果设置了paint.setTextAlign(Paint.Align.CENTER);那就是字符的中心, y是指定这个字符baseline在屏幕上的位置。y不是这个字符中心在屏幕上的位置,而是baseline在屏幕上的位置。
【参考资料】http://blog.csdn.net/lovexieyuan520/article/details/43153275
#include <stdio.h>
int main(int argc, char *argv[])
{
int n;
scanf("%d", &n);
int a[n];
/** | |
* @file: PointerIncrement.cpp | |
* @description: p为指针变量,p++代表什么? | |
* | |
* @author: Du Ang | |
* @date: Apr. 21st, 2017 | |
*/ | |
#include <iostream> |
Libraries have been installed in: /usr/local/lib
If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following:
def plot_confusion_matrix(cm, classes, | |
normalize=False, | |
title='Confusion matrix', | |
cmap=plt.cm.jet): | |
""" | |
This function prints and plots the confusion matrix. | |
Normalization can be applied by setting `normalize=True`. | |
""" | |
plt.imshow(cm, interpolation='nearest', cmap=cmap) | |
plt.title(title) |
# -*- encoding=utf-8 -*- | |
# Python2 代码 | |
import os | |
import csv | |
# Open the csv and write headers. | |
with open("files_count.txt",'wb') as out: | |
outwriter = csv.writer(out) | |
# outwriter.writerow(['Directory','FilesInDir','FilesIncludingSubdirs']) |