anonymous No title
C++
#include "M5CoreInk.h"
#include <LovyanGFX.hpp>

Ink_Sprite InkPageSprite(&M5.M5Ink);
static LGFX_Sprite sprite;

void setup() {
  M5.begin();
  M5.M5Ink.isInit();
  M5.M5Ink.clear();
  InkPageSprite.creatSprite(0, 0, 200, 200, false);

  // スプライト作成
  sprite.setColorDepth(2);
  sprite.createPalette();
  sprite.createSprite(200, 200);
  sprite.clear(TFT_WHITE);

  // 描画テスト
  sprite.drawLine(0, 0, 199, 199, TFT_BLACK);
  pushSprite();

  delay(1000);

  // 描画テスト
  sprite.drawLine(0, 0, 199, 0, TFT_BLACK);
  pushSprite();

  delay(1000);

  // 描画テスト
  sprite.clear(TFT_WHITE);
  sprite.drawLine(0, 10, 199, 10, TFT_BLACK);
  pushSprite();
}

void loop() {
  delay(10000);
}

void pushSprite() {
  InkPageSprite.clear();
  for (int y = 0; y < 200; y++) {
    for (int x = 0; x < 200; x++) {
      uint16_t c = sprite.readPixel(x, y);
      if (c == 0x0000) {
        InkPageSprite.drawPix(x, y, 0);
      } else {
        InkPageSprite.drawPix(x, y, 1);
      }
    }
  }
  InkPageSprite.pushSprite();
}
NinoX No title
C++
import notification , clipboard , keyboard , datetime
import tweepy
import base64 , json
import time , glob
import os , sys , re
import random , console , sound

# ルーム番号
roomid = "2881" 
# パスツイ分
passtime = "29"

username = clipboard.get()
password  = ""
path1 = "/"
path2 = ".pa"
times = str(datetime.datetime.now())
file = glob.glob("*.pa")

def tweet_trim(tweet):
#tweet = tweet_filter(tweet)
    itemlist = itemlist1 = ["@[a-zA-Z0-9_]+",
             "[0-9]{1,2}:[0-5][0-9]",
             "[0-9]{1,2}時[0-59]分",
             "([0-9]|[0-2][0-9])時",
             "[0-5][0-9]分",
             "[1-9]{1,2}/[0-9]{1,2}",
             "[0-9]{1,2}月([1-3][0-9]|[0-9])日",]
    for i in itemlist:
        tweet = re.sub(i,"",tweet)
    tweet = tweet.replace(" ","")
    tweet = tweet.replace(" ","")
    tweet = re.findall(r"\d+",tweet)
    return tweet

text1 = "⓪①②③④⑤⑥⑦⑧⑨"
text2 = "⓿❶❷❸❹❺❻❼❽❾"
text3 = "0123456789"
text4 = "0123456789"
text5 = "𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡"

consumerkey = "qXB67caV4OujUrfqqSMQYZlFV"
consumersecret = "DpaGn0iawPjylujhj4VFxheA8aO578Ik080KDs3vZyHO0PdslY"
accesstoken = "1239524723035230208-oMi7WkXjHUvQm0qZDMD86fwEftVoL2"
accesstokensecret = "RpQFgDrjnV7aL8Q89cfN7HidEi4WIm401EKi1BuSsUXGl"

Auth = tweepy.OAuthHandler(consumerkey,consumersecret)
Auth.set_access_token(accesstoken,accesstokensecret)
Api = tweepy.API(Auth)

now   = datetime.datetime.now()
minute = now.minute

if("/" in str(username)):
    username = username.split("/")
    username = username[3].split("?")
    username = username[0]
else:
    print("tweetする方のプロフィールコピーしてください")
    sys.exit()

