>>> YieldNull
  • /blog
  • /archives
  • /github
  • /about

Blog Entries all / by tag / by year

  • CSAPP Bomb Lab

    2017-07-24 00:11:26 / CSAPP /6581 hits

    CSAPP Bomb Lab V.2016.01.12

    $ ./bomb inputs.txt 
    Welcome to my fiendish little bomb. You have 6 phases with
    which to blow yourself up. Have a nice day!
    Phase 1 defused. How about the next one?
    That's number 2.  Keep going!
    Halfway there!
    So you got that one.  Try this one.
    Good work!  On to the next...
    Curses, you've found the secret phase!
    But finding it and solving it are quite different...
    Wow! You've defused the secret stage!
    Congratulations! You've defused the bomb!
    

    Read more...


  • FoldLeft Via FoldRight

    2017-07-22 12:26:43 / FP Scala /1269 hits

    怎么用FoldRight实现FoldLeft呢?两个函数的签名如下

    def foldLeft[A,B]: (List[A], B) => ((B, A) => B) => B
    
    def foldRight[A,B]: (List[A], B) => ((A, B) => B) => B
    

    Read more...


  • CSAPP Data Lab

    2017-07-19 21:21:54 / Computer CSAPP /10283 hits

    CSAPP Data Lab V.2016.05.04。

    $ ./btest 
    Score   Rating  Errors  Function
     1  1   0   bitAnd
     2  2   0   getByte
     3  3   0   logicalShift
     4  4   0   bitCount
     4  4   0   bang
     1  1   0   tmin
     2  2   0   fitsBits
     2  2   0   divpwr2
     2  2   0   negate
     3  3   0   isPositive
     3  3   0   isLessOrEqual
     4  4   0   ilog2
     2  2   0   float_neg
     4  4   0   float_i2f
     4  4   0   float_twice
    Total points: 41/41
    

    Read more...


  • 斐波那契数的递归求法

    2017-07-01 17:03:41 / Algorithm /1271 hits

    斐波拉契数列,即形如0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89...,通项公式为An = An-1 + An-2的数列。那么怎么用递归的方式求出指定位置的斐波拉契数呢?

    Read more...


  • Python3 Truth Value Testing and Boolean Operations

    2017-05-29 23:49:13 / Python /1147 hits

    之前一直以为Python中and、or 这两个表达式的返回值是True 或者 False,今早帮同学解答问题时才发现之前的理解是错误的。

    Read more...


  • Java字符串编码方式

    2017-05-12 11:03:22 / Encoding Java /2071 hits

    想要运行一个Java程序需要经过三个阶段:编写源代码—编译—在JVM上运行。那么一个字符串在以上三个阶段的编码方式是怎样的呢?另外,如果Java程序中要输出字符串,那么输出的字符串的编码又是什么呢?

    Read more...


  • « Previous 3 / 11
  • Next 5 / 11 »

About this site © YieldNull, . 鄂ICP备16003391号