Kejie's profile◆ Neverland ◆PhotosBlogListsMore Tools Help
    10/24/2009

    Brown County


     
    8/26/2009

    上了jconline

    早上去买狗粮,发现晚上有活动Hike With Your Hound,于是下午回家带上胖子就去了Columbia Park,注册完毕正在给胖子戴三角巾,一个摄影师跑过来说“投拍”了我们,于是征得我们同意得到我们的姓名,回家就看到了在jconline,特此纪念一下!

    活动挺不错,很多赞助商,petsmart也加入了,所以胖子得到了很多treat还有玩具。下次可能就要等明年,那时候不知道还在不在这呢!

    8/20/2009

    CUDA Eclipse project setup step by step

    UPDATE: I still have problems for step i), executable file produced, and can be run normally. 
    Only problem now is debug step. I need some advices!



    a) Start Eclipse and set the workspace to the SDK install folder/projects

    b) Create a new C or C++ Makefile Project
    New>File>C++ Project; then choose ("Makefile project" in the "Project types" selection window)
    In the "Toolchain" selection window select "Linux GCC",set a name and click Finish. Let's say the project name is CUDA_test

    c) Add a new Source File with the extension eg. "CUDA_test.cu" and click Finish
    File>New>Source File

    d) Add a new File called "Makefile" (File>New>File) and click ok

    e) Edit the Makefile
    Copy these lines to the makefile:

    #################################################

    # Build script for project

    #################################################


    EXECUTABLE := CUDA_test

    # cu files

    CUFILES := CUDA_test.cu

    # c/c++

    CCFILES :=


    CUDA_INSTALL_PATH := /usr/local/cuda

    PROJECT_PATH := .

    NV_ROOT_PATH := /home/username/NVIDIA_GPU_Computing_SDK/C


    ifeq ($(emu), 1)

    LIB := -lcufftemu

    else

    LIB := -lcufft

    endif


    # Basic directory setup for SDK

    # (override directories only if they are not already defined)

    #SRCDIR ?= $(PROJECT_PATH)/Source

    #ROOTDIR ?= $(PROJECT_PATH)

    #ROOTBINDIR ?= $(PROJECT_PATH)/bin

    #BINDIR ?= $(ROOTBINDIR)/linux

    #ROOTOBJDIR ?= $(ROOTBINDIR)/obj

    #LIBDIR := $(NV_ROOT_PATH)/lib

    #COMMONDIR := $(NV_ROOT_PATH)/common


    include ../../common/common.mk

    #######################################################

    f) now edit the CUDA_test.cu file 
    ##############################################################################
    /*
    * Copyright 1993-2008 NVIDIA Corporation. All rights reserved.
    *
    * NOTICE TO USER:
    *
    * This source code is subject to NVIDIA ownership rights under U.S. and
    * international Copyright laws. Users and possessors of this source code
    * are hereby granted a nonexclusive, royalty-free license to use this code
    * in individual and commercial software.
    *
    * NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
    * CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
    * IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
    * REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
    * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
    * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
    * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
    * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
    * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
    * OR PERFORMANCE OF THIS SOURCE CODE.
    *
    * U.S. Government End Users. This source code is a "commercial item" as
    * that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
    * "commercial computer software" and "commercial computer software
    * documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
    * and is provided to the U.S. Government only as a commercial end item.
    * Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
    * 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
    * source code with only those rights set forth herein.
    *
    * Any use of this source code in individual and commercial software must
    * include, in the user documentation and internal comments to the code,
    * the above Disclaimer and U.S. Government End Users Notice.
    */


    // includes, system
    #include <stdio.h>
    #include <assert.h>

    // Simple utility function to check for CUDA runtime errors
    void checkCUDAError(const char* msg);

    // Part 1 of 1: implement the kernel
    __global__ void reverseArrayBlock(int* d_B, int* d_A )
    {
    int tx = threadIdx.x;
    d_B[blockDim.x-tx-1] = d_A[tx];
    }

    ////////////////////////////////////////////////////////////////////////////////
    // Program main
    ////////////////////////////////////////////////////////////////////////////////
    int main( int argc, char** argv)
    {
    // pointer for host memory and size
    int *h_a;
    int dimA = 256;

    // pointer for device memory
    int *d_b, *d_a;

    // define grid and block size
    int numBlocks = 1;
    int numThreadsPerBlock = dimA;

    // allocate host and device memory
    size_t memSize = numBlocks * numThreadsPerBlock * sizeof(int);
    h_a = (int *) malloc(memSize);
    cudaMalloc( (void **) &d_a, memSize );
    cudaMalloc( (void **) &d_b, memSize );

    // Initialize input array on host
    for (int i = 0; i < dimA; ++i)
    {
    h_a[i] = i;
    }

    // Copy host array to device array
    cudaMemcpy( d_a, h_a, memSize, cudaMemcpyHostToDevice );

    // launch kernel
    dim3 dimGrid(numBlocks);
    dim3 dimBlock(numThreadsPerBlock);
    reverseArrayBlock<<< dimGrid, dimBlock >>>( d_b, d_a );

    // block until the device has completed
    cudaThreadSynchronize();

    // check if kernel execution generated an error
    // Check for any CUDA errors
    checkCUDAError("kernel invocation");

    // device to host copy
    cudaMemcpy( h_a, d_b, memSize, cudaMemcpyDeviceToHost );

    // Check for any CUDA errors
    checkCUDAError("memcpy");

    // verify the data returned to the host is correct
    for (int i = 0; i < dimA; i++)
    {
    assert(h_a[i] == dimA - 1 - i );
    }

    // free device memory
    cudaFree(d_a);
    cudaFree(d_b);

    // free host memory
    free(h_a);

    // If the program makes it this far, then the results are correct and
    // there are no run-time errors. Good work!
    printf("Correct!\n");

    return 0;
    }

    void checkCUDAError(const char *msg)
    {
    cudaError_t err = cudaGetLastError();
    if( cudaSuccess != err)
    {
    fprintf(stderr, "Cuda error: %s: %s.\n", msg, cudaGetErrorString( err) );
    exit(EXIT_FAILURE);
    }
    }

    #######################################################
    g) now you have to change the Project properties.
    Right click the project and select properties.
    g.1) Select C/C++ Build options.
    Deselect the option "Use default build command".
    Then, on the Build command input field enter:
    For release mode let the field with "make" unchanged.
    For debug mode enter "make dbg=1" (Use customarily this option)
    For debug emulation mode enter "make dbg=1 emu=1"
    (this enables the user to acces GPU functions when debugging
    Notice that that the used compiler for GPU functions is not nvcc but gcc)
    For emulation mode enter "make emu=1".
    	g.2) Still in the C/C++ Build options, 
    Switch to tab "Behaviour"
    Empty the textboxes next to Build (Incremental build) and Clean [delete "all" and "clean"]
    (located at the bottom of :Workbench Build Type" area)
    Select the line "Discovery options" under the menu C/C++ Build
    set the Discovery profile to "GCC per project scanner info profile"
    g.3) At C/C++ General
    Select the line "Paths and symbols" under the menu and
    switch to the tab "Library Paths". Click on Add and enter "$LD_LIBRARY_PATH".
    Select the box "Add to all configurations"
    At last click ok to close this tab, and again to close the "Paths and symbols window"
    g.4) Ctrl + b to Build Project

    h) Now create a debug profile for this project (assuming the executable could be produced).
    h.1) Right click the Project option and select "Debug As..">"Open Debug Dialog...".
    Double left-click on C/C++ Local Application to add a new debug configuration

    h.2) Select the new configuration and then in the line "C/C++ Application:"
    click "Browse..." and select the executable from your filesystem.
    [it should be here "/home/username/NVIDIA_GPU_Computing_SDK/C/bin/linux/release/"]

    h.3) Now switch to the tab common and select in the box "Display in favorites menu" the
    checkbox for Debug. Press Apply and close the window.

    i) Press F11 to start the program or select the start configuration from the "bug" button
    in the shortcut menu.
    Then you have the following options:

    RUN dialog give the different opportunities
    F8 from break point to break point (or end)
    F6 execute stepwise
    F5 step into function


    Thanks bin04017 @ gmail.com for his/her instructions from nvidia forum.
    8/18/2009

    CUDA on ubuntu 9.04

    My steps are:

    1. install the 2.6.28.11 server;
    2. without install gnome, "sudo apt-get install build-essential linux-headers-`uname -r`"
    3. wget the cuda 2.3 driver for ubuntu 9.04
    4. at this moment, since no gnome installed, no X-server is on, "sudo sh NVIDIA_LONG_NAME_64_BIT_DRIVER.run"
    5. It asked me if I would like to install 32 bit compatible OPEN GL library, i said yes
    6. Installed Nvidia driver sucessfully
    7. install gnome
    8. reboot
    9. in gnome, run "sudo nvidia-xconfig"

    After done with above, go to System -> Preferences -> Display, it would say something about some feature is not there, it asks whether you want to use alternative driver from your graphics card. Choose "YES", then you can see the Nvidia X driver Utilities Panel

    ONE MORE THING: after changing all the display settings, you would like to save that xorg.config, but the system would tell you it could not remove/create xorg.config.backup. What I did was, clicked on the preview settings, and copied the whole thing, manually changed xorg.config by editor.

    And now you can reboot, and you will see the display setting is still there!

    Add /usr/local/cuda/bin to $PATH, /usr/local/cuda/lib64 to $LD_LIBRARY_PATH, ~/NVIDIA_GPU_Computing_SDK/C to  $NVSDKCUDA_ROOT.You should put them into ~/.bashrc to make it permernant!

    Added some lib such as libglut3, libxi and libmu to make the "make" under SDK run) 
    Then CUDA SDK samples all worked on my system!

    It's time to get some my own test code running!
    8/11/2009

    成渝铁路:新中国的第一条铁路[组图](ZZ)

    才知道是第一条!一定要转



    2009年08月11日 15:07:32  来源:新华网

        1952年7月1日,成渝铁路全线通车。图为由成都驶往重庆的第一列火车出站。

        中国地大物博,铁路作为国家重要基础设施,国民经济的大动脉、大众化的交通工具,在经济社会发展中发挥着巨大作用。而在纵横交错的铁路线中,有一个令新中 国铁路建设者们振奋且永远不能忘怀的名字,它在中国铁路发展史上具有极其重要的意义,因为它是新中国自行修建的第一条铁路——成渝铁路。这是中国自行设计 施工,完全采用国产材料修建的第一条铁路,是中国铁路史上的一个创举。

        成渝铁路线西起成都,东抵重庆,全长505公里,作为中国西南地区第一条铁路干线,是连接川西、川东的经济、交通大动脉。新华社发

        1952年7月1日由重庆开出的第一列火车,在2日上午11时5分到达成都车站,受到川西区和成都市各界人民5万余人的热烈欢迎。    新华社发
    8/1/2009

    2009黄石游(新增照片注释)

      
    6/2/2009

    Cool 5D II video "Timescapes Timelapse: Learning to Fly"

      

    Timescapes Timelapse: Learning to Fly from Tom @ Timescapes on Vimeo.

    digg:

    http://digg.com/design/Absolutely_Stunning_Timelapse_Learning_To_Fly

    some stuff shot on the Canon 5D Mark II DLSR this Winter/Spring 2009.

    To contact author:

    http://www.timescapes.org/contact.html

    Here is a direct link to download the 1080p MOV. It's H264, 352MBs...

    http://www.timescapes.org/LearningtoFly1080.mov

    You'll need a powerful computer and 1080p screen to view it.

    http://twitter.com/timescapes


    5/27/2009

    没有看到比赛,贴个高光

    Barcelona v Manchester United
     
    4/5/2009

    哎呀,老虎不发威你拿我当HOLLE KITTY是不是?小驴不说话你拿我当SNOOPY啊?

    哎呀 老虎不发威 你拿我当HOLLE KITTY是不是?小驴不说话你拿我当SNOOPY啊?
    天晴了 雨停了 你又觉得你行了,人间大道你说你怎么咋就不去走呢?
    五员人民币就是说你这种没实力,拿着别人的作品硬说是自己的创意
    别再欺骗自己 那不是你的实力,也许你自己的无能使你这么没有自信
    只会偷别人的抄袭 那没有任何意义,真正的作者在这里 你不用那么神秘
    你从小缺盖 长大缺爱 腰系麻绳 头顶锅盖,还说你是中国说唱界的东方不败
    你长的挺有创意 活得挺有勇气,丑不是你的本意 是上帝发的脾气
    你活着浪费空气 死了浪费土地,掘B的浪费人民币
    如果没有你的存在怎么能衬托世界的美丽,如果没有你的存在怎么能衬托LM的美丽
    你靠山山倒 靠河河干 看鸡鸡死 看狗狗翻,还要杨起HIP-HOP的一片风帆
    你还整个你的名字叫做旷云 你不如叫做矿井,你妈叫做旷课 你爸叫做矿工
    你还起名叫做 云上舞 你不如叫过街老鼠,我写啥 你抄啥 你还真是有点土
    你语言没有杀伤力 拿着5个大硬币,看场三毛流浪记 一天活得还挺满意
    没事喝着小酒 然后迈着犬步,梳着伤心的发型 走在乡间的小路
    还硬说你那个让人踢碎的嗓子唱歌像TM阿杜,(这小子那天在网吧上网 然后给人发视平
    人家网管告诉他防火墙不同发不了,他还一下跟人网管急了 哪个是防火墙 防火墙在哪呢
    我要给它扒了 我要看人,你这个老顿迷糊 那个嘴笨的跟棉裤裆似的
    还天天在那汪汪汪汪汪汪汪还这RAP 那RAP的)

    还有一个三级模特 自以为很挺独特,身上的避孕工具更不只一个两个
    她需要让人养着 不需要让人管着,她嫉妒心随着 春季之们常开着
    她打扮比鬼难看 一打扮鬼都瘫痪,你说你该怎么办
    你说身高是你的优势 丰满是你的标志,为啥一说话就像是孩子弱了智
    你说有钱人就是机智 没钱人就是幼稚,那我的钱和你比 你简直就是精致
    你还在那跟我在这吹你奶奶个哨子,她家那穷的
    交通基本靠走,通信基本靠吼
    取暖基本靠抖,治安基本靠狗
    你说你还怎么说的出口,真是在大众面前献丑
    你头上插个鸡毛掸子 没事包个狗皮毯子,近看像个铅笔杆子 远看像个铁皮铲子
    HEY What's Up Girl,真的有句话想对你说 你想知道吗?
    那我就告诉你 你XX 狗XX,(你说你家穷那个样 你说你拿个小灵通 你站在风雨中
    左手换右手 你还右手打不通 耗子去你家都含眼泪走的,这样你还说你男朋友长的帅 有钱 长的是有前
    长的跟前列腺似的 尿尿都分岔了 赶紧给治治吧,还白呼啥呀)

    还有人天天在那告诉我什么才是真正的嘻哈,问我听了他那个撒尿的音乐到底哈不哈
    什么刀枪棍棒斧岳钩* 烧饼油条包子麻花,我看你就像一个纯种荷兰傻瓜
    YO !·#¥%……—*()——~#%¥……%%…………—*
    我也不知道,听不惯的 有意见的 都闭上你的嘴
    让我发现了那就是给你们一顿堆,HIP-HOP不是COOL 它是一种态度
    为啥你们总三翻五次的老犯错误,炫耀过度 还是你根本没穿内裤
    为啥总感觉你没走寻常路呢,上有天 下有地 中间有空气
    歌里有了你们的参与那才算是有了完整意义,这回给你们点脸 希望你们长点记性
    别以为这样很不公平,其实是你们真的不行,大萝卜坐飞机你在那给冒充进口大苹果呢
    老强调自己有智商 这回真的让我给治伤了是不是?

    写这点玩意给我累坏了 两管笔都写没油了,TOMMY哥在最后再整两句?
    整两句 整啥呢 拉倒吧 就这么结束吧,老整两句多俗啊 就这样挺好的 行不行?

    那也行!
    3/14/2009

    托雷斯进球 = 利物浦必胜

    不错!红军这场打ManU打得很漂亮!

    刚洗刷了皇马,又4:1胜ManU(而且还是被先进一点球)终结其连胜不败继续,两场托雷斯都是先进球,托雷斯进球 = 利物浦必胜!而且此赛季双杀ManU,Chelsea

    红军现在状态太猛了!继续加油!托+杰组合继续加油!

      
    3/12/2009

    欧冠高潮迭起

    16进8

     

    最闪亮的两场

    红军横扫银河战舰,5:0打得对手没有脾气,托+杰组合让红军闪亮冠军风范

    拜仁5:0和7:1两场总分12:1屠杀对手

     

    其它

    蓝军 3:2 淘汰老妇人,希丁克阿希丁克,难道你的传奇还会继续?

    ManU 神7进球了,2:0 灭国米,最后狂人还是扛不住福格森,只能低头

    巴萨 摆脱了水土不服的亨利大帝的梅开二度送“亲戚”回家了,而且亨利大帝史诗进球(50球)也超越了皇马传奇,欧冠总破门排名历史第四,落后于舍瓦(56球),范尼(60球),劳尔(64球)

    枪手客场1:0被拖入点球大战,第一轮球被对方门将扑出的压力下,8轮过后总分8:7淘汰对手,托内托的高射炮太强大,葬送了罗马连续三赛季进入八强的资格

    波尔图凭借客场进球多2:2总分将床单军挤出八强

    潜水艇2:1挺进八强

    image

    欧冠8强英超占据半壁江山,意甲全军覆没。。。

     

    最新的夺冠赔率

    欧冠8强最新赔率

    ManU居首,和第二的巴萨相当,而且前五大热门球队英超拥有四席,这是何等的强大,4强之争会更加激烈。。。

     

    个人觉得ManU有可能拿到5冠,但是难度很大,红军的表现应该会起决定性的作用(期待马上开始的英超 ManU 和 红军 的对决)

     

    现阶段调查一下大家的看法:

      • 巴萨 会不会像07年的米兰在英超球队的包夹中成功突围?
      • 梅西 会成为本届最佳射手吗?
      • 拜仁 还能踢出对 里斯本 的那种酣畅淋漓吗?
      • 潜水艇 和 波尔图 会成为黑马吗?
      • ManU 和 红军 会在决赛中相遇吗?ManU 会2连冠,还是 红军 会光环再现?

     

    无论如何这些问题慢慢会有答案。。。大家拭目以待吧!

    2/26/2009

    The BlackBerry Storm ad that might have been

     
    2/18/2009

    My fitness coach 很好很强大!

    一直都以为Wii fit是很能够锻炼人的了,原来不需要wii fit balance board的my fitness coach也很强大。
     
    刚刻出D版的(有D版玩就是好),昨天晚上拿出来试试,还没有进行workout,只是建立一个profile,进行了里面所有项目的test就让我的全身上下酸到了今天,本来打算今天去游泳的也只有改到下周了。。。
     
    这个游戏虽然说不需要balance board,但是可以加入哑铃,健身球,踩踏板等等等等,瑜伽,有氧,上身训练,下身训练都有,而且不同的人(就是不同的Profile它有不同的recommendation,需要做什么练习,一周几天,每天多长时间都计划好了,只要是跟着练还是因该很有效果的。
     
    像我这样一周也就去游泳40分钟的,这个游戏是很适合玩的,算是一个私人的电子健身教练了。
     
    昨天只测试了所有的profile test没有体力玩workout了,今天继续跟着它设计的健身计划练练,看看还有没有什么出彩的地方,好像有group worlkout还是灰色的,现在还不知道怎么才能unlock。
     
    有兴趣听的我可以回来报告一下,没人有兴趣那就算了。。。谁想试试的可以找我啊,iso或者是DVD-rom都可以提供
     
    恩,my fitness coach也忒强大了!
    2/3/2009

    居然有Mario Rap!

     
    1/31/2009

    一道有点难理解的概率问题

    我想了很久,而且看过了答案,才勉强觉得想通,你们大家都看看。

    问题:
    一个live show,一位主持人,一位参赛者,三扇门(一扇门后面有奖品:车,其他的都是羊)
     
    1、三扇门,后面有两个是羊,一个是车。参赛者在三扇门中挑选一扇。他并不知道内里有甚么。
    2、主持人知道每扇门后面有什么。
    3、主持人必须开启剩下的其中一扇门,并且必须提供换门的机会。
    4、主持人永远都会挑一扇有羊的门。
    5、如果参赛者挑了一扇有羊的门,主持人必须挑另一扇有羊的门。
    6、如果参赛者挑了一扇有车的门,主持人随机在另外两扇门中挑一扇有羊的门。
    7、参赛者会被问是否保持他的原来选择,还是转而选择剩下的那一道门。

    那么请问参赛者是否要选择换门呢?也就是说请大家算算换门后得到车的概率是多少?(如果可以,请详细地给出你的解释)Smile
    1/29/2009

    金融危机后的大公司LOGO (转载)

    收到朋友的一个MAIL,恶搞了一把各大公司的LOGO。被金融危机重创的这些知名大公司,几家欢乐几家愁?

    Received the following mail. i think it is cool

    The 2008 crash is probably the most serious economic crisis we have faced after the Great Depression. Stock markets from around the world fell as much as 20% in a single week, dozens of banks either failed or were rescued by government and private institutions, and companies started laying off employees as a consequence of the reduced demand.

    We know how we entered into the crisis, but we don’t how, when, or how we will be getting out of it. Considering that issue, we decided to our little bit to help cheer everyone up by redoing the logos of some renowned companies …. after the crisis.

     image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    image

    12/17/2008

    心 * 跳 (Youtube高清晰MV)

      
    终于出了高清晰MV

    人的心,是一个很神奇的东西

    可以带来无限的喜悦或无限的伤痛

    MISTs

    Crabs That Fib

    Picture of crab

    You talkin' to me? Male fiddler crabs pick fights, even if they know their replacement claws put them at a disadvantage.

    So That's Why Chickens Have Combs

    Picture of lizard

    Beneath the skin. Reptiles, like this green anole lizard, make hair proteins, but they use them for claws instead.

    ......Hair-keratin genes likely evolved before the split between mammals and reptiles. The common ancestor of mammals, birds, and reptiles would have had hair-keratin genes, probably expressed in skin and claws. After the separation, reptiles developed their own variants of hair keratins, while mammals adapted the genes to create hair.

    Denis Headon, who studies skin development at the University of Manchester in the U.K., says that the study shows "that the components required to make hair fibers were already encoded in the premammalian genome." The remaining question, he adds, is the origin of the follicle, the assembly unit of mammalian hair, which is absent in birds and reptiles. ......

    10/31/2008

    万圣节,一起“鬼”混吧!

     奔一张我家胖子的小蜜蜂costume的PP

    还有今年刻的南瓜(北京奥运标志)