1234589
anonymous No title
JavaScript
あああ
anonymous GAS
JavaScript
function myFunction() {
  let sheet = SpreadsheetApp.getActiveSheet();
  // 数値ではなく文字列として取得
  let value = sheet.getRange(1, 1).getDisplayValue();
  
  // 年月日を切り出す
  let year = value.slice(0, 4);
  let month = value.slice(4, 6);
  let day = value.slice(6, 8);
  // 月は0から数えるので-1
  let date = new Date(year, month - 1, day);
  
  // 転記
  sheet.getRange(1, 2).setValue(date).setNumberFormat('yyyy/mm/dd');
}
anonymous No title
JavaScript
anonymous No title
JavaScript
console.log('a')
anonymous No title
JavaScript
console.log('ちんぽ')
anonymous No title
JavaScript
// ボゴソート2
function Bogosort(arr){
    var isSorted = function(arr){
        for(var i = 1; i < arr.length; i++){
            if (arr[i-1] > arr[i]) {
                return false;
            }
        }
        return true;
    };
    function shuffle(arr){
        var count = arr.length, temp, index;
        while(count > 0){
            index = Math.floor(Math.random() * count);
            count--;
            temp = arr[count];
            arr[count] = arr[index];
            arr[index] = temp;
        }
        return arr;
    }
   function sort(arr){
        var sorted = false;
        while(!sorted){
            arr = shuffle(arr);
            sorted = isSorted(arr);
        }
        return arr;
    }
    return sort(arr);
}
var arra = "いろはにほへとちりぬるをわかよたれそつねならむ"; 
console.log("Original Array Elements"); 
console.log(arra); 
console.log("Sorted Array Elements"); 
console.log(Bogosort(arra));
anonymous No title
JavaScript
// ボゴソート
function Bogosort(arr){
    var isSorted = function(arr){
        for(var i = 1; i < arr.length; i++){
            if (arr[i-1] > arr[i]) {
                return false;
            }
        }
        return true;
    };

    function shuffle(arr){
        var count = arr.length, temp, index;

        while(count > 0){
            index = Math.floor(Math.random() * count);
            count--;

            temp = arr[count];
            arr[count] = arr[index];
            arr[index] = temp;
        }

        return arr;
    }

   function sort(arr){
        var sorted = false;
        while(!sorted){
            arr = shuffle(arr);
            sorted = isSorted(arr);
        }
        return arr;
    }

    return sort(arr);
}


var arra = [3, 0, 2, 5, -1, 4, 1, 6, 3, 7]; 
console.log("Original Array Elements"); 
console.log(arra); 
console.log("Sorted Array Elements"); 
console.log(Bogosort(arra));
やなぎ No title
JavaScript
function myFunction() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var member_sheet = spreadsheet.getSheetByName("名簿");
  var member_listdata = member_sheet.getRange(2, 1, member_sheet.getLastRow()-1, 3).getValues();
  var sheet_ID = Browser.inputBox("GoogleFormの集計データと紐づけされているスプレッドシートのIDを入力してください");
  var practice_numbers = Browser.inputBox("面接練習の日数を半角で入力してください");
  practice_numbers = Number(practice_numbers);
  var input_sheet = SpreadsheetApp.openById(sheet_ID).getSheets()[0];
  var input_allmembers = input_sheet.getLastRow()-1;
  var input_category = input_sheet.getLastColumn();
  var input_data = input_sheet.getRange(1, 1, input_allmembers+1, input_sheet.getLastColumn()).getValues();
  var member3=[];
  var info3=[];
  var info3_follow=[];
  var member4=[];
  var info4=[];
  var info4_follow=[];
  var array=[];
  for(let i=0;i<=input_allmembers;i++){
    for(let j=0;j<=member_listdata.length-1;j++){
      if(input_data[i][2]===member_listdata[j][0]){
        member3.push(input_data[i][2]);
        for(let k=3;k<=practice_numbers+2;k++){
          array.push(input_data[i][k]);
        }
        info3.push(array);
        array.length=0;
        for(let k=practice_numbers+3;k<=input_category-1;k++){
          array.push(input_data[i][k]);
        }
        info3_follow.push(array);
        array.length=0;
      }
      if(input_data[i][2]===member_listdata[j][1]){
        for(let k=1;k<=member_listdata[j][2];k++){
          member4.push(input_data[i][2]);
        }
        for(let k=3;k<=practice_numbers+2;k++){
          array.push(input_data[i][k]);
        }
        info4.push(array);
        array.length=0;
        for(let k=practice_numbers+3;k<=input_category-1;k++){
          array.push(input_data[i][k]);
        }
        info4_follow.push(array);
        array.length=0;
      }
    }
  }
  console.log(member3,info3,member4,info4,);
}
anonymous No title
JavaScript
'use strict';

