Skip to content

Instantly share code, notes, and snippets.

@qaz10102030
qaz10102030 / NavHomeFragment.java
Created May 17, 2022 16:37
Chanel Fashion APP - home list
package com.chanel.fashion.fragments.navigation;
import android.os.Bundle;
import android.view.View;
import butterknife.BindView;
import com.chanel.fashion.R;
import com.chanel.fashion.application.Constant;
import com.chanel.fashion.application.StatsConstant;
import com.chanel.fashion.backstage.models.Tracking;
import com.chanel.fashion.backstage.models.component.BSBasePushComponent;
String p = Objects.requireNonNull(getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)).getAbsolutePath() + "/IOC_Report";
Log.d(TAG, "Path: " + p);
File directory = new File(p);
Log.d(TAG, "initData: " + directory.getAbsolutePath());
File[] files = directory.listFiles();
Log.d(TAG, "Size: " + files.length);
for (int i = 0; i < files.length; i++) {
Log.d(TAG, "FileName:" + files[i].getName());
}
import numpy as np
import spectral.io.envi as envi
from matplotlib import pyplot as plt
"""
超高速小畫家
* 顏色增加改for迴圈寫法
* 改顏色也換寫法
# %%
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
from spectral.io import envi
def read_rgb_ir(folder, key):
r = np.array(Image.open(f"{folder}/{key}_R.tif"))
g = np.array(Image.open(f"{folder}/{key}_G.tif"))
import cv2
cam = cv2.VideoCapture(0 + cv2.CAP_DSHOW)
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cam.set(cv2.CAP_PROP_CONVERT_RGB, 0)
try:
print("Starting video. Press CTRL+C to exit.")
while True:
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
// find TextInputLayout
TextInputLayout textInputLayout = findViewById(R.id.textInputLayout);
// 隨意設定一個 startIcon
textInputLayout.setStartIconDrawable(R.drawable.ic_check);
// 從 textInputLayout 找出 icon 後隱藏
CheckableImageButton icon = textInputLayout.findViewById(R.id.text_input_start_icon);
icon.setVisibility(View.GONE);
@qaz10102030
qaz10102030 / Test.java
Created September 29, 2021 08:28
icon 在 error text 的左邊
// find TextInputLayout
TextInputLayout textInputLayout = findViewById(R.id.textInputLayout);
// set error enable and error text
textInputLayout.setErrorEnabled(true);
textInputLayout.setError(" 需完成信箱驗證唷");
// 關閉原本的錯誤 icon
textInputLayout.setErrorIconDrawable(null);
import time
import numpy as np
def Algorithm(cube, tar, num, off_set=0):
[w, h, di] = cube.shape
flatten_array = cube.reshape(w * h, di).T
result_bands = []
for i in range(num):
result = [] # local result before sort