What is an escape sequence (escape character)?

An escape sequence is a special character string that controls character output, such as character color change, cursor movement, and character deletion, when outputting characters on the screen, rather than outputting the characters themselves.

In addition to the information that people can recognize as “character”, information other than “characters” such as control characters and character editing information on the OS is also included a s character information used in the OS. These characters are sometimes called “special characters”. An escape sequence exists for this special character to let people enter characters and tell it to the OS.

Typical escape sequences include the following characters.

\a : bell character(alert)
\b : return one character
\f : page feed(clear)
\n : line feed, return
\r : back to the beginning of the same line
\t : horizontal tab
\v : vertical tab
\\ : show \
\' : single quotation mark
\" : double quotation mark
\0 : null

Linux $ source

“source” is a command to execute the command described in the file.

list.txt

echo Hello

[vagrant@localhost tests]$ ls
index.php list.txt test.php tinymce
[vagrant@localhost tests]$ source list.txt
Hello

wow.

isExist APP ~ "pgrep httpd"
if [[ -n $isExist App ]]i then
	 service httpd stop
fi

あああああああああ、シェルスクリプト勉強しなきゃ。。。駄目だ、時間がかかりすぎる。

tail -n 100 /var/log/httpd/error_log | egrep -i “WARN|ERR|FAIL|CRIT”

Can use the tail command to export the file specified in the File parameter from the specified position to standard output.

[vagrant@localhost ~]$ tail -n 100 /var/log/httpd/error_log
[Sun Feb 10 09:48:03 2019] [notice] Digest: generating secret for digest authentication …
[Sun Feb 10 09:48:03 2019] [notice] Digest: done
[Sun Feb 10 09:48:03 2019] [notice] Apache/2.2.15 (Unix) DAV/2 configured — resuming normal operations

unix permission “r w x”

Permissions are represented by nine-character strings such as rwxr-xr-x and numeric values such as 755. The 9 character string consists of r(readable), w(writable), x(executable), and hyphen(-), which have the meanings.

The commonly used permission patterns are as follows.
644
normal HTML file etc. can read and write, but group members and others can only read.

666
files to be written by CGI script, etc. Both myself and group members and others can read and write.

755
Regular directories, commands, CGI script, etc. Everyone can read and execute, but write only oneself.

777
Directory for CGI scripts to create files. Anyone can do anything. Slightly dangerous on security.

delete part of table td border:border-right-style: hidden

<table border="1">
		<tr id="title">
			<td colspan="3">検索条件</td>
		</tr>
		<tr>
			<td>hoge</td>
			<td></td>
			<td style="border-right-style: hidden;border-bottom-style: hidden;"></td>
		</tr>
		<tr>
			<td>hoge</td>
			<td>姓 名</td>
		</tr>
		<tr>
			<td>hoge</td>
			<td></td>
		</tr>
		<tr>
			<td>hoge</td>
			<td> </td>
		</tr>
		<tr>
			<td>hoge</td>
			<td> </td>
		</tr>
		<tr>
			<td>hoge</td>
			<td> </td>
		</tr>
	</table>

芸がこまけー

create menu with dl, dt, dd

html

<body>
	<hr>
    <div class="container">
    <div class="menu">
    	<dl>
    		<dt>機能</dt>
    		<dd><a href="">管理<a></dd>
    		<dd><a href="">管理<a></dd>
    		<dd><a href="">管理<a></dd>
    	</dl>
    	<dl>
    		<dt>機能</dt>
    		<dd><a href="">管理<a></dd>
    		<dd><a href="">管理<a></dd>
    		<dd><a href="">管理<a></dd>
    	</dl>
    	<dl>
    		<dt>パスワード変更</dt>
    		<dd><a href="">パスワード変更</a></dd>
    	</dl>
    	<dl>
    		<dt>機能</dt>
    		<dd><a href="">管理<a></dd>
    		<dd><a href="">管理<a></dd>
    		<dd><a href="">管理<a></dd>
    	</dl>
    </div>
    <div class="main">
	<p>テキストが入ります</p>
    </div>
	</div>
</body>

css

.menu dt {
	border-bottom:1px solid gray;
	border-left:1px solid gray;
	padding-left: 10px;
	margin-bottom:5px;
}
.menu dd {
	font-size:14px;
}

view

quite better than expected

make login form css

coding a form appropriately

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>ログイン|入稿管理支援システム</title>
	<link rel="stylesheet" type="text/css" href="asset/css/styles.css" />
</head>
<header>
	<p><a href="index.html">Hpscript</a></p>
	<nav>
		<p>入稿管理支援システム</p>
	</nav>
</header>
<body>
    <div id="content">
	<h1>ログイン</h1>
	<form action="cgi-bin/hoge.cgi" method="post">
		<p>
		    ユーザーID:<input type="text" name="login_id" size="20">
		</p>
		<p>
		    パスワード:<input type="text" name="password" size="20">
		</p>
		<p>
		    <input type="submit" value="ログイン">
		</p>
	</form>
	</div>
</body>
</html>

In a sense this is already fine, but i want to it center.

#content {
	margin-top:100px;
	text-align:center;
}
#content h1{
	font-size: 16px;
	margin-bottom:40px;
}