{
  // 落ちるスピード
  let GAME_SPEED = 700;

  // フィールドサイズ
  const FIELD_COL = 10;
  const FIELD_ROW = 20;

  
  // ブロック一つのサイズ(ピクセル)
  const BLOCK_SIZE = 30;

  // キャンバスのサイズ
  const SCREEN_W = FIELD_COL * BLOCK_SIZE; //300
  const SCREEN_H = FIELD_ROW * BLOCK_SIZE; //600

  // テトロみののサイズ
  const TETRO_SIZE = 4; 

  let can = document.getElementById("can");
  let con = can.getContext("2d");

  can.width = SCREEN_W;
  can.height = SCREEN_H;
  can.style.border = "4px solid #555";

  const TETRO_COLORS = [
    "#000",
    "#6cf",
    "#fa2",
    "#00f",
    "#f0f",
    "#fd2",
    "#f44",
    "#5b5",
  ];

  const TETRO_TYPES = [
    [],// 0
    [
      [0, 0, 0, 0],//1.I
      [1, 1, 1, 1],
      [0, 0, 0, 0],
      [0, 0, 0, 0],
    ],
    [
      [0, 1, 0, 0],// 2.L
      [0, 1, 0, 0],
      [0, 1, 1, 0],
      [0, 0, 0, 0],
    ],
    [
      [0, 0, 1, 0],// 3.J
      [0, 0, 1, 0],
      [0, 1, 1, 0],
      [0, 0, 0, 0],
    ],
    [
      [0, 1, 0, 0],// 4.T
      [0, 1, 1, 0],
      [0, 1, 0, 0],
      [0, 0, 0, 0],
    ],
    [
      [0, 0, 0, 0],// 5.O
      [0, 1, 1, 0],
      [0, 1, 1, 0],
      [0, 0, 0, 0],
    ],
    [
      [0, 0, 0, 0],// 6,Z
      [1, 1, 0, 0],
      [0, 1, 1, 0],
      [0, 0, 0, 0],
    ],
    [
      [0, 0, 0, 0],// 7.O
      [0, 1, 1, 0],
      [1, 1, 0, 0],
      [0, 0, 0, 0],
    ],
  ];

  const START_X = FIELD_COL / 2 - TETRO_SIZE / 2;
  const START_Y = 0;

  // テトロミノ本体
  let tetro;
  
  // テトロミノの座標
  let tetro_x = START_X;
  let tetro_y = START_Y;
  // テトロミノの形
  let tetro_t;

  // フィールド本体
  let field = [];

  // ゲームオーバーフラグ
  let over = false;

  tetro_t = Math.floor(Math.random() * (TETRO_TYPES.length - 1)) + 1;
  tetro = TETRO_TYPES[tetro_t];

  // 初期化に関数
  function init() 
  {
    for (let y = 0; y < FIELD_ROW; y++) 
    {
      field[y] = [];
      for (let x = 0; x < FIELD_COL; x++) 
      {
        field[y][x] = 0;
      }
    }
    // テスト
    // field[5][8] = 1;
    // field[19][0] = 1;
    // field[19][9] = 1;
  }

  init();
  drawAll();

  setInterval(dropTetro, GAME_SPEED);

  // ブロック一つを描画する。
  function drawBlock(x, y, c) 
  {
    let px = x * BLOCK_SIZE;
    let py = y * BLOCK_SIZE;

    con.fillStyle = TETRO_COLORS[c];
    con.fillRect(px, py, BLOCK_SIZE, BLOCK_SIZE);    
    con.strokeStyle ="black";
    con.strokeRect(px, py, BLOCK_SIZE, BLOCK_SIZE)
  }

  // フィールドとテトロを表示する関数
  function drawAll()
  {

    con.clearRect(0, 0, SCREEN_W, SCREEN_H);

    for (let y = 0; y < FIELD_ROW; y++) 
    {
      for (let x = 0; x < FIELD_COL; x++) 
      {
        if (field[y][x]) 
        {
          drawBlock(x, y, field[y][x]);
        }
      }
    }

    for (let y = 0; y < TETRO_SIZE; y++) 
    {
      for (let x = 0; x < TETRO_SIZE; x++) 
      {
        if (tetro[y][x]) 
        {
          drawBlock(tetro_x + x, tetro_y + y, tetro_t);
        }
      }
    }
    if (over) 
    {
      let s = "GAME OVER"
      con.font = "40px 'MS ゴシック'";
      let w =  con.measureText(s).width;
      let x = SCREEN_W/2 - w/2;
      let y = SCREEN_H/2 - 20;
      con.lineWidth = 4;
      con.strokeText(s, x, y);
      con.fillStyle = "white";
      con.fillText(s, x, y);
    }
  }

  // ブロックの衝突判定
  function checkMove(mx, my, ntetro) 
  {
    if (ntetro === undefined) ntetro = tetro;

    for (let y = 0; y < TETRO_SIZE; y++) 
    {
      for (let x = 0; x < TETRO_SIZE; x++) 
      {
        if (ntetro[y][x]) 
        {
          let nx = tetro_x + mx + x;
          let ny = tetro_y + my + y;

          if (ny < 0 ||
              nx < 0 ||
              ny >= FIELD_ROW ||
              nx >= FIELD_COL ||
              field[ny][nx] ) 
          {
            return false;         
          }
        }
      }
    }
    return true;
  }

  // // テトロの回転
  function rotate() 
  {
    let ntetro = [];

    for (let y = 0; y < TETRO_SIZE; y++) 
    {
      ntetro[y] = [];
      for (let x = 0; x < TETRO_SIZE; x++) 
      {
        ntetro[y][x] = tetro[TETRO_SIZE-x-1][y];
      }
    }
    return ntetro;
  }

  // テトロを固定する
  function fixTetro()
  {
    for (let y = 0; y < TETRO_SIZE; y++) 
    {
      for (let x = 0; x < TETRO_SIZE; x++) 
      {
        if (tetro[y][x]) 
        {
          field[tetro_y + y][tetro_x +x] = tetro_t;
        }
      }
    }
  }

  // ラインが揃ったかチェックして消す
  function checkLine() 
  {
    let linec = 0;
    for (let y = 0; y < FIELD_ROW; y++) 
    {
      let flag = true;

      for (let x = 0; x < FIELD_COL; x++) 
      {
        if (!field[y][x]) 
        {
          flag = false;
          break;
        }
      }
      if (flag) 
      {
        linec++;

        for (let ny = y; ny > 0; ny--) 
        {
          for (let nx = 0; nx < FIELD_COL; nx++) 
          {
            field[ny][nx] = field[ny-1][nx]
          }
        }
      }
    }
  }

  // ブロックが落ちる処理
  function dropTetro() 
  {
    if (over) return;

    if (checkMove(0, 1)) tetro_y++;
    else 
    {
      fixTetro();
      checkLine();

      tetro_t = Math.floor(Math.random() * (TETRO_TYPES.length - 1)) + 1;
      tetro = TETRO_TYPES[tetro_t];
      tetro_x = START_X;
      tetro_y = START_Y;

      if (!checkMove(0,0)) 
      {
        over = true;
      }
    }

    drawAll();
  }

  document.onkeydown = function(e) 
  {
    // 
    if (over) return;
    switch (e.keyCode) 
    {
      case 37: // left
        if (checkMove(-1, 0)) tetro_x--;
        break; 
      // case 38: // up
      //   if (checkMove(0, -1)) tetro_y--;
      //   break; 
      case 39: // right
        if (checkMove(1, 0)) tetro_x++;
        break;
      case 40: // down
        if (checkMove(0, 1)) tetro_y++;
        break;
      case 32: // spaceKey
        let ntetro = rotate();
        if (checkMove(0, 0, ntetro,)) tetro = ntetro;
        break;

    }
    drawAll();
  }
}
anonymous No title
JavaScript
import * as React from "react";
import { useSelector, useDispatch } from "react-redux";
import { Form, Button } from "react-bootstrap";

