上下文切换(Context Switch)
或者环境切换多任务系统中,上下文切换是指CPU的控制权由运行任务转移到另外一个就绪任务时所发生的事件。(时间片切换)在操作系统中,CPU切换到另一个进程需要保存当前进程的状态并恢复另一个进程的状态:当前运行任务转为就绪(或者挂起、删除)状态,另一个被选定的...
分类:
其他好文 时间:
2014-05-24 01:04:08
阅读次数:
337
This post introduces the principle of the use
of switch-pattern.
分类:
编程语言 时间:
2014-05-22 16:15:39
阅读次数:
280
什么叫魔法数字?就是在写代码的时候,我们经常会使用到一些数字,或者是用来switch,或者是用来赋值,虽然我们自己知道这些数字代表什么,但是别人可能有所疑惑,这样造成程序的可读性变差,这就是魔法数字。在程序开发中需要避免出现魔法数字解决办法:使用枚举或者是宏定义,来诠释数字1.枚举类型实质上就是一....
分类:
其他好文 时间:
2014-05-22 14:50:24
阅读次数:
520
讲解了Java中的分支和循环结构,包括用if...else...和switch...case...default构造分支结构以及用whie、do...while...和for构造循环结构。...
分类:
编程语言 时间:
2014-05-22 10:06:36
阅读次数:
349
#include//中缀表达式求值
#include
using namespace std;
int precede(char t1,char t2) //shuru//判断优先级
{
int t=0;
switch(t2)
{
case '+':
case '-':
if(t1=='(...
分类:
其他好文 时间:
2014-05-22 07:48:44
阅读次数:
237
这里列出了很多Java静态分析工具,每一种工具关注一个特定的能发挥自己特长的领域,我们可以列举一下:Pmd它是一个基于静态规则集的Java源码分析器,它可以识别出潜在的如下问题:–
可能的bug——空的try/catch/finally/switch块。– 无用代码(Dead code):无用的本地...
分类:
数据库 时间:
2014-05-21 23:50:58
阅读次数:
586
??
ViewPaper和slidingmenu冲突?
通过查看slidingmenu的viewpage例子,发现如下代码,添加进去后调试正常.
@Override
public void onPageSelected(int position) {
switch (position) {
case 0:
...
分类:
其他好文 时间:
2014-05-21 07:53:14
阅读次数:
184
编程题:学生成绩评分#include<stdio.h>voidmain(){intscore;printf("请输入学生分数:"); scanf("%d",&score); switch(score/10) {case10: case9:printf("成绩优秀\n");break;/*成绩在90~100分*/ case8:printf("成绩良好\n");break;/*成绩在80~89分*/ case7:print..
分类:
其他好文 时间:
2014-05-21 00:38:21
阅读次数:
356
戳我去解题Given a non-negative number represented as an
array of digits, plus one to the number.The digits are stored such that the most
significant digit ...
分类:
其他好文 时间:
2014-05-20 10:42:14
阅读次数:
244