for a in range(400):  
    for i in range(400) :
        for i, status in enumerate(tweepy.Cursor(Api.user_timeline,id=username,tweet_mode="extended").items(1)):
            tweet = status.full_text
            tweettime = status.created_at
        start = time.time()
        a = 0
        for i in text1:
            if(i in tweet):
              tweet = tweet.replace(i,text3[a])
            a = a + 1
        a = 0
        for i in text2:
            if(i in tweet):
                tweet = tweet.replace(i,text3[a])
            a = a + 1
        a = 0
        for i in text4:
            if(i in tweet):
                tweet = tweet.replace(i,text3[a])
            a = a + 1
        a = 0
        for i in text5:
            if(i in tweet):
                tweet = tweet.replace(i,text3[a])
            a = a + 1

        tweet = tweet_trim(tweet)
        tweettime = re.findall(r"\d+",str(tweettime))
        count = len(tweet)

        if(passtime in tweettime):
            print("Passward!")
        else:
            print("Loading...[{0}]".format(datetime.datetime.now()))
            time.sleep(0.000000000000000000000000000000000000000000000000000000001)
            break

        if(len(tweet) == 0):
             print("I can not find the password.")
             sys.exit()
        if(roomid in tweet and len(tweet) >= 2):
            room_id_index = tweet.index(roomid)
            if(room_id_index == 0):
                password = str(tweet[1])
                keyboard.insert_text(password)
                keyboard.insert_text("\n")
                sound.play_effect("digital:PhaserDown3",volume = 100 )
                print("Password:"+password)
                e = time.time() - start
                print(e)
                sys.exit()
            elif(room_id_index == 1):
                password = str(tweet[0])
                keyboard.insert_text(password)
                keyboard.insert_text("\n")
                sound.play_effect("digital:PhaserDown3",volume = 100 )
                print("Password:"+password)
                e = time.time() - start
                print(e)
                sys.exit()
        elif(len(tweet) >= 1):
            password = str(tweet[0])
            keyboard.insert_text(password)
            keyboard.insert_text("\n")
            sound.play_effect("digital:PhaserDown3",volume = 100 )
            print("Password:"+password)
            e = time.time() - start
            print(e)
            sys.exit()
        else:
            password = tweet[0]
            keyboard.insert_text(password)
            keyboard.insert_text("\n")
            print("Password:"+password)
            sound.play_effect("digital:PhaserDown3",volume = 100 )
            e = time.time() - start
            print(e)
            sys.exit()
anonymous No title
C++
#include "stdio.h"

//階乗関数
double fact(double k) {
	double y,i;
	y = 1;
	for (i = 1; i <= k;i++) {
		y = y * i;
	}
	return(y);
}

//自然対数01
int main() {
	double s, i;
	s = 0;

	for (i = 0; i <= 20; i++) {
		s += 1 / fact(i);
	}

	printf("%lf",s);
}

//自然対数02
int main() {
	double s, p, i;
	s = 1 , p = 1;

	for (i = 1; i <= 20; i++) {
		p = p / i;
		s += p;
	}

	printf("%lf",s);
}

//組み合わせ01
int main() {
	double c, n, r, i;

	//入力
	printf("n=");
	scanf_s("%lf",&n);
	printf("r=");
	scanf_s("%lf",&r);

	c = fact(n) / (fact(r)*fact(n-r));

	printf("%lf",c);
}
りゅうちゃん@hパラメータ No title
C++
#include "stdio.h"
#include "stdlib.h"
#include "math.h"

int main() {
	double sum, ave, max, sd, devi;
	int count;
	int rand_nums [10];

	//変数初期化
	sum = 0, ave = 0, max = 0, sd = 0, devi = 0;

	//乱数配列 --1から100の乱数--
	srand(100);
	for (count = 0; count < 10; count++) {
		rand_nums [count] = rand() % 100 +1;
	}

	//##############################################################

	//合計
	for (count = 0; count < 10; count++) {
		sum += rand_nums [count];
	}

	//平均
	ave = sum / 10;

	//最大
	max = rand_nums[0];
	for (count = 1; count < 10; count++) {
		if (max < rand_nums [count]) {
			max = rand_nums[count];
		}
	}

	//標準偏差
	for (count = 0; count < 10; count++) {
		devi += pow((rand_nums [count] - ave),2);
	}
	sd = sqrt(devi / 10);

	//##############################################################

	//表示
	printf("乱数:");
	for (count = 0; count < 10; count++) {
		printf("%d,", rand_nums [count]);
	}
	printf("\n合計:%lf\n平均:%lf\n最大:%lf\n標準偏差:%lf\n", sum, ave, max, sd);

	return 0;
}
りゅうちゃん@hパラメータ No title
C++
#include <stdio.h>
#include<stdlib.h>
#include<math.h>
int main(void){
    int a[100], n, i,s,h,z,x;
    float j;
    srand(100);
    printf("Input n=?\n");
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        a[i]=rand()%100;
        printf("a[%d]=%d\n",i,a[i]);

    }
    s=0;
    z=0;
    x=0;
    for(i=1;i<=n;i++){
        s=s+a[i];
        if(a[i]>z){
            z=a[i];
        }else{
        }

    }
    h = s / n;
    for(i=1;i<=n;i++){
        x=x+((a[i]-h)*(a[i]-h));
    }
    j=sqrt(x/n);
    printf("sum=%d\n",s);
    printf("avarage=%d\n",h);
    printf("max=%d\n",z);
    printf("標準偏差=%f",j);
}
anonymous No title
C++
#include "stdio.h"

