This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`Bài 1: https://leetcode.com/problems/divide-two-integers/description` | |
Có 2 cách cơ bản để biểu diễn một số | |
1. N = a1^b1 a2^b2 ... an^bn trong đó a1 .. an là các số nguyên tố | |
2. N = 2^0 * a0 + 2^1 * a1 + ... | |
Để tính giá trị của phép chia X / Y chẳng hạn. Ta giả sử giá trị này là Z, vì vậy X = Y * Z + số dư. | |
Biểu diễn Z dưới dạng nhị phân Z = 2^0 * a0 + ... 2^n * an. Ta có: X = Y * (2^0 * a0 + ... + 2^n * an) + số dư. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.stream.Collectors; | |
public class bench { | |
public static int numRequest = 100000; | |
public static int numEndpoints = 500; | |
public static void main(String[] args) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
const ( | |
numberOperations = 100000000 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"sync" | |
"time" | |
"github.com/m3db/m3db/src/dbnode/client" | |
"github.com/m3db/m3db/src/dbnode/sharding" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coordinator: | |
listenAddress: 0.0.0.0:7201 | |
metrics: | |
scope: | |
prefix: "coordinator" | |
prometheus: | |
handlerPath: /metrics | |
listenAddress: 0.0.0.0:7203 # until https://github.com/m3db/m3db/issues/682 is resolved | |
sanitization: prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reporting-disabled = true | |
[meta] | |
# Where the metadata/raft database is stored | |
dir = "/Users/gnu/.influxdb/meta" | |
# Automatically create a default retention policy when creating a database. | |
# retention-autocreate = true | |
# If log messages are printed for the meta service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"sync" | |
"time" | |
"github.com/influxdata/influxdb/client/v2" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"math/rand" | |
"net/http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"io/ioutil" | |
"net/http" | |
"sync" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2019 LINE Corporation | |
// | |
// LINE Corporation licenses this file to you under the Apache License, | |
// version 2.0 (the "License"); you may not use this file except in compliance | |
// with the License. You may obtain a copy of the License at: | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
OlderNewer