This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apo list tuples se dictionary key: lista. eg | |
# results = [("word1", "explaination1"), ("word2", "explaination2"), ("word1", "explaination12")] | |
# -> | |
# data = {"word1": ["explaination1", "explaination12"], "word2": explaination2} | |
data = {} | |
for i in results: | |
data.setdefault(i[0],[]).append(i[1]) | |
# exigisi: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Filter a list is JS is an attribute of an array (array.filter) and takes one argument, a function to apply | |
to each list element if the return value of the function is True then the element is in the result list, otherwise | |
it is discarded | |
Example for filter | |
arr = ['some text', 'a', 'some more text', 'the', 'I go to play football'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Goddady + Heroku + Domain | |
* disable domain from github | |
* Heroku hobby version | |
* Heroku add domain www.egg-fights.com, www.tsougkrizo.com | |
* Godday set in CNAME www that weird thing HEROKU gives for each the domain | |
Forwarding domain -> https://www.tsougkrizo.com | |
Forwarding domain -> https://www.egg-fights.com | |
Goddady with redirect | |
* Heroku disable custom domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple, defaultdict | |
from pprint import pprint | |
#filename = 'small_input.txt' | |
filename = 'input.txt' | |
Recipe = namedtuple('Recipe', 'ingr allerg') | |
recipes = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def in_level(x, y, z, w, sizex, sizey, sizez, sizew): | |
return 0 <= x < sizex and 0 <= y < sizey and 0 <= z < sizez and 0 <= w < sizew | |
def active_neighbours(x, y, z, w, sizex, sizey, sizez, sizew, levels): | |
active = 0 | |
for u in range(w - 1, w + 2): | |
for k in range(z - 1, z + 2): | |
for j in range(y - 1, y + 2): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def in_level(x, y, z, sizex, sizey, sizez): | |
return 0 <= x < sizex and 0 <= y < sizey and 0 <= z < sizez | |
def active_neighbours(x, y, z, sizex, sizey, sizez, levels): | |
active = 0 | |
for k in range(z - 1, z + 2): | |
for j in range(y - 1, y + 2): | |
for i in range(x - 1, x + 2): |
Query to get all required data for one pulication
select
p.id, doi, pmid, pmcid, p.title, p.abstract.preferred, acknowledgements.preferred, journal.title, book_series_title.preferred,
proceedings_title , mesh_terms, date, year, volume, issue, pages, type,
au.first_name, au.last_name, au.raw_affiliations, au.corresponding, au.researcher_id, au.grid_ids,
p.research_orgs,
grid.name, grid.id, grid.address.city , grid.address.country, grid.address.state
funder_orgs,
fgrid.address.country, fgrid.name,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clt - Shift - P # commands | |
Clt - , # edit settings | |
Clt - p # open file | |
Clt - Shift - / (next to shift) # dublicate line | |
# useful commands | |
Reorg imports | |
Reload window |
NewerOlder