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
#### work | |
import typing as t | |
import asyncio | |
RateResult = t.Callable[..., t.Coroutine[t.Any, t.Any, None]] | |
def rate_limit_builder(count_limit: int, time_period: int) -> RateResult: |
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
############ 1 | |
UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 < 100; | |
QUERY PLAN | |
-------------------------------------------------------------------------------------------------------------------------------- | |
Update on tenk1 (cost=5.07..229.46 rows=101 width=250) (actual time=14.628..14.628 rows=0 loops=1) | |
-> Bitmap Heap Scan on tenk1 (cost=5.07..229.46 rows=101 width=250) (actual time=0.101..0.439 rows=100 loops=1) | |
Recheck Cond: (unique1 < 100) | |
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101 width=0) (actual time=0.043..0.043 rows=100 loops=1) |
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
QUERY PLAN | |
— Index Scan using foo_c1_idx on foo (cost=0.42..34623.01 rows=999519 width=37) (actual time=0.178..1018.045 rows=999500 loops=1) | |
Index Cond: (c1 > 500) | |
Total runtime: 1434.429 ms | |
(3 rows) | |
QUERY PLAN | |
— Seq Scan on foo (cost=0.00..20834.12 rows=999522 width=37) | |
Filter: (c1 > 500) |
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 company.evo.elasticsearch.rescore; | |
import org.elasticsearch.common.ParseField; | |
import org.elasticsearch.common.ParsingException; | |
import org.elasticsearch.common.io.stream.StreamInput; | |
import org.elasticsearch.common.io.stream.StreamOutput; | |
import org.elasticsearch.common.xcontent.ConstructingObjectParser; | |
import org.elasticsearch.common.xcontent.XContentBuilder; | |
import org.elasticsearch.common.xcontent.XContentParser; | |
import org.elasticsearch.index.fielddata.IndexFieldData; |
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
################################################################ | |
def get_products_list(last_pk=0, batch=1000): | |
product = Product.objects\ | |
.filter( | |
id__gte=last_pk, | |
... | |
)[:batch] | |
return product |
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 * as React from 'react'; | |
type ComponenProps = { | |
a: string; | |
}; | |
export function withLikeActions<T extends ComponenProps>(Component: React.ComponentType<T>): React.SFC<T> { | |
return (props: T) => ( | |
<Component {...props} /> | |
); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{ | |
"lint-staged": { | |
"*.{js,jsx}": [ | |
"eslint --fix", | |
"git add" | |
], | |
"*.{json,graphql}": [ | |
"prettier --write", | |
"git add" | |
], |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<input id="all" type="checkbox"> |
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 numpy as np | |
import matplotlib.pyplot as plt | |
from math import * | |
import pylab | |
from matplotlib import mlab | |
dlin_p=3; glub=-1; lamda=0.8; kv=2*3.14/lamda; | |
dx=lamda/0; dt=dx; dlin=round(23.0/dx); X_ros=0; |
NewerOlder