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
$('#clickme').click(function() { | |
$('#book').toggle('slow', function() { | |
// Animation complete. | |
}); | |
}); |
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
// There is no reload or replace method for images. The src property can be set in the same way as the location.href property though. | |
with($('#image')) { | |
src = src.replace(/\?.*$/, '') + '?' + Math.random(); | |
} |
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
$( 'html, body' ).animate( { scrollTop: 0 }, 0 ); | |
// or | |
$( 'html, body' ).animate( { scrollTop: 0 }, 'slow' ); |
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
// imagine the accordion is started like this: | |
$("#accordion").accordion({ header: 'h5', collapsible: true , active: false}); | |
// this gets you the index of open accordion [0.....n] | |
$("#accordion h5").index($("#accordion h5.ui-state-active")); | |
// let's save that index.. and use it to activate/deactivate the tab | |
n = $("#accordion h5").index($("#accordion h5.ui-state-active")); | |
$('#accordion').accordion('activate', n); |
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
-- Return researchers and their publication count | |
-- LIMITED TO | |
-- publications with FOR “11 Medical and Health Sciences” | |
-- WHERE | |
-- Researcher is from Canada, Austria, Belgium, Czech Rep, Denmark, Finland, France, Australia | |
-- Researcher did NOT publish in the 2018, 2019, 2020 in a journal from publisher “Public Library of Science (PLoS)” | |
-- Researcher has email address | |
-- number of publications is minimum 3 | |
-- sorted by | |
-- publication count |
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
-- Pub criteria: | |
-- FOR code | |
-- Specific journals | |
-- Year | |
-- Author criteria: | |
-- FCR (of any paper for last 5 years) > 1.5 | |
-- Last publication < 24 months ago | |
-- Total publications > 7 |
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
SELECT | |
p.id, | |
p.title.preferred AS title, | |
p.doi, | |
p.year, | |
p.journal.title, | |
p.type, | |
p.date AS date_publication, | |
p.date_inserted, | |
FROM |
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
-- example 1 | |
-- unnest an array in line so to perform an aggregation | |
select | |
id, | |
(SELECT MAX(e) from UNNEST(email) e) as first_email | |
from `dimensions-ai.data_analytics.researchers` r | |
WHERE ARRAY_LENGTH(email) > 0 | |
LIMIT 10 |
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
# source: https://github.com/springernature/scigraph/blob/master/2018Q3/context/scigraph.json | |
{ | |
"@context": { | |
"@vocab": "http://schema.org/", | |
"@base": null, | |
"sg": "http://scigraph.springernature.com/id/", | |
"sgo": "http://scigraph.springernature.com/ontologies/core/", | |
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", | |
"rdfs": "http://www.w3.org/2000/01/rdf-schema#", |
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
import MySQLdb | |
conn = MySQLdb.connect(host=\"localhost\", user=\"root\", passwd=\"nobodyknow\", db=\"amit\") | |
cursor = conn.cursor() | |
stmt = \"SELECT * FROM overflows\" | |
cursor.execute(stmt) | |
# Fetch and output | |
result = cursor.fetchall() |