锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久综合香蕉国产蜜臀AV,中文字幕精品无码久久久久久3D日动漫 ,久久精品国产亚洲沈樵http://www.shnenglu.com/lk624424108/category/18330.htmlzh-cnTue, 03 Jan 2012 20:34:16 GMTTue, 03 Jan 2012 20:34:16 GMT60libevent examplehttp://www.shnenglu.com/lk624424108/articles/162909.htmllikunlikunTue, 27 Dec 2011 06:20:00 GMThttp://www.shnenglu.com/lk624424108/articles/162909.htmlhttp://www.shnenglu.com/lk624424108/comments/162909.htmlhttp://www.shnenglu.com/lk624424108/articles/162909.html#Feedback0http://www.shnenglu.com/lk624424108/comments/commentRss/162909.htmlhttp://www.shnenglu.com/lk624424108/services/trackbacks/162909.html闃呰鍏ㄦ枃

likun 2011-12-27 14:20 鍙戣〃璇勮
]]>
緙栫▼璇█鐨勯夋嫨http://www.shnenglu.com/lk624424108/articles/162665.htmllikunlikunFri, 23 Dec 2011 04:06:00 GMThttp://www.shnenglu.com/lk624424108/articles/162665.htmlhttp://www.shnenglu.com/lk624424108/comments/162665.htmlhttp://www.shnenglu.com/lk624424108/articles/162665.html#Feedback0http://www.shnenglu.com/lk624424108/comments/commentRss/162665.htmlhttp://www.shnenglu.com/lk624424108/services/trackbacks/162665.html

浣犳効鎰忓涔犳柊鐨勭紪紼嬭璦鍚楋紵浣犳効鎰忕疆韜簬涓涓叏鏂扮殑搴旂敤寮鍙戜笘鐣岄噷鍚楋紵閭e氨璧跺揩閫夋嫨涓闂ㄧ紪紼嬭璦寮濮嬪涔犲惂錛佷篃璁稿湪鍑犲勾鍚庯紝浣犲氨鑳戒緷闈犲涔犵殑縐瘡鐙珛寮鍙戝嚭搴旂敤紼嬪簭銆備絾鍦ㄦ涔嬪墠錛屼綘瑕佸厛鍋氳凍浜嬪墠鍑嗗銆?/p>

鍦ㄥ濡傜墰姣涚殑緙栫▼璇█涓栫晫涓紝閫夋嫨璇█涔熸槸涓闂ㄥ緢閲嶈鐨勫姛璇俱傚浣曞湪澶ч噺鐨勮璦涓夋嫨鍛紵榪欓噷灝嗕負浣犳彁渚涗竴涓疄鐢ㄦ寚鍗椼?/p>

 

鎴戣姳璐逛竷鍛ㄧ殑鏃墮棿璇諱簡涓冪緙栫▼璇█鍚庡仛鍑轟簡榪欎釜嫻佺▼鍥捐〃銆傛垜鍙戠幇鍦ㄩ夋嫨緙栫▼璇█鐨勭粨鏋滀腑錛屾湁涓閮ㄥ垎鏄垱涓氱殑寮鍙戣咃紝浠栦滑涓轟簡鍒涗笟鑰屽皾璇曞涔犳柊鐨勮璦鏀句笅鍘熸潵鐨勮璦銆傛墍浠ワ紝榪欎篃鏄綘鐨勬満浼氾紝璧跺揩閫夋嫨鍜屽涔犲惂錛?/p>

鍘熸枃閾炬帴錛?a style="color: #015fb6; text-decoration: none; ">streamhead.com



likun 2011-12-23 12:06 鍙戣〃璇勮
]]>
鍥藉唴鐨勭煡鍚嶄駭鍝佸強鍏跺紑鍙戣璦v0.0.1http://www.shnenglu.com/lk624424108/articles/162428.htmllikunlikunMon, 19 Dec 2011 14:52:00 GMThttp://www.shnenglu.com/lk624424108/articles/162428.htmlhttp://www.shnenglu.com/lk624424108/comments/162428.htmlhttp://www.shnenglu.com/lk624424108/articles/162428.html#Feedback0http://www.shnenglu.com/lk624424108/comments/commentRss/162428.htmlhttp://www.shnenglu.com/lk624424108/services/trackbacks/162428.html闃呰鍏ㄦ枃

