Skip to content

Instantly share code, notes, and snippets.

{"features":[{"geometry":null,"id":"43983df5-3639-4d71-848e-ae4ae9d13e9a","type":"Feature","properties":{"creator":"V3J0SD","visible":true,"title":"Folder","class":"Folder","updated":1671220175956}},{"geometry":null,"id":"d6087151-0803-4ff5-aedb-d32fed63ebeb","type":"Feature","properties":{"stroke-opacity":1,"creator":"V3J0SD","stroke-width":2,"title":"Op Period 1","fill":"#A200FF","stroke":"#A200FF","fill-opacity":0.1,"class":"OperationalPeriod","updated":1671217018944}},{"geometry":null,"id":"102f2667-daee-40ab-a253-0d4b0a344f5e","type":"Feature","properties":{"stroke-opacity":1,"creator":"V3J0SD","stroke-width":2,"title":"Op Period 2","fill":"#FF0000","stroke":"#FF0000","fill-opacity":0.1,"class":"OperationalPeriod","updated":1671217024463}},{"geometry":{"coordinates":[[[-107.69922100726502,37.88173177321965],[-107.69910416313718,37.88167778864207],[-107.69902238772508,37.88159262119461],[-107.69898813059389,37.88148923676771],[-107.69900660708132,37.881383374661866],[-107.69907500430963,37.8812911514459],
@colbymorrison
colbymorrison / flush.md
Last active September 20, 2022 15:20
DAO Flushing Investigation
  • Tl;dr We probably want to keep some level of manual flushing, but there are a lot of flushes we can remove!

Upstream Code Outside of sarsoft/upstream/src/org/sarsoft/online/jobs

  • Currently, we create Hibernate Sessions with FlushMode.MANUAL (code pointer and code pointer). This mode delegates all flushing operations to us.

    • Initially I thought about changing our Sessions to have FlushMode.COMMIT or FlushMode.AUTO, both of which automatically flush before each Transaction commit. However, this looks to generate flushes that contain no actual changes, which we want to avoid.
  • The methods of GenericHibernateDao execute their queries with [`GenericHibernate

from random import randint
# Decides if the user or computer won
def decide_winner(user_choice, computer_choice):
print("You selected " + user_choice)
print("Computer selected " + computer_choice)
if user_choice=="R" and computer_choice=="S":
print("You Win!")
elif user_choice=="P" and computer_choice=="R":
print("You Win!")
mylists = ([1, 2, 3], [4, 5, 6], [7, 8, 9])
out = [sum(x) for x in zip(*mylists)]
print(out) # Prints [12, 15, 18]