Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Linq;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("sdf");
string[] txt = {"あ山あ","いい山","川うう"};
var linqWhere = txt.Where(item => item.Contains("山"));
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
DateTime start = DateTime.Now;
using System;
using System.Linq;
class Program
{
static void Main(string[] args)
{
string[] text = {"ああ山","いい山","うう山","ええ山","おお山"};
var linqAll = text.All(item => item.EndsWith("山"));
Console.WriteLine(linqAll);
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
IEnumerable<int> counter = Enumerable.Range(0, 10);
var linqWhere = counter.Where(item => item > 3 && item < 8);
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
var num = Enumerable.Range(-5, 6);
@wheeliechamp
wheeliechamp / days_of_month.vba
Created February 11, 2020 05:27
月の日数を取得する
月の日数を調べるには、翌月の初日の前日が調べたい月の最終日となることを利用して調べる(C6の日付の月の日数を表示する)。
Private Sub CommandButton1_Click()
MsgBox Day(DateSerial(Year(Range("C6")), Month(Range("C6")) + 1, 0))
End Sub
@wheeliechamp
wheeliechamp / py_a025
Created February 13, 2020 13:35
Python
# ダメなコード
datas = []
info = list(map(int, input().split(' ')))
for i in range(info[0]):
tmp = input().rstrip().split(' ')
datas.append(tmp)
result_ary = []
result_ary.append([0, info[1]])
for i in range(info[0]):
@wheeliechamp
wheeliechamp / py_a025_2
Created February 14, 2020 15:52
Python 再帰処理
# これもだめだった
#8 300 400
#9 39
#48 38
#21 10
#14 45
#32 20
#32 48
#9 7
#19 16
@wheeliechamp
wheeliechamp / MainActivity.java
Created April 30, 2020 12:53
Activity以外から更新とSharedPreferencesの使い方
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
Context context;
@wheeliechamp
wheeliechamp / TextChange.java
Created April 30, 2020 12:54
Activity以外から更新とSharedPreferencesの使い方
import android.content.Context;
import android.content.SharedPreferences;
import android.widget.TextView;
import static android.content.Context.MODE_PRIVATE;
public class TextChange {
private Context appContext;