其他
Java虚拟机的内存区域中,程序计数器、虚拟机栈和本地方法栈三个区域是线程私有的,随线程生而生,随线程灭而灭;栈中的栈帧随着方法的进入和退出而进行入栈和出栈操作,每个栈帧中分配多少内存基本上是在类结构确定下来时就已知的,因此这三个区域的内存分配和回收都具有确定性。垃圾回收重点关注的是堆和方法区部分的内存。
常用的垃圾回收算法有:
(1).引用计数算法:
给对象中添加一个引用计数器...
这个非常简单,直接上代码:
MainActivity:
package com.home.getsdinfo;
import java.io.File;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.os.StatFs;
...
今天分析试了一下,有两个页面index.html和main_wdsp.html
发现在index.html中通过
$.mobile.changePage("main_wdsp.html?userid="+userId,"slidedown", true, true);
方法切换页面后,在main_wdsp.html中无法接收到pageinit事件,我把事件写在下方的script中,然后又试了...
一个很有用的vimrc文件(添加抬头,产生cpp初始程序,添加注释,注释一行,自动K&R格式化,taglist)...
public class Plane implements Vehicle
{
/*
* @author jcy
*/
@Override
public void run()
{
System.out.println("飞机在飞。。。。");
}
}public class Car implements Vehicle
{
/*
* @author jc...
首先看看add函数实在event_add函数中调用的,肯定是evsel->add的方式调用的。
259 static int
260 epoll_add(void *arg, struct event *ev)
261 {
262 struct epollop *epollop = arg;
263 struct epoll_event epev = {0, {0}}...
static int
192 epoll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
193 {
194 struct epollop *epollop = arg;
195 struct epoll_event *events = epollop->events;
196 struct...
前面学firefly的过程让我学到了很多知识,但是简单的掌握一个小server完全不够用,所以决定再吃几个。神马erlang,golang,mina,c++,node.js,都尽量了解了解。先学开源的,那么就Pomelo吧!
pomelo,柚子,是网易(NetEasy)的一个基于Node.js的开源GameServer框架。
我前面介绍过firefly,初步看pomelo的时候,第一感...
一张图明白Activity和Fragment对应的生命周期:...
环境:ubuntu12.04
一。安装软件
apt-get install sendmail
apt-get install sendmail-cf(一般上面一步已经安装此软件)
apt-get install mailutils
查看是否安装成功:终端输入ps aux | grep sendmail
root 23905 0.0 0.2 15104 2240 ...