发博文
个人资料
fengchunjian
fengchunjian
  • 博客等级:
  • 博客积分:100
  • 博客访问:4,282
  • 关注人气:0
分类
评论
加载中…
留言
加载中…
访客
加载中…
好友
加载中…
博文
(2006-07-12 13:28)
好久没有更新了,有点不太象话了.
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
wget http://www-unix.mcs.anl.gov/mpi/mpich2/downloads/mpich2-1.0.3.tar.gz
tar -zxvf mpich2-1.0.3.tar.gz
cd mpich2-1.0.3
./configure --prefix=/home/chunjian/service/mpi
make
make install
vi ~/.bash_profile
 PATH=$PATH:$HOME/service/mpi/bin:.
 export PATH
cd ~
touch .mpd.conf
chmod 0600 .mpd.conf
~/service/mpi/bin/mpd &
编写helloworld.c
#include 'mpi.h'
#include <stdio.h>
int main(int argc, char *argv[])
{
        MPI_Init(&argc, &argv);
        printf('Hello, world!\n');
        MPI_Finalize();
        return 0;
}
~/service/mpi/bin/mpicc -o helloworld helloworld.c
~/service/mpi/bin/mpiexec -n 2 helloword
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
import com.sleepycat.db.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
public class AccessExample
{
 public static void main(String[] args)
 {
  try
  {
   String databaseName = 'example.db';
   DatabaseConfig dbConfig = new DatabaseConfig();
   dbConfig.setErrorStream(System.err);
   dbConfig.setErrorPrefix('AccessExample');
   dbConfig.setType(DatabaseType.BTREE);
   dbConfig.setAllowCreate(true);
   Database table = new Database(databaseName, null, dbConfig);
   String aKey = 'KEY';
   String aData = 'DATA';
   DatabaseEntry theKey = new DatabaseEntry(aKey.getBytes('UTF-8'));
&
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
1 下载jdk-1_2_2_017-linux-i586.tar.gz
2 解压缩到/usr/home/chunjian/service/jdk1.2.2
3 vi ~/.bash_profile添加
 JAVA_HOME=/usr/home/chunjian/service/jdk1.2.2
 JRE=$JAVA_HOME/jre
 CLASSPATH=$JAVA_HOME/lib:$JRE/lib:.
 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$JRE/bin:.
 export JAVA_HOME JRE CLASSPATH
 export PATH
4 重新登陆环境
5 编写HelloWorld.java
 public class HelloWorld
 {
         public static void main(String args[])
         {
                 System.out.println('Hello World!');
         }
 }
6 javac HelloWorld.java
7 java HelloWorld
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
rm ./-123
rm -- -123
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2006-04-28 16:50)
#include <sys/socket.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include <errno.h>
#define PORT 8888
#define BUFFER 'HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\nContent-Type: text/html\r\n\r\nHello'
int epfd;
void *serv_epoll(void *p);
void setnonblocking(int fd)
{
        int opts;
        opts=fcntl(fd, F_GETFL);
        if (opts < 0)
        {
                fprintf(stderr, 'fcntl failed\n');
                return;
  &nbs
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
char buffer[1024] = {0};
char *p_buffer;
int length, nget;
if (ap_setup_client_block(r, REQUEST_CHUNKED_ERROR) != OK)
 goto err;
if (ap_should_client_block(r))
{
 length = r->remaining;
 p_buffer = buffer;
 while ((nget = ap_get_client_block(r, p_buffer, length)) > 0)
 {
  ap_reset_timeout(r);
  p_buffer += nget;
  length -= nget;
  if (length <= 0) break;
 }
}
ap_kill_timeout(r);
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2006-03-28 11:27)
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2006-03-28 11:24)
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <event.h>

void signal_cb(int fd, short event, void *arg)
{
        fprintf(stderr, 'Hello, signal\n');
        return;
}
int main(int argc, char *argv[])
{
        struct event ev;

        event_init();
        signal_set(&ev, SIGUSR1, signal_cb, &ev);
        signal_add(&ev, NULL);

        event_dispatch();
      
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2006-03-28 11:01)
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <event.h>

void signal_cb(int fd, short event, void *arg)
{
        fprintf(stderr, 'Hello, signal\n');
        exit(0);
}
int main(int argc, char *argv[])
{
        struct event ev;
        struct itimerval itv;

        event_init();
        signal_set(&ev, SIGALRM, signal_cb, &ev);
        signal_add(&ev, NULL);
&nbs
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
  

新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有