ITeye博客

frenchleaf的博客

frenchleaf · 共 22 篇文章

[置顶] ubuntu笔记

ubuntu10.10: 网络: /etc/init.d/network-manager restart 编辑/etc/network/interfaces windows盘符 : du --max-depth=1 . 10.10会把wubi所在的硬盘(比如E:\)直接挂载到/host,不用再重新挂了 fdisk -l查看 fuser -m /dev/sda1 查看那些进程在用这个设备 在/media/winD 或者挂载 mount -t ntfs-3g /dev/sda3 /mnt/winE apt-get install lvm2 root用户: sudo passwd su root …

2010-10-14 11:03 · 评论(0)

被隐藏了的jni

public class HelloWorld { static { System.loadLibrary("Hello"); } public native void DisplayHello(); public static void main(String[] args) { new HelloWorld().DisplayHello(); } } javac HelloWorld.java javah -jni HelloWorld 生成helloworld.h /* DO NOT EDIT THIS FILE - it is machine generated */ #includ…

2011-11-21 17:12 · 评论(0)

iptables清空

#!/bin/sh IPT='/sbin/iptables' $IPT -t nat -F $IPT -t nat -X $IPT -t nat -P PREROUTING ACCEPT $IPT -t nat -P POSTROUTING ACCEPT $IPT -t nat -P OUTPUT ACCEPT $IPT -t mangle -F $IPT -t mangle -X $IPT -t mangle -P PREROUTING ACCEPT $IPT -t mangle -P INPUT ACCEPT $IPT -t mangle -P FORWARD ACCEPT $IPT -…

2011-02-25 12:07 · 评论(0)

axis2笔记

转载百度文库 package sample; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; public class HelloWorld { public OMElement sayHello(OMElement in){ System.out.println("hello world at server "); S…

2010-12-09 16:41 · 评论(0)

收藏的网址

groovy例子 http://pleac.sourceforge.net/pleac_groovy/index.html java贝叶斯网络 http://www.cs.cmu.edu/~javabayes/Home/ 概率-统计之都 http://cos.name aws-eclipse http://aws.amazon.com/eclipse/ ssh-putty http://www.ascc.sinica.edu.tw/putty ode BPEL http://download.eclipse.org/technology/bpel/update-site/

2010-12-02 23:19 · 评论(0)

被隐藏了的JNA

jni没用过,接触一下jna 如果在windows下 import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Platform; public class HelloWorld { public interface CLibrary extends Library { CLibrary INSTANCE = (CLibrary) Native.loadLibrary((Platform.isWindows() ? "msvcrt" : "c"), CLibrary.class); void print…

2010-12-01 10:12 · 评论(7)

fork笔记

#include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main(void) { pid_t result; result=fork(); if(result==-1){ // perrer("fork"); exit; }else if(result==0){ printf("result=%d,ppid=%d,pid=%d\n",result,getppid(),getpid()); }else{ printf("result=%d,ppid=%d,pid=%d\n",re…

2010-11-30 22:20 · 评论(0)

unix网络编程卷1笔记

http://bbs.chinaunix.net/archiver/tid-505577.html 和http://chenliang.info/?p=224 cd unpv12e ./configure make vim README看怎么安装 cd unpv12e/lib make会报错unp.h:114: error: redefinition of ‘struct in_pktin unp.h中,这段代码注释掉,因为在linux系统include文件中已经定义了这个结构, /* The structure returned by recvfrom_flags() */ struct …

2010-11-24 22:06 · 评论(0)

服务器向客户端推送

shell用curl http://www.google.com.hk 然后用dwr的推送 可以达到服务器响应后,立即在客户端出现效果, 再也不用定时刷新啦

2010-11-17 17:35 · 评论(0)

snprintf

转载http://hi.baidu.com/lindastar/blog/item/e7c08fafdceb63cc7dd92a4a.html int snprintf(char *restrict buf, size_t n, const char * restrict format, ...); 函数说明:最多从源串中拷贝n-1个字符到目标串中,然后再在后面加一个0。所以如果目标串的大小为n 的话,将不会溢出。 函数返回值:若成功则返回欲写入的字符串长度,若出错则返回负值。 Result1(推荐的用法) #include <stdio.h> #include <stdlib.h> int…

2010-11-16 11:46 · 评论(0)

进程通信笔记

来自apue fig15.5 fig 15.6 #include "apue.h" int main(void) { int n; int fd[2]; pid_t pid; char line[maxline]; if (pipe(fd) < 0) err_sys("pipe error"); if ((pid = fork()) < 0) { err_sys("fork error"); } else if (pid > 0) { /* parent */ close(fd[0]); write(fd[1], "hello world\n", 12); } else { /* child…

2010-11-15 16:08 · 评论(0)

linux信号

信号是软件中断,感觉就像javascript里的事件 #include "apue.h" static void sig_usr(int); /* one handler for both signals */ int main(void) { if (signal(SIGUSR1, sig_usr) == SIG_ERR) err_sys("can't catch SIGUSR1"); if (signal(SIGUSR2, sig_usr) == SIG_ERR) err_sys("can't catch SIGUSR2"); for ( ; ; ) pause(); } static …

2010-11-15 13:30 · 评论(0)

linux截图

linux源码

2010-11-15 09:32 · 评论(0)

VC学习笔记

工具VC++.6.0.with.SP6+VisualAssist 第一个程序 使用goto,注意lebel后面需要有语句,没有不行 #include "stdafx.h" int i; int main(int argc, char* argv[]) { char name[30]; printf("Hello World!\n"); puts("hello"); for(i=0;i<10;i++){ if(i==5) goto label1; printf("in the for loop i=%d\n",i);//不打印5 label1: { scanf("%s",name); prin…

2010-11-10 14:08 · 评论(0)

jquery IE刷新慢问题global:false

jquery1.4.2的4932行左右 ajaxSettings: { url: location.href, global: true, type: "GET", contentType: "application/x-www-form-urlencoded", processData: true, async: true, global这个东西超级重要,尤其是在ie的情况下, 当一个页面用了8个$.ajax调用,火狐正常会异步的一个一个显示div,而ie就崩溃了,基本上beforesend里面如果不写alert就会卡在那里,直到最后一个div刷出来,开始以为是async的问题,上网查了很…

2010-10-28 17:10 · 评论(0)