码迷,mamicode.com
首页 >  
搜索关键字:while loop    ( 31405个结果
STL的队列和栈简单使用
STL的队列和栈简单使用 #include #include #include #include #include #include using namespace std; int main() {  queue Q;  stack S;  int i;  for(i=1;i  {Q.push(i);S.push(i);}  while(...
分类:其他好文   时间:2014-06-03 03:51:26    阅读次数:238
Iterative (non-recursive) Merge Sort
An iterative way of writing merge sort: #include using namespace std; void merge(int A[], int l, int r, int e, int B[]) { int i = l, j = r, k = l; while (i<r && j A[j]) B[k++] =...
分类:其他好文   时间:2014-06-03 02:33:24    阅读次数:215
《Java并发编程实战》第九章 图形用户界面应用程序界面 读书笔记
一、为什么GUI是单线程化 传统的GUI应用程序通常都是单线程的。 1. 在代码的各个位置都需要调用poll方法来获得输入事件(这种方式将给代码带来极大的混乱) 2. 通过一个“主事件循环(Main Event Loop)”来间接地执行应用程序的所有代码。 如果在主事件循环中调用的代码需要很长时间才能执行完成,那么用户界面就会“冻结”,直到代码执行完成。这是因为只有当执行控制权返回到主事件...
分类:编程语言   时间:2014-06-03 01:28:22    阅读次数:221
Iterative (non-recursive) Quick Sort
An iterative way of writing quick sort: #include #include #include using namespace std; void quickSort(int A[], int n) { stack> stk; stk.push(make_pair(0, n-1)); while (!stk.empty()) { pair ...
分类:其他好文   时间:2014-06-03 00:16:43    阅读次数:357
解决git提交问题error: The requested URL returned error: 403 Forbidden while accessing
git提交代码时,出现这个错误“error: The requested URL returned error: 403 Forbidden while accessing https”      解决方法:      编辑.git目录下的config文件即可。 vim .git/config #修改对于的配置 #原来的url = https://github.com/elitecodegr...
分类:数据库   时间:2014-06-03 00:03:44    阅读次数:349
Nio学习4——EchoServer在Io,Nio,Nio.2中的实现
阻塞IO实现: public class PlainEchoServer { public void serve(int port) throws IOException { final ServerSocket socket = new ServerSocket(port); try { while (true) { final Socket clientSocket...
分类:其他好文   时间:2014-06-02 23:32:20    阅读次数:357
nyoj 找球号三(除了一个数个数为基数,其他为偶数,编程之美上的)
#include#includeusing namespace std;int main(){ int len; while(cin>>len) { int ans; len--; cin>>ans; while(len--) { int a; cin>>a; ...
分类:其他好文   时间:2014-06-02 19:59:57    阅读次数:190
java-第五章-do{}while()升级菜单切换
importjava.util.Scanner; publicclassA04{ publicstaticvoidmain(String[]args){ //TODOAuto-generatedmethodstub Scannerinput=newScanner(System.in); System.out.println("欢迎使用MyShopPing管理系统"); System.out.println("\n********************************..
分类:编程语言   时间:2014-06-02 14:44:48    阅读次数:378
java-第五章-while升级购物结算升级版
importjava.util.Scanner; publicclassA03{ /** *@paramargs */ publicstaticvoidmain(String[]args){ //TODOAuto-generatedmethodstub Scannerinput=newScanner(System.in); System.out.println("****************************************"); System.out.print..
分类:编程语言   时间:2014-06-01 16:42:08    阅读次数:335
Nio学习5——对NIO.2(AIO) Reactor模式封装的拆解
我们通过nio学习了Reactor模式,但是在java7中又出现了NIO.2,新的异步框架出来了,在上节中的服务端视线中看不到Reactor的影子了,但是Netty in action中写到:But notice that NIO.2 handles threading and the creation of the so-called event loop for you.所以模式还是没变,只是封装了而已!那让我们来分解下AIO(NIO.2)的封装吧!...
分类:其他好文   时间:2014-06-01 01:40:11    阅读次数:388
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!