77 Matching Annotations
  1. Last 7 days
  2. Aug 2019
  3. Jun 2019
  4. Mar 2019
    1. A Gentle Tutorial of Recurrent Neural Network with ErrorBackpropagation

      A Gentle Tutorial of Recurrent Neural Network with ErrorBackpropagation

    1. Revisiting the tree edit distance and its backtracing: A tutorial

  5. Feb 2019
  6. Jan 2019
    1. Fitting A Mixture Distribution to Data: Tutorial

      目测是一篇很有爱的教程!

  7. Oct 2018
    1. 可以使用内建函数 make 也可以使用 map 关键字来定义 Map:
      // 声明变量,默认 map 是 nil
      var map_variable map[key_data_type]value_data_type
      
      // 使用make 函数
      map_variable := make(map[key_data_type]value_data_type)
      
    1. /* 打印子切片从索引 0(包含) 到索引 2(不包含) */ number2 := numbers[:2] printSlice(number2) /* 打印子切片从索引 2(包含) 到索引 5(不包含) */ number3 := numbers[2:5] printSlice(number3)
      numbers := []int{0,1,2,3,4,5,6,7,8}
      

      len=2 cap=9 slice=[0 1]

      len=3 cap=7 slice=[2 3 4]

    2. 通过内置函数make()初始化切片s,[]int 标识为其元素类型为int的切片
      s := make([]int, len, cap)
      
    3. 初始化切片s,是数组arr的引用
      s := arr[:]
      
    1. /* 未定义长度的数组只能传给不限制数组长度的函数 */ setArray(array) /* 定义了长度的数组只能传给限制了相同数组长度的函数 */ var array2 = [5]int{1, 2, 3, 4, 5}
      func setArray(params []int) {
          fmt.Println("params array length of setArray is : ", len(params))
      }
      
      func setArray2(params [5]int) {
          fmt.Println("params array length of setArray2 is : ", len(params))
      }
      
    1. 注意:以上代码中倒数第二行的 } 必须要有逗号,因为最后一行的 } 不能单独一行,也可以写成这样:
      a = [3][4]int {
          {0, 1, 2, 3} ,
          {4, 5, 6, 7} ,
          {8, 9, 10, 11} ,    // 此处的逗号是必须要有的
      }
      

      上面代码也可以等价于

      a = [3][4]int {
          {0, 1, 2, 3} ,
          {4, 5, 6, 7} ,
          {8, 9, 10, 11}}
      
    1. func getSequence() func() int { i:=0 return func() int { i+=1 return i } }

      闭包,A函数 返回一个函数,假设返回的函数为B,那么函数B,可以使用A函数中的变量

      nextNumber := getSequence()

      nextNumber 是 返回函数B类型,func() int,i是函数A中的变量,初始值 i=0

      执行nextNumber(),i+=1, reuturn i ==> 1

      再执行nextNumber(),i+=1,return i ==> 2

      再执行nextNumber(),i+=1,return i ==> 3

    1. for 循环的 range 格式可以对 slice、map、数组、字符串等进行迭代循环。
      for key, value := range oldMap {
           newMap[key] = value
      }
      
    1. 以下描述了 select 语句的语法
      • 每个case都必须是一个通信
      • 所有channel表达式都会被求值
      • 所有被发送的表达式都会被求值
      • 如果任意某个通信可以进行,它就执行;其他被忽略。
      • 如果有多个case都可以运行,Select会随机公平地选出一个执行。其他不会执行。

      否则:

      1. 如果有default子句,则执行该语句。
      2. 如果没有default字句,**select将阻塞,直到某个通信可以运行**;Go不会重新对channel或值进行求值。
      
    1. iota 表示从 0 开始自动加 1,所以 i=1<<0, j=3<<1(<< 表示左移的意思),即:i=1, j=6,这没问题,关键在 k 和 l,从输出结果看 k=3<<2,l=3<<3。
      package main
      import "fmt"
      const (
          i=1<<iota
          j=3<<iota
          k
          l
      )
      func main() {
          fmt.Println("i=", i)
          fmt.Println("j=", j)
          fmt.Println("k=", k)
          fmt.Println("l=", l)
      }
      

      以上实例运行结果为:

      i=1
      j=6
      k=12
      l=24
      
    1. 这种因式分解关键字的写法一般用于声明全局变量
      var (
          vname1 v_type1
          vname2 v_type2
      )
      
    1. 以一个大写字母开头,如:Group1,那么使用这种形式的标识符的对象就可以被外部包的代码所使用(客户端程序需要先导入这个包),这被称为导出(像面向对象语言中的 public)
    2. main 函数是每一个可执行程序所必须包含的,一般来说都是在启动后第一个执行的函数(如果有 init() 函数则会先执行该函数)
  8. Sep 2018
    1. The evidence strongly suggests that the Canadiens adopted a casual attitude toward the clergy, which could (and did) sometimes express itself as contempt

      I wonder if this contrasts with early settlers in the American colonies. and if there was some sort of historical reason why contemporary Canada is a more secular country, while the USA is still largely religious.

  9. Jul 2018
  10. Mar 2018
  11. Feb 2018
  12. Jul 2017
  13. Jun 2017
  14. Mar 2017
  15. Feb 2017
    1. Video tutorial from Jun 2016 showing how to use Hypothesis to annotate a Wikipedia page.

      It briefly shows groups and the stream, but using the old (pre-Nov 2016) Hypothesis website.

  16. Jan 2017
  17. Jun 2016
  18. Jan 2016
    1. slack-invite-script

      Much thanks to @dherbst for creating this—a very useful tool for Slack, which doesn't currently let users sign themselves up for your teams. I used this for the Digital Humanities Slack (tinyurl.com/dhslack) invite form.

      Unfortunately, I neglected to note how I did the one fiddly part when following these instructions—finding your Slack channel code—and some colleagues are now stuck on getting that part to work. I've tried to annotate these docs with more info and questions to help others use them, too.

    2. in getMyHost() fill in your slack domain

      Replace the URL in line 3 of code.js. Should take the form: yourslackteamname.slack.com

    3. fill in your slack api token

      Replace the fill_in_your_api_token in Line 8 with your token (should look like a longish number/letters)

    4. fill in the channel you want to send updates to

      I remember this part took me a bit to figure out, and now I can't remember what I did to see my Slack team's channel codes. Anyone have more specific instructions for finding your channel codes?

  19. Oct 2015
  20. Aug 2015
    1. R Grouping functions: sapply vs. lapply vs. apply. vs. tapply vs. by vs. aggregate var ados = ados || {}; ados.run = ados.run || []; ados.run.push(function () { ados_add_placement(22,8277,"adzerk794974851",4).setZone(43); }); up vote 463 down vote favorite 606 Whenever I want to do something "map"py in R, I usually try to use a function in the apply family. (Side question: I still haven't learned plyr or reshape -- would plyr or reshape replace all of these entirely?) However, I've never quite understood the differences between them [how {sapply, lapply, etc.} apply the function to the input/grouped input, what the output will look like, or even what the input can be], so I often just go through them all until I get what I want. Can someone explain how to use which one when? [My current (probably incorrect/incomplete) understanding is... sapply(vec, f): input is a vector. output is a vector/matrix, where element i is f(vec[i]) [giving you a matrix if f has a multi-element output] lapply(vec, f): same as sapply, but output is a list? apply(matrix, 1/2, f): input is a matrix. output is a vector, where element i is f(row/col i of the matrix) tapply(vector, grouping, f): output is a matrix/array, where an element in the matrix/array is the value of f at a grouping g of the vector, and g gets pushed to the row/col names by(dataframe, grouping, f): let g be a grouping. apply f to each column of the group/dataframe. pretty print the grouping and the value of f at each column. aggregate(matrix, grouping, f): similar to by, but instead of pretty printing the output, aggregate sticks everything into a dataframe.] r sapply tapply r-faq

      very useful article on apply functions in r

  21. May 2015
  22. berkelee.wordpress.com berkelee.wordpress.com
    1. Hypothes.is says its mission is to bring a new layer to the web, allowing you to annotate and share anything on the Internet. You can also see and respond to other people’s public or shared comments, creating online conversation and a system of peer review for online content. I created a quick video tutorial in Quicktime, shared above.

      Watch a quick video tutorial of hypothes.is here.

  23. Apr 2015
    1. Outside the triple, information is lost and a literal is just data without any meaning.

      That does seem to be a problem.

    2. hey can not be subjects in RDF triples – they are always the objects used to describe a resource.
    3. Literals are nodes in an RDF graph, used to identify values such as numbers and dates by means of a lexical representation.

      Yeah! At last a definition I can understand!

  24. Jan 2015
    1. Edit, Compile, Execute and Share your C, C++, Java, Python, Perl, PHP, Node.js, Javascript, HTML-5 or any project in your social networks using simple links.

      Online kodlama, tutorial tüm diller var