likun 2011-12-19 22:52 鍙戣〃璇勮
]]>
Makefile Libtool Automakehttp://www.shnenglu.com/lk624424108/articles/162427.htmllikunlikunMon, 19 Dec 2011 14:47:00 GMThttp://www.shnenglu.com/lk624424108/articles/162427.htmlhttp://www.shnenglu.com/lk624424108/comments/162427.htmlhttp://www.shnenglu.com/lk624424108/articles/162427.html#Feedback0http://www.shnenglu.com/lk624424108/comments/commentRss/162427.htmlhttp://www.shnenglu.com/lk624424108/services/trackbacks/162427.html

鐢╝utomake寤虹珛鍏變韓搴?鍔ㄦ侀摼鎺ュ簱)Makefile

瑕佷嬌鐢╝utomake宸ュ叿鍖呭緩绔嬩竴涓氦鍙夌紪璇戠殑鍏變韓搴撶殑Makefile

榪欓噷鐢ㄧ殑autoconf鏄?.67鐗堟湰錛屽湪debian涓嬪疄鐜?

濡傛灉鐗堟湰浣庯紝鍙互鐢╝pt-get install automake鏉ヨ鏈鏂扮殑鐗堟湰錛岃繕闇瑕乴ibtool,涔熼渶瑕佺敤apt-get install鏉ュ畨瑁呫?/p>

榪欓噷寤虹珛涓涓畝鍗曠殑鍑芥暟搴撴潵浠嬬粛錛?/p>

寤虹珛鐩綍rx,鍙婃簮鐮佺洰褰晄rc:

$mkdir rx
$mkdir rx/src

鍦╮x/src涓嬬紪杈憆x.c,rx.h涓や釜婧愭枃浠?

mybdebian:/home/myb/php/rx/src# cat rx.h
#ifndef __RX_H_
#define __RX_H_
int fun
();
#endif
mybdebian:
/home/myb/php/rx/src# cat rx.c
#include "rx.h"
int fun
()
{
return 1234;
}

鍦╮x鐩綍鍜宺x/src鐩綍涓嬪垎鍒緩绔婱akefile.am鏂囦歡

rx鐩綍涓嬬殑Makefile.am涓洪《灞侻akefile.am鏂囦歡錛屽彧瑕佸寘鍚叾瀛樻斁婧愮爜鐨勫瓙鐩綍鍗沖彲錛屽唴瀹瑰涓嬶細

AUTOMAKE_OPTIONS=foreign
SUBDIRS
=src

rx/src鐩綍涓嬬殑Makefile.am鍐呭濡備笅錛?/p>

AUTOMAKE_OPTIONS=foreign
lib_LTLIBRARIES
=librx.la
librx_la_SOURCES
=rx.c
include_HEADERS=rx.h

鍏朵腑lib_LTLIBRARIES=鍚庨潰鐨?#8220;librx.la”涓鴻鐢熸垚鐨勫簱鏂囦歡鍚?蹇呴』鍐欐垚.la錛屼笉鑳芥槸.so錛屽疄闄呬細鐢熸垚librx.so鏂囦歡銆?/p>

涓嬮潰鐨刲ibrx_la鏄痩ibrx.la鎶?#8220;.”鎹㈡垚涓嬪垝綰?#8220;_”鍚庨潰鍔犱笂“_SOURCES=”錛岀瓑鍙蜂互鍚庝負婧愭枃浠跺悕縐幫紝澶氫簬涓涓椂鐢ㄧ┖鏍奸殧寮銆?/p>

