0.前言
水平居中基本方法——指定块的宽度并设定块的左右外边距为auto,上下外边距可取0,那么该块可以在父元素中水平居中。
样式如下:
1:margin:0px auto
2:margin-left:auto; margin-right:auto;
垂直居中基本方法——设定块的上下内边距相等。
样式如下:
padding-top:20px; paddin...
分类:
Web程序 时间:
2014-06-19 12:59:35
阅读次数:
540
本文介绍两种主线程等待子线程的实现方式,以5个子线程来说明:
1、使用Thread的join()方法,join()方法会阻塞主线程继续向下执行。
2、使用java.util.concurrent中的CountDownLatch,是一个倒数计数器。初始化时先设置一个倒数计数初始值,每调用一次countDown()方法,倒数值减一,他的await()方法会阻塞当前进程,直到倒数至0。
join方...
分类:
编程语言 时间:
2014-06-19 11:29:16
阅读次数:
262
问题
查找某个值在list中的位置
解决思路
可以用折半查询的方法解决此问题。
解决(Python)
#! /usr/bin/env python
#coding:utf-8
#折半查找某个元素在list中的位置
def half_search(lst,value,left,right):
length = len(lst)
while left<ri...
分类:
其他好文 时间:
2014-06-19 11:09:48
阅读次数:
527
Java7语法新特性:前言,这是大部分的特性,但还有一些没有写进去,比如多核 并行计算的支持加强 fork join 框架;这方面并没有真正写过和了解。也就不写进来了。1. switch中增加对String类型的支持。Java代码 public String generate(String name, String gender) {
String title = ""...
分类:
编程语言 时间:
2014-06-19 10:55:23
阅读次数:
336
1 left join
左外连接:查询结果以左表数据为准。假如左表有四条数据,右表有三条数据,则查询结果为四条,且都是左表中有的数据。例如:EMP表:SAL表:左连接select*fromEMPLeftjoinSALonEMP.ENAME=SAL.ENAME;左连接,表EMP是主表,因此查询结果是显...
分类:
数据库 时间:
2014-06-16 06:30:58
阅读次数:
246
原题地址:https://oj.leetcode.com/problems/unique-paths/题意:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The ...
分类:
编程语言 时间:
2014-06-15 23:37:55
阅读次数:
311
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is trying to reach the...
分类:
其他好文 时间:
2014-06-15 19:28:54
阅读次数:
246
手工设置文本与图片相对位置时,常用到如下方法:
setCompoundDrawables(left, top, right, bottom)
setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom)
意思是设置Drawable显示在text的左、上、右、下位置。
但是两者有些区别:
setCompoun...
分类:
移动开发 时间:
2014-06-14 00:18:45
阅读次数:
491
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2014-06-13 20:36:56
阅读次数:
280