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
<?php
$name = "";
$message = "";
$date = date("Y-m-d");
$filename = 'kadai2_3.txt';
$script_name = $_SERVER["SCRIPT_NAME"];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset = “UFT-8”>
<title>簡易掲示板</title>
</head>
<body>
<h1>削除番号の送信</h1>
<form method = "post">
<label>削除番号:<input type="number"name="number"/></label>
<input type="submit" name="deleteSend" value="削除"/>
<?php
$ret_array = file( $filename );
for($i=0; $i<count($ret_array); $i++){
    $damy = explode("<>",$ret_array[$i]);
    echo "</br>".$damy[0].$damy[1].$damy[2].$damy[3];
}
?>
<?php
if(isset($_POST["deleteSend"])==true){
    $ret_array = file( $filename );
    for($i=0; $i<count($ret_array); $i++){
        $damy = explode("<>",$ret_array[$i]);
        if($damy[0]==$_POST["number"]){
            array_splice($ret_array, $i, 1);
            file_put_contents($filename, $ret_array);
        }
    }
    header("location: $script_name");
}
?>
</form>
</body>
</html>
anonymous No title
PHP
<?php
$name = "";
$message = "";
$date = date("Y-m-d");
$filename = 'kadai2_3.txt';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset = “UFT-8”>
<title>簡易掲示板</title>
</head>
<body>
<h1>削除番号の送信</h1>
<form method = "post">
<label>削除番号:<input type="number"name="number"/></label>
<input type="submit" name="deleteSend" value="削除"/>
<?php
$ret_array = file( $filename );
for($i=0; $i<count($ret_array); $i++){
    $damy = explode("<>",$ret_array[$i]);
    echo "</br>".$damy[0].$damy[1].$damy[2].$damy[3];
}
?>
<?php
if(isset($_POST["deleteSend"])==true){
    $ret_array = file( $filename );
    for($i=0; $i<count($ret_array); $i++){
        $damy[] = explode("<>",$ret_array[$i]);
        if($damy[0]!=$_POST["number"]){
            array_splice($ret_array, $_POST["number"]-1, 1);
            $fp = fopen($filename, 'w');
            fwrite($fp, implode("\n",$ret_array));
            fclose($fp);
        }
    }
}
?>
</form>
</body>
</html>
anonymous No title
PHP
<?php
$name = "";
$message = "";
$date = date("Y-m-d");
$filename = 'kadai2_3.txt';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset = “UFT-8”>
<title>簡易掲示板</title>
</head>
<body>
<h1>削除番号の送信</h1>
<form method = "post">
<label>削除番号:<input type="number"name="number"/></label>
<input type="submit" name="deleteSend" value="削除"/>
<?php
$ret_array = file( $filename );
foreach($ret_array as $value){
    $damy = explode("<>",$value);
    echo "</br>".$damy[0].$damy[1].$damy[2].$damy[3];
}
?>
<?php
if(isset($_POST["deleteSend"])==true){
    $ret_array = file( $filename );
    for($i=0; $i<count($ret_array); $i++){
        $damy[] = explode("<>",$value);
        if($damy[0]!=$_POST["number"]){
            array_splice($ret_array, $_POST["number"]-1, 1);
            $fp = fopen($filename, 'w');
            fwrite($fp, implode("\n",$ret_array));
            fclose($fp);
        }
    }
}
?>
</form>
</body>
</html>
首領パッチ 課題2の(6)
PHP
<?php
//list.txtを一行ごとの配列に格納、
// passwordフォームから入力されたものを$passwordに代入
$array = file("list.txt");
$password = @$_POST['password'];

