<network-security-config>
<debug-overrides>
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
# Based on younesbelkada/finetune_llama_v2.py | |
# Install the following libraries: | |
# pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 scipy | |
from dataclasses import dataclass, field | |
from typing import Optional | |
import torch | |
from datasets import load_dataset | |
from transformers import ( |
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
pcall(require,"socket") | |
Scheduler = setmetatable({}, { | |
__call = function(class) | |
return setmetatable({ | |
threads = {}, | |
}, class) | |
end | |
}) | |
Scheduler.__index = Scheduler |
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
目前网上有不少的实现QQ机器人的方法,都不太稳定甚至都已经失效了,而且我们还要冒着QQ号被盗用的风险。其实我们可以自己实现一个QQ自动应答的机器人,思路非常简单:通过模拟登录3G版QQ,来实现相关的操作: | |
一、首先我们得看看3GQQ的相关协议 | |
为此,我们需要一个支持WAP的浏览器,可以使用Firefox的wmlbrowser插件,打开FF后,访问地址:https://addons.mozilla.org/zh-CN/firefox/search/?q=wmlbrowser&cat=all&x=17&y=11 | |
二、进入3GQQ的进行协议分析 | |
3GQQ的地址是:http://pt.3g.qq.com/s?aid=nLogin3gqq 用安装了wmlbrowser插件的FF打开页面后,启用firebug,即可监视提交的数据。 | |
三、源代码 |
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
// Engine | |
const React = { | |
index: 0, | |
state: [], | |
useEffect: (callback, dependencies) => { | |
const cachedIndex = React.index; | |
const hasChanged = dependencies !== React.state[cachedIndex]; | |
if (dependencies === undefined || hasChanged) { | |
callback(); |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
import pysubs2 | |
import re | |
from stardict import DictCsv | |
# depend on https://github.com/skywind3000/ECDICT/ | |
dict_filename="ecdict.csv" | |
sub_filename="01sub.srt" |
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
// <input id="my-input-element" type="text" value="foo"/> | |
var evt, node = document.getElementById('my-input-element'); | |
// Have to use dispatchEvent/fireEvent because jQuery.trigger will not | |
// fire an event attached via addEventListener. Each environment has an | |
// unusual way to trigger a keyup event. | |
if (node.dispatchEvent) { | |
// Sane browsers | |
try { | |
// Chrome, Safari, Firefox |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
- Take the
download.sh
file and put it into a directory where you want the files to be saved. cd
into the directory and make sure that it has executable permissions (chmod +x download.sh
should do it)- Run
./download.sh
and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
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
(* | |
This script counts lines in C# and F# projects. | |
It is used to compare the "useful lines" in F# projects with those in C# projects. | |
Copied from Kit Eason's code at http://www.fssnip.net/h4 | |
REQUIRES: | |
* FSharp.Charting for charts | |
via NuGet |
NewerOlder