33 Matching Annotations
  1. Apr 2024
  2. Mar 2024
  3. Dec 2023
  4. Mar 2023
  5. Dec 2022
  6. Sep 2022
    1. To see how this plays out, we can continue looking at matrix shapes. Tracing the matrix shape through the branches and weaves of the multihead attention blocks requires three more numbers. d_k: dimensions in the embedding space used for keys and queries. 64 in the paper. d_v: dimensions in the embedding space used for values. 64 in the paper. h: the number of heads. 8 in the paper.
  7. Apr 2022
    1. Favor std::array, std::vector, or std::string over a smart pointer managing a fixed array, dynamic array, or C-style string.

      对于固定的 array,动态 array 和字符串,更推荐使用哪种类型?

  8. Feb 2022
    1. To manage a variable-size stack frame, x86-64 code uses register %rbp to serveas a frame pointer

      frame pointer 什么情况下会使用?

    2. The array elements areordered in memory in row-major order, meaning all elements of row 0, whichcan be written A[0], followed by all elements of row 1 (A[1]), and so on.

      array 在 memory 中的排列顺序是怎么样的?

  9. Jun 2021
    1. You can use jsonb_agg and jsonb_array_elements_text to flatten or unnest an array of arrays in PostgreSQL: SELECT jsonb_array_elements_text(jsonb_agg(array_of_arrays)) FROM x;
    1. As stated in the title, I am in a situation where I need to return a count of occurrences within an array, that is within a jsonb column.
    1. json_array_elements_text ( json ) → setof text jsonb_array_elements_text ( jsonb ) → setof text Expands the top-level JSON array into a set of text values. select * from json_array_elements_text('["foo", "bar"]') → value ----------- foo bar
  10. May 2021
  11. Mar 2021
  12. Sep 2020
  13. Aug 2020
  14. May 2020
    1. 通常,Arrays用于两种数据结构:queue和stack。 要了解什么queue是食品,您可以想象在食品商店中有一个普通的队列:新人们在队列的末端加入队列,而刚开始的人们则先离开队列。这就是为什么我们需要两种方法来实现的原因queue:一种在的末尾添加元素,Array而另一种在的开始处删除元素的方法queue。这两种方法是push()将一个或多个元素添加到数组的末尾并返回新的数组长度,并shift()删除数组的第零个元素并返回其值:
    2. The slice() method works only with arrays whose elements are strings, numbers, or boolean values.

      只有字符串,数字,布尔值三种类型的数组可以用 slice 操作

    3. Indexes can also be negative. If you specify a negative index in the first parameter, it will shift the end of the sequence. For example, slice(-4) call will extract the last four elements of the sequence:

      index 可以是复数,arr.slice(-4)代表从倒数第四个值到最后

    4. The slice() method does not change the source array, but returns a copy of the array

      slice()方法是个纯函数

    1. function foo { local -n data_ref=$1 echo ${data_ref[a]} ${data_ref[b]} } declare -A data data[a]="Fred Flintstone" data[b]="Barney Rubble" foo data

      best way to pass associative arrays as function argument in bash

  15. Feb 2020
    1. head(as.data.frame(nasa))#> lat long month year cloudhigh cloudlow cloudmid ozone pressure #> 1 36.20000 -113.8 1 1995 26.0 7.5 34.5 304 835 #> 2 33.70435 -113.8 1 1995 20.0 11.5 32.5 304 940 #> 3 31.20870 -113.8 1 1995 16.0 16.5 26.0 298 960 #> 4 28.71304 -113.8 1 1995 13.0 20.5 14.5 276 990 #> 5 26.21739 -113.8 1 1995 7.5 26.0 10.5 274 1000 #> 6 23.72174 -113.8 1 1995 8.0 30.0 9.5 264 1000 #> surftemp temperature #> 1 272.7 272.1 #> 2 279.5 282.2 #> 3 284.7 285.2 #> 4 289.3 290.7 #> 5 292.2 292.7 #> 6 294.1 293.6

      unrolling a tbl_cube into 2 dimensions (data.frame)

  16. Aug 2019
  17. Mar 2018
  18. Jan 2018
  19. Apr 2017
    1. array with component type int

      My only suggestion is that this should be changed to single-dimension array with component type int. As per the Encoding conventions defined by java.lang.Class#getName()'s contract.

      In other other words, the OP missed the fact that for every dimension of the array-object, an [ character is prepended to the enconding of the type contained in the array.

  20. Mar 2015