原创 Git for PyCharm

Git for PyCharm Using PyCharm’s Git integration locally:http://confluence.jetbrains.com/display/PYH/Using+PyCharm

原创 django_url視圖

基礎 django.cof.url.defaults django.cof.url.defaults.patterns() urlpatterns = patterns('', # Example: # (r'

原创 16. 3Sum Closest

問題 Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Ret

原创 18. 4Sum

問題 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all un

原创 時間到數據庫自動更新狀態

在MySQL中實現根據時間字段自動更改狀態字段 首先定義update_conference_status過程,判斷系統時間與start_time和end_time的關係,根據這兩個字段調整status字段的狀態。 DELIMITER

原创 3. Longest Substring Without Repeating Characters

描述 Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", t

原创 14. Longest Common Prefix

問題 Write a function to find the longest common prefix string amongst an array of strings. 分析: 最長前綴 Python class Solutio

原创 7. Reverse Integer

問題 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -

原创 15. 3Sum

問題 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in

原创 804. Unique Morse Code Words

問題 International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as

原创 11. Container With Most Water

問題 Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines a

原创 4. Median of Two Sorted Arrays

問題 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays.

原创 2. Add Two Numbers

問題 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse or

原创 django 數據庫遷移(migrate)應該知道的一些事

命令 首先數據庫遷移的兩大命令: python manage.py makemigrations & python manage.py migrate 前者是將model層轉爲遷移文件migration,後者將新版本的遷移文件執行,更

原创 利 and、or 條件短路

利用 and、or 條件短路,寫得更簡潔些。 >>> x = 1 >>> print (x > 0 and "+") or (x < 0 and "-") or "0" + >>> x = 0 >>> print (x > 0 and