None of the string methods modify this
– they always return fresh strings.
-
charAt(pos: number): string
ES1Returns the character at index
pos
, as a string (JavaScript does not have a datatype for characters).str[i]
is equivalent tostr.charAt(i)
and more concise (caveat: may not work on old engines).
func TestRedis(t *testing.T) { | |
s, _ := testutil.PrepareTestRedis() | |
for i := 0; i < 10000; i++ { | |
s.Set("key"+strconv.Itoa(i), "hoge"+strconv.Itoa(i)) | |
} | |
client := redis.NewClient(&redis.Options{Addr: s.Addr()}) | |
// 普通にループ | |
result := map[string]string{} | |
for i := 0; i < 10000; i++ { |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
var Backbone = require('backbone'); | |
// Flash /////////////////////////////////////////////////////////////////////////////////////////// | |
// The flash is a way for one controller to pass a small amount of information to the next | |
// controller, through a navigation event. | |
// | |
// The flash holds arbitrary parameters, and is cleared by the router after each navigation event. | |
var flash = exports.flash = { | |
params: {}, |
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
// # Mocha Guide to Testing | |
// Objective is to explain describe(), it(), and before()/etc hooks | |
// 1. `describe()` is merely for grouping, which you can nest as deep | |
// 2. `it()` is a test case | |
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
// before/after first/each it() or describe(). | |
// | |
// Which means, `before()` is run before first it()/describe() |