일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- port
- PyQt
- urllib
- 유니티
- PER
- pandas
- 다이어트
- Linux
- MS-SQL
- IOS
- tensorflow
- 라즈베리파이
- 맛집
- javascript
- 날짜
- node.js
- ubuntu
- Unity
- 함수
- PyQt5
- ASP
- swift
- python
- 리눅스
- mssql
- sqlite
- flutter
- MySQL
- GIT
- Excel
아미(아름다운미소)
checkbox 모두 체크 사과 배 바나나 멜론 function check_all() { for(i=0; i < my_form.mycheck.length; i++) { my_form.mycheck[i].checked = true; } } function uncheck_all() { for(i=0; i < my_form.mycheck.length; i++) { my_form.mycheck[i].checked = false; } } function count_check() { var cnt = 0; for(i=0; i < my_form.mycheck.length; i++) { if(my_form.mycheck[i].checked) cnt++; } alert(cnt); }
이렇게 하려면 필요에 따라 네 가지 방법이 있다.listdir() 메쏘드는 한 디렉토리 안의 모든 파일을 담은 리스트를 돌려준다:import os for filename in os.listdir(r'c:\windows'): print filenamefnmatch() 모듈을 사용하면 파일 이름을 여과할 수 있다.glob 모듈은 listdir()과 fnmatch()를 하나의 모듈 안에 싸넣은 것이다:import glob for filename in glob.glob(r'c:\windows\*.exe'): print filename서브디렉토리를 모을 필요가 있다면, os.path.walk()를 사용하자:import os.path def processDirectory ( args, dirname, filenam..
파일 압축하기:import zipfile f = zipfile.ZipFile('archive.zip','w',zipfile.ZIP_DEFLATED) f.write('file_to_add.py') f.close()'w'를 'a'로 바꾸면 집 압축파일에 파일을 추가할 수 있다.집 압축파일에서 파일을 풀기:import zipfile zfile = zipfile.ZipFile('archive.zip','r') for filename in zfile.namelist(): data = zfile.read(filename) file = open(filename, 'w+b') file.write(data) file.close() 디렉토리 안에 있는 파일을 (모든 서브디렉토리를) 모두 재귀적으로 압축하고 싶으면 :imp..
웹서버 import BaseHTTPServer, SimpleHTTPServer server = BaseHTTPServer.HTTPServer(('',80),SimpleHTTPServer.SimpleHTTPRequestHandler) server.serve_forever()
function check() { alert(document.getElementById("email").value); var email = document.getElementById("email").value; var exptext = /^[A-Za-z0-9_\.\-]+@[A-Za-z0-9\-]+\.[A-Za-z0-9\-]+/; if(exptext.test(email)==false){ //이메일 형식이 알파벳+숫자@알파벳+숫자.알파벳+숫자 형식이 아닐경우 alert("이 메일형식이 올바르지 않습니다."); document.addjoin.email.focus(); return false; } }
웹 페이지에서 모든 링크 얻는 법(1) ... 정규 표현식의 마법을 활용하면.import re, urllib htmlSource = urllib.urlopen("http://sebsauvage.net/index.html").read(200000) linksList = re.findall('.*?',htmlSource) for link in linksList: print link 웹 페이지에서 모든 링크 얻는 법(2) HTMLParser 모듈을 사용할 수도 있다.import HTMLParser, urllib class linkParser(HTMLParser.HTMLParser): def __init__(self): HTMLParser.HTMLParser.__init__(self) self.links = [..
각 Ajax 방식을 호출하는 방법 // 버튼 클릭시 ajax 실행 $("#btnOK").click(function(){ var url="test.aspx"; var params="name="+name+"&age="+age+"&nickName=손흥민"; $.ajax({ type:"POST", url:url, data:params, success:function(args){ $("#result").html(args); }, beforeSend:showRequest, error:function(e){ alert(e.responseText); } }); }); 1. $.post() 방식 - 서버에 데이터를 HTTP POST 방식으로 전송한 후 서버측 응답 받을 때 사용 [형식] jQuery.post( url [..
FTP를 사용하여 파일 전송하는 법 from win32com.client import gencache import ftplib # FTP 모듈 반입 session = ftplib.FTP('mysite.com','login','passord') # FTP 서버에 접속 uploadfile = open('upload.txt','rb') # 전송할 파일 열기 session.storbinary('STOR upload.txt', uploadfile) # 파일 전송 uploadfile.close() # 파일 닫기 session.quit() # FTP 세션
MSSQL 데이터 특정시점 복원 데이터베이스 특정 시점에서 복원하는 방법에 대해 포스팅 하였습니다. 조건 지정된 시간으로 데이터를 복원하기 위해서는 해당 데이터베이스 복구 모델이 전체로 되어 있어야 합니다. 데이터베이스 복구 모델에 대한 내용은 다음 기술 문서를 참조하십시오. · 복구 모델 개요 (http://msdn.microsoft.com/ko-kr/library/ms189275.aspx) 현재 데이터베이스의 복구 모델은 Microsoft SQL Server Management Studio(이하 SSMS)에서 해당 데이터베이스 속성 화면의 [옵션]에서 확인할 수 있습니다. 그림 축소그림 확대 특정시점 복원 시 , 복구모드는 "전체"로 적용되어 있어야 하며, backup tool에서도 동일하게 설정되어..
-옵셔널 체이닝(Optional Chaining) //: Playground - noun: a place where people can play import UIKit var str = "손흥민" //str = nil // Error var name: String? = "손흥민" var name2: Optional = "흥민" print(name ?? "nil 이라서 기본값 출력함") print(name!) var name3: String! = "손흥민" var name4: ImplicitlyUnwrappedOptional = "손흥민" print(name3) if name != nil { print(name!) } else { print("nil 입니다") } // 옵셔널 바인딩 if let n = n..