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
func TestMe(t *testing.T) { | |
var primes int | |
for i := 2; i < 1e7; i++ { | |
if isPrime(i) { | |
primes++ | |
// fmt.Printf("%d is prime. Congrats!\n", i) | |
if primes == 10_001 { | |
fmt.Printf("%d th prime is %d\n", primes, i) | |
break | |
} |
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 ( | |
"context" | |
"crypto/ecdsa" | |
"fmt" | |
"github.com/ethereum/go-ethereum/crypto" | |
"github.com/ethereum/go-ethereum/ethclient" | |
"os" | |
) |
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 server | |
import ( | |
"context" | |
"fmt" | |
"io" | |
"net/http" | |
"testing" | |
"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
package main | |
import ( | |
"context" | |
"crypto/tls" | |
"flag" | |
"fmt" | |
"github.com/davecgh/go-spew/spew" | |
sdk "github.com/tinkoff/invest-api-go-sdk" | |
"google.golang.org/grpc" |
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 ( | |
"bufio" | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
"regexp" | |
"strings" |
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
set hlsearch " highlight all search results | |
set ignorecase " do case insensitive search | |
set incsearch " show incremental search results as you type | |
set number " display line number | |
set noswapfile " disable swap file ??? |
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
FROM ubuntu | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update && \ | |
apt-get install -y curl git php python php-xml libtool m4 automake pkg-config g++ make | |
# Install composer | |
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ | |
php -r "if (hash_file('sha384', 'composer-setup.php') === 'c31c1e292ad7be5f49291169c0ac8f683499edddcfd4e42232982d0fd193004208a58ff6f353fde0012d35fdd72bc394') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ |
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
service Kirugan { | |
void ping(); | |
set<i32> doit(); | |
} |
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
#include <iostream> | |
template<std::size_t T> | |
struct FixedPoint { | |
static constexpr int Size = T; | |
int value; | |
static_assert(Size < sizeof(value) * 8); | |
}; | |
constexpr FixedPoint test(double 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
int main() { | |
auto a = new int[1000]; | |
a[500] = 33; | |
auto b = new(a) int[1000]; | |
std::cout << b[500] << std::endl; | |
return 0; | |
} |
NewerOlder