目前分類:程式記憶區 (9)

瀏覽方式: 標題列表 簡短摘要
系統中可能需要自動寄信的功能,例如會員通知、認證資格等等的需求

嘎抓強 發表在 痞客邦 留言(0) 人氣()

因為有時候會需要兩台系統的串連,所以需要把第一台電腦所得到的資訊

嘎抓強 發表在 痞客邦 留言(0) 人氣()

  • 201 Post 指令被成功地執行
  • 202 請求被接受
  • 203 Get或Head請求被完成
  • 204 請求被完成,但沒有內如容傳回
  • 300 資源可在許多地方被找到
  • 301 資源永久的移除
  • 302 資源暫時被移除
  • 304 資源未被更改過
  • 400 client的不正確請求信息
  • 401 未授權的請求訊息
  • 402 完成請求信息必須有回應
  • 403 禁止使用此資源
  • 404 資源找不到
  • 405 資源不允許使用此方法
  • 406 不被接受的資源型別
  • 410 無此資源
  • 500 Server 內部發生錯誤
  • 501 沒有被實作的方法
  • 502 不正確的 gateway 或 server 負荷過重
  • 503 無此 service 或 gateway 餘時 200 OK

嘎抓強 發表在 痞客邦 留言(0) 人氣()

轉自這邊

由於編輯器和系統換行功能會被自動加上一些不必要的原始碼,所以要將設定修改如下:

 

嘎抓強 發表在 痞客邦 留言(0) 人氣()

什麼是 Google 地圖 API

Google 地圖 API」可讓您利用 JavaScript 將「Google 地圖」嵌入自己的網頁。此 API 透過多種服務提供一些公用程式,以操控地圖 (如同 http://maps.google.com 網頁上所示),並新增地圖內容,能讓您在網站上建立強大的地圖應用程式。

 

嘎抓強 發表在 痞客邦 留言(0) 人氣()




# 題目是 請找出符合下列公式的排列方式
# O/OO + O/OO + O/OO = 1
# 填上1~9,數字不可重複


from time import time
t0 = time()

def Try(ans):
    if (ans[0] * 1.0 / (ans[1] * 10 + ans[2]) + ans[3] * 1.0 / (ans[4] * 10 + ans[5]) + ans[6] * 1.0 / (ans[7] * 10 + ans[8])) == 1:
        print ans

def F(s, lv):
    if lv == 0:
        Try(ans)
        return

    for (x, i) in enumerate(s):
        ans.insert(0, i)
        tmp = s[:]
        tmp.pop(x)
        F(tmp, lv-1)
        ans.pop(0)

ans = []
orz = range(1, 10)
F(orz, len(orz))
print time()-t0




嘎抓強 發表在 痞客邦 留言(0) 人氣()

# -*- coding: utf8 -*-
'''
------------題目--------------
y=
sin(1* x1*x2 )
-sin(2* x3*x4 )
+sin(3* x5*x6 )
-sin(4* x7*x8 )
..
..
+sin(15*x29*x30)

有30個整數,[1,2,3,.....,30]
分別指定給  x1,x2,x3......., x30
要如何指定,會使得 y --> max

------------題目--------------
'''

'設定環境變數'
alive = 5      #每代留下幾個最好的基因
child = 10     #一個基因生下幾個孩子
t = 500        #你要玩弄他幾次

from numpy import *
from random import *
from time import time
t0 = time()

'目標方程式'
def fun(F):
    sum = 0
    for i in xrange(15):
        sum += (-1)**i * sin((i+1)*F[(i+1)*2 - 2] * F[(i+1)*2 - 1])
    return sum

'排序方程式,越大的排前面'
def sort_by_last(A, B):
    if A[-1]: return 1
    elif A[-1] > B[-1]: return -1
    else: return 0

'產生第一代的基因'
S = range(1,31)    #第一個基因
mother = []        #母體儲存位置

for i in xrange(alive*child + alive):
    fir = int(random() * 30)
    sec = int(random() * 30)
    while fir == sec:
        fir = int(random() * 30)
        sec = int(random() * 30)
    tmp = S[fir]
    S[fir] = S[sec]
    S[sec] = tmp
    save = S[:]
    save.append(fun(save))
    mother.append(save)

'開始玩弄他'
for i in xrange(t):
    tmp = mother[:]
    tmp.sort(sort_by_last)
    mother = []
    if (i%10) == 0:
        print 'the',i,'th Times ,MAX=',fun(tmp[0])
    for j in xrange(alive):
        mother.append(tmp[j])
        ttt = tmp[j][:]
        for k in xrange(child):
            fir = int(random() * 30)
            sec = int(random() * 30)
            while fir == sec:
                fir = int(random() * 30)
                sec = int(random() * 30)
            kkk = ttt[fir]
            ttt[fir] = ttt[sec]
            ttt[sec] = kkk
            save = ttt[:]
            save[-1] = fun(save)
            mother.append(save)

mother.sort(sort_by_last)
print '---------------------------------------'
print 'Times = ', t
print 'take', time()-t0, 'sec'
print 'MAX = ', fun(mother[0])
print 'ANS:', mother[0]


嘎抓強 發表在 痞客邦 留言(0) 人氣()

C:\WINDOWS\system32\drivers\etc

裡面的hosts檔案

嘎抓強 發表在 痞客邦 留言(0) 人氣()

# -*- coding:utf8  -*-          utf8格式
from numpy import *

嘎抓強 發表在 痞客邦 留言(0) 人氣()