Skip to content

Instantly share code, notes, and snippets.

View FloydHsiu's full-sized avatar

Charlie Chang FloydHsiu

  • Phison
  • Taiwan
View GitHub Profile
%{
#include <stdio.h>
%}
/*Identifiers*/
Id [a-zA-Z][a-zA-Z0-9]*
%%
{Id} {
宣告某token xyz++ 在讀的時候只會讀到xyz就會印出找到該token
解決方式
1.使用 xyz”++” or “xyz++”
2.使用 xyz\+\+
[abc] 表示只要符合abc其中之一
[a-z0-9<>_] 表示a~z, 0~9 , <, >, _ 其中之一符合就可
但因為有a-z這種表示方式,所以導致如果要當 “-“也列入考量
“-“必須擺在最一開始或最後, Ex: [-+0-9]
static public void getCookie() throws IOException
{
HttpURLConnection HttpConn;
URL Url = new URL(INDEX_URL);
HttpConn = (HttpURLConnection) Url.openConnection();
System.out.println(HttpConn);
HttpConn.setConnectTimeout(15000);
#include<stdio.h>
#include<stdlib.h>
int scale = 0;
int i = 0;
int j = 0;
int is_p = 0;
scanf("%d", &scale);
//calculate every int lower than scale
@FloydHsiu
FloydHsiu / Test.c
Last active October 27, 2016 08:58
#include <stdio.h>
#include <stdlib.h>
void change(char i);
int main(){
char string[5];
int j=0;
printf("1.請輸入進行編碼的五個字元:");
scanf("%c%c%c%c%c", string, string+1, string+2, string+3, string+4);
@FloydHsiu
FloydHsiu / Cal.c
Last active October 31, 2016 04:13
int main()
{
int N;
double input;
printf("學號後五碼:30023\n");
printf("Enter a number:");
scanf("%lf",&N); //讀double要用%lf
fflush(stdin);
int input;
int answer[100]
int counter = 0
int i;
scanf("%d", &input);
while(input >= 1){
answer[counter] = input % 2;
input = input / 2;
sum=input;
for(count=1;count<=10;count++)//反向相加的次數以10為上限(這裡開始好像怪怪的)
{
reverse = 0;
temp=sum;
while(temp)
{
reverse=reverse*10+temp%10;
temp/=10;
}
typedef struct Cards
{
int face;
char* suit;
} Card;
char spade[5];
char heart[5];
char diamond[7];
char club[4];
基本教學
https://medium.com/pyladies-taiwan/python-%E5%B0%87python%E6%89%93%E5%8C%85%E6%88%90exe%E6%AA%94-32a4bacbe351
除錯參考
https://dotblogs.com.tw/shaynling/2018/01/22/170349
PyInstaller
http://www.pyinstaller.org/