well, finally reaching the point.

css: left logo and right menu

start with making parts first.

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>ログイン|入稿管理支援システム</title>
	<link rel="stylesheet" type="text/css" href="asset/css/styles.css" />
</head>
<header>
	<p><a href="index.html">Hpscript</a></p>
	<nav>
		<p>入稿管理支援システム</p>
	</nav>
</header>
<body>
	<h1>ログイン</h1>
	<form>
		<p>ユーザーID</p><br>
		<p>パスワード</p><br>
		<p>ログイン</p><br>
	</form>
</body>
</html>

fix log and menu position with “position absolute”
styles.css

header {
	text-align: right;
}

header p a {
	position: absolute;
	font-size: 1.25em;
	left: 20px;
	top: 20px;
}
header nav p {
	margin-top: 30px;
	margin-right: 40px;
}

Could i write down a line with css?

header {
	text-align: right;
}
header p a {
	position: absolute;
	font-size: 1.25em;
	left: 20px;
	top: 20px;
}
header nav p {
	position: absolute;
	top: 15px;
	right: 20px;
	width:220px;
	border-bottom: 1px solid;
}
#content {
	margin-top:80px;
}

fixed, it took 40 minutes to adjust this header layout, lol.

PHP/Laravel Coding guideline

If you do not have a framework convention, there is no doubt to follow PSR-2? Really?

PSR-2: Coding Style Guide

1. Overview
– code must follow a coding style guide psr-1!??
– code must use 4 spaces for indenting, not tabs
– there must not be a hard limit on line lenght
– there must be one blank line after the namespace declation
– opening braces for classes must go on the next line, and closing braces must go on the next line
– opening braces for methods must go on the next line
– visibility must be declared on the all properties and methods
– control structure keywords must have one space after them
– opening braces for control structures must go on the same line
– opening parentheses for control structers must not have a space after them

2. General
2.1 basic coding stand
– code must follow all rules outlined in PSR-1
2.2 files
– all php files must use the unix lf line ending
– all php files must end with a single blank line
– the closing ?> tag must be ommitted from files containing only php
2.3 lines
– there must not be a hard limit on line length
– the soft limit on line length must be 120 characters
– lines should not be longer than 80 characters;
– there must not be trailing whitespace at the end of non-blank lines
– blank lines may be added to improve readability and to indicate related blocks of code
– there must not be more than one statement per line
2.4 indenting
– code must use an indent of 4 spaces, must not use tabs for indenting
– using only spaces, and not mixing spaces with tabs, helps to avoid problems with diffs, patches, history, and annotations.
2.5 keywords and true/false/null
php keywords must be in lower case
php constants true, false, and null must be in lower case

3. Namespace and Use Declarations
– when present there must be one blank line after the namespace declaration
– when present, all use declarations must go after the namespace declaration
– there must be one use keyword per declaration
– there must be one blank line after the use block

<?php
namespace Vendor\Package;

use FooClass;
use BarClass as Bar;
use OtherVendor\OtherPackage\BazClass;
&#91;/php&#93;

<b>4. Classes, Properties, and Methods</b>
4.1 extends and implements
- the extends and implements keywords must be declared on the same line as the class name.
- the opening brace for the class must go on its own line;

class ClassName extends ParentClass implement \ArrayAccess, \Countable
{
}

– list of implements may be split across multiple lines, where each subsequent line is indented once.

4.2 properties
– visibility must be declared on all properties
– the var keyword must not be used to declare a property
– there must not be more than one property declared per statement
– property names should not be prefixed with a single underscore to indicate protected or private visibility
– a property declaration looks like the following

class ClassName
{
    public $foo = null;
}

うおおおおおおお、 量多いな。。。
4.3 method
– visibility must be declared on all methods
– method names should not be prefixed with a single underscore to indicate protected or private visibility
– method names must not be declared with a space after the method name

public function fooBarBaz($arg1, &$arg2, $arg3 = [])
{
}

4.4 method arguments
– in all argument list, there must not be a space before each comma, and there must be one space after each comma.
– method arguments with default values must go at the end of the argument list

4.5 abstract, final and static
when present, the abstract and final declarations must precede the visibility declaration
when present, the static declaration must come after the visibility declaration

4.6 method and function call

5. control structures
– there must be one space after the control structure keyword
– there must not be a space after the opening parenthesis
– there must not be a space before the closing parenthesis
– there must be one space between the closing parenthesis and the opening brace
– the structure body must be indented once
– the closing brace must be on the next line after the body
5.1 if, elseif, else

if ($expr1){
}

5.2 switch, case
5.3 while, do while
5.4 for
5.5 foreach
5.6 try, catch

Closure
– closure must be declared with a space after the function keyword, and a space before and after the use keyword
– the opening brace must go on the same line, and the closing brace must go on the next line following the body
– there must not be a space after the opening parenthesis of the argument list or variable list, and there must not be a space before the closing parenthesis of the argument list or variable list
– in the argument list and variable list, there must not be a space before each comma, and there must be one space after each comma
– closure arguments with default value must go at end of the argument list

ああ、なんかすげー疲れた。。