include_HEADERS=鍚庨潰鐨勪負澶存枃浠訛紝鏄緵鍏跺畠紼嬪簭鍖呭惈鐢ㄧ殑錛宮ake install鏃朵細澶嶅埗鍒板畨瑁呯洰褰曠殑include 鐩綍涓?/p>

鍥炲埌涓婂眰鐩綍錛屼嬌鐢╝utoscan鎵弿婧愮爜鐩綍:

$autoscan
$ls
autoscan.log configure.scan Makefile.am src

鎶奵onfigure.scan鏀瑰悕鎴愪負configure.ac

$mv configure.scan configure.ac
AC_OUTPUT([Makefile
src
/Makefile])

緙栬瘧榪欎釜鏂囦歡:

$vim configure.ac
# -*- Autoconf -*-
#
Process this file with autoconf to produce a configure script.

AC_PREREQ([
2.67])
AC_INIT([FULL
-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([src
/rx.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile
src
/Makefile])
AC_OUTPUT

淇敼AC_INIT涓鍙ワ紝鍗蟲妸鍖呯殑鍏ㄥ悕銆佺増鏈彿鍙夿UG鎶ュ憡email鍦板潃娣諱笂錛屽錛?/p>

AC_INIT(rx2dlib,0.01,resound@163.com)

鍦ㄥ畠鍚庨潰鍔犱竴鍙?

AM_INIT_AUTOMAKE

榪欏彞璇濇槸蹇呴』鐨勩?/p>

鐢變簬榪欎釜鑴氭湰鏄敤浜庣敓鎴愬叡浜簱鐨勶紝鎵浠ヨ鍔犱竴鍙C_PROG_LIBTOOL鍦ˋC_PROG_CC鐨勪笅涓琛岋細

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL

淇敼鍚庨潰鐨勯偅涓狝C_CONFIG_FILES璇彞錛屾敼鎴怉C_OUTPUT,騫舵妸鍚庨潰鐨勪竴鏉C_OUTPUT鍘繪帀錛?/p>

AC_OUTPUT([Makefile
src
/Makefile])

榪欐牱錛宑onfigure.ac灝卞緩濂戒簡錛屼慨鏀瑰悗鐨勫唴瀹瑰涓?

# -*- Autoconf -*-
#
Process this file with autoconf to produce a configure script.

AC_PREREQ([
2.67])
AC_INIT(rx2dlib,
0.01,resound@163.com)
AM_INIT_AUTOMAKE

AC_CONFIG_SRCDIR([src
/rx.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_OUTPUT([Makefile
src
/Makefile])

鐒跺悗鎸夐『搴忔墽琛?

$aclocal
$autoconf
$autoheader
$libtoolize --automake
$automake –-add-missing
configure
.ac:13: installing `./config.guess'
configure
.ac:13: installing `./config.sub'
configure
.ac:6: installing `./install-sh'
configure
.ac:6: installing `./missing'
src
/Makefile.am: installing `./depcomp'

榪欐椂configure鑴氭湰宸茬粡鐢熸垚浜嗐?/p>

鍙互鐢ㄥ畠鏉ラ厤緗敓鎴怣akefile浜嗐?/p>

濡傛垜浠鐢熸垚浜ゅ弶緙栬瘧緇橝RM CPU浣跨敤鐨勫叡浜簱,榪欓噷鍋囪鎴戜滑瑕佷嬌鐢ㄧ殑緙栬瘧鍣ㄤ負arm-none-linux-gnueabi-gcc錛屽茍涓旀垜浠渶緇堝湪ARM鏉夸笂鎵ц鏃訛紝瑕佹妸搴撳畨瑁呭埌鐩爣鏉跨殑/usr/local/armrx2d鐩綍涓幓銆傚彲浠ヨ繖鏍烽厤緗?

$./configure --host=arm-none-linux-gnueabi --prefix=/usr/local/armrx2d

$make


Make瀹屾垚鍚庡彲浠ュ埌src鐩綍涓嬮潰鐨勪竴涓殣钘忕洰褰?libs鐩綍涓湅鍒扮敓鎴愮殑搴撴枃浠訛細

mybdebian:/home/myb/php/rx/src/.libs# ls -l
鎬昏
20
-rw-r--r--
1 root root 2368 04-19 22:48 librx.a
lrwxrwxrwx
1 root root 11 04-19 22:48 librx.la -> ../librx.la
-rw-r--r--
1 root root 930 04-19 22:48 librx.lai
lrwxrwxrwx
1 root root 14 04-19 22:48 librx.so -> librx.so.0.0.0
lrwxrwxrwx
1 root root 14 04-19 22:48 librx.so.0 -> librx.so.0.0.0
-rwxr-xr-x
1 root root 5422 04-19 22:48 librx.so.0.0.0
-rw-r--r--
1 root root 2228 04-19 22:48 rx.o

鎴戜滑鍐嶅洖鍒伴《灞傜洰褰曪紝鎵цmake install鍙互鑷姩瀹夎鐢熸垚鐨勫簱鍒?usr/local/armrx2d/lib鐩綍涓嬨?/p>

鑻ヤ嬌鐢╝utomake鏃跺嚭鐜頒笅闈㈤敊璇俊鎭?/p>

required file `./ltmain.sh' not found

鏄洜涓簂ibtool鏈厤緗細

瑙e喅鍔炴硶錛?/p>

$libtoolize --automake --debug --copy –force

鎴栵細

$libtoolize --automake

#
#
# 鍒╃敤libtool鑷姩鐢熸垚鍔ㄦ佸簱
#
1. autoscan鍛戒護鍦ㄥ綋鍓嶇洰褰曠敓鎴恈onfigure.scan鏂囦歡, 鍐呭涓?
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AC_CONFIG_SRCDIR([src/bot.h])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h malloc.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset strcasecmp strchr strdup])
AC_OUTPUT
灝嗗叾璇ュ悕涓篶onfigure.ac 鐒跺悗淇敼:
configure.ac 鏂囦歡鏄?autoconf 鐨勮緭鍏ユ枃浠訛紝緇忚繃 autoconf 澶勭悊錛屽睍寮閲岄潰鐨?m4瀹忥紝
杈撳嚭鐨勬槸 configure 鑴氭湰銆?/span>
絎?4 琛屽0鏄庢湰鏂囦歡瑕佹眰鐨?autoconf 鐗堟湰錛屽洜涓烘湰渚嬩嬌鐢ㄤ簡鏂扮増鏈?2.57錛屾墍浠ュ湪姝ゆ敞鏄庛?/span>
絎?5 琛?AC_INIT 瀹忕敤鏉ュ畾涔夎蔣浠剁殑鍚嶇О鍜岀増鏈瓑淇℃伅
AC_INIT([test], 1.0, [email]linhanzu@gmail.com[/email])
澧炲姞鐗堟湰淇℃伅(涓虹敓鎴恖ib搴撳仛鍑嗗)
lt_major=1
lt_age=1
lt_revision=12
dist_version=0.1.12
AM_INIT_AUTOMAKE(test, $dist_version) //鑷姩鐢熸垚Makefile鏂囦歡
澧炲姞瀹? 鎵撳紑鍏變韓搴?/span>
AC_PROG_LIBTOOL
# Check for dl  
DL_PRESENT=""
AC_CHECK_LIB( dl, dlopen, DL_PRESENT="yes",, $DL_LIBS -ldl )
if test "x$DL_PRESENT" = "xyes"; then
AC_DEFINE(HAVE_LIBDL, 1, [Define if DL lib is present])
DL_LIBS="-ldl"
AC_SUBST(DL_LIBS)
fi
# Check for libm
M_PRESENT=""
AC_CHECK_LIB( m, sin, M_PRESENT="yes",, $M_LIBS -lm )
if test "x$M_PRESENT" = "xyes"; then
AC_DEFINE(HAVE_LIBM, 1, [Define if libm is present])
M_LIBS="-lm"
AC_SUBST(M_LIBS)
fi
澧炲姞渚濊禆搴擄紝榪欓噷灝變粎浠呭垪涓句簡pthread搴擄紝鐢熸垚鐨凪akefile浼氳嚜鍔ㄥ姞涓?pthread
# Check for pthread
PTHREAD_PRESENT=""
AC_CHECK_LIB( pthread, pthread_create, PTHREAD_PRESENT="yes",, $PTHREAD_LIBS
-lpthread )
if test "x$PTHREAD_PRESENT" = "xyes"; then
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if libpthread is present])
PTHREAD_LIBS="-lpthread"
AC_SUBST(PTHREAD_LIBS)
fi
瑕佺敓鎴愰」鐩伐紼嬬洰褰曞拰鍏跺畠鐩綍涓嬬殑Makefile 鏂囦歡, 蹇呴渶鍔犲叆
AM_CONFIG_FILES鐨勫畯:
渚嬪: AC_CONFIG_FILES([Makefile
                     src/Makefile
                     data/Makefile
                     docs/Makefile])