import { query } from "../requests/query"

export const Tags = (): React.ReactElement => {
  const dispatch = useDispatch();

  const [name,setName] = React.useState("");
  const [,] = React.useState("");
  

  const hadleSubmit = (event) => {
    
  }


  return (
    <div className="card">
      <div className="card-body">
        <h1>タグ作成</h1>
        <Form onSubmit={handleSubmit}>
          <Form.Group>
            <FormData.Label>タググループ名</FormData.Label>
            <FormData.Control type='text' value={name} onChange={(event) => setName(event.target.value)} />
          </Form.Group>
          <Button type="submit" >作成</Button>
        </Form>
      </div>
    </div>
  );
};


import { createSlice, PayloadAction } from "@reduxjs/toolkit";

const AuthorRequestState = [
    "uninitialized",
    "fetching",
    "loaded",
  ] as const;

export type AuthorRequestState = typeof AuthorRequestState[number];

export type Author = {
    id: number;
    name: string;
}

export type Authors = {
    requestState: AuthorRequestState;
    authors?: Author[];
}

export const authorStore = createSlice({
    name: "author",
    initialState: {
        requestState: "unintialazed",
        authors: null,
    } as Authors,
    reducers: {
        
    }
})


import axios from "axios";

import { RootDispatch } from "../state";
import { query } from "../requests/query";

