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 matplotlib.pyplot as plt | |
from statsmodels.tsa.holtwinters import ExponentialSmoothing | |
import numpy as np | |
# 1. 數據準備 | |
# 2024年銷售數據(從第8天開始) | |
sales_data_2024 = [34, 66, 68, 70, 73, 75, 79, 83, 88, 92, 94, 98, 102, 109, 112, 113, 117, 118, 120, 121, 122, 123, 128, 136, 140] | |
sales_data_2024.extend([142, 146, 149, 154, 155, 161, 164, 167, 171, 175, 180, 183, 187, 202, 209, 214, 219, 221, 221]) # Aug 8 added | |
# 2023年銷售數據 |
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 software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; | |
import software.amazon.awssdk.regions.Region; | |
import software.amazon.awssdk.services.s3control.S3ControlClient; | |
import software.amazon.awssdk.services.s3control.model.*; | |
import java.util.stream.Collectors; | |
public class S3OutpostsBucket { | |
public static void main(String[] args) { | |
// Enable debug-level logging for the AWS Java SDK v2 |
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
generate 500 token story |
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
#!/bin/bash | |
# Remove proxy settings for various protocols | |
unset http_proxy | |
unset https_proxy | |
unset ftp_proxy | |
unset rsync_proxy | |
# Remove proxy for apt (if exists) | |
sudo rm -f /etc/apt/apt.conf.d/99proxy |
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
@startuml | |
skinparam handwritten true | |
"You/Browser" -> slack.com: 1. I would like to access my files on Google Drive via your interface. | |
slack.com -> "You/Browser": 2. You should apply the "Authorization Code" from Google for me first. | |
"You/Browser" -> account.google.com: 3. I would like to permit slack.com to access my files. | |
account.google.com -> "You/Browser": 4. Are you sure? | |
"You/Browser" -> account.google.com: 5. [Y] | |
account.google.com -> "You/Browser": 6. Okay. Here is the "Authorization Code." Plz give it back to slack.com now. | |
"You/Browser" -> slack.com: 7. You can do what I asked now (with the Authorization Code which is just received from Google.) | |
slack.com -> account.google.com: 8. I would like to exchange the "Authorization Code" for the "Access Token." |
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
# Configuration file for runtime kernel parameters. | |
# See sysctl.conf(5) for more information. | |
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for | |
# an explanation about some of these parameters, and instructions for | |
# a few other tweaks outside this file. | |
# See evil packets in your logs. | |
net.ipv4.conf.all.log_martians = 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
In [2]: from solid_oidc_client import SolidOidcClient, MemStore | |
...: solid_oidc_client = SolidOidcClient(storage=MemStore()) | |
...: import requests | |
In [4]: issuer = 'https://login.inrupt.com/' | |
...: redirect_url = 'http://localhost:3333/oauth/callback' | |
...: solid_oidc_client.register_client(issuer, [redirect_url]) | |
In [5]: login_url = solid_oidc_client.create_login_uri('/', redirect_url) | |
...: print(login_url) |
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 org.example; | |
import java.io.File; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.net.URL; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
public class PlayPath { |
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
#!/bin/sh | |
# Script to download, compile and install mhvtl | |
# Tested on ubuntu 16.04 | |
# Origin: http://mhvtl-a-linux-virtual-tape-library.966029.n3.nabble.com/Easy-Install-for-Debian-Ubuntu-td4025413.html | |
# 03/04/13 | |
# Added libconfig-general-perl (ensures tgt-admin can run) | |
# 04/04/13 | |
# Added line to append www-data to sudoers automatically | |
# Added check for sudo/root | |
# Added copy for tgt-admin in sbin (fixes persistant config in tgt mhvtl-gui) |
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 com.google.gson.Gson; | |
import com.google.gson.JsonElement; | |
import java.io.ByteArrayInputStream; | |
import java.io.InputStreamReader; | |
import org.junit.jupiter.api.Test; | |
/** | |
* Convert Json from/to object/tree/inputstream/reader/file with Gson in Java | |
* | |
* ref https://www.javadoc.io/doc/com.google.code.gson/gson/2.9.0/com.google.gson/com/google/gson/Gson.html |
NewerOlder