Here are my solutions to all SQL problems on leetcode.
-- how to do rank with out window function
select t1.category, count(distinct t2.id) as dense_rank
from table t1, table t2
where t1.id = t2.id and t1.value <= t2.value
group by t1.category| #!/bin/bash | |
| # first start it in another terminal | |
| # vllm serve Qwen/Qwen2-VL-7B-Instruct --swap-space 16 --disable-log-requests | |
| # Define model variables | |
| MODEL_NAME="Qwen/Qwen2-VL-7B-Instruct" | |
| NUM_PROMPTS=10 | |
| # Define the output markdown file | |
| OUTPUT_FILE="benchmark_output.md" |
| import boto3 | |
| def get_s3_object(key, bucket_name, | |
| object_component='Body', | |
| region_name='us-east-1', | |
| encoding='utf-8'): | |
| """ | |
| Method to read s3 file directly in meomory | |
| :param key: key of the file on s3 bucket | |
| :param bucket_name: the s3 bucket name |
| make_wheel: | |
| python setup.py bdist_wheel --universal | |
| package_cloud push vevo/common/python ./dist/`ls dist` | |
| container_make_wheel: | |
| docker build --build-arg pc_config='${PC_CONFIG}' \ | |
| -t vevo/vevoml-build . | |
| docker run -it --entrypoint make vevo/vevoml-build make_wheel |
Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112
For older versions of Spark and ipython, please, see also previous version of text.
| hexo clean | |
| hexo generate | |
| cp -R public/* .deploy/your_githubname.github.io | |
| cd .deploy/your_githubname.github.io | |
| git add . | |
| git commit -m "update" | |
| git push -f origin master | |
| cd ../../ |
| echo "Please enter your github name: " | |
| read github_name | |
| git_link="https://github.com/$github_name/$github_name.github.io.git" | |
| git clone $git_link .deploy/$github_name.github.io | |
| cd .deploy/$github_name.github.io | |
| git pull | |
| cd ../../ |
| # install NodeJS | |
| curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash | |
| nvm install stable | |
| # install hexo | |
| npm install -g hexo-cli | |
| # initialize | |
| echo "Please enter your github name: " | |
| read github_name |
| git checkout --orphan latest_branch | |
| git add -A | |
| git commit -am "initial commit" | |
| git branch -D master | |
| git branch -m master | |
| git push -f origin master |
| -- Remove the history from | |
| rm -rf .git | |
| -- recreate the repos from the current content only | |
| git init | |
| git add . | |
| git commit -m "Initial commit" | |
| -- push to the github remote repos ensuring you overwrite history | |
| git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git |