淇敼瀹屽悗Makefile.ac濡備笅:
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT([test],[1.0],[[email]arne_caspari@users.sourceforge.net[/email]])
AM_CONFIG_HEADER(config.h)
lt_major=1
lt_age=1
lt_revision=12
dist_version=0.1.12
AM_INIT_AUTOMAKE(test, $dist_version)
AC_SUBST(lt_major)
AC_SUBST(lt_revision)
AC_SUBST(lt_age)
# Checks for programs.
#AC_PROG_CC
#AC_PROG_INSTALL
#AC_PROG_LN_S
#AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
# Checks for libraries.
pkg_modules="gtk+-2.0 >= 2.0.0"
PKG_CHECK_MODULES(GTK_PACKAGE, [$pkg_modules], HAVE_GTK2="yes", HAVE_GTK2="no" )
AC_SUBST(GTK_PACKAGE_CFLAGS)
AC_SUBST(GTK_PACKAGE_LIBS)
# Check for dl
DL_PRESENT=""
AC_CHECK_LIB( dl, dlopen, DL_PRESENT="yes",, $DL_LIBS -ldl )
if test "x$DL_PRESENT" = "xyes"; then
AC_DEFINE(HAVE_LIBDL, 1, [Define if DL lib is present])
DL_LIBS="-ldl"
AC_SUBST(DL_LIBS)
fi
# Check for libm
M_PRESENT=""
AC_CHECK_LIB( m, sin, M_PRESENT="yes",, $M_LIBS -lm )
if test "x$M_PRESENT" = "xyes"; then
AC_DEFINE(HAVE_LIBM, 1, [Define if libm is present])
M_LIBS="-lm"
AC_SUBST(M_LIBS)
fi
# Check for pthread 
PTHREAD_PRESENT=""
AC_CHECK_LIB( pthread, pthread_create, PTHREAD_PRESENT="yes",, $PTHREAD_LIBS
-lpthread )
if test "x$PTHREAD_PRESENT" = "xyes"; then
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if libpthread is present])
PTHREAD_LIBS="-lpthread"
AC_SUBST(PTHREAD_LIBS)
fi
# Checks for header files.
#AC_HEADER_DIRENT
#AC_HEADER_STDC
#AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
#AC_TYPE_PID_T
#AC_TYPE_SIZE_T
#AC_HEADER_TIME
# Checks for library functions.
#AC_FUNC_CLOSEDIR_VOID
#AC_FUNC_MALLOC
#AC_CHECK_FUNCS([memset strstr])
AC_CONFIG_FILES([Makefile
             src/Makefile
             data/Makefile
             doc/Makefile])
