I hereby claim:
- I am abdouseck on github.
- I am aseck (https://keybase.io/aseck) on keybase.
- I have a public key ASDjVkM0h3zHkVUrkbaofaafZujw0FeGtxaYSAKgS4YnRQo
To claim this, I am signing this object:
import multiprocessing as mp | |
def RunPrice(items, price): | |
print("There is %s items, price is: %s" % (items, price)) | |
def GetTargetItemsAndPrice(cursor): | |
res = cursor.execute("SELECT DISTINCT items, price FROM SELLS") | |
results = dict() | |
with mp.Pool() as pool: |
env.yaml |
fn main() { | |
let mut arr = [12, 8, 10, 3, 5, 10, 45]; | |
if let Some(elem) = arr.get(10) { | |
println!("Element requested: {}.", elem); | |
} else { | |
println!( | |
"Element at index {} could not be found in an array of size {}.", | |
10, | |
arr.len() | |
); |
# There is really not a dynamic way of doing what you want. | |
# You will need to expand the dash and generate a sequence from it. | |
# I wrote an example function that converts something like 2-4 into seq(2, 4) | |
expand.dash <- function(dashed) { | |
limits <- unlist(strsplit(dashed, '-')) | |
seq(limits[1], limits[2]) | |
} | |
# We can use the above function inside another function which expands ballrooms |
I hereby claim:
To claim this, I am signing this object:
# The arbitrary and opinionated conversion of strings to datetime in Series comparisons | |
# When comparing two values where the left side values is a pandas datetime object, | |
# Pandas casts the left side values to pd.DatetimeIndex | |
# Once the casting is successfully, Pandas then calls the __eq__ method on the result of the cast operation. | |
# In this case, you want to take a look at pd.DatetimeIndex.__eq__ to figure out how the comparison is being handled | |
# The following is how pd.DatetimeIndex.__eq__ is defined (it's a decorated function, so the function name doesn't come up): | |
def wrapper(self, other): |
#!/usr/bin/env python3 | |
""" | |
Script to test or run commands on given servers. | |
./this_script.py test # To test all servers | |
./this_script.py run --id 127.0.0.1 --command "echo hello world" | |
""" | |
from argparse import ArgumentParser, RawDescriptionHelpFormatter as RDHF | |
def test_servers(servers): |
# persons.txt | |
# Person 1 | |
# Class Grade | |
# Math A | |
# Science C | |
# English A | |
# Person 2 | |
# Class Grade | |
# Math D | |
# English A |
# https://stackoverflow.com/q/52613778/3135417 | |
# Function to keep track of diff changes along the V1 column | |
get_ids <- function(x) { | |
vrle <- rle(cummin(x))$lengths | |
rep(1:length(vrle), vrle) | |
} | |
# Thesis data | |
thesis <- data.frame(V1=c(8628, 8626, 8624, 8622, 8620, 8618, |
# application.py | |
from flask import Flask, render_template_string | |
from flask_sqlalchemy import SQLAlchemy | |
db = SQLAlchemy() | |
class User(db.Model): | |
""" |