const urlHead = "";

type SQ = {/* */}

export type makeTagQuery = {
    method: string;
    URL: string;
    data: {
        Name: string;
        MotherTagGroup: number;
    }
}



export function makeMakeTagQuery(name: string,tgID: number): makeTagQuery {

    return {
        method: "POST",
        URL: urlHead+"/booktags",
        data: {
            Name: name,
            MotherTagGroup: tgID,
        }
    }
}

export type makeBookQuery = {
    method: string;
    URL: string;
    data: {
        ISBN?: number;
        AutomadeYL: number;
        HandmadeYL: number;
        PublisherID: number;
        Numberofpages: number;
        AuthorID: number;
        PainterID: number;
        Wordcount: number;
        Title: string;
        Published: string;
        Synopsis: string;
        Impression: string;
        URL?: string;
        Tagged: boolean;
    }
}

export function makeMakeBookquery(
    ISBN: number,
    AutomadeYL: number,
    HandmadeYL: number,
    PublisherID: number,
    Numberofpages: number,
    AuthorID: number,
    PainterID: number,
    Wordcount: number,
    Title: string,
    Published: string,
    Synopsis: string,
    Impression: string,
    URL: string,
    Tagged: boolean): makeBookQuery {
    return {
        method: "POST",
        URL: urlHead+"/books",
        data: {
            ISBN: ISBN,
            AutomadeYL: AutomadeYL,
            HandmadeYL: HandmadeYL,
            PublisherID: PublisherID,
            Numberofpages: Numberofpages,
            AuthorID: AuthorID,
            PainterID: PainterID,
            Wordcount: Wordcount,
            Title: Title,
            Published: Published,
            Synopsis: Synopsis,
            Impression: Impression,
            URL: URL,
            Tagged: Tagged
        }
    }
}

export function makeAuthor(dispatch: RootDispatch, makeAuthorQuery: SQ) {
    const responce = query(dispatch,makeAuthorQuery);
}

export type makeAuthorQuery = {

}
Don't you submit code?
Submit
1234589