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 flask import Flask, request, make_response | |
import requests | |
app = Flask(__name__, static_folder=None) | |
target_site = "https://cn.bing.com/" | |
general_headers = { | |
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" | |
} |
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
function FindProxyForURL(url, host) | |
{ | |
return "SOCKS localhost:8089"; | |
} |
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
# -*- coding: utf-8 -*- | |
# encoding=utf-8 | |
# REQUIREMENTS: | |
# pip install jieba mysql-connector | |
# Download the dataset from https://github.com/fate233/toutiao-text-classfication-dataset | |
import sys | |
import codecs |
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 tensorflow as tf | |
from tensorflow import keras | |
import numpy as np | |
import mysql.connector | |
db_conn = None | |
def get_db_connect(database="imdb"): | |
global db_conn | |
if not db_conn: |
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 tensorflow as tf | |
import numpy as np | |
class LSTMClassifier(tf.keras.Model): | |
def __init__(self, feature_columns, units=32, hidden_layer=32, n_classes=2): | |
"""LSTMClassifier | |
:param feature_columns: feature columns. | |
:type feature_columns: list[tf.feature_column]. | |
:param hidden_units: number of hidden units. | |
:type hidden_units: list[int]. |
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
# -*- coding: utf-8 -*- | |
# encoding=utf-8 | |
# REQUIREMENTS: | |
# pip install mysql-connector | |
import sys, os | |
import codecs | |
import mysql.connector | |
def prepare_tables(): |
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 ( | |
"fmt" | |
"regexp" | |
"strings" | |
"github.com/pingcap/parser" | |
_ "github.com/pingcap/tidb/types/parser_driver" // As required by https://github.com/pingcap/parser/blob/master/parser_example_test.go#L19 | |
) |
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> | |
#include <vector> | |
#include <chrono> | |
#include <thread> | |
#include <math.h> | |
#include <time.h> | |
#include "ThreadPool.h" | |
#include "ctpl.h" |
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
######################################################################### | |
# File Name: h2dtest.sh | |
# Author: lychee | |
# Email: lizhi14@baidu.com | |
# goto /usr/local/cuda/samples/1_Utilities/bandwidthTest and run make | |
######################################################################### | |
#!/bin/bash | |
# Host to GPU | |
echo "#### Host to GPU ####" | |
for i in `seq 1 30`; do |
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 __future__ import print_function | |
import random | |
from visualdl import LogWriter | |
logdir = "resnet50_v100" | |
def parse_logdata(logfile): | |
loss_ret = {} |
NewerOlder