본문 바로가기

Web20

Dovecot POP3 설정 후에도 Outlook에서 로그인이 안되는 경우 1. Port 110 테스트 #telnet domain(or ip) 110 (ex) ID: test, PW: 1234 테스트 결과 아래와 같이 에러가 발생할 경우 INBOX 폴더에 권한 문제 이다.#telnet 110.11.00.44 110Trying 110.11.00.44... Connected to 110.11.00.44. Escape character is '^]'. +OK Dovecot ready user test +OK pass 1234 - ERR [IN-USE] Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2013-10-17 11:20:00] Connection closed by .. 2013. 10. 17.
jQuery Form Plugin - Example 출처: http://jquery.malsup.com/form/progress.html jQuery Form Plugin을 이용해서 파일을 올리는 샘플 소스이다. File Upload Progress Demo #1 0% 2013. 6. 5.
jQuery Form Plugin - Option 출처: http://jquery.malsup.com/form/#options-objectajaxForm and ajaxSubmit OptionsNote: Aside from the options listed below, you can also pass any of the standard $.ajax options to ajaxForm and ajaxSubmit.Both ajaxForm and ajaxSubmit support numerous options which can be provided using an Options Object. The Options Object is simply a JavaScript object that contains properties with values set as f.. 2013. 6. 5.
jQuery Form Plugin - API 출처: http://jquery.malsup.com/form/#api 관련싸이트가 폐쇠 될지도 몰라서 내 블로그에 저장함!! Form Plugin APIThe Form Plugin API provides several methods that allow you to easily manage form data and form submission.ajaxFormPrepares a form to be submitted via AJAX by adding all of the necessary event listeners. It does not submit the form. Use ajaxForm in your document's ready function to prepare your form(s) for AJAX .. 2013. 6. 5.
Django File upload Django에서 CSV 파일을 서버에 업로드를 할 때 이용한 방법이다. view에서 input type='file'의 name을 이용해서 파일 정보를 받는다. Url에서 /uploadcsvfile의 주소는 view의 uploadCSVfile 함수이다. 참고사이트: http://hanjiq.egloos.com/2373084 JQuery Form Plugin: http://jquery.malsup.com/form/ Plugin download site: http://jquery.malsup.com/form/#download 1. Html {% csrf_token %} 올리기 2. JavaScript 3. View.py def uploadCSVfile(request): response = {} if reque.. 2013. 5. 28.
PHP's explode() 함수를 Python으로 처리할 경우 string을 분할 하는 함수를 사용하면 된다. import string string.split(the_string, the_separator) 예를 들어 보면 아래와 같다. >>>print "this is a test string!".split(' ') ['this', 'is', 'a', 'test', 'string!'] >>>print "this is a test string!".split(' ', 2) ['this', 'is', 'a test string!'] 2013. 1. 7.
Apache와 Django 연결 1. Apache를 다운 받아 설치 한다. http://www.apache.org2. Python, Django를 다운 받아 설치 한다. http://www.python.org/download/ python27폴더를 속성(내컴퓨터) -> 고급 -> 환경변수 -> path에 추가 https://www.djangoproject.com/download/ command line에서 django 압축해제한 디렉토리로 이동 c:\>cd c:\Django-1.4 c:\Django-1.4>python setup.py install Django-1.4\django\bin 디렉토리에 있는 django-admin.py를 c:\windows나 파이썬이 설치된 디렉토리에 복사한다. 3. Django 프로젝트를 생성한다. com.. 2012. 11. 29.
Python 이차원배열 생성 방법 가로, 세로 크기 만큼의 2차원 배열을 만들 경우 아래와 같이 테스트를 할 수 있다. #create width x height matrix matrix = [[0 for col in range(width)] for row in range(height)] for row in range(height): for col in range(width): matrix[row][col] = 0 if col == 0 and row == 0: matrix[row][col] = 1 if col == width-1 and row == height-1: matrix[row][col] = 20 for row in matrix: print row 만약 가로 크기 3, 세로 5의 크기를 가지고 있을 경우 아래와 같은 결과가 출력된다.. 2012. 10. 18.
PIL을 이용한 그리기 part. 1 Example import Image, ImageDraw im = Image.open("test.png") draw = ImageDraw.Draw(im) draw.line((0, 0) + im.size, fill = 128) draw.line((0, im.size[1], im.size[0], 0), fill = 128) del draw im.save(sys.stdout, "PNG") - Imge.new("1", size) 1 bit 이미지를 만들면 0으로 채워진다. bmp로 저장하면 검은색으로 채워져 있다. - polygon으로 그린다면 아래와 같이 1로 채운다. draw.polygon(xy, fill = 1) 1로 채우고 bmp로 저장하면 polygon 부분이 흰색으로 채워져 있다. xy는 list로 .. 2012. 9. 6.