AC_OUTPUT

2.鐢熸垚鍚勭洰褰曚笅鐨凪akefile.am鏂囦歡
./Makefile.am   //宸ョ▼鐩綍涓?/span>
  SUBDIR = src data doc
../src/Makefile.am  //婧愮爜鐩綍涓?/span>
  MAINTAINERCLEANFILES = Makefile.in
   INCLUDES = -I../include  
   CPPFLAGS=-DINSTALL_PREFIX="\"$(prefix)\""
   lib_LTLIBRARIES = libtest.la
   libtest_la_LDFLAGS = -version-info @lt_major@:@lt_revision@:@lt_age@
   libtest_la_SOURCES = \
                      test.c \
                      test_private.h \
                      check_match.c \
                      check_match.h \
                      test_helpers.c \
                      test_helpers.h \
                      debug.h
    libtest_la_LIBADD = \
                      @DL_LIBS@ \
                      @M_LIBS@

3. 鐢熸垚autogen.sh鑴氭湰, 鍐呭
#! /bin/sh
set -x
aclocal
autoheader
automake --foreign --add-missing --copy
autoconf

淇濆瓨鍚庝慨鏀規潈闄?chmod a+x autogen.sh

3.榪愯鑴氭湰./autogen.sh, 鐢熸垚configure鑴氭湰. 榪欓噷鍙兘浼氶亣鍒伴敊璇? 鍙互鏍規嵁閿欒鎻愮ず浣滅浉搴斾慨鏀?錛堟敞鎰忥細濡傛灉鎮ㄤ慨鏀逛簡Makefile.am涓殑欏癸紝閭d箞灝卞緱閲嶆柊鎵ц榪欎竴姝ワ級

