
↓のようにマルチバイトのディレクトリ名をちゃんと見れます。

さらにログインユーザのホームディレクトリに以下の内容の".vimrc"というファイルを作成します。
↓
set fileencodings=iso-2022-jp,euc-jp,cp932,utf-8,latin1
set number
set tabstop=4
viエディタでUTF-8エンコードのファイルを文字化けせずに見ることができます。
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <string.h>
int main(char** argv, int argc)
{
try
{
/* セマフォキー値 OSで一意の値です */
long lnSemKey = 0x0000ffff;
errno=0;
/* セマフォ生成 */
int iSemId = semget(lnSemKey,1,(0666|IPC_CREAT|IPC_EXCL));
if(iSemId < 0)
{
throw -1;
}
/* セマフォ構造体 */
union semun
{
int val;
struct semid_ds *buf;
ushort *array;
}arg;
//初期セマフォ数の設定
arg.val = 1;
errno=0;
if((semctl(iSemId,0,SETVAL,arg)) < 0)
{
throw -1;
}
}
catch(int r)
{
return(r);
}
return(0);
}
def acts_as_sequenced_class
::#{self.name}
end
class_eval <<-EOV
include ActiveRecord::Acts::List::InstanceMethods
def acts_as_sequenced_class
::#{self.name}
end
def position_column
'#{configuration[:column]}'
end
#{scope_condition_method}
before_create :assign_next_number_in_sequence
EOV
/**
* 方程式計算
* @param coefficients 次数の大きいものからの係数の配列
* @param x 変数
* @return 結果
* 3x^2+2x-2ならば、double[] coefficients = {3,2,-1};となる
*/
static public double calculateEquation( double[] coefficients, double x ) {
double result = 0;
int powNum = coefficients.length - 1;
for( int i=0 ; powNum>=0 ; powNum--, i++ ) {
result += coefficients[i] * Math.pow(x, powNum);
}
return result;
}
/**
* 線形最小二乗法での傾き算出処理.
* @param x_val X軸方向の値の配列.
* @param y_val Y軸方向の値の配列.
* @return 傾きを戻します。.
*/
static public double calulateGradientByLinearLeastSquares(double x_val[], double y_val[]) {
double x_sum = 0;
for( double d : x_val ) {
x_sum += d;
}
int num = x_val.length;
double x_avg = x_sum/num;
double tmp = 0;
for( double d : x_val ) {
tmp += Math.pow( d - x_avg, 2 );
}
double y_sum = 0;
for( double d : y_val ) {
y_sum +=d;
}
double y_avg = y_sum/num;
double xt = 0;
for (int i = 0; i < num; i++) {
xt += ( x_val[i] - x_avg ) * (y_val[i] - y_avg);
}
return( xt/tmp );
}
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |