C++

サンプルコード

#include <iostream>
using namespace std;

const int N = 40000;

void FactCal(int n) ...

Java

Javaコード:
public static String doPostFile(String reqUrl, String fileUrl) {
return doPostFile(reqUrl, fileUrl, ...

Linux

例1:ファイルを作成
# touch 2015ctn.log 2016ctn.log
# ll
-rw-r–r– 1 appuser appuser 0 10-28 16:01 2015 ...

shellscript

サンプルコード:
MACCESS=`date -d yesterday +%Y%m%d`
FILE=”access_$MACCESS.log.tgz”
cd/data/nginx/log ...

Linux

1.現在のディレクトリの場所を確認
# pwd
/opt/jmeter/data

2.リンクのパスを確認
# cd/etc/init.d
# pwd
/etc/init.d ...

Software

1.インデックスを作成
db.collection.ensureIndex({key:1})

2.インデックスを参照
db.collection.stats()

3.インデックスのクエリをチェッ ...

PHP

PHPコード:
<?php
$str=array(4,8,2,7,10,0,3,12,11);
for ($I = 0; $I <= count($str); $I++) if (in_array( ...

Software

1.primary keyを追加
ALTER TABLE テーブル名 ADD PRIMARY KEY(カラム名);

2.primary keyを削除
ALTER TABLE table_name DROP ...

PHP

1.round()
echo round(3.4);//3
echo round(3.5);//4
echo round(3.6);//4
echo round(3.6, 0);//4
echo ...

PHP

PHPコード:
$rand = mt_rand(0,1);
if( $rand==0 )
{
$array = array(36,35,16,29,30);
}
elseif( $ran ...

PHP

phpコード
<?php
//USER AGENTを取得
$agent = strtolower($_SERVER);
//データを分析
$is_pc = (strpos($agent, ...

PHP

phpコード:
<?php function devicetype_get(){
$agent = strtolower($_SERVER);
$type = ‘other’; ...

Software

C#コード
using System;namespace ArrayApplication{
class InfoArray
{
static void Main(string n = new int; ...

C++

C#コード
using System;namespace ArrayApplication{
class MyArray
{
static void Main(string n = new int; ...

PHP

PHPコード
<?php
header(‘HTTP/1.1 200 OK’);
header(‘HTTP/1.1 404 Not Found’);

shellscript

shellコード:
#!/bin/bash
#useradd andpassword
echo “please input username:”
read name
ec ...

shellscript

shellコード:
#!/bin/bash
FILE=’20161204cft.csv’
MYSQL=’/usr/local/mysql/bin/mysql’ ...

shellscript

方法1
numbers=(122 134 132 154 160 189)

while true
do
index=$(($RANDOM % ${#numbers}))
echo numbe ...