전체 글(809)
-
Javascript arrya 데이터 삭제시 주의점
for문 등을 이용해서 삭제할 경우, 데이터가 밀리는 문제가 있음뒤에서부터 삭제를 해야 밀리는 문제가 없어짐잘못된 예const drawContainer = Ext.ComponentQuery.query('#drawContainer')[0];const surface = drawContainer.getSurface();const sprites = surface.getItems();console.log(sprites);displayedRects.splice(0, displayedRects.length);sprites.forEach(sprite => { if (sprite.type === 'rect') { console.log(sprite); surface.remove(sprite,..
2024.12.25 -
Sencha combobox 로딩시, 서버에서 값 가져오기
afterrender 이벤트 사용Ext.create('Ext.form.ComboBox', { fieldLabel: 'Select Item', queryMode: 'local', displayField: 'name', valueField: 'id', renderTo: Ext.getBody(), store: { fields: ['id', 'name'] // Define fields for the store }, listeners: { afterrender: function(combo) { // Trigger when ComboBox is rendered Ext.Ajax.request({ url:..
2024.12.24 -
Crontab에서 job 중복 실행 방지
옵션은 없음Lock 파일 사용flock - Ensures only one instance of the job can run at a time.-n - Fails immediately if the lock cannot be acquired./tmp/myjob.lock - Lock file location./path/to/script.sh - The script to execute. * * * * * flock -n /tmp/myjob.lock /path/to/script.sh PID 체크Creates a PID file (/tmp/myjob.pid) to track the running job.Exits if the file already exists.Deletes the PID file after the..
2024.12.24 -
Quartz 같은 job이 중복되게 작동하지 못하도록 하기
@DisallowConcurrentExecution annotation을 추가import org.quartz.DisallowConcurrentExecution;import org.quartz.Job;import org.quartz.JobExecutionContext;import org.quartz.JobExecutionException;@DisallowConcurrentExecutionpublic class MyJob implements Job { @Override public void execute(JobExecutionContext context) throws JobExecutionException { System.out.println("Executing job: " + con..
2024.12.24 -
Linux \r\n --> \n 변환
-i: 파일에 그대로 적용 s: 문자변환/\r//: \r을 없앰g: 파일 전체 적용*.sh: 대상 파일sed -i "s/\r//g" *.sh
2024.12.24 -
Sencha 특정 컬럼만 수정(modified)표시 제거하기
delete를 통해서 상태를 원래대로 돌리고, refresh()를 통해서 화면을 업데이트 함checkchange: function (column, rowIndex, checked, record) { const view = column.up('treepanel').getView(); delete record.modified['check']; // Clear modified state for 'check' // Optional: Refresh the grid view view.refresh();}
2024.12.22