// dltフォームに入った数値が存在すれば$dlt_numに代入
if ($dlt_num = @$_POST['dlt']) {
    for ($i = 0; $i < count($array); $i++) {
        $new_array = explode('<>', $array[$i]);
        if ($new_array[0] == $dlt_num) {
            $new_array = explode('<>', $array[$i]);
            $d_p = explode('****', $new_array[3]);
            //list.txt内にあるpasswordを確認し、$pwdに代入
            $pwd = $d_p[1];
            echo 'password:' . $password . "/" . 'pwd:' . $pwd;
            
            //フォームから入力された$passwordとlist.txt内に存在した$pwdが一致した場合の処理
            if ($password == $pwd) {
                unset($array[$i]);
                file_put_contents('list.txt', $array);
                echo "投稿を削除しました";
            } else {
                echo '削除できませんでした';
            }
        }
    }
}
?>
anonymous No title
PHP
<?php echo "Hello"; ?>
anonymous No title
PHP
<?php
$name = "";
$message = "";
$date = date("Y-m-d");
$filename = 'kadai2_3.txt';
if(isset($_POST["send"])==true){
    if(isset($_POST["name"])==true&&isset($_POST["message"])==true){
        $fp = fopen($filename, 'a');
        $name = $_POST["name"];
        $message = $_POST["message"];
        $i = count(file($filename))+1;
        fwrite($fp, $i."<>".$_POST["name"]."<>".$_POST["message"]."<>".$date."\n");
        fclose($fp);
    }
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset = “UFT-8”>
<title>簡易掲示板</title>
</head>
<body>
<h1>削除番号の送信</h1>
<label>削除番号:<input type="number"name="number"/></label>
<input type="submit" name="deleteSend" value="削除"/>
<?php
$ret_array = file( $filename );
foreach($ret_array as $value){
    $damy = explode("<>",$value);
    echo "</br>".$damy[0].$damy[1].$damy[2].$damy[3];
}
?>

</form>
<?php
echo 2;
if(isset($_POST["deleteSend"])==true){
    echo 3;
    $fp = fopen($filename, 'a');
    $ret_array = file( $filename );
    foreach($ret_array as $value){
        echo 4;
        $damy[] = explode("<>",$value);
        if($damy[0]!=$_POST["number"]){
            echo 1;
        }
    }
}
?>
</body>
</html>
anonymous No title
Python
import hashlib
m = "example@example.com"
for i in range(2):
  m = hashlib.md5(m.encode('utf-8')).hexdigest()
anonymous No title
Python
import hashlib
mail_address = "example@example.com"
md5_1 = hashlib.md5(mail_address.encode('utf-8')).hexdigest()
md5_2 = hashlib.md5(md5_1.encode('utf-8')).hexdigest()
anonymous No title
Python
//@version=3
strategy("pivot reverse", overlay=true)

//pivot
len=4
len2=20
pL = input(len,minval=1,title="left")
pR = input(len2,minval=1,title="right")
SL     = input(true,title="line")
maxLvlLen        = input(20,minval=0, title="line")
pvthi = pivothigh(pL,pR)
pvtlo = pivotlow(pL,pR)
swh = pivothigh(pL, pR)
swl = pivotlow(pL, pR)

//entry
swh_cond = not na(swh)

hprice = 0.0
hprice := swh_cond ? swh : hprice[1]

le = false
le := swh_cond ? true : (le[1] and high > hprice ? false : le[1])

if (le)
    strategy.entry("BUY", strategy.long, comment="L", stop=hprice + syminfo.mintick)

swl_cond = not na(swl)

lprice = 0.0
lprice := swl_cond ? swl : lprice[1]


se = false
se := swl_cond ? true : (se[1] and low < lprice ? false : se[1])

if (se)
    strategy.entry("SEL", strategy.short, comment="S", stop=lprice - syminfo.mintick)

//coler&etc.

counthi = 0.0 
counthi := pvthi[1] ? 0 : nz(counthi[1])+1
countlo = 0.0
countlo := pvtlo[1] ? 0 : nz(countlo[1])+1
pvthis = 0.0
pvthis := pvthi[1] ? high[pR+1] : pvthis[1]
pvtlos = 0.0
pvtlos := pvtlo[1] ? low[pR+1] :  pvtlos[1]
hipc = (pvthis != pvthis[1]) ? na : blue
lopc = (pvtlos != pvtlos[1]) ? na: red
h2l= (pvthis+pvtlos)/2
plot(SL and (maxLvlLen==0 or counthi<maxLvlLen)? pvthis : na, color=hipc, transp=30, linewidth=1, offset=-pR-1, title="H-line", trackprice=false)
plot(SL and (maxLvlLen==0 or countlo<maxLvlLen)? pvtlos : na, color=lopc, transp=30, linewidth=1, offset=-pR-1, title="L-line", trackprice=false)
anonymous No title
Python
    private void moveToWrapper(double pos_x, double pos_y, double pos_z, double qua_x, double qua_y, double qua_z, double qua_w) {
        final int LOOP_MAX = 20;
        final Point point = new Point(pos_x, pos_y, pos_z);
        final Quaternion quaternion = new Quaternion((float) qua_x, (float) qua_y, (float) qua_z, (float) qua_w);
        Result result = api.moveTo(point, quaternion, true);
        int loopCounter = 0;
        while (!result.hasSucceeded() && loopCounter < LOOP_MAX) {
            result = api.moveTo(point, quaternion, true);
            ++loopCounter;
        }
    }