가끔식 로또할때가 있어서 그냥 무식하게 random으로 찍기는 싫어서 약간의 custom number를 만들수 있도록 간단히 만들어봄.
백만개씩 만들어놓고 당첨번호랑 매칭하는 것도 만들 예정임. 일주일에 백만개씩 사도 로또에 담청될수 없다는 교훈을 가르칠기 위해. ^^
----------------------
import random
import time
#TODO: use current time as random seed
lotterynumbers = range(1,71) # 1-70
# previous winning numbers
# high numbers
# not luckey numbers
exclude_numbers = [12,27,29,43,68,
66,67,69,70, #68s
4,22,53]
#print lotterynumbers
for num in exclude_numbers:
lotterynumbers.remove(num)
print "Number Pool: %s" %lotterynumbers
print "------------------------"
x = 0
while x < 10:
#lotterynumbers.append(random.randint(1, 10))
#lotterynumbers.append(random.sample(range(10), 6))
#lotterynumbers.sort()
fredarray = random.sample(lotterynumbers, 5)
fredarray.sort()
print fredarray
#print lotterynumbers
x += 1
print;print
#Mega Number - one lucky number
mega_numbers = range(1,26) # 1-25
mega_exclude_numbers = [1, 2, 22, 25]
for num in mega_exclude_numbers:
mega_numbers.remove(num)
print "Mega Number Pool: %s" %mega_numbers
print "------------------------"
y = 0
while y < 5:
print random.sample(mega_numbers, 1)
y += 1
#end of the program
#
import urllib2
import json
def printResults(data):
# Use the json module to load the string data into a dictionary
theJSON = json.loads(data)
# now we can access the contents of the JSON like any other Python object
if "title" in theJSON["metadata"]:
print theJSON["metadata"]["title"]
# output the number of events, plus the magnitude and each event name
count = theJSON["metadata"]["count"];
print "Yesterday Total " + str(count) + " events recorded"
# for each event, print the place where it occurred
# for i in theJSON["features"]:
# print i["properties"]["place"]
# print the events that only have a magnitude greater than 4
print"\n"
print "Magnitude greater than 4:\n"
for i in theJSON["features"]:
if i["properties"]["mag"] >= 4.0:
print "%2.1f" % i["properties"]["mag"], i["properties"]["place"]
# print only the events where at least 1 person reported feeling something
print "\n"
print "Events that were felt:\n"
for i in theJSON["features"]:
feltReports = i["properties"]["felt"]
placeOccur = i["properties"]["place"]
if (feltReports != None) & (feltReports > 0):
if (i["properties"]["place"].find("California") > 0 or i["properties"]["place"].find("Mexico") > 0) :
print "*****************************************"
print "%2.1f" % i["properties"]["mag"], i["properties"]["place"], " reported " + str(feltReports) + " times"
def main():
# define a variable to hold the source URL
# In this case we'll use the free data feed from the USGS
# This feed lists all earthquakes for the last day larger than Mag 2.5
#Fred: http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php
urlData = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson"
# Open the URL and read the data
webUrl = urllib2.urlopen(urlData)
print ("USGS is alive, response=%d" % webUrl.getcode())
if (webUrl.getcode() == 200):
data = webUrl.read()
# print out our customized results
printResults(data)
else:
print "Received an error from server, cannot retrieve results " + str(webUrl.getcode())
if __name__ == "__main__":
main()
상당히 자세한 분석인데 평균이다 보니 각 지역의 현실을 잘 반영하는것 같지는 않습니다. 추세정보 비교는 가능할것 같네요. 이런 data를 분석해서 인포그래픽으로 만들어 내는 사람들 정말 존경합니다.
what to learn
which role to play
startup or not
----------
If we look at a software engineer’s salary as a journey of many steps, at every step we’ll see that where you are, what you do, what you value most, and when you join the company determines your salary according to recent research by Startup Compass.
How can you get paid the most?
Before we dive into the statistics, let’s see what kind of a software engineer would get paid the most. Let’s call our hypothetical engineer Alex.
When Alex chooses the programming language to learn, she should go for the less user-friendly and hard to learn ones. C++ is the best. She should also focus on programming the backend.
Become the CTO, right away
Next, Alex should aim for being a CTO or VP of Engineering as soon as possible. Being an architect would be the next best thing.
But being a CTO right away is ambitious, unless Alex heads to work in a startup. Luckily, startups tend to pay more than the other two options – traditional IT firms and freelancing. Being the CTO of a startup from day 1 is possible, as long as Alex is really good.
Now that we know Alex is looking to work in a startup, how big should the startup be? Ideally, 51-100 people.
Does it matter that Alex does not yet have experience? Yes. Her salary will rise significantly after 6 years. It will go up almost twice once she has 20 years of experience.
But salaries changes thanks to raises. Alex would likely get a significant raise after the third year. So it makes sense to stay at the startup at least that long.
Just money or a piece of the pie?
But Alex might see more meaning in her work than just getting money. She might be interested in getting a piece of the company she works for – equity. Here, she will have to sacrifice a little. As the CTO, she will get around 13% of the company and about $96,000. Were she a VP of Engineering, she could get 2% of the company instead and take home $120,000.
So at what stage should Alex join a startup? Her salary will be the lowest at a startup with no funding or seed funding. If she wants a higher salary, she should wait until the startup raises their series B round of funding. Of course, by the time series B comes around there will probably be another CTO at the startup. But that CTO could leave, so joining a well-funded startup as the CTO is still possible, but at that point there will be less equity to go around.
All startups can be divided into consumer product oriented ones and enterprise oriented ones. While building things for consumers might be more exciting, the enterprise oriented startups tend to pay more. So Alex should be looking at startups that describe themselves as “SaaS”, “B2B”, “platform.” If that sounds too boring, there are always more consumer startups out there.
Lastly, there are many kinds of a software engineer Alex could be, aside from her CTO title. The highest-paid kind would be a software architect. The next best thing would be a data scientist.
By now Alex probably realizes that the advice on how to get a higher salary is conflicting. By now she may wonder whether getting the highest salary is less important than her freedom to choose a less popular programming language, to get more equity in a company, or to become a different kind of software engineer. She will have some deciding to do.
Where did we get this data?
In October 2014, Startup Compass conducted a Tech Salary survey of the engineering community from around the world to gather data on salary and equity. They included basic salary information from different countries, roles and skills as well as technologies from other sources such as Elance-oDesk, Toptal, Glassdoor, Angellist and Payscale.
Margaret Hamilton – lead software engineer of Appolo, who coined the term “Software Engineering”
아 참 재밌는 프로젝트가 널려있네. 이렇게 high level언어들도 멋진 app들이 빠르게 구동된다니 정말 믿어지지 않을정도로 무섭습니다.
http://python-eve.org/
Python REST API Framework
Eve is an open source Python REST API framework designed for human beings. It allows to effortlessly build and deploy highly customizable, fully featured RESTful Web Services.