Share Code Quickly

What is Harigami?

Harigami is a simple source code sharing service. You can share source code by an URL which is issued after submission.
You can also run your source code online such as Python, Ruby, JavaScript and so on.
For free.Use for code review.
Preferences
anonymous No title
Python
import sys
import numpy
from yahoo_finance_api2 import share
from yahoo_finance_api2.exceptions import YahooFinanceError
import pandas as pd
import time

print('銘柄コードの上位1ケタを入力してください')
user_input_num = input()

up1_num = int(user_input_num)

f = open(f'./sql/basedata_{up1_num}xxx.sql', 'w')
for num in range(up1_num*1000, (up1_num+1)*1000):
    print(f'銘柄コード:{num}')
    my_share = share.Share(f'{num}.T')
    symbol_data = None

    try:
        symbol_data = my_share.get_historical(
            share.PERIOD_TYPE_YEAR, 50,
            share.FREQUENCY_TYPE_DAY, 1)
        print('データ取得成功')
        df = pd.DataFrame(symbol_data)
        if df.empty:
            continue
        df["datetime"] = pd.to_datetime(df.timestamp, unit="ms")
        for record in df.values:
            print(f'銘柄コード:{num} 日付:{record[6]} 始値:{record[1]} 高値:{record[2]} 安値:{record[3]} 終値:{record[4]} 出来高:{record[5]}')
            if numpy.isnan(record[1]) or numpy.isnan(record[2]) or numpy.isnan(record[3]) or numpy.isnan(record[4]):
                continue
            f.write(f'INSERT INTO `my_stock_database` VALUES (null, \'{num}\', \'{record[6]}\', {record[1]}, {record[2]}, {record[3]}, {record[4]}, {record[5]});\n')

    except YahooFinanceError as e:
        print('データ取得失敗')
        print(e.message)
    time.sleep(1)
f.close()

anonymous No title
Python
import sys
import numpy
from yahoo_finance_api2 import share
from yahoo_finance_api2.exceptions import YahooFinanceError
import pandas as pd
import time

print('銘柄コードの上位1ケタを入力してください')
user_input_num = input()

up1_num = int(user_input_num)

f = open(f'./sql/{up1_num}xxx.sql', 'w')
for num in range(up1_num*1000, (up1_num+1)*1000):
    print(f'銘柄コード:{num}')
    my_share = share.Share(f'{num}.T')
    symbol_data = None

    try:
        symbol_data = my_share.get_historical(
            share.PERIOD_TYPE_YEAR, 50,
            share.FREQUENCY_TYPE_DAY, 1)
        print('データ取得成功')
        df = pd.DataFrame(symbol_data)
        if df.empty:
            continue
        df["datetime"] = pd.to_datetime(df.timestamp, unit="ms")
        for record in df.values:
            print(
                f'銘柄コード:{num} 日付:{record[6]} 始値:{record[1]} 高値:{record[2]} 安値:{record[3]} 終値:{record[4]} 出来高:{record[5]}')
            if numpy.isnan(record[1]) or numpy.isnan(record[2]) or numpy.isnan(record[3]) or numpy.isnan(record[4]):
                continue
            f.write(
                f'INSERT INTO `my_stock_database` VALUES (null, \'{num}\', \'{record[6]}\', {record[1]}, {record[2]}, {record[3]}, {record[4]}, {record[5]});\n')

    except YahooFinanceError as e:
        print('データ取得失敗')
        print(e.message)
    time.sleep(1)
f.close()

anonymous No title
VBA
'ブックモジュール
Option Explicit

Private Sub Workbook_Open()
    Application.OnKey "+^{c}", "inTotal"
    Application.OnKey "+^{+}", "plusTotal"
    Application.OnKey "+^{v}", "outTotal"
    Application.OnKey "+^{*}", "clearTotal"
End Sub


'標準モジュール
Option Explicit

Dim stackSum As Variant

Sub inTotal()
    stackSum = CDec(WorksheetFunction.Sum(Selection))
    Call showStatusBer(stackSum)
End Sub

Sub plusTotal()
    stackSum = stackSum + CDec(WorksheetFunction.Sum(Selection))
    Call showStatusBer(stackSum)
End Sub


Sub outTotal()
    Selection.Value = stackSum
End Sub

Sub clearTotal()
    stackSum = 0
    Application.StatusBar = False
End Sub

Sub showStatusBer(ByVal num As Variant)
    Dim len小数部 As Long:  len小数部 = Len(CStr(num)) - Len(CStr(Int(num))) - 1
    
    If len小数部 <= 0 Then
        Application.StatusBar = "Total = " & Format(num, "#,##0")
    Else
        Application.StatusBar = "Total = " & Format(num, "#,##0." & String(len小数部, "0"))
    End If