//階乗関数
double fact(double k) {
	double y,i;
	y = 1;
	for (i = 1; i <= k;i++) {
		y = y * i;
	}
	return(y);
}

int main() {
	double c, n, r, i;

	//入力
	printf("n=");
	scanf_s("%lf",&n);
	printf("r=");
	scanf_s("%lf",&r);

	c = fact(n) / (fact(r)*fact(n-r));

	printf("%lf",c);
}
anonymous No title
C++
#include "stdio.h"
#include "stdlib.h"
#include "math.h"

int main() {
	double sum, ave, max, sd, devi;
	int count;
	int rand_nums [10];

	//変数初期化
	sum = 0, ave = 0, max = 0, sd = 0, devi = 0;

	//乱数配列 --1から100の乱数--
	for (count = 0; count < 10; count++) {
		rand_nums [count] = rand() % 100 +1;
	}

	//##############################################################

	//合計
	for (count = 0; count < 10; count++) {
		sum += rand_nums [count];
	}

	//平均
	ave = sum / 10;

	//最大
	max = rand_nums[0];
	for (count = 1; count < 10; count++) {
		if (max < rand_nums [count]) {
			max = rand_nums[count];
		}
	}

	//標準偏差
	for (count = 0; count < 10; count++) {
		devi += pow((rand_nums [count] - ave),2);
	}
	sd = sqrt(devi / 10);

	//##############################################################

	//表示
	printf("乱数:");
	for (count = 0; count < 10; count++) {
		printf("%d,", rand_nums [count]);
	}
	printf("\n合計:%lf\n平均:%lf\n最大:%lf\n標準偏差:%lf\n", sum, ave, max, sd);

	return 0;
}
anonymous No title
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"hello"<<endl;
}
anonymous No title
C++
#include <Arduino.h>

#if defined( ARDUINO_M5Stack_Core_ESP32 ) || defined( ARDUINO_M5STACK_FIRE )
  #include "M5Stack.h"
#elif defined( ARDUINO_M5Stick_C )
  #include "M5StickC.h"
#endif

void setup() {
  M5.begin();
  M5.Lcd.fillScreen(RED);
}

void loop() {
}
anonymous No title
C++
#include <LGFX_TFT_eSPI.hpp>
#include "AXP192.h"
#include "utility/Config.h"
#include "utility/SH200Q.h"
#include "utility/MPU6886.h"
#include "utility/Button.h"
#include "utility/CommUtil.h"
#include "RTC.h"
#include "IMU.h"
 
#define BLACK               0x0000
#define NAVY                0x000F
#define DARKGREEN           0x03E0
#define DARKCYAN            0x03EF
#define MAROON              0x7800
#define PURPLE              0x780F
#define OLIVE               0x7BE0
#define LIGHTGREY           0xC618
#define DARKGREY            0x7BEF
#define BLUE                0x001F
#define GREEN               0x07E0
#define CYAN                0x07FF
#define RED                 0xF800
#define MAGENTA             0xF81F
#define YELLOW              0xFFE0
#define WHITE               0xFFFF
#define ORANGE              0xFD20
#define GREENYELLOW         0xAFE5
#define PINK                0xF81F
 
class M5StickCBoth {
  public:
    void begin(bool LCDEnable = true, bool PowerEnable = true, bool SerialEnable = true) {
      if (SerialEnable) {
        Serial.begin(115200);
        Serial.flush();
        delay(50);
        Serial.print("M5StickC initializing...");
      }
      if (PowerEnable) {
        Axp.begin();
      }
      if (LCDEnable) {
        Lcd.begin();
      }
      if (SerialEnable) {
        Serial.println("OK");
      }
      Rtc.begin();
    }
    void update() {
      BtnA.read();
      BtnB.read();
    }
    TFT_eSPI Lcd;
    AXP192 Axp = AXP192();
    const int DEBOUNCE_MS = 10;
    Button BtnA = Button(BUTTON_A_PIN, true, DEBOUNCE_MS);
    Button BtnB = Button(BUTTON_B_PIN, true, DEBOUNCE_MS);
    RTC  Rtc;
    IMU Imu;
    CommUtil I2C = CommUtil();
    MPU6886 Mpu6886;
    SH200Q Sh200Q;
};
 
static M5StickCBoth M5;
 
void setup() {
  M5.begin();
}
 
void loop() {
  M5.Lcd.fillScreen(WHITE);
  delay(1000);
  M5.Lcd.fillScreen(BLACK);
  delay(1000);
}
Don't you submit code?
Submit
年末年始は機械学習・深層学習を勉強しませんか?
広告
未経験から最短でエンジニアへの転職を目指すなら