전체 글
-
javascript 엑셀 정보 읽어오는 방법javascript&html 2024. 2. 14. 08:30
javascript 에서 엑셀 정보 읽어오는 방법으로 외부 js파일을 사용한다. SheetJS을 이용하여 간단하게 엑셀 정보를 읽어올 수 있다. var firstSheet = workbook.Sheets[workbook.SheetNames[0]]; : 첫번째 시트[0] var excel = XLSX.utils.sheet_to_json(firstSheet, { header: 1 }); : 엑셀 파일을 json형태로 변환 *엑셀 정보 읽어올때, 날짜의 경우 간혹 날짜가 변환된 경우가 있으므로 계산을 통해 변환해줘야 한다. 결과값 = (날짜- 25569) * 86400;
-
문자열 공백제거javascript&html 2023. 10. 19. 21:35
자바스크립트 문자열 공백제거 함수 1. replace() 1-1) str.replace(/\s/g, "") : 앞,뒤,가운데 모든 공백을 제거 (모든 공백을 제거하고자 할때 사용) 1-2) str.replace() : 앞 공백만 제거 2. trim() str.trim() : 앞,뒤 공백만제거 3. trimStart() str.trimStart () : 앞, 공백만제거 4. trimEnd() str. trimEnd () : 뒤 공백만제거 var sample = " Test Blank "; console.log(sample); console.log(sample.replace(/\s/g, "")); //가운데 공백까지 모두 제거 console.log(sample.replace(" ","")); // 앞에 공백..
-
ci3 가상환경 index.php 없애기CI3 2022. 10. 29. 17:38
https://wildflower282.tistory.com/7 ci4 index.php 없애기 1. Config/App.php 설정 $baseURL = 'http://localhost/{project_name}/ 로 변경 $indexPage = ‘’; 로 변경 $uriProtocol = 'PATH_INFO’; 로 변경 2. Apache 설정 파일 수정 (파일 : conf/httpd.conf) .. wildflower282.tistory.com ci4 주소에 index.php 없애기를 하였으나 정상 작동되지 않았다. 방법은 맞았으나 내 환경에 맞지 않아 없어지지 않은 것이다. 자신의 개발 환경이 가상호스트일 경우에는 위와 같이 셋팅해도 index.php 를 없앨 수 없다. 따라서, 자신의 개발환경이 가상..
-
CI3 트랜잭션 (transaction)CI3 2022. 9. 30. 18:42
# 트랜잭션 시작 $this->db->trans_start(); # 트랜잭션 완료 $this->db->trans_complete(); #트랜잭션 엄격모드 비활성화 $this->db->trans_strict(false); #트랜잭션 수동처리 $this->db->trans_begin(); $this->db->query("YOUR QUERY"); if ($this->db->trans_status() === FALSE){ $this->db->trans_rollback(); } else { $this->db->trans_commit(); } # CI3 & CI4 Transaction 처리 CI3 CI4 트랜잭션 시작 trans_start() transStart() 트랜잭션 완료 trans_complete() tr..
-
[php] opcache기타 2022. 9. 30. 18:41
PHP 속도 개선을 위해 opcache 설정을 테스트 했다. 정확히는 모르나 opcache 설정이 되어 있으면 속도 개선이 된다하여 적용해 보았다. 1. PHP 미설치된 환경 php 5.5.x 버전에서는 opcache 가 기본 내장되어 있다. 따라서 php 설치시에 --enable-opcache 를 설정해주고 설치하고, php.ini 파일의 [opcache] 하단에 아래와 같이 설정해주고 httpd 재부팅 ( service httpd restart) 하면 적용 된다. [opcache] opcache.enable = 1 opcache.enable_cli = 1 opcache.memory_consumption = 256 // 캐시 메모리 크기 opcache.max_accelerated_files = 1200..