End Sub
anonymous No title
HTML
<LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:textStyle="bold"
                android:paddingStart="32dp"
                android:layout_weight="6"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="30dp"
                android:textColor="@color/black"
                android:text="からだの症状"/>
            <TextView
                android:textStyle="bold"
                android:paddingEnd="32dp"
                android:textAlignment="textEnd"
                android:layout_weight="4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="30dp"
                android:textColor="@color/black"
                android:text="1    2    3    4    5"/>
        </LinearLayout>

        <View
            android:layout_width="wrap_content"
            android:layout_height="1dp"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            android:visibility="visible"
            android:background="@color/black"/>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:paddingStart="32dp"
                android:layout_weight="6"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="30dp"
                android:textColor="@color/black"
                android:text="目が疲れる"/>
            <LinearLayout
                android:gravity="right"
                android:layout_weight="4"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <CheckBox
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <CheckBox
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <CheckBox
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <CheckBox
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <CheckBox
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

            </LinearLayout>
        </LinearLayout>
anonymous No title
PHP
<!DOCTYPE html>
<html>
<head>
<title>kadai_1.php</title>
</head>
<body>

<h1><?php $str_hello="HTML内で";

echo "Hello World";?></h1>
</form>
</body>
</html>
anonymous No title
PHP


<form action = "kadai_1.php" method = "POST" >
<input type="text" name="comment">
<input type="submit" value="送信">
</form>

<?php
echo "あああ";

$file_handle = fopen( "test.txt", "w");
fwrite( $file_handle, "テスト2");
fclose($file_handle);
if (isset($_POST["comment"])) {
    echo $_POST["comment"];
}
?>
anonymous No title
Python
print('hello world')
anonymous No title
VBA
'ブックモジュール
Option Explicit

Private Sub Workbook_Open()
    Application.OnKey "+^{c}", "inTotal"
    Application.OnKey "+^{+}", "plusTotal"
    Application.OnKey "+^{v}", "outTotal"
    Application.OnKey "+^{*}", "clearTotal"
End Sub

'標準モジュール
Option Explicit

Dim stackSum As Double

Sub inTotal()
    stackSum = WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub

Sub plusTotal()
    stackSum = stackSum + WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub


Sub outTotal()
    Selection.Value = stackSum
End Sub

Sub clearTotal()
    stackSum = 0
    Application.StatusBar = False
End Sub

anonymous No title
VBA
'ブックモジュール
Option Explicit

Private Sub Workbook_Open()
    Application.OnKey "+^{c}", "inTotal"
    Application.OnKey "+^{+}", "plusTotal"
    Application.OnKey "+^{v}", "outTotal"
    Application.OnKey "+^{*}", "clearTotal"
End Sub



'標準モジュール
Option Explicit

Dim stackSum As Long

Sub inTotal()
    stackSum = WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub

Sub plusTotal()
    stackSum = stackSum + WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub


Sub outTotal()
    Selection.Value = stackSum
End Sub

Sub clearTotal()
    stackSum = 0
    Application.StatusBar = False
End Sub

anonymous No title
HTML
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="robots" content="noindex,nofollow">
  
    <!-- ページタイトルを入力 -->
    <title>ウツシヨノホトリ</title>
  
  </head>
  
  <body>
    <!--""の間にお好みのカラータグを入力してください-->
    <body bgcolor="#a0d8ef" text="#2792c3" link="#165e83 " alink="#165e83" vlink="#165e83">
      
      <h1>この店舗について</h1>
      <p>
        <!-- 自己紹介文を書く -->
       個人の同人小説サークル。
       今日は死出/弔出のみの出品です。
       どうぞよしなに。
      </p>

      <h1>お支払い方法</h1>
    
        <p>
          <ul>
            <li>クレジットカード(VISA、MASTER、JCB、AMEX、DINERS)</li>
            <li>銀行振込(Paidy後払い決済)</li>
            <li>コンビニ決済(Paidy後払い決済)</li>
          </ul>
        ただし、ダウンロード頒布の場合のみ、JCB・AMEX・DINESのクレジットカードはご利用いただけません。
        詳しくは、<a href="https://pictspace-support.zendesk.com/hc/ja/articles/360002864296-%E6%B1%BA%E6%B8%88%E6%96%B9%E6%B3%95%E3%81%AF%E4%BD%95%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B">こちら。</a>
      </p>

      <h1>配送までの期間</h1>

      <p>
      <!--u~/uの間に発送までの日数を記入してください-->
      ご注文から<u>7日間以内</u>の発送とさせていただきます。
      あらかじめご了承ください。
      </p>
    
      <hr color="#007bbb" width="60%" size="1"> 

      <h1>特定商取引法に基づく表記</h1>
      <h2>事業者の名称・連絡先</h2>
      <p>
        <br><a href="mailto:kzmc1004@gmail.com">kzmc1004@gmail.com</a></br>
        <br>省略した記載については、電子メール等の請求により遅滞なく開示いたします。</br>
      </p>
      <h2>販売価格</h2>
      <p>
        <br>販売価格は、消費税を含む価格で表示されています。<br>
      </p> 
      
      <h2>返品などについての特約</h2>
      <p>
        <br>商品に欠陥があり、当ショップが認める場合を除き、返品には応じません。</br>
      </p>
    </font>
  </body>
</html>