他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.
ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.
D言語のmainはCとは違い以下のようなシグネチャです.
| <?php | |
| /** | |
| * @param string $file Shift_JIS の csv ファイルパス | |
| * @return array | |
| */ | |
| function parseCsv($file) | |
| { | |
| $str = file_get_contents($file); | |
| $is_win = strpos(PHP_OS, "WIN") === 0; |
| # coding: utf-8 | |
| import os, sys | |
| import wx | |
| import cv2 | |
| import cvframe | |
| import datetime | |
| import configparser | |
| import numpy as np | |
| from threading import Event, Thread | |
| import winsound |
| ;;; ------------------------------------------------------------ | |
| ;;; 次/前のwordbreakへ | |
| ;; gist-description: Emacs(Elisp): forward/backward-wordだと、移動距離が微妙に大きいので、単語境界でひっかかるように。 | |
| ;; gist-id: 467f4302c002049bfb95511bd21cdbe7 | |
| ;; gist-name: move-to-next(previous)-word-break.el | |
| ;; gist-private: nil | |
| ;; thx http://d.hatena.ne.jp/h1mesuke/20070803/p1 | |
| (defun move-to-next-word-break (&optional arg) | |
| "Move point forward ARG word breaks (backward if ARG is negative)." |
| #!/usr/bin/env python | |
| # | |
| # Copyright 2009 Facebook | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | |
| # not use this file except in compliance with the License. You may obtain | |
| # a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # |
| ;; 配下のフォルダ全読み込み | |
| (setq load-path(cons "~/.emacs.d/elisp" load-path)) | |
| (setq inhibit-startup-message t) | |
| (let ((dir (expand-file-name "~/.emacs.d/elisp"))) | |
| (if (member dir load-path) nil | |
| (setq load-path (cons dir load-path)) | |
| (let ((default-directory dir)) | |
| (load (expand-file-name "subdirs.el") t t t)))) | |
| (require 'package) |
| #define _CRT_SECURE_NO_WARNINGS 1 | |
| #include "DxLib.h" | |
| #include <opencv2/opencv.hpp> | |
| void MixSound(int main, int sub, int samplePos) { | |
| int sampleNum = GetSoftSoundSampleNum(sub); | |
| for (int i = 0; i < sampleNum; i++) { | |
| int ch1 = 0; |
| // | |
| // This file consists of 3 parts. | |
| // The first 2 parts are from yohhoy's C11 <threads.h> emulation library. | |
| // The original files are from https://gist.github.com/yohhoy/2223710 | |
| // I, takl, commented out 2 lines. | |
| // These 2 parts are ditributed under the Boost Software License, Version 1.0. | |
| // (See the header of these parts for detail) | |
| // | |
| // The last part is written by takl. | |
| // This part is licensed under CC0. |
| #include "DxLib.h" | |
| int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, | |
| LPSTR lpCmdLine, int nCmdShow ) | |
| { | |
| ChangeWindowMode(TRUE); | |
| int GHandle[ 4 ] ; | |
| int i ; | |
| if( DxLib_Init() == -1 ) // DXライブラリ初期化処理 |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class Opacity : MonoBehaviour | |
| { | |
| bool sight; | |
| Color color; | |
| float red, green, blue, alpha; //RGBを操作するための変数 |