4.榪愯./configure鑴氭湰.鑷姩鐢熸垚src鐩綍涓嬬殑makefile鏂囦歡

5. 鍒囨崲鍒扮洰褰晄rc, 榪愯make 鑷姩鍦ㄥ綋鍓嶇洰褰曚笅寤虹珛.libs鏂囦歡, 緙栫▼鐢熸垚鐨勫簱鏂囦歡灝變繚瀛樺湪璇ョ洰褰曚笅.
    make install 瀹夎鍦ㄩ粯璁ょ洰褰?/usr/local/lib/涓?

6.濡傛灉瑕佺敓鎴愬叾瀹冪殑瀹夎鐩綍錛孧akefile.am灝辮榪欐牱鍐?/span>
MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I../include 
lib_LTLIBRARIES = libtt.la
libdir = $(prefix)/lib/test  //榪欎釜灝辨槸瀹夎鐩綍
libtt_la_LDFLAGS = -version-info @lt_major@:@lt_revision@:@lt_age@
libtt_la_LIBADD = @PTHREAD_LIBS@
libtt_la_SOURCES = \
                tt.c \
                video.c \
                video.h

褰撶劧錛孧akefile涓殑璇硶瑙勫垯涓繕鏈夊緢澶氬畯瀹氫箟錛屾偍鍙互鍦∕akefile鐨勫畼鏂圭綉绔欐壘鍒拌鏄庛?/span>
涓嬩竴綃囧氨鎵撶畻鍐欏啓鏉′歡緙栬瘧鐨凪akefile鍐欐硶銆?/span>







 



likun 2011-12-19 22:47 鍙戣〃璇勮
]]>
Redis 綺懼僵鏂囩珷http://www.shnenglu.com/lk624424108/articles/162035.htmllikunlikunTue, 13 Dec 2011 07:26:00 GMThttp://www.shnenglu.com/lk624424108/articles/162035.htmlhttp://www.shnenglu.com/lk624424108/comments/162035.htmlhttp://www.shnenglu.com/lk624424108/articles/162035.html#Feedback0http://www.shnenglu.com/lk624424108/comments/commentRss/162035.htmlhttp://www.shnenglu.com/lk624424108/services/trackbacks/162035.htmlRedis

likun 2011-12-13 15:26 鍙戣〃璇勮
]]>
瀛楃鏁扮粍鐨勮祴鍊鹼紝鍒濆鍖栥傘傘?/title><link>http://www.shnenglu.com/lk624424108/articles/162019.html</link><dc:creator>likun</dc:creator><author>likun</author><pubDate>Tue, 13 Dec 2011 05:42:00 GMT</pubDate><guid>http://www.shnenglu.com/lk624424108/articles/162019.html</guid><wfw:comment>http://www.shnenglu.com/lk624424108/comments/162019.html</wfw:comment><comments>http://www.shnenglu.com/lk624424108/articles/162019.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/lk624424108/comments/commentRss/162019.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/lk624424108/services/trackbacks/162019.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">int</span> main()<br />{<br />        <span style="color: #0000FF; ">char</span> t[20]="This is a test!!!\n";<br />        printf("t:%s\n",t);   //杈撳嚭錛歍his is a test!!!<br />        t[0] = '\0';<br />        printf("t:%s\n",t);   //杈撳嚭錛氱┖涓?br /><br />        <span style="color: #0000FF; ">return</span> 0;<br />}</div><img src ="http://www.shnenglu.com/lk624424108/aggbug/162019.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/lk624424108/" target="_blank">likun</a> 2011-12-13 13:42 <a href="http://www.shnenglu.com/lk624424108/articles/162019.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>0-1鑳屽寘闂http://www.shnenglu.com/lk624424108/articles/161984.htmllikunlikunMon, 12 Dec 2011 12:07:00 GMThttp://www.shnenglu.com/lk624424108/articles/161984.htmlhttp://www.shnenglu.com/lk624424108/comments/161984.htmlhttp://www.shnenglu.com/lk624424108/articles/161984.html#Feedback0http://www.shnenglu.com/lk624424108/comments/commentRss/161984.htmlhttp://www.shnenglu.com/lk624424108/services/trackbacks/161984.html璁$畻鏈虹畻娉曡璁′笌鍒嗘瀽錛堢涓夌増錛塒78
鑳屽寘闂錛?br />m(i,j) = (1). max{m[i+1][j],m[i+1][j-w[i]]+v[i]}
           (2).m[i+1][j]

m(n,j) = (1) v[n] j>=w[n]
            (2) 0 0<=j<w[n]

m[i][j]錛氳〃紺鴻儗鍖呭閲忎負j錛屽彲閫夋嫨鐨勭墿鍝佷負i,i+1,....,n鏄?-1鑳屽寘闂鐨勬渶浼樺箋?br />

#include<iostream>
#include<time.h>
#include<stdlib.h>
using namespace std;

#define N 5
#define C 25

int m[N+1][C+1];

//#define MAX(a,b)  ((a)>(b)?(a):(b))

int Min(int a,int b)
{
        return a<b?a:b;
}

int Max(int a,int b)
{
        return a>b?a:b;
}

void print(int *x)
{
        for(int i=1;i<=N;i++)
        {
              cout<<x[i]<<"\t";
        }
        cout<<endl;
}

void fb(int *w)
{
       cout<<"\n";
       
        int x[N+1];
        int c=C;
        
        for(int i=0;i<=N;i++)
        {
                x[i]=-1;
        }
        
        for(int i=1;i<N;i++)
        {
                if(m[i][c]==m[i+1][c]){
                        x[i]=0;
                }
                else{
                        x[i]=1;
                        c-=w[i];
                        cout<<w[i]<<"\t";
                }
        }
        
        cout<<endl;
        
        x[N] = (m[N][c])?1:0;
        print(x);
}


