Skip to content

Instantly share code, notes, and snippets.

View Myoga1012's full-sized avatar

Myoga Suibashi Myoga1012

View GitHub Profile
@Myoga1012
Myoga1012 / Calendar.java
Last active January 30, 2023 08:46
Java(アプレット)でカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.util.Calendar;
import java.util.Locale;
public class AppletCalendar extends Applet {
@Myoga1012
Myoga1012 / Calendar.adb
Last active January 30, 2023 08:45
Adaでカレンダーを出力するソースコードです。
-- 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
-- Twitter : https://twitter.com/Myoga1012
-- 使用するライブラリの宣言
-- 入出力
with Ada.Text_IO, Ada.Integer_Text_IO; use Ada.Text_IO;
-- カレンダー(但し、他の言語でいう日付ライブラリみたいなものです)
with Ada.Calendar, Ada.Calendar.Formatting, Ada.Calendar.Time_Zones;
use Ada.Calendar, Ada.Calendar.Formatting, Ada.Calendar.Time_Zones;
@Myoga1012
Myoga1012 / 14seq.h
Last active January 30, 2023 08:41
7セグ or 14セグメントのドットマトリックスで日付を表示するカレンダーです。言語はC++、ライブラリはDXライブラリです。
#pragma once
#include "DxLib.h"
#include <vector>
// sourceの値が、targetのリストのいずれかとマッチするかどうかを判別します。
bool AnyOneOfMatch( char source, std::vector<char> target ) {
bool ans = false;
std::vector<char>::iterator titer = target.begin();
while( titer != target.end() ) {
if( source == *titer++ ) {
@Myoga1012
Myoga1012 / Calendar.coffee
Last active January 30, 2023 08:40
CoffeeScriptでカレンダーを出力するソースコードです。
# 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
# Twitter : https://twitter.com/Myoga1012
window.onload = () ->
# 現在日を取得し、当月1日の曜日と末日を求めます。
now = new Date()
prePad = new Date( now.getFullYear(), now.getMonth(), 1 ).getDay()
lastDay = new Date( now.getFullYear(), now.getMonth() + 1, 0 ).getDate()
@Myoga1012
Myoga1012 / Calendar.cs
Last active January 30, 2023 08:38
Windowsストアアプリ(WinRT)上でカレンダーを表示するソースコードです(言語はXAMLとC#です)。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
using System;
using Windows.UI;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
namespace WSAPP {
// カレンダー用オブジェクトです。
@Myoga1012
Myoga1012 / Calendar.cpp
Last active January 30, 2023 08:29
C++(Win32フォームアプリ(Win32 API))でカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#define MAX_LOADSTRING 100
TCHAR szTitle[MAX_LOADSTRING] = _T( "Calendar" ); // タイトル バーのテキスト
@Myoga1012
Myoga1012 / Calendar.cpp
Last active January 30, 2023 08:28
C++とDXライブラリでカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
#include <stdio.h>
#include "DxLib.h"
// Zellerの公式でddの1日目の曜日を求めます。
int Zeller( DATEDATA& dd ) {
return ( dd.Year + dd.Year / 4 - dd.Year / 100 + dd.Year / 400 + ( 13 * dd.Mon + 8 ) / 5 + 1 ) % 7;
}
@Myoga1012
Myoga1012 / Calendar.vb
Last active January 30, 2023 08:27
Wordのドキュメントに、カレンダーをMicrosoft数式3.0の行列として出力するVBAのモジュールです。
' 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
' Twitter : https://twitter.com/Myoga1012
Option Explicit
Sub Calendar()
' 現在の日付を取得します。
Dim now As Date
now = Date
' 当月1日を表すインスタンスを生成します。
@Myoga1012
Myoga1012 / Calendar.cpp
Last active January 30, 2023 08:25
C++ / CLIでカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
#include "stdafx.h"
#include <stdio.h>
using namespace System;
int main( array<System::String ^> ^args ) {
@Myoga1012
Myoga1012 / Calendar.dtl
Last active January 30, 2023 08:24
ドリトルでカレンダーを出力するソースコードです。
// 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
// Twitter : https://twitter.com/Myoga1012
// 現在の日付と曜日を取得します。
現在年 = ( システム ! 年? ). 現在月 = ( システム ! 月? ). 現在日 = ( システム ! 日? ).
現在曜日 = ( システム ! 曜日? ).
// 曜日を文字から数値( 日曜 : 0、月曜 : 1、・・・、土曜 : 6 )に変換します。
「現在曜日 == "日"」 ! なら「現在曜日 = "0"」
そうでなければ「「現在曜日 == "月"」 ! なら「現在曜日 = "1"」