- (1) Bash
- (2) C#
- (3) C
- (4) CSS
- (5) JavaScript
- (6) Perl
- (7) PHP
- (8) Plain Text
- (9) SQL
- (10) HTML
(1) Bash
# A return of 4 or higher means there were serious problems.
if [ $rc -gt 1 ]; then
[ -n "$PLYMOUTH" ] && plymouth --hide-splash
failure "$STRING"
echo
echo
echo $"*** An error occurred during the file system check."
str=$"(Repair filesystem)"
PS1="$str \# # "; export PS1
[ "$SELINUX_STATE" = "1" ] && disable_selinux
start rcS-emergency
echo $"Unmounting file systems"
umount -a
mount -n -o remount,ro /
echo $"Automatic reboot in progress."
reboot -f
elif [ "$rc" -eq "1" ]; then
_RUN_QUOTACHECK=1
fi
(2) C#
// A Hello World! program in C#.
using System;
namespace HelloWorld
{
class Hello
{
static void Main()
{
Console.WriteLine("Hello World!");
// Keep the console window open in debug mode.
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}
(3) C
#include <stdio.h>
/* 複数行の
コメント */
int main(int argc, char *args[]) // 単一行コメント
{
printf("Hello, world!\n");
return 0;
}
(4) CSS
p /* 段落を青くして行の高さを1.5倍にする */
{
color: blue;
line-height: 1.5;
}
(5) JavaScript
document.write("Hello World!!");
function jikoku()
{
dd = new Date();
document.F1.T1.value = dd.toLocaleString();
window.setTimeout("jikoku()", 1000);
}
(6) Perl
#!/usr/bin/perl
print "Content-type: text/html\n"; # コメント
print "\n";
print "Hello World!";
(7) PHP
<?php
echo 'Hello World!'; // C++型の単一行用のコメント
/* 複数行用のコメント
もう一行分のコメント */
echo 'もうひとつのテストです';
echo '最後のテストです'; # シェル型の単一行用のコメント
?>
(8) Plain Text
httpd.conf
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
ServerRoot "/usr/local"
(9) SQL
SELECT
* -- コメント
FROM
TABLEA;
(10) HTML
<!DOCTYPE html>
<html>
<head>
<meta name="Description" content="コンテンツ">
<title>タイトル</title>
</head>
<body>
Hello World <!-- コメント -->
</body>
|