void f(int *w,int *v)
{        
        int max = Min(w[N]-1,C);
        //int max = min(w[N],C);
        for(int i=0;i<=N;i++)
        {
                for(int j=0;j<=C;j++)
                {
                        m[i][j]=-1;
                }
        }
        
        
        
        for(int j=0;j<max;j++)
        {
                m[N][j] = 0;
        }
        
        for(int j=max;j<=C;j++)
        {
                m[N][j] = v[N];
        }
        
        for(int i=N-1;i>1;i--)
        {
                max = Min(C,w[i]-1);
                //max = min(C,w[i]);
                for(int j=0;j<max;j++)
                {
                        m[i][j]=m[i+1][j];
                }
                
                for(int j=w[i];j<=C;j++)
                {
                        m[i][j] = Max(m[i+1][j],m[i+1][j-w[i]]+v[i]);
                }
        }
        
        m[1][C] = m[2][C];
        if(C>=w[1]){
                m[1][C] = Max(m[1][C],m[2][C-w[1]]+v[1]);
        }
        
        //print(m);
        
        for(int i=1;i<=N;i++)
        {
                for(int j=1;j<=C;j++)
                {
                        cout<<m[i][j]<<" ";
                }
                cout<<endl;
        }
        
        
        fb(w);
        
             
}

int main()
{
        int i;
        int w[N],v[N];
        
        srand(time(NULL));
        for(i=1;i<=N;i++)
        {
                w[i]=rand()%10;
                v[i]=rand()%25;
        }
        
        f(w,v);
        
        return 0;
}

likun 2011-12-12 20:07 鍙戣〃璇勮
]]>
vfork 浜х敓鐨勫鎬殑鐜拌薄錛屾眰瑙i噴http://www.shnenglu.com/lk624424108/articles/161833.htmllikunlikunFri, 09 Dec 2011 08:13:00 GMThttp://www.shnenglu.com/lk624424108/articles/161833.htmlhttp://www.shnenglu.com/lk624424108/comments/161833.htmlhttp://www.shnenglu.com/lk624424108/articles/161833.html#Feedback0http://www.shnenglu.com/lk624424108/comments/commentRss/161833.htmlhttp://www.shnenglu.com/lk624424108/services/trackbacks/161833.htmlvfork  浜х敓鐨勫鎬殑鐜拌薄錛屾眰瑙i噴
浠g爜濡備笅錛?span class="Apple-style-span" style="font-size: 13px; background-color: #eeeeee; ">  #include <stdio.h>
  #include <unistd.h>
  #include <stdlib.h> 
  int main()
  {
         int count=0; 
         vfork(); 
         count++; 
         printf("%d\n",count);
         return 0;


涓嶇煡閬撳師鍥狅紝鎴戠殑杈撳嚭鏄?鍜?2054517  浜ゆ浛鍑虹幇 n嬈″悗鍋滄


likun 2011-12-09 16:13 鍙戣〃璇勮
]]>
青青草国产成人久久91网| 91精品观看91久久久久久| 日本精品久久久久影院日本| 久久久久久国产a免费观看黄色大片| 中文字幕无码久久精品青草| 99久久精品国产高清一区二区 | 中文字幕热久久久久久久| 日本强好片久久久久久AAA | 色婷婷噜噜久久国产精品12p| 久久久精品久久久久影院| 国产精品毛片久久久久久久| 久久久久久国产a免费观看不卡| 东京热TOKYO综合久久精品| 99久久精品免费看国产一区二区三区 | 久久发布国产伦子伦精品| 久久久国产视频| 品成人欧美大片久久国产欧美...| 久久久久99精品成人片直播| 精品久久久久久久久久中文字幕| 精品国产乱码久久久久久郑州公司 | 国产福利电影一区二区三区,免费久久久久久久精 | 亚洲精品无码专区久久同性男| 久久久久久午夜成人影院| 欧美与黑人午夜性猛交久久久 | 一级a性色生活片久久无| 国产呻吟久久久久久久92| 国产99精品久久| 久久国产精品成人影院| 一本久道久久综合狠狠爱| 中文字幕精品久久久久人妻| 久久久久无码中| 久久久久亚洲?V成人无码| 久久久久亚洲精品中文字幕| 久久一区二区免费播放| 久久97久久97精品免视看秋霞| 久久国产精品久久精品国产| 久久久久久国产精品免费免费| 国产免费久久精品99久久| 国产精品久久久久久久久免费 | 久久不射电影网| 2021国产成人精品久久|