#SPDX-License-Identifier: MIT
import os
import sys
import ipdb
import traceback
if (sys.version_info > (3, 0)):
import configparser as configparser
else:
import ConfigParser as configparser
sys.path.append('..')
import augur
from flask import Flask, request, Response
from flask_cors import CORS
import json
AUGUR_API_VERSION = 'api/unstable'
# Location to load configuration from
CONFIG_BAD = False
'''
make a try and accept condition
if its open the GH_DATA_ONFIG_FILE and then its open in read mode
and if the file does't open the it print Couldn\'t open config file, attempting to create.
'''
try:
AUGUR_CONFIG_FILE = open(os.getenv('AUGUR_CONFIG_FILE', 'augur.cfg'), 'r+')
except:
print('Couldn\'t open config file, attempting to create.')
AUGUR_CONFIG_FILE = open(os.getenv('AUGUR_CONFIG_FILE', 'augur.cfg'), 'w+')
CONFIG_BAD = True
# Options to export the loaded configuration as environment variables for Docker
AUGUR_ENV_EXPORT = os.getenv('AUGUR_ENV_EXPORT', '0') == '1'
if AUGUR_ENV_EXPORT:
AUGUR_ENV_EXPORT_FILE = open(os.getenv('AUGUR_ENV_EXPORT_FILE', 'lastrun.cfg.sh'), 'w+')
def serialize(data, orient='records'):
if (orient is None):
orient = 'records'
result = ''
if hasattr(data, 'to_json'):
result = data.to_json(orient=orient, date_format='iso', date_unit='ms')
else:
try:
result = json.dumps(data)
except:
result = data
return result
[docs]def flaskify(func):
"""
Simplifies API endpoints that just accept owner and repo,
serializes them and spits them out
"""
def generated_function(*args, **kwargs):
kwargs.update(request.args.to_dict())
df = func(*args, **kwargs)
return Response(response=serialize(df, orient=request.args.get('orient')),
status=200,
mimetype="application/json")
generated_function.__name__ = func.__name__
return generated_function
[docs]def addMetric(app, function, endpoint):
"""Simplifies adding routes that only accept owner/repo"""
app.route('/{}/<owner>/<repo>/{}'.format(AUGUR_API_VERSION, endpoint))(flaskify(function))
[docs]def addTimeseries(app, function, endpoint):
"""
Simplifies adding routes that accept owner/repo and return timeseries
:param app: Flask app
:param function: Function from a datasource to add
:param endpoint: GET endpoint to generate
"""
addMetric(app, function, 'timeseries/{}'.format(endpoint))
app.route('/{}/<owner>/<repo>/timeseries/{}/relative_to/<ownerRelativeTo>/<repoRelativeTo>'.format(AUGUR_API_VERSION, endpoint))(flaskify(augur.util.makeRelative(function)))
app = Flask(__name__)
CORS(app)# Try to open the config file and parse it
parser = configparser.RawConfigParser()
parser.readfp(AUGUR_CONFIG_FILE)
if AUGUR_ENV_EXPORT:
AUGUR_ENV_EXPORT_FILE.write('#!/bin/bash\n')
def read_config(section, name, environment_variable, default):
global CONFIG_BAD
value = default
try:
value = os.getenv(environment_variable, parser.get(section, name))
except Exception as e:
if not parser.has_section(section):
parser.add_section(section)
CONFIG_BAD = True
print('[' + section + ']->' + name + ' is missing. Your config will be regenerated with it included after execution.')
parser.set(section, name, default)
value = default
if AUGUR_ENV_EXPORT:
AUGUR_ENV_EXPORT_FILE.write('export ' + environment_variable + '="' + value + '"\n')
return value
host = read_config('Server', 'host', 'AUGUR_HOST', '<IP_ADDRESS>')
port = read_config('Server', 'port', 'AUGUR_PORT', '5000')
publicwww = augur.PublicWWW(api_key=read_config('PublicWWW', 'APIKey', 'AUGUR_PUBLIC_WWW_API_KEY', 'None'))
github = augur.GitHubAPI(api_key=read_config('GitHub', 'APIKey', 'AUGUR_GITHUB_API_KEY', 'None'))
librariesio = augur.LibrariesIO(api_key=read_config('LibrariesIO', 'APIKey', 'AUGUR_LIBRARIESIO_API_KEY', 'None'), githubapi=github)
downloads = augur.Downloads(github)
localcsv = augur.LocalCSV()
if (read_config('Development', 'developer', 'AUGUR_DEBUG', '0') == '1'):
debugmode = True
else:
debugmode = False
dbstr = 'mysql+pymysql://{}:{}@{}:{}/{}'.format(
read_config('Database', 'user', 'AUGUR_DB_USER', 'root'),
read_config('Database', 'pass', 'AUGUR_DB_PASS', 'password'),
read_config('Database', 'host', 'AUGUR_DB_HOST', '<IP_ADDRESS>'),
read_config('Database', 'port', 'AUGUR_DB_PORT', '3306'),
read_config('Database', 'name', 'AUGUR_DB_NAME', 'msr14')
)
ghtorrent = augur.GHTorrent(dbstr=dbstr)
dbstr = 'mysql+pymysql://{}:{}@{}:{}/{}'.format(
read_config('GHTorrentPlus', 'user', 'AUGUR_GHTORRENT_PLUS_USER', 'root'),
read_config('GHTorrentPlus', 'pass', 'AUGUR_GHTORRENT_PLUS_PASS', 'password'),
read_config('GHTorrentPlus', 'host', 'AUGUR_GHTORRENT_PLUS_HOST', '<IP_ADDRESS>'),
read_config('GHTorrentPlus', 'port', 'AUGUR_GHTORRENT_PLUS_PORT', '3306'),
read_config('GHTorrentPlus', 'name', 'AUGUR_GHTORRENT_PLUS_NAME', 'ghtorrentplus')
)
ghtorrentplus = augur.GHTorrentPlus(dbstr=dbstr, ghtorrent=ghtorrent)
"""
@api {get} / API Status
@apiName Status
@apiGroup Misc
"""
@app.route('/{}/'.format(AUGUR_API_VERSION))
[docs]def api_root():
"""API status"""
# @todo: When we support multiple data sources this should keep track of their status
# @todo: Add GHTorrent test to determine status
ghtorrent_status = "good"
# @todo: Add GitHub API status
# @todo: Add PublicWWW API status
return """{"status": "healthy", "ghtorrent": "{}"}""".format(ghtorrent_status)
#######################
# Timeseries #
#######################
# @todo: Link to LF Metrics
"""
@api {get} /:owner/:repo/timeseries/commits?group_by=:group_by Commits
@apiName Commits
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiParam {String} group_by (Default to week) Allows for results to be grouped by day, week, month, or year
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"commits": 153
},
{
"date": "2015-01-08T00:00:00.000Z",
"commits": 192
}
]
"""
addTimeseries(app, ghtorrent.commits, 'commits')
"""
@api {get} /:owner/:repo/timeseries/commits/comments count of commit comments weekly
@apiName CommitComments
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{ "date":"2009-02-16T00:00:00.000Z",
"comments":1.0
},
{ "date":"2009-07-12T00:00:00.000Z",
"comments":2.0
},
"""
addTimeseries(app, ghtorrent.commit_comments, 'commits/comments')
"""
@api {get} /:owner/:repo/timeseries/forks?group_by=:group_by Forks
@apiName Forks
@apiGroup Timeseries
@apiParam {String} group_by (Default to week) Allows for results to be grouped by day, week, month, or year
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"forks": 13
},
{
"date": "2015-01-08T00:00:00.000Z",
"forks": 12
}
]
"""
addTimeseries(app, ghtorrent.forks, 'forks')
"""
@api {get} /:owner/:repo/timeseries/issues?group_by=:group_by Issues
@apiName Issues
@apiGroup Timeseries
@apiParam {String} group_by (Default to week) Allows for results to be grouped by day, week, month, or year
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"issues":13
},
{
"date": "2015-01-08T00:00:00.000Z",
"issues":15
}
]
"""
addTimeseries(app, ghtorrent.issues, 'issues')
"""
@api {get} /:owner/:repo/timeseries/issues/activity
@apiName Issues
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2010-12-23T00:00:00.000Z",
"count": 0.0,
"action": "closed"
},
{
"date": "2010-12-23T00:00:00.000Z",
"count": 2.0,
"action": "opened"
},
{
"date": "2010-12-23T00:00:00.000Z",
"count": 8.0,
"action": "reopened"
},
{
"date": "2010-12-23T00:00:00.000Z",
"count": 12.0,
"action": "open"
}
]
"""
addTimeseries(app, ghtorrent.issue_activity, 'issues/activity')
"""
@api {get} /:owner/:repo/timeseries/issues/closed
@apiName Issues
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2011-03-19T00:00:00.000Z",
"issues_closed": 3
},
{
"date": "2011-03-20T00:00:00.000Z",
"issues_closed": 0
}
]
"""
addTimeseries(app, ghtorrent.issues_closed, "issues/closed")
#TODO documentation
addMetric(app, ghtorrentplus.issue_close_time, 'issue_close_time')
"""
@api {get} /:owner/:repo/timeseries/issue_comments count of new comments weekly
@apiName uniqueCommenters
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{ "date":"2009-02-16T00:00:00.000Z",
"total_unique_comments":1.0
},
{ "date":"2009-07-12T00:00:00.000Z",
"total_unique_comments":2.0
},
]
"""
addTimeseries(app, ghtorrent.issue_comments, 'issue/comments')
"""
@api {get} /:owner/:repo/timeseries/issues/response_time Issue Response Time
@apiName IssueResponseTime
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"created_at": "2013-09-16T17:00:54.000Z",
"responded_at": "2013-09-16T17:20:58.000Z"
},
{
"created_at": "2013-09-16T09:31:34.000Z",
"responded_at": "2013-09-16T09:43:03.000Z"
}
]
"""
addTimeseries(app, ghtorrent.issue_response_time, 'issues/response_time')
"""
@api {get} /:owner/:repo/timeseries/pulls Pull Requests by Week
@apiName PullRequestsByWeek
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"pull_requests": 1
"comments": 11
},
{
"date": "2015-01-08T00:00:00.000Z",
"pull_requests": 2
"comments": 31
}
]
"""
addTimeseries(app, ghtorrent.pulls, 'pulls')
"""
@api {get} /:owner/:repo/timeseries/pull_request_comments count of new pull request comments weekly
@apiName PullRequestComments
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{ "date":"2009-02-16T00:00:00.000Z",
"comments":1.0
},
{ "date":"2009-07-12T00:00:00.000Z",
"comments":2.0
},
"""
addTimeseries(app, ghtorrent.pull_request_comments, 'pulls/comments')
"""
@api {get} /:owner/:repo/timeseries/pulls/acceptance_rate Pull Request Acceptance Rate by Week
@apiDescription For each week, the rate is calculated as (pull requests merged that week) / (pull requests opened that week)
@apiName PullRequestAcceptanceRate
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"rate": 0.5
},
{
"date": "2015-01-08T00:00:00.000Z",
"rate": 0.33
}
]
"""
addTimeseries(app, ghtorrent.pull_acceptance_rate, 'pulls/acceptance_rate')
"""
@api {get} /:owner/:repo/timeseries/stargazers?group_by=:group_by Stargazers
@apiName Stargazers
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiParam {String} group_by (Default to week) Allows for results to be grouped by day, week, month, or year
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"watchers": 133
},
{
"date": "2015-01-08T00:00:00.000Z",
"watchers": 54
}
]
"""
addTimeseries(app, ghtorrent.stargazers, 'stargazers')
"""
@api {get} /:owner/:repo/watchers
@apiName Community Engagement
@apiGroup Users
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"watchers": 40349
}
]
"""
addMetric(app, ghtorrent.watchers, 'watchers')
"""
@api {get} /:owner/:repo/timeseries/community_engagement
@apiName Community Engagement
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2009-04-01T00:00:00.000Z",
"issues_opened": 1.0,
"issues_closed": 0.0,
"pull_requests_opened": 0.0,
"pull_requests_merged": 0.0,
"pull_requests_closed": 0.0,
"issues_opened_total": 2.0,
"issues_closed_total": 0.0,
"issues_closed_rate_this_window": 0.0,
"issues_closed_rate_total": 0.0,
"issues_delta": 1.0,
"issues_open": 2.0,
"pull_requests_opened_total": 0.0,
"pull_requests_closed_total": 0.0,
"pull_requests_closed_rate_this_window": null,
"pull_requests_closed_rate_total": null,
"pull_requests_delta": 0.0,
"pull_requests_open": 0.0
},
{
"date": "2009-04-16T00:00:00.000Z",
"issues_opened": 2.0,
"issues_closed": 1.0,
"pull_requests_opened": 1.0,
"pull_requests_merged": 1.0,
"pull_requests_closed": 1.0,
"issues_opened_total": 3.0,
"issues_closed_total": 5.0,
"issues_closed_rate_this_window": 4.0,
"issues_closed_rate_total": 6.0,
"issues_delta": 1.0,
"issues_open": 2.0,
"pull_requests_opened_total": 3.0,
"pull_requests_closed_total": 5.0,
"pull_requests_closed_rate_this_window": null,
"pull_requests_closed_rate_total": null,
"pull_requests_delta": 2.0,
"pull_requests_open": 1.0
}
]
"""
addTimeseries(app, ghtorrent.community_engagement, 'community_engagement')
"""
@api {get} /:owner/:repo/timeseries/tags Tags release timeseries
@apiDescription Timeseries of tags
@apiName Tags
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"release": 0.5
},
{
"date": "2015-01-08T00:00:00.000Z",
"release": 0.5.1
}
]
"""
addTimeseries(app, github.tags, 'tags')
"""
@api {get} /:owner/:repo/timeseries/tags/major Tags for major releases timeseries
@apiDescription Timeseries of Major release tags
@apiName Major Release Tags
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"release": 1.0.0
},
{
"date": "2015-01-08T00:00:00.000Z",
"release": 2.0.0
}
]
"""
addTimeseries(app, github.major_tags, 'tags/major')
#TODO: Documentation
addTimeseries(app, github.lines_changed, 'lines_changed')
"""
@api {get} /:owner/:repo/timeseries/downloads Number of downloads
@apiDescription Timeseries of downloads from package manager
@apiName Downloads
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"downlads": 235
},
{
"date": "2015-01-08T00:00:00.000Z",
"dowloads": 327
}
]
"""
addTimeseries(app, downloads.downloads, 'downloads')
# Contribution Trends
"""
@api {get} /:owner/:repo/contributors Total Contributions by User
@apiName TotalContributions
@apiGroup Users
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"login": "foo",
"location": "Springfield",
"commits": 1337.0,
"pull_requests": 60.0,
"issues": null,
"commit_comments": 158.0,
"pull_request_comments": 718.0,
"issue_comments": 1668.0
},
{
"login": "bar",
"location": null,
"commits": 3968.0,
"pull_requests": null,
"issues": 12.0,
"commit_comments": 158.0,
"pull_request_comments": 718.0,
"issue_comments": 1568.0
}
]
"""
addMetric(app, ghtorrent.contributors, 'contributors')
#######################
# Contribution Trends #
#######################
"""
@api {get} /:owner/:repo/timeseries/contributions Contributions by Week
@apiName ContributionsByWeek
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiParam (String) user Limit results to the given user's contributions
@apiSuccessExample {json} Success-Response:
[
{
"date": "2015-01-01T00:00:00.000Z",
"commits": 37.0,
"pull_requests": null,
"issues": null,
"commit_comments": 7.0,
"pull_request_comments": 8.0,
"issue_comments": 17.0
},
{
"date": "2015-01-08T00:00:00.000Z",
"commits": 68.0,
"pull_requests": null,
"issues": 12.0,
"commit_comments": 18.0,
"pull_request_comments": 13.0,
"issue_comments": 28.0
}
]
"""
@app.route('/{}/<owner>/<repo>/contributions'.format(AUGUR_API_VERSION))
def contributions(owner, repo):
repoid = ghtorrent.repoid(owner=owner, repo=repo)
user = request.args.get('user')
if (user):
userid = ghtorrent.userid(username=user)
contribs = ghtorrent.contributions(repoid=repoid, userid=userid)
else:
contribs = ghtorrent.contributions(repoid=repoid)
serialized_contributors = serialize(contribs, orient=request.args.get('orient'))
return Response(response=serialized_contributors,
status=200,
mimetype="application/json")
"""
@api {get} /:owner/:repo/committer_locations Commits and Location by User
@apiName CommitterLocations
@apiGroup Diversity
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"login": "bonnie",
"location": "Rowena, TX",
"commits": 12
},
{
"login":"clyde",
"location":"Ellis County, TX",
"commits": 12
}
]
"""
addMetric(app, ghtorrent.committer_locations, 'committer_locations')
"""
@api {get} /:owner/:repo/timeseries/community_age Timeline of events to determine the age of a community
@apiName CommunityAge
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"login": "bonnie",
"location": "Rowena, TX",
"commits": 12
},
{
"login":"clyde",
"location":"Ellis County, TX",
"commits": 12
}
]
"""
addMetric(app, ghtorrent.community_age, 'community_age')
"""
@api {get} /:owner/:repo/dependencies List of dependencies from libraries.io
@apiName Dependencies
@apiGroup Ecosystem
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{ "full_name": "rails/rails"
"description": "Ruby on Rails",
"fork": false, "created_at": "2008-04-11T02:19:47.000Z",
"updated_at": "2017-09-20T20:16:47.181Z",
"pushed_at": "2017-09-20T19:39:08.000Z",
"homepage": "http://rubyonrails.org",
"size": 155199, "stargazers_count": 36993,
"language": "Ruby", "has_issues": true,
"has_wiki": false,
"has_pages": false,
"forks_count": 15130,
"mirror_url": null,
"open_issues_count": 1157,
"default_branch": "master",
"subscribers_count": 2452,
"uuid": "8514", "source_name": null,
"license": "MIT", "private": false,
"contributions_count": 2616,
"has_readme": "README.md",
"has_changelog": null,
"has_contributing": "CONTRIBUTING.md",
"has_license": "MIT-LICENSE",
"has_coc": "CODE_OF_CONDUCT.md",
"has_threat_model": null,
"has_audit": null,
"status": null,
"last_synced_at": "2017-09-20T20:16:47.153Z",
"rank": 28, "host_type": "GitHub",
"host_domain": null,
"name": null,
"scm": "git",
"fork_policy": null,
"github_id": "8514",
"pull_requests_enabled": null,
"logo_url": null,
"github_contributions_count": 2616,
"keywords": ["activejob", "activerecord", "html", "mvc", "rails", "ruby"],
"dependencies": [
{ "project_name": "websocket-driver",
"name": "websocket-driver",
"platform": "rubygems",
"requirements": "~> 0.6.1",
"latest_stable": "0.7.0",
"latest": "0.7.0",
"deprecated": false, "outdated": true,
"filepath": "actioncable/actioncable.gemspec", "
kind": "runtime"
}
]
"""
addMetric(app, librariesio.dependencies, 'dependencies')
"""
@api {get} /:owner/:repo/dependents List of dependants from libraries.io
@apiName Dependents
@apiGroup Ecosystem
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"login": "bonnie",
"location": "Rowena, TX",
"commits": 12
},
{
"login":"clyde",
"location":"Ellis County, TX",
"commits": 12
}
]
"""
addMetric(app, librariesio.dependents, 'dependents')
"""
@api {get} /:owner/:repo/dependency_stats List of libraries.io stats
@apiName DependencyStats
@apiGroup Ecosystem
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"dependencies": "10",
"dependent_projects": "10.6K",
"dependent_repositories": "392K"
}
]
"""
addMetric(app, librariesio.dependency_stats, 'dependency_stats')
"""
@api {get} /:owner/:repo/timeseries/total_committers count of new committers weekly
@apiName UniqueCommitters
@apiGroup Timeseries
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{ "date":"2009-02-16T00:00:00.000Z",
"total_total_committers":1.0
},
{ "date":"2009-07-12T00:00:00.000Z",
"total_total_committers":2.0
},
]
"""
addTimeseries(app, ghtorrent.total_committers, 'total_committers')
# Popularity
"""
@api {get} /:owner/:repo/linking_websites Linking Websites
@apiDescription Returns an array of websites and their rank according to http://publicwww.com/
@apiName LinkingWebsites
@apiGroup Popularity
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"url": "missouri.edu",
"rank": "1"
},
{
"url": "unomaha.edu",
"rank": "2"
}
]
"""
addMetric(app, publicwww.linking_websites, 'linking_websites')
"""
@api {get} /ghtorrent_range Range of dates covered by GHTorrent
@apiName GhtorrentRange
@apiGroup Misc
"""
@app.route('/{}/ghtorrent_range'.format(AUGUR_API_VERSION))
def ghtorrent_range():
ghtorrent_range = serialize(ghtorrent.ghtorrent_range())
return Response(response=ghtorrent_range,
status=200,
mimetype="application/json")
#######################
# GitHub API #
#######################
"""
@api {get} /:owner/:repo/bus_factor Bus Factor
@apiDescription Returns an integer that is the number of developers that have a summed percentage of contributions higher than the threshold
@apiName GitHub
@apiGroup Users
@apiParam {String} owner Username of the owner of the GitHub repository
@apiParam {String} repo Name of the GitHub repository
@apiSuccessExample {json} Success-Response:
[
{
"best": "5",
"worst": "1"
}
]
"""
addMetric(app, github.bus_factor, 'bus_factor')
#######################
# Batch Requests #
#######################
"""
@api {post} /batch Bus Factor
@apiDescription Returns results of batch requests
@apiName Batch
@apiGroup Batch
POST JSON of api requests
"""
#TODO: documentation
@app.route('/{}/batch'.format(AUGUR_API_VERSION), methods=['GET', 'POST'])
[docs]def batch():
"""
Execute multiple requests, submitted as a batch.
:statuscode 207: Multi status
"""
if request.method == 'GET':
"""this will return sensible defaults in the future"""
return make_response('{"status": "501", "response": "Defaults for batch requests not implemented. Please POST a JSON array of requests to this endpoint for now."}', 501)
try:
requests = json.loads(request.data)
except ValueError as e:
abort(400)
responses = []
for index, req in enumerate(requests):
method = req['method']
path = req['path']
body = req.get('body', None)
with app.app_context():
with app.test_request_context(path,
method=method,
data=body):
try:
# Can modify flask.g here without affecting
# flask.g of the root request for the batch
# Pre process Request
rv = app.preprocess_request()
if rv is None:
# Main Dispatch
rv = app.dispatch_request()
except Exception as e:
rv = app.handle_user_exception(e)
response = app.make_response(rv)
# Post process Request
response = app.process_response(response)
# Response is a Flask response object.
# _read_response(response) reads response.response
# and returns a string. If your endpoints return JSON object,
# this string would be the response as a JSON string.
responses.append({
"path": path,
"status": response.status_code,
"response": str(response.get_data(), 'utf-8')
})
return Response(response=json.dumps(responses),
status=207,
mimetype="application/json")
if (debugmode):
app.debug = True
if read_config('Development', 'interactive', 'AUGUR_INTERACTIVE', '0') == '1':
ipdb.set_trace()
# Close files and save config
if (CONFIG_BAD):
print('Regenerating config...')
AUGUR_CONFIG_FILE.seek(0)
parser.write(AUGUR_CONFIG_FILE)
AUGUR_CONFIG_FILE.close()
if AUGUR_ENV_EXPORT:
AUGUR_ENV_EXPORT_FILE.close()
def run():
app.run(host=host, port=int(port), debug=debugmode)
if __name__ == "__main__":
try:
run()
except Exception as e:
print(e)
type, value, tb = sys.exc_info()
traceback.print_exc()
if (debugmode):
ipdb.post_mortem(tb)
exit(1)


Extending with Compiler Extensions
The sections below include information about extending with compiler extensions.
Annotations
Annotations can be used to provide structured metadata about a particular construct. Annotations are not executable. However, they can be used to alter the behavior of constructs they are attached to.
Annotations can be attached to:
- services and resources
- type definitions
- function definitions
- function parameters
- function return
- module-level variables and constants
- annotations
- listeners
- workers
- type cast expressions
The Ballerina compiler can be extended using compiler extensions (if required) for additional verification or processing (e.g. modifications, artifact generation etc.). Such custom extensions provided will be executed at the end of the compilation phase before generating the Ballerina Intermediate Representation (BIR). A compiler extension can make use of the metadata provided via annotations to introduce additional behavior to the compilation process.
The ballerina/docker
and ballerina/kubernetes
modules make use of custom annotations. They introduce new annotations such as @docker:Config
and @kubernetes:Deployment
that can be attached to certain constructs in a Ballerina source file. The respective compiler extensions then run a post-compilation process that reads these annotations and generates the Docker and Kubernetes deployment artifacts.
Note: Currently, there are two caveats when writing compiler extensions:
- The Ballerina Compiler is written in Java 8. Therefore, you will need JDK 1.8.
- End users will have to install the extension manually.
Hello World: The Annotation Way
In this guide, we will take a look at how to create a custom annotation and how to write a compiler extension to read and act upon our custom annotation. The custom annotation (i.e. @hello:Greeting
) is attachable to functions. It has an attribute called salutation
, which will be read by the compiler extension and written to a file when building the program. The annotation can be shared with others by publishing it to Ballerina Central. Currently, there isn’t a mechanism for sharing compiler extensions. The compiler extension has to be copied to the <BALLERINA_HOME>/bre/lib
directory.
The end user would be able to write a program such as the following:
import foo/hello;
@hello:Greeting {
salutation: "Guten Tag!"
}
function add(int x, int y) returns int {
return x + y;
}
public function main() {
var sum = add(10, 20);
}
At the end of the build, the user should be able to see a <module_name>.txt
file in the target/greetings/
directory.
Defining a Custom Annotation
Creating the Annotation
Create a new Ballerina project and add a module named hello
. For this instance, add a single source file named annotation.bal
and remove other boilerplate code and files. Your project structure should look similar to the following:
.
├── Ballerina.toml
└── src
└── hello
└── annotation.bal
Add the following code to define the @hello:Greeting
annotation in the annotation.bal
file.
# This record defines the fields of the @hello:Greeting annotation.
#
# + salutation - The greeting message
public type HelloConfiguration record {|
string salutation = "Hello!";
|};
# Define an annotation named `Greeting`. Its type is `HelloConfiguration` and it can be
# attached to functions.
public annotation HelloConfiguration Greeting on function;
Now, build this annotation. The -c
flag is used since this module will only be used as a library.
$ ballerina build -c hello
If all went well, a /target
directory should be created with the built artifacts.
target/
├── balo
│ └── hello-2019r3-any-0.1.0.balo
├── caches
│ ├── bir_cache
│ │ └── foo
│ │ └── hello
│ │ └── 0.1.0
│ │ └── hello.bir
│ └── jar_cache
│ └── foo
│ └── hello
│ └── 0.1.0
│ └── foo-hello-0.1.0.jar
└── tmp
└── foo-hello-0.1.0.jar
Verifying the Annotation
At this stage, you can use the annotation in a program to verify the correctness of what was done so far. To do so, create a demo project, add our hello
module as a dependency, and attach it to a function. Your program should compile without any errors.
The demo project structure looks like the following:
.
├── Ballerina.toml
└── src
└── greet
└── greeting.bal
Add the foo/hello
module as a path dependency in the Ballerina.toml
file.
[project]
org-name = "bar"
version = "0.1.0"
[dependencies]
"foo/hello" = { path = "<path_to_annotation_project_dir>/hello-annot/target/balo/hello-2019r3-any-0.1.0.balo" }
Add a function to the greeting.bal
file. Note that the function is annotated using the @hello:Greeting
annotation.
import foo/hello;
@hello:Greeting {
salutation: "Guten Tag!"
}
function add(int x, int y) returns int {
return x + y;
}
public function main() {
var sum = add(10, 20);
}
Building the greet
module should produce an executable named greet.jar
in the target/bin
directory.
Writing the Compiler Extension
The Ballerina compiler can be extended through compiler extensions if there are additional verifications or tasks you would like to perform. Such custom extensions will be executed towards the end of the compilation phase. A compiler extension can be created by implementing the CompilerPlugin
interface provided by the org.ballerinalang.compiler.plugins
package. It defines the following methods, which the user can implement to add additional verifications.
void process(PackageNode packageNode)
void process(BLangTestablePackage testablePackageNode)
void process(ServiceNode serviceNode, List<AnnotationAttachmentNode> annotations)
void process(TypeDefinition typeDefinition, List<AnnotationAttachmentNode> annotations)
void process(FunctionNode functionNode, List<AnnotationAttachmentNode> annotations)
void process(SimpleVariableNode variableNode, List<AnnotationAttachmentNode> annotations)
void process(AnnotationNode annotationNode, List<AnnotationAttachmentNode> annotations)
void codeGenerated(PackageID packageID, Path binaryPath)
Each of the process()
methods correspond to annotable constructs of the language. The codegenerated()
method gets invoked once the code generation phase is completed. The org.ballerinalang.compiler.plugins
package also provides a convenience class named AbstractCompilerPlugin
with empty implementations for the above methods.
The extension will read the salutation field of the @hello:Greeting
annotation and write its value to a file in the /target
directory.
Setting Up the Project
Start by creating a Java project for the extension. It needs two classes: HelloPlugin
and HelloModel
. Also, create a resource file named org.ballerinalang.compiler.plugins.CompilerPlugin
in the resources/META-INF/services
directory. This file should contain the fully-qualified class name of the extension class (which in this case, is xyz.foo.hello.HelloPlugin
).
src/
└── main
├── java
│ └── xyz
│ └── foo
│ └── hello
│ ├── HelloModel.java
│ └── HelloPlugin.java
└── resources
└── META-INF
└── services
└── org.ballerinalang.compiler.plugins.CompilerPlugin
The only dependency you will need for this extension is the ballerina-lang
project. Add the following Maven repository
to your project to get the ballerina-lang
dependency.
http://maven.wso2.org/nexus/content/repositories/releases/
Given below is a sample build.gradle
file for the project.
plugins {
id 'java'
}
group 'xyz.foo'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
maven {
url "http://maven.wso2.org/nexus/content/repositories/releases/"
}
}
dependencies {
implementation group: 'org.ballerinalang', name: 'ballerina-lang', version: '1.0.0'
}
Adding the Code for the Extension
Add the following code to the HelloPlugin.java
file.
import org.ballerinalang.compiler.plugins.AbstractCompilerPlugin;
import org.ballerinalang.compiler.plugins.SupportedAnnotationPackages;
import org.ballerinalang.model.elements.PackageID;
import org.ballerinalang.model.tree.AnnotationAttachmentNode;
import org.ballerinalang.model.tree.FunctionNode;
import org.ballerinalang.util.diagnostic.Diagnostic;
import org.ballerinalang.util.diagnostic.DiagnosticLog;
import org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment;
import org.wso2.ballerinalang.compiler.tree.expressions.BLangLiteral;
import org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral;
import org.wso2.ballerinalang.compiler.tree.expressions.BLangRecordLiteral.BLangRecordKeyValue;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.List;
/**
* Compiler extension to generate greetings.
*/
// This annotation specifies that this compiler extension should only be enabled when the mentioned module is used.
@SupportedAnnotationPackages(
value = "foo/hello:0.1.0"
)
public class HelloPlugin extends AbstractCompilerPlugin {
private DiagnosticLog dlog;
@Override
public void init(DiagnosticLog diagnosticLog) {
this.dlog = diagnosticLog;
}
// The annotation is attached to functions. Therefore, the process() method is overridden for functions.
@Override
public void process(FunctionNode functionNode, List<AnnotationAttachmentNode> annotations) {
// Iterate through the annotations attached to the service.
for (AnnotationAttachmentNode annotation : annotations) {
// The `annotations` list contains all the annotations attached to the service.
// Since only the `@hello:Greeting` annotation is considered, skip the other annotations.
if (!"Greeting".equals(annotation.getAnnotationName().getValue())) {
continue;
}
// Retrieve the fields of the annotation value.
List<BLangRecordKeyValue> annotFields =
((BLangRecordLiteral) ((BLangAnnotationAttachment) annotation).expr).getKeyValuePairs();
// In this particular case, there is no need to iterate through the list since the `@hello:Greeting` annotation only has
// one field. Therefore, take the first element of the fields list.
BLangRecordKeyValue salutationField = annotFields.get(0);
String annotFieldValue = ((BLangLiteral) salutationField.getValue()).getValue().toString();
String greeting = String.format("%s from %s()\n", annotFieldValue, functionNode.getName().getValue());
HelloModel.getInstance().setGreeting(greeting);
}
}
// The `codeGenerated()` method gets invoked once the executable is built. The greeting is written to a text file
// with the same name as the executable and in the same directory as the executable.
@Override
public void codeGenerated(PackageID packageID, Path binaryPath) {
String fileName = binaryPath.getFileName().toString().replace(".jar", ".txt");
Path greetingsPath = Paths.get("target", "greetings", fileName);
String greeting = HelloModel.getInstance().getGreetings();
try {
System.out.println("\nGenerating greetings");
System.out.println("\t" + greetingsPath.toString());
writeToFile(greeting, greetingsPath);
} catch (IOException e) {
dlog.logDiagnostic(Diagnostic.Kind.ERROR, null, e.getMessage());
}
}
private void writeToFile(String greetings, Path targetFilePath) throws IOException {
File newFile = targetFilePath.toFile();
if (newFile.exists()) {
Files.write(targetFilePath, greetings.getBytes(StandardCharsets.UTF_8), StandardOpenOption.APPEND);
return;
}
if (newFile.getParentFile().mkdirs()) {
Files.write(targetFilePath, greetings.getBytes(StandardCharsets.UTF_8));
return;
}
Files.write(targetFilePath, greetings.getBytes(StandardCharsets.UTF_8));
}
}
Add the following code to the HelloModel.java
file.
class HelloModel {
private static HelloModel instance = new HelloModel();
private String greeting;
private HelloModel() {
}
static HelloModel getInstance() {
return instance;
}
String getGreetings() {
return greeting;
}
void setGreeting(String greeting) {
this.greeting = greeting;
}
}
Finally, build the extension and place the resulting JAR file inside the <BALLERINA_HOME>/distributions/jballerina-<BALLERINA_VERSION>/bre/lib/
directory.
Putting it All Together
Now, build your hello world project again. You should see an additional step logged in the console for generating the greeting.
$ ballerina build greet
Compiling source
bar/greet:0.1.0
Creating balos
target/balo/greet-2019r3-any-0.1.0.balo
Running tests
bar/greet:0.1.0
No tests found
Generating executables
target/bin/greet.jar
Generating greetings
target/greetings/greet.txt
The target/greetings/greet.txt
file should contain the following text: Guten Tag! from add()
Learning More About Writing Compiler Extensions
The example considered in this how-to guide is a basic compiler extension. If you are looking for something which goes beyond this, take a look at the compiler extensions written for generating Docker and Kubernetes artifacts.


#include <XKMSValidateRequest.hpp>
Inheritance diagram for XKMSValidateRequest:
The <ValidateRequest> is one of the fundamental message types of the XKISS service. It is used by the Validate service to find a key and return a set of key bindings for that key.
The schema definition for ValidateRequest is as follows :
<!-- ValidateRequest --> <element name="ValidateRequest" type="xkms:ValidateRequestType"/> <complexType name="ValidateRequestType"> <complexContent> <extension base="xkms:RequestAbstractType"> <sequence> <element ref="xkms:QueryKeyBinding"/> </sequence> </extension> </complexContent> </complexType> <!-- /ValidateRequest -->
Constructors and Destructors | |
| virtual | ~XKMSValidateRequest () |
| XKMSValidateRequest () | |
Public Member Functions | |
Getter Interface Methods | |
| virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * | getElement (void) const =0 |
| Return the element at the base of the message. | |
| virtual XKMSQueryKeyBinding * | getQueryKeyBinding (void)=0 |
| Obtain the QueryKeyBinding element. | |
Setter Interface Methods | |
| virtual XKMSQueryKeyBinding * | addQueryKeyBinding (void)=0 |
| Add a QueryKeyBinding element. |
|
|
|
|
|
|
|
|
Add a QueryKeyBinding element. Set a QueryKeyBinding element in the ValidateRequest message. The returned object can be manipulated to add KeyInfo elements to the ValidateRequest.
|
|
|
Return the element at the base of the message.
Implements XKMSRequestAbstractType. |
|
|
Obtain the QueryKeyBinding element. The QueryKeyBinding element is the core of the ValidateRequest message, and defines the public key information that will be sent to the server.
|


Home
Login
Register
Posts
logout
Loading...
Success
Error
Username
Password
Username
Password
Confirm Password
Title
Body


com.jme3.asset
contains the {@link com.jme3.asset.AssetManager},
a utility class that is used to load assets such as textures, models, and
sound effects in a jME3 application.
AssetLoaders
{@link com.jme3.asset.AssetLoader asset loaders} are registered to load
assets of a particular format. For example, an AssetLoader
that
loads TGA images should read a stream in .tga format and return an
{@link com.jme3.texture.Image} object as its output.
AssetLoader
s are initialized once a file of that format
is loaded, there's only one AssetLoader per thread so
AssetLoader's load() method does not have to be thread safe.
AssetLocators
{@link com.jme3.asset.AssetLocator}(s) are used to resolve
an asset name (a string) into an {@link java.io.InputStream} which is
contained in an {@link com.jme3.asset.AssetInfo} object.
There are AssetLocators
for loading files from the application's
classpath, the local hard drive, a ZIP file, an HTTP server, and more. The user
can implement their own AssetLocators and register them with the AssetManager
to load their resources from their own location.


Arne Saknussemm
问题描述 :
Following the account of Jules Verne, a scrambled message written by the middle age alchemist Arne Saknussemm, and deciphered by professor Lidenbrock, started the incredible travel to the center of the Earth. The scrambling procedure used by Arne is alike the procedure given below.
1. Take a non empty message M that contains letters from the English alphabet, digits, commas, dots, quotes (i.e. '), spaces and line breaks, and whose last character is different than space. For example, consider the following message whose translation reads “In Sneffels’s crater descend brave traveler, and touch the center of the Earth”.
In Sneffels craterem descende audas |
2. Choose an integral number 0<K≤length(M) and add trailing spaces to M such that the length of the resulting message, say M’, is the least multiple of K. For K=19 and the message above, where length(M)=74 (including the 8 spaces and the line break that M contains), two trailing spaces are added yielding the message M’ with length(M’)=76.
3. Replace all the spaces from M’ by the character _ (underscore) ; replace all the line breaks from M’ by \ (backslash), and then reverse the message. In our case:
__.segnitta_murtnec_ertserret_te_,rotaiv\sadua_ednecsed_meretarc_sleffenS_nI |
4. Write the message that results from step 3 in a table with length(M’)/K rows and K columns. The writing is column wise. For the given example, the message is written in a table with 76/19=4 rows and 19 columns as follows:
| _ | e | t | m | n | e | e | t | _ | t | \ | u | d | s | m | t | _ | f | S |
| _ | g | t | u | e | r | r | _ | , | a | s | a | n | e | e | a | s | f | _ |
| . | n | a | r | c | t | r | t | r | i | a | _ | e | d | r | r | l | e | n |
| s | i | _ | t | _ | s | e | e | o | v | d | e | c | _ | e | c | e | n | I |
5. The strings of characters that correspond to the rows of the table are the fragments of the scrambled message. The 4 fragments of Arne’s message given in step 1 are:
_etmneet_t\udsmt_fS |
_gtuerr_,asaneeasf_ |
Write a program that deciphers non empty messages scrambled as described. The length of a message, before scrambling, is at most 1000 characters, including spaces and line breaks.
输入:
The program input is from a text file where each data set corresponds to a scrambled message. A data set starts with an integer n, that shows the number of fragments of the scrambled message, and continues with n strings of characters that designate the fragments, in the order they appear in the table from step 4 of the scrambling procedure. Input data are separated by white-spaces and terminate with an end of file.
输出:
The deciphered message must be printed on the standard output, from the beginning of a line and must be followed by an empty line as shown in the input/output sample below.
样例输入:
4 _etmneet_t\udsmt_fS _gtuerr_,asaneeasf_ .narctrtria_edrrlen si_t_seeovdec_ecenI 11 e n r e V _ s e l u J
样例输出:
In Sneffels craterem descende audas viator, et terrestre centrum attinges. Jules Verne
解题代码:
//* @author: import java.util.*; import java.math.*; import java.io.FileReader; public class Main { public static void main(String[] args) throws Exception{ Scanner in=new Scanner(System.in); while (true) { int n; try { n=in.nextInt(); } catch(Exception e) {return;} String []s=new String [n]; for (int i=0;i< n;i++) s[i]=in.next(); int m=s[0].length(); String tp=new String(); for (int i=m-1;i>=0;i--) for (int j=n-1;j>=0;j--) tp=tp.concat(String.valueOf(s[j].charAt(i))); int lastone=0; for (int i=tp.length()-1;i>=0;i--) if (tp.charAt(i)!='_') {lastone=i;break;} for (int i=0;i< tp.length();i++) { if (tp.charAt(i)=='_') System.out.print(' '); else if (tp.charAt(i)=='\\') System.out.println(); else System.out.print(tp.charAt(i)); if (i==lastone) break; } System.out.println(); System.out.println(); } } }
不错，感谢分享。
这个问题别太纠结了，不同的编译器结果不一样
正解，已改正。应该都是protected
顶一个 赞一个
无需用转移方程也可以解决，哈哈
这种二分还是比较经典！mark
这个才是我想要的
这个后缀数组不是常用的那个.
#!/usr/bin/env python def cou(n): arr = [1]
很好的思路，可以借鉴
I like your publish. It is great to see you verbalize from the coronary heart and clarity on this essential subject matter can be easily noticed.
very good solutions.
题目需要求解的是最小值，而且没有考虑可能存在环，比如
0 0 0 0 0
1 1 1 1 0
1 0 0 0 0
1 0 1 0 1
1 0 0 0 0
会陷入死循环
很好的思路，可以借鉴


Helps you imagine your data before you collect it. Hierarchical data structures and correlated data can be easily simulated, either from random number generators or by resampling from existing data sources. This package is faster with 'data.table' and 'mvnfast' installed.
| Version: | 0.6.0 |
| Depends: | R (≥ 3.4.0) |
| Imports: | rlang (≥ 0.2.0) |
| Suggests: | testthat, data.table, mvnfast, MASS |
| Published: | 2018-08-23 |
| Author: | Graeme Blair [aut, cre], Jasper Cooper [aut], Alexander Coppock [aut], Macartan Humphreys [aut], Aaron Rudkin [aut], Neal Fultz [aut] |
| Maintainer: | Graeme Blair <graeme.blair at ucla.edu> |
| BugReports: | https://github.com/DeclareDesign/fabricatr/issues |
| License: | MIT + file LICENSE |
| URL: | https://declaredesign.org/r/fabricatr, https://github.com/DeclareDesign/fabricatr |
| NeedsCompilation: | no |
| Materials: | NEWS |
| CRAN checks: | fabricatr results |
| Reference manual: | fabricatr.pdf |
| Package source: | fabricatr_0.6.0.tar.gz |
| Windows binaries: | r-devel: fabricatr_0.6.0.zip, r-release: fabricatr_0.6.0.zip, r-oldrel: fabricatr_0.6.0.zip |
| OS X binaries: | r-release: fabricatr_0.6.0.tgz, r-oldrel: fabricatr_0.6.0.tgz |
| Old sources: | fabricatr archive |
| Reverse depends: | DeclareDesign, DesignLibrary |
| Reverse suggests: | estimatr |
Please use the canonical form https://CRAN.R-project.org/package=fabricatr to link to this page.


Contact Us:
Zoom Rental Cars Private Limited
Sector 1, Plot No: 3, Manesar,
Gurgoan, Haryana
Ph No: +91<PHONE_NUMBER>.
Email<EMAIL_ADDRESS>HOME
ADMIN LOGIN
CUSTOMER LOGIN
REGISTRATION
CONTACT US
ABOUT US


enum class KFileType
Used to represent what type of file this KFile is.
Author Boston Vanseghi
Since 2.0.3


This is a culmination of all of the personal projects that I am working on.
Listed with the project is a description of some of the things I liked or learned while working on the project. Also, listed are the components that were used and some of the future implementations I hope to complete for the project.


--- layout: page-with-toc color: purple title: Accommodation headings: "hotels,other-hotels" ---
There are many hotels in and around Heidelberg covering a range of prices. To make things easier, we have organised with Heidelberg Tourism some hotels that have been pre-booked for the SotM conference with special rates. The rooms can be booked via this booking platform. Note that some hotels are only available during SOTM or HOT summit, not both.
If you want to extend your stay in Heidelberg beyond the SOTM and HOT summit, please send your booking request mentioning “State of the Map” and your preferred dates and hotel to<EMAIL_ADDRESS>The Hotel NH offers a more "high-end" stay for the conference being a 4 star hotel.
The Ibis hotel offers a more budget accommodation, and is situated right next to Heidelberg's main train station.
Star Inn Hotel & is a fairly new and large hotel located within walking distance to the main train station.
Denner is a hotel with a little more character, with no two rooms being the same.
If you prefer staying in a hostel we have arranged a number of beds in dormitories at Steffi's Hostel. For booking here, you need to contact the hostel directly mentioning the word "State of the map" and/or "HOT Summit".
Other than these pre-booked hotels, there are a large number of hotels that you can use during the conference. Aswell as staying in Heidelberg, you can also choose to stay in nearby towns and cities such as Mannheim. There are fairly regular connections between Heidelberg and Mannheim both via the local train network and using trams. There are connections throughout the night on Friday and Saturday, but limited connections on Sunday night (last train around 1am on Monday morning).
If you're on a low budget you might consider the Youth Hostel Heidelberg International, which is located within walking distance of the SotM conference venue. If you prefer to camp, there are a few camp sites not very far from Heidelberg.


Changing the e-mail address Forefront Protection for Exchange 2010 uses
Forefront Protection for Exchange 2010 makes it possible to check messages for virusses and spam. Just like every other software Forefront can send messages when an infected message is found. By default Forefront generates an e-mail address during the installation. This may be something you don’t want but where can you change the e-mail address? You would expect that it can be changed in the console but you won’t find it there. To change the e-mail address you will need edit the registry.


Web Technologist Since 1999
I was born in Florida and I have always lived there. I have a wife and family and I love them very much. I enjoy the mountains when I get the chance, they make for a great change of scenery!
Having been at this stuff for a long time now, I attended the first Flash Forward in 2000 and I have battled Netscape 4. Through the years many things have changed and some things have stayed the same. What was for the web is now for almost everything. HTML, CSS, JavaScript to build websites, apps, IoT, digital signage, games, the list goes on…
I have used Flash for banners, games, online apps that act like HTML, hardware simulations, experiential museum installs and retail kiosks ( as Air ). HTML, CSS and JavaScript for your website, kiosk or app. Content management done in XML, JSON, ASP, PHP, Ruby, Python, JavaScript, the "Cloud".
The technology is not the determinant, the project goal and its best solution are. Today there are so many options that we can pick and choose, adapt and read the documentation as needed. Think hammer or screwdriver for that nail.
Shawn has been using technology to solve problems since 1997, including clients such as SpeedTV, Upper Deck, Coors, Heineken, Disney, Tupperware Brands, Motorola/Nextel, Bose, 3M, Harmonic, Riteaid and a wide variety of additional clients. His goal is to use the best technology for the solution at hand. His expertise stretches from websites and mobile or online applications, to proof of concept demos, to content managed multi-touch interactives. Shawn has created interactive installations for Tupperware Headquarters in Orlando Florida, 3M innovation Center in St. Paul Minnesota and the Witte Museum in San Antonio Texas as well as Motorola kiosks for printing tattoos and laser etching to mobile phones.
Shawn has a passion for learning and pushing the boundaries using the latest interactive technologies. In his free time, Shawn enjoys being a devoted husband since 2003 and father of two beautiful girls.


Coverage Summary for Class: StationApp (core.statistics.balance.station)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| StationApp | 100% (1/ 1) | 11.1% (1/ 9) | 7.9% (3/ 38) |
1 package core.statistics.balance.station;
2
3 import core.components.SortStationByMostUsed;
4 import core.components.Station;
5 import core.system.MyVelibSystem;
6
7 import java.util.Collections;
8 import java.util.List;
9
10 /**
11 * The StationApp class in statistics.balance.station : This class has all the algorithms and methods that we need to calculate the statistics
12 * in the application for stations, that is to say, plus stations and standard stations.
13 */
14 public class StationApp {
15
16 /**
17 * Getter of the most used station of a give system
18 *
19 * @param system the system that is being studied
20 * @return the station that has is most used (the number of droppings is used to compare). Return the first one, if there are more
21 */
22 public static Station getMostUsedStation(MyVelibSystem system) {
23 Station mostUsedStation = system.getStations().get(0); // Take the first station on the system
24
25 for (Station station : system.getStations()
26 ) {
27 // Check to see if station has a higher numberOfLocations
28 if (station.getNumberOfDroppings() > mostUsedStation.getNumberOfDroppings()) {
29 mostUsedStation = station;
30 }
31 }
32
33
34 return mostUsedStation;
35 }
36
37 /**
38 * Getter for the least occupied station
39 *
40 * @param system the system that is being studied
41 * @return the station that is least used (the rate of occupation is used). Return the first one, if there are more
42 */
43 public static Station getLeastOccupiedStation(MyVelibSystem system) {
44 Station leastOccupiedStation = system.getStations().get(0); // Take the first station
45
46 // We are going to see how many free slots there are in the station and compare them
47 // TODO: Design method
48
49 return leastOccupiedStation;
50 }
51
52
53 /**
54 * This method is used to get the station balance, it is used to compute many different parameters
55 * parameter 1 : average station balance on the system
56 * parameter 2 : the station which gained the most in the system
57 * parameter 3 : the station which gained the least in the system
58 *
59 * @param system the system that will be studied
60 */
61 public static void stationBalance(MyVelibSystem system) {
62 // Calculate the average station balance
63 double averageStationBalance = 0; // Initialize the average to zero
64
65 for (Station station : system.getStations()
66 ) {
67 averageStationBalance += station.getMoney();
68 }
69
70 averageStationBalance /= system.getStations().size();
71
72 System.out.println("The average station balance is: " + averageStationBalance + "!");
73 System.out.println();
74
75
76 // Calculate the average of all station money // ????
77
78 // Calculate the station that gained the most in the myVelib system
79 Station stationWhoGainedTheMost = system.getStations().get(0); // Take the first
80
81 for (Station station : system.getStations()
82 ) {
83 if (station.getMoney() > stationWhoGainedTheMost.getMoney()) {
84 stationWhoGainedTheMost = station;
85 }
86 }
87
88 System.out.println("The station who gained the most is: " + stationWhoGainedTheMost + "!");
89 System.out.println();
90
91
92 // Calculate the station that gained the least in the myVelib system
93 Station stationWhoGainedTheLeast = system.getStations().get(0); // Take the first
94
95 for (Station station : system.getStations()
96 ) {
97 if (station.getMoney() < stationWhoGainedTheLeast.getMoney()) {
98 stationWhoGainedTheLeast = station;
99 }
100 }
101
102 System.out.println("The station who gained the least is: " + stationWhoGainedTheLeast + "!");
103 System.out.println();
104
105 // Calculate other stuff
106
107 }
108
109 /**
110 * Getter for the number of rentings
111 *
112 * @param station The station that will be studied
113 * @return an integer that represents the number of rentings
114 */
115 public static int getNumberOfRentings(Station station) {
116 return station.getNumberOfRentings();
117 }
118
119 /**
120 * Getter for the number of droppings
121 *
122 * @param station The station that will be studied
123 * @return an integer that represents the number of droppings
124 */
125 public static int getNumberOfDroppings(Station station) {
126 return station.getNumberOfDroppings();
127 }
128
129 /**
130 * This methods is used to compute the average rate of occupation of a given station
131 *
132 * @param station the station that is being studied
133 * @return a double that represents the average rate of occupation of a given station
134 */
135 public static double computeAverageRateOfOccupation(Station station) {
136 // TODO: Design method
137 return 0;
138 }
139
140 /**
141 * This method is used to sort a list of station by the most used policy
142 *
143 * @param stations the list of stations that is being used
144 * @return the list sorted
145 */
146 public static List<Station> sortStationByMostUsed(List<Station> stations) {
147
148 SortStationByMostUsed mostUsedComparator = new SortStationByMostUsed();
149 Collections.sort(stations, mostUsedComparator);
150
151 return stations;
152 }
153
154 /**
155 * This method is used to sort a list of station by the least occupied policy
156 *
157 * @param stations the list of stations that is being used
158 */
159 public static void sortStationByLeastOccupied(List<Station> stations) {
160 // TODO: Design method
161 }
162 }


Course Evaluations
All Evaluations
By Grade
{% regroup sections|dictsort:"teacher.first_name"|dictsort:"teacher.last_name" by teacher as teacher_list %}
By Teacher
{% if evaluation_set.is_open %}
Zip file download is disabled for open evaluation sets
{% else %}
Download as zip file by department/teacher/course
{% endif %}
{% for teacher in teacher_list %}
{% regroup teacher.list|dictsort:"course.course_name" by course as course_list %}
-
{{ teacher.grouper.name }}
{% endfor %}
IIP Evaluations
{% if evaluation_set.is_open %}
Zip file download is disabled for open evaluation sets
{% else %}
Download as zip file
{% endif %}
Dorm Parent Evaluations
By Dorm
{% if evaluation_set.is_open %}
Zip file download is disabled for open evaluation sets
{% else %}
Download as zip file by dorm/dorm parent
{% endif %}
{% regroup dorm_parents by dorm as dorm_list %}
{% for dorm in dorm_list %}
-
{{ dorm.grouper }}
{% endfor %}
MELP Evaluations
All MELP Evaluations
{% if evaluation_set.is_open %}
Zip file download is disabled for open evaluation sets
{% else %}
Download all MELP evaluations as a zip file
{% endif %}


The Unified backend was introduced in ArrayFire with version 3.2. While this is not an independent backend, it allows the user to switch between the different ArrayFire backends (CPU, CUDA and OpenCL) at runtime.
The steps to compile with the unified backend are the same as compiling with any of the other backends. The only change being that the executable needs to be linked with the af library (libaf.so
(Linux), libaf.dylib
(OSX), af.lib
(Windows)).
Check the Using with Linux, OSX, Windows for more details.
To use with CMake, use the ArrayFire_Unified_LIBRARIES variable.
The Unified backend will try to dynamically load the backend libraries. The priority of backends is CUDA -> OpenCL -> CPU
The most important aspect to note here is that all the libraries the ArrayFire libs depend on need to be in the environment paths
LD_LIBRARY_PATH
-> Linux, Unix, OSXDYLD_LIBRARY_PATH
-> OSXPATH
-> WindowsIf any of the libs are missing, then the library will fail to load and the backend will be marked as unavailable.
Optionally, The ArrayFire libs may be present in AF_PATH
or AF_BUILD_PATH
environment variables if the path is not in the system paths. These are treated as fallback paths in case the files are not found in the system paths. However, all the other upstream libraries for ArrayFire libs must be present in the system path variables shown above.
The af_backend enum stores the possible backends. To select a backend, call the af::setBackend function as shown below.
To get the count of the number of backends available (the number of libaf*
backend libraries loaded successfully), call the af::getBackendCount function.
This example is shortened form of basic.cpp.
This output would be:
Trying CPU Backend ArrayFire v3.2.0 (CPU, 64-bit Linux, build fc7630f) [0] Intel: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz Max threads(8) af::randu(5, 4) [5 4 1 1] 0.0000 0.2190 0.3835 0.5297 0.1315 0.0470 0.5194 0.6711 0.7556 0.6789 0.8310 0.0077 0.4587 0.6793 0.0346 0.3834 0.5328 0.9347 0.0535 0.0668 Trying CUDA Backend ArrayFire v3.2.0 (CUDA, 64-bit Linux, build fc7630f) Platform: CUDA Toolkit 7.5, Driver: 355.11 [0] Quadro K5000, 4093 MB, CUDA Compute 3.0 af::randu(5, 4) [5 4 1 1] 0.7402 0.4464 0.7762 0.2920 0.9210 0.6673 0.2948 0.3194 0.0390 0.1099 0.7140 0.8109 0.9690 0.4702 0.3585 0.1541 0.9251 0.5132 0.6814 0.4452 Trying OpenCL Backend ArrayFire v3.2.0 (OpenCL, 64-bit Linux, build fc7630f) [0] NVIDIA : Quadro K5000 -1- INTEL : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz af::randu(5, 4) [5 4 1 1] 0.4107 0.0081 0.6600 0.1046 0.8224 0.3775 0.0764 0.8827 0.9518 0.3027 0.0901 0.1647 0.1794 0.6456 0.5933 0.8060 0.4198 0.5591 0.1098 0.5938
It is very easy to run into exceptions if you are not careful with the switching of backends.
ArrayFire checks the input arrays to functions for mismatches with the active backend. If an array created on one backend, but used when another backend is set to active, an exception with code 503 (AF_ERR_ARR_BKND_MISMATCH
) is thrown.
We recommend that you use a technique to track the arrays on the backends. One suggested technique would be to use a suffix of _cpu
, _cuda
, _opencl
with the array names. So an array created on the CUDA backend would be named myarray_cuda
.
If you have not used the af::setBackend function anywhere in your code, then you do not have to worry about this as all the arrays will be created on the same default backend.
This is another area that is a no go when using the Unified backend. It not recommended that you use custom kernels with unified backend. This is mainly becuase the Unified backend is meant to be ultra portable and should use only ArrayFire and native CPU code.


RT @marsroverdriver: The Death Star is not a star. At most, it's a sort of Death Satellite.
This is why I don't work in marketing, BTW.
1/9/2017, 11:20:07 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @marsroverdriver: The Death Star is not a star. At most, it's a sort of Death Satellite.
This is why I don't work in marketing, BTW.
1/9/2017, 11:20:07 PM
Favs: 0
Retweets: 0
link


1. Overview ¶
최근 comprehensive genomic profiling을 사용한 대규모 코호트 연구들에 따르면 90%가 유용한 alteration을 가지고 있다고 보고되고 있다cite{Priestley:2019bp}. 엔젠바이오는 연구자들을 돕기 위해 323개의 암관련 유전자 (225 coding exon, 98 hotspot cover)를 분석하는 ONCOaccuPanel을 제공한다. small nucleotide variants(SNVs), insertions/deletions(indels), copy-number variations(CNVs), splice variants, fusions과 함께 최근 다수의 genomic loci 분석을 기반으로 하는 tumor mutational burden(TMB) and microsatellite instability(MSI) 분석을 제공한다.
|
Variant type |
Relevant exmaples |
|---|---|
|
SNVs and indels |
KRAS G12D, EGFR exon 19 deletions, BRAF V600E |
|
Fusions |
EGFR, ROS1, RET, ALK, NTRK1 |
|
Splice variants |
MET exon 14 |
|
CNVs |
HER2 |
|
MSI 1 |
MSI-HIGH |
|
TMB 2 |
TMB-HIGH |
Note
로그인 창이 나타나지 않거나 로그인 버튼을 눌러도 연결되지 않는 경우에는 인터넷 또는 기관 내부망(인트라넷) 연결이 활성화 되었는지 확인하거나, 아이디 및 비밀번호를 올바르게 입력했는지 확인한다.
Warning
-
선택한 암종에 따라 해석(interpreation)의 tier 정보가 달라진다.
-
선택한 암종에 따라 white list가 달라진다.
-
NGS를 수행한 RUN 이름을 입력한다.
-
“Local Fastq Files”을 선택하여 로컬 컴퓨터의 FASTQ 파일 또는 “Server Fastq Files”를 선택1하여 원격지의 FASTQ 파일을 선택한다.
-
분석할 FASTQ 파일을 선택한 후, 열기 버튼을 클릭한다.
This theme provides a responsive Material Design theme for Sphinx documentation. It derives heavily from Material for MkDocs , and also uses code from Guzzle Sphinx Theme .
There are two methods to alter the theme. The first, and simplest, uses the
options exposed through
html_theme_options
in
conf.py
. This site’s
options are:
html_theme_options = {
'base_url': 'http://bashtage.github.io/sphinx-material/',
'repo_url': 'https://github.com/bashtage/sphinx-material/',
'repo_name': 'Material for Sphinx',
'google_analytics_account': 'UA-XXXXX',
'html_minify': True,
'css_minify': True,
'nav_title': 'Material Sphinx Demo',
'logo_icon': '',
'globaltoc_depth': 2
}
The complete list of options with detailed explanations appears in
theme.conf
.
1.1. Configuration Options ¶
-
nav_title
-
Set the name to appear in the left sidebar/header. If not provided, uses html_short_title if defined, or html_title.
-
touch_icon
-
Path to a touch icon, should be 152x152 or larger.
-
google_analytics_account
-
Set to enable google analytics.
-
repo_url
-
Set the repo url for the link to appear.
-
repo_name
-
The name of the repo. If must be set if repo_url is set.
-
repo_type
-
Must be one of github, gitlab or bitbucket.
-
base_url
-
Specify a base_url used to generate sitemap.xml links. If not specified, then no sitemap will be built.
-
globaltoc_depth
-
The maximum depth of the global TOC; set it to -1 to allow unlimited depth.
-
globaltoc_collapse
-
If true, TOC entries that are not ancestors of the current page are collapsed.
-
globaltoc_includehidden
-
If true, the global TOC tree will also contain hidden entries.
-
theme_color
-
The theme color for mobile browsers. Hex Color without the leading #.
-
color_primary
-
Primary color. Options are red, pink, purple, deep-purple, indigo, blue, light-blue, cyan, teal, green, light-green, lime, yellow, amber, orange, deep-orange, brown, grey, blue-grey, and white.
-
color_accent
-
Accent color. Options are red, pink, purple, deep-purple, indigo, blue, light-blue, cyan, teal, green, light-green, lime, yellow, amber, orange, and deep-orange.
-
html_minify
-
Minify pages after creation using htmlmin.
-
html_prettify
-
Prettify pages, usually only for debugging.
-
css_minify
-
Minify css files found in the output directory.
-
logo_icon
-
Set the logo icon. Should be a pre-escaped html string that indicates a unicode point, e.g.,
''
which is used on this site. -
master_doc
-
Include the master document at the top of the page in the breadcrumb bar. You must also set this to true if you want to override the rootrellink block, in which case the content of the overridden block will appear
-
nav_links
-
A list of dictionaries where each has three keys:
-
href
: The URL or pagename (str) -
title
: The title to appear (str) -
internal
: Flag indicating to use pathto to find the page. Set to False for external content. (bool)
-
-
heroes
-
A
dict[str,str]
where the key is a pagename and the value is the text to display in the page’s hero location. -
version_dropdown
-
A flag indicating whether the version drop down should be included. You must supply a JSON file to use this feature.
-
version_dropdown_text
-
The text in the version dropdown button
-
version_json
-
The location of the JSON file that contains the version information. The default assumes there is a file versions.json located in the root of the site.
-
version_info
-
A dictionary used to populate the version dropdown. If this variable is provided, the static dropdown is used and any JavaScript information is ignored.
-
table_classes
-
A list of classes to not strip from tables. All other classes are stripped, and the default table has no class attribute. Custom table classes need to provide the full style for the table.
1.2. Sidebars ¶
You must set
html_sidebars
in order for the side bar to appear. There are
four in the complete set.
html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}
You can exclude any to hide a specific sidebar. For example, if this is changed to
html_sidebars = {
"**": ["globaltoc.html"]
}
then only the global ToC would appear on all pages (
**
is a glob pattern).
1.3. Customizing the layout ¶
You can customize the theme by overriding Jinja template blocks. For example, ‘layout.html’ contains several blocks that can be overridden or extended.
Place a ‘layout.html’ file in your project’s ‘/_templates’ directory.
mkdir source/_templates
touch source/_templates/layout.html
Then, configure your ‘conf.py’:
templates_path = ['_templates']
Finally, edit your override file
source/_templates/layout.html
:
{# Import the theme's layout. #}
{% extends '!layout.html' %}
{%- block extrahead %}
{# Add custom things to the head HTML tag #}
{# Call the parent block #}
{{ super() }}
{%- endblock %}
1.4. New Blocks ¶
The theme has a small number of new blocks to simplify some types of customization:
-
footerrel
-
Previous and next in the footer.
-
font
-
The default font inline CSS and the class to the google API. Use this block when changing the font.
-
fonticon
-
Block that contains the icon font. Use this to add additional icon fonts (e.g., FontAwesome ). You should probably call
{{ super() }}
at the end of the block to include the default icon font as well.
1.5. Version Dropdown ¶
A version dropdown is available that lets you store multiple versions in a single site. The standard structure of the site, relative to the base is usually:
/
/devel
/v1.0.0
/v1.1.0
/v1.1.1
/v1.2.0
To use the version dropdown, you must set
version_dropdown
to
True
in
the sites configuration.
There are two approaches, one which stores the version information in a JavaScript file and one which uses a dictionary in the configuration.
1.5.1. Using a Javascript File ¶
The data used is read via javascript from a file. The basic structure of the file is a dictionary of the form [label, path].
This dictionary tells the dropdown that the release version is in the root of the site, the other versions are archived under their version number, and the development version is located in /devel.
Note
The advantage of this approach is that you can separate version information from the rendered documentation. This makes is easy to change the version dropdown in _older_ versions of the documentation to reflect additional versions that are released later. Changing the Javascript file changes the version dropdown content in all versions. This approach is used in statsmodels .
1.5.2.
Using
conf.py
¶
Warning
This method has precedence over the JavaScript approach. If
version_info
is
not empty in a site’s
html_theme_options
, then the static approach is used.
The alternative uses a dictionary where the key is the title and the value is the target.
The dictionary is part of the size configuration’s
html_theme_options
.
The dictionary structure is nearly identical. Here you can use relative paths like in the JavaScript version. You can also use absolute paths.
Note
This approach is easier if you only want to have a fixed set of documentation, e.g., stable and devel.


CellView
About
Cells
Cells
MCC (Mobile Country Code):
MNC (Mobile Network Code):
Radio:
LAC (Local Area Code LAC):
RNC (Radio Network Controller):
PSC (Primary Scrambling Code):
CID (Cell ID):
×
About
TODO
Source code
Server part
Modified mozstumbler


Materials
Ranging from lecture notes, past questions and tutorial questions. Get all the materials you need here. Exclusive to members only
Any queries? Reach out to us!
No material uploaded for this level yet
Loading contents...
| Course | Files | |
|---|---|---|
|
{{codeCode}} |


Barış Can Soy Portfolio Site
Welcome to my website where I share my portfolio.
Home
About
Projects
Contact
Dark Mode
© | Barış Can Soy


Join EddieHub
Join
EddieHub
Join Us in MLH LHD Share
instructions, link and button
Join us on Discord
Link and button
Join our Github organisation
instructions and link


Kristen Watson
About
(current)
Portfolio
Contact
Contact
Name
Email address
Message
Send
Connect With Me
© Kristen Watson 2017


Will contain a chart of information retrieved regarding low items queried from the inventory list.
Using the Bootstrap grid style and simple HTML border tag this is a prototype of the wireframe for the "MyList" inventory website.


--- title: core keywords: fastai sidebar: home_sidebar summary: "Enable saving current notebook execution history as a notebook" description: "Enable saving current notebook execution history as a notebook" nb_path: "core.ipynb" ---
save_notebook_history("tmp/my_history.ipynb")


Bible passages explained in modern language
07 Sep 2014I’m not bashing Christianity or any other religion, believe in whatever you want, it’s your choice, you’re free to choose. I for, example, believe that my dog is my god.  Something I wouldn’t do even for my own kids, cater to their every need, stroke them, brush them, do anything for them, unconditionally. If that’s not the description of a god then I don’t know what is. I know a lot of fervent Christians that are more devout to their dogs than to their god.
This is just me having a little fun. Try not to be offended.
Here is a very good article about things that might be “wrong” with Christianity
I’ve taken the bible passages from this article for convenience sakes, but really it could apply to any part of the bible.
Why hasn’t the bible been updated? Because it’s the word of God I hear you say, but, surely, if it were translated into a bit more modern speak more people would understand it, isn’t that the whole point?
Anyway, here are a couple of bible passages translated to modern speak.
The Son of Man will send out his angels, and they will weed out of his kingdom everything that causes sin and all who do evil. They will throw them into the blazing furnace, where there will be weeping and gnashing of teeth.
 They’ll burn, and there will be a lot of bitching.
But I tell you that anyone who looks at a woman lustfully has already committed adultery with her in his heart. If your right eye causes you to stumble, gouge it out and throw it away. It is better for you to lose one part of your body than for your whole body to be thrown into hell.
Translation: basically, you’re all fucked.  Ladies, you think you’re safe?
Now go, attack the Amalekites and totally destroy all that belongs to them. Do not spare them; put to death men and women, children and infants, cattle and sheep, camels and donkeys.
   Did I mention they pissed me off?

Translation: I’ll be right back. (Voy a lleva a la jeba y vengo).
For the Lord Himself will descend from heaven with a shout, with the voice of the archangel, and with the trumpet of God; and the dead in Christ shall rise first. Then we who are alive and remain shall be caught up together with them in the clouds to meet the Lord in the air, and thus we shall always be with the Lord.
 People will fly.
If someone slaps you on one cheek, turn to them the other also. If someone takes your coat, do not withhold your shirt from them. Give to everyone who asks you, and if anyone takes what belongs to you, do not demand it back.
Translation: move to a hippie commune. If you can’t find one, move to a communist country.

Translation: don’t get married! You’ll inevitably commit adultery.
Do not store up for yourselves treasures on earth, where moths and vermin destroy, and where thieves break in and steal.

Women should remain silent in the churches. They are not allowed to speak, but must be in submission, as the law says.
Translation: take your wife to church often, it’s the only peace and quiet you’ll ever get!
  Although they cannot repay you, you will be repaid at the resurrection of the righteous.”
Translation: your friends suck.
Anyone who beats their male or female slave with a rod must be punished if the slave dies as a direct result, but they are not to be punished if the slave recovers after a day or two, since the slave is their property.
Translation: beat your lazy-ass slaves within an inch if their lives to avoid getting punished.
Your male and female slaves are to come from the nations around you; from them you may buy slaves. You may also buy some of the temporary residents living among you and members of their clans born in your country, and they will become your property. You can bequeath them to your children as inherited property and can make them slaves for life, but you must not rule over your fellow Israelites ruthlessly.
Translation: buy your slaves from your neighbor, you’ll get better quality. Jewish slaves are the worst.
For man did not come from woman, but woman from man; neither was man created for woman, but woman for man.
Translation: women were put on this earth to serve you, make sure they know that.
I could go on and on, but I’m out of time. Hope you had a laugh.


FROM.Mr.Ishmila Sani, Personal Assistant to, President Charles Taylor(ex) Date;28th march,2007. Dear sir/madam, I personally decided to put in writing as below, the full details of this business proposal that I have been trying to explain to you. I have a re-profiling amount in an excess of US$50M,(Fifty Million USD) which I seek your partnership in accommodating for me. I am willing to give out 25% of this total sum to you for your quick assistance and partnership, 70% for me and while 5% should be set side for reimbursement of any unforeseen expenses we both might incure in the cause of this transaction. However, I sincerely seek your confidence in this transaction, which I am proposing to you. My name is Ishmila Sani, I am the personal assistance to the former President of Republic of Liberia (President Charles Taylor). President Charles Taylor decided on the 11th of August 2003 to go into exile in a neighboring country Nigeria to seek asylum. Based on these developments, his various foreign bank accounts have been frozen and some are still under serious investigation. But in the light of all these happenings, President Charles Taylor was able, through the help of some loyalist succeeded to secretly move the sum of US$50M, on my name as the owner to a private security company vault where the final crediting is expected to be carried out later, but recently he has just been arrested and taken away. You can read more on CNN news of March 30, 2006. http://www.cnn.com/2006/WORLD/africa/03/29/taylor.nigeria/index.html All the depositing documents of the above fund were on my name and they are still in my possession, What I need from you is to stand as the beneficiary of the above quoted sum and I will arrange for the documentation which will enable the Security Company transfer / wire the fund to your bank account. I have decided to do this only with you and use this sum to relocate to European, American or Asia continent and never to be connected to any of President Charles Taylor's conglomerates. This transaction can be concluded within 2 weeks. My questions are:- 1. Can you handle this project? 2. Can I give you this trust? 3. can you keep this business as very confidential? 4. If you can sponsor this transfer, Is 25% acceptable to you, as your commission? Consider this and reach me on my private email above, for more discussion, so I can give you more clear explanations details and information about this transaction. I will also need your direct telephone and fax number for easy communication. Finally, it is my humble prayer that the information as contained herein is accorded the necessary attention, urgency as well as the secrecy it deserves. Please I need you to send me your telephone number so I can give you a call immediately for more discussion.  Kinder regards, Ishmila Sani.ibn.


Sprint-03 Technical Blog
11th September 2020
When starting to understand the structure of creating modern day webpages it is key to understand how the different
pieces connect to and work with each other to create the impressive, interactive and appealing webpages of today. A
good analogy to think about is that of a car. If we think of <html> as the chassis of a
car, it provides the structure to allow you to add the elements that you need. While you might not be able to see it
easily, without the <html> a webpage won't run, just like a chassis in a car! For example:
an element of <html> is the <header>. The <header> could be associated with headlights on a car. The headlights have to be fitted to
the chassis to be stable and connected to the wiring system to be powered up, in the same way a <header> has to be imbedded into the <html> to render
correctly.
All cars have chassis', however not all cars are of the same brand. Car enthusiasts are able to look quickly at a vehicle and tell you exactly what brand of vehicle you are looking at. CSS is like the brand of a car. It defines how the vehicle will look. It provides methods and means to determine how for example users will see the headlights on your car and what colour they will shine.
Within programming languages there is a term called control flow. This is talking about the control
of execution of commands in the programming language. Like water the control of a programme will flow in a logical
order unless it encounters instructions where it has to behave differently as water would when it comes into contact
with a dam or a rock.
In the instance where a progamme, encounters something unusual it will assess the instruction and act accordingly.
Like water when it comes into contact with a rock, it will find the path of least resistance and proceed. This can
be seen when looking a loops within programming. A loop like a water will continue
to flow in the path of least resistance as long as the conditions that are needed for the flow to continue remain
true. To provide an everyday example of the control flow of a loop think of eating breakfast.
To be able to eat breakfast certain elements need to remain true.
1. The person eating must be hungry
2. Food must be available
A programming loop of this might look like the following:
The programme will continue to assess the hungry and food_is_available variables and leave control
with the loop while hungry and food_available remain true, it will continue to execute the function
continueToEatBreakfast(). As soon as either hungry or food_available are no longer
true the programme will stop executing the loop and continue through the code.
The Document Object Model or DOM for short is the glue that makes up a document within a webpage. It is the <html> document as a tree structure where in each node is an object representing a part of the document. This is captured well at a high level by Kirupa Channathambi in his video javascript, the broswer and the DOM as per the image below:
A key reason to interact with the DOM is especially important in the placement of elements on a page. As mentioned in the Sprint-02 Technical Blog the positioning of items within a webpage is dependent on the parent object of a child element, and where it is located in a page. Understanding the structure above allows a webpage to display items in the correct place on a webpage.
Arrays and Objects in programming can be quite confusing, they may look very similar
in structure, behave in a very similar manners, but they are in fact quite different.
An Array in JavaScript is a single variable that is used to store different elements - GeeksforGeeks.
An Object on the other hand "loosely speaking, may be defined as an unordered collection of related
data, of primitive or reference types, in the form of “key: value” pairs" - GeeksforGeeks.
The key difference between the two is the way data is accessed in each one.
An Array uses a position to determine where an element is e.g.
Unlike humans a programme starts counting at 0 rather than 1. So as can be seen from the above element "one" is
located at position numbersArray[0].
An Object on the other hand uses a unique identifier to locate an element called a
propertyName e.g.
In the above example numbers has three properties. To find the correct property of an object a programme needs to use one of its propertyName values to correctly identify the property as is seen on line 09 of the code.
A Function in JavaScript is a set of statements that take inputs, do some specific computation, and produces output - GeeksforGeeks. They are useful because they are able to streamline repetative behaviour allowing reuse of code instead of repeating it. ***See the makeBreakfast() example below!
They also have the ability to speed up performance of webpages if implemented correctly.
References:
1. GeeksforGeeks
2. Kirupa Chinnathambi
3. MDN web docs
4. EDA


curve(3f) - [M_draw:CURVE] Draw a curve. (LICENSE:PD)
Synopsis
Description
Example
subroutine curve(geom) real geom(3,4)
Draw a curve.
Sample Program:
program demo_curve ! ! using curves ! use M_draw implicit noneinteger i, idum, ios character(len=50) :: buf real bezier(4, 4), cardinal(4, 4), bspline(4, 4) real geom1(3, 4), geom2(3, 6) ! ! curve basis types ! data bezier / & & -1.0, 3.0, -3.0, 1.0, & & 3.0, -6.0, 3.0, 0.0, & & -3.0, 3.0, 0.0, 0.0, & & 1.0, 0.0, 0.0, 0.0 & & /
data cardinal / & & -0.5, 1.5, -1.5, 0.5, & & 1.0, -2.5, 2.0, -0.5, & & -0.5, 0.0, 0.5, 0.0, & & 0.0, 1.0, 0.0, 0.0 & & /
data bspline / & & -0.166666, 0.5, -0.5, 0.166666, & & 0.5, -1.0, 0.5, 0.0, & & -0.5, 0.0, 0.5, 0.0, & & 0.166666, 0.666666, 0.166666, 0.0 & & /
! ! Geometry matrix to demonstrate basic spline segments ! data geom1 / & & -180.0, 10.0, 0.0, & & -100.0, 110.0, 0.0, & & -100.0, -90.0, 0.0, & & 0.0, 50.0, 0.0 & & /
! ! Geometry matrix to demonstrate overlapping control points to ! produce continuous (Well, except for the bezier ones) curves ! from spline segments ! data geom2 / & & 200.0, 480.0, 0.0, & & 380.0, 180.0, 0.0, & & 250.0, 430.0, 0.0, & & 100.0, 130.0, 0.0, & & 50.0, 280.0, 0.0, & & 150.0, 380.0, 0.0 & & /
print*,Enter output device: read(*,(a),iostat=ios) buf if(ios.ne.0)buf=
call vinit(buf)
call ortho2(-200.0, 400.0, -100.0, 500.0)
call color(D_BLACK) call clear()
call color(D_YELLOW)
call textsize(10.0, 10.0) ! ! label the control points in geom1 ! do i = 1, 4 call move2(geom1(1, i), geom1(2, i)) write(buf, (i1))i call drawstr(buf) enddo ! ! label the control points in geom2 ! do i = 1, 6 call move2(geom2(1, i), geom2(2, i)) write(buf, (i1))i call drawstr(buf) enddo ! ! scale the current font so that 30 of the largest characters ! in the current font will fit in a region 300 world units wide, ! 20 high. ! call boxfit(300.0, 20.0, 30)
! ! set the number of line segments appearing in each curve to 20 ! call curveprecision(20)
! ! copy the bezier basis matrix into the curve basis matrix. ! call curvebasis(bezier)
call color(D_RED)
! ! draw a curve using the current basis matrix (bezier in this case) ! and the control points in geom1 ! call curve(geom1)
call move2(70.0, 60.0) call drawstr(Bezier Curve Segment)
call move2(-190.0, 450.0) call drawstr(Three overlapping Bezier Curves)
! ! curven draws overlapping curve segments according to geom2, the ! number of curve segments drawn is three less than the number of ! points passed, assuming there are a least four points in the ! geometry matrix (in this case geom2).


Design Patterns - Part 1
Part of my work for an undergraduate thesis is to build an application based on graphlets. This application parses a file to generate a graph then uses the graph to create graphlet degree vectors (GDV) for each node. Once that initial step is completed it uses the GDVs to put together a matrix and perform other statistical analysis.
While writing this application I’ve run into design issues. Initially everything was just methods. I wrote it this way in order to ensure everything was working; at the time I didn’t realize how much extra work I was creating for myself. I’ve refactored all of the code once so I’m using objects and not repeating some code unnecessarily. However, now when I need to add features, like being able to process different types of graphs, (directed, weighted, signed, etc…) I’m having to rewrite base methods with more logic. This work is not a very efficient use of my time and overall it’s a bad practice. This is why I’ve picked up a textbook on design patterns.
Improving a current application I’m working on is one reason to study design patterns, another is to become a better programmer in general. Designing a program with efficiency, modularity, and reusability in mind is difficult. Modularity is a feature of object oriented programming that makes it great. If we strike a proper balance between specific and general when designing our system we can use our solution again when a similar problem arises.
Throughout a degree in Computer Science you learn many of the object oriented programming (OOP) tools like classes, interfaces, inheritance, diagrams for relationships and interaction, and many more. However, how all these tools can work together to achieve a simple and general solution isn’t a focus of the curriculum. This isn’t really because of any deficiency in the CS program, it’s more that there is so much material to cover in four years. When it comes to OOP specifically time has to be spent reinforcing the concepts. Being familiar with these concepts equips us to tackle something like design patterns when we’re ready or when we realize that we’re writing the same method for the 4th time and want to find a better way.
When picking up the textbook for the first time I skimmed through a few of the chapters and started to wonder if I’m ready to take on this topic. Some of the ideas were not clear to me right away and others never became clear. My assumption is that I will have to revisit this topic many times throughout my career. There are some videos on the Google sponsored YouTube channel about interviewing at Google. In the coding interview video it’s mentioned that if you have 5+ years of experience in the industry you could be asked system design questions. While I may not get the full benefit from this textbook at least now I will have a better idea of system design and maybe even improve my graphlet program.
So with that out of the way, what are design patterns? They are patterns that come up again and again when designing a system and have proven to be effective and reusable. (I was going to write simple but I’m not convinced of that yet). In a sense they capture the experience of those who have designed many systems. The textbook is organized as a catalogue of design patterns that can be used as a solution when a similar problem arises. Experienced programmers have noticed these patterns showing up again and again and have tested these solutions in production code.
Rather than getting into the specific details I will provide some real world examples, since design patterns occur everywhere. Consider construction, when building a structure like a bridge, house, or road the solution at the core of the problem is the same and is used over and over again. We can use the core solution many times and still not solve the problem the same way twice. Another example is found in storytelling. Most movies, books, and songs tell the same old stories over and over again but in very different ways.
That’s the general idea, or what I’ve been able to gather. I know I haven’t gone into much technical detail here but I find these abstractions useful before diving into something new. Next time I write about design patterns I will try to write a more concrete definition and give an example. I still think this general idea is fairly exciting and promises to improve your code at any level.


Fatma Imamoglu
is a postdoctoral researcher at the
International Computer Science Institute,
UC Berkeley's Helen Wills Neuroscience Institute and a
data science fellow at the
Berkeley Institute for Data Science.
She is interested in how sensory information is encoded in the
brain and uses machine learning approaches to fit computational
models to brain data acquired by functional magnetic resonance
imaging. Her current research is on the representation of language
and music in the human brain.


Comprehensive Swing Leg Motion Predictor for Steady and Transient Walking Conditions
Data-driven methods based on neural networks
are becoming more widespread for predicting human lower-limb motion. Until now, however, actual examples have focused
on only a handful, steady locomotion behaviors. Here we explore
if neural network predictors can simultaneously cover many
more behaviors including transient ones. Training four common
types of predictor networks on a large data set of human gait,
we find that they all accommodate these behaviors similarly
well, maintaining prediction errors of a few centimeters (lower-limb joint positions) and degrees (joint angles) when tested
on data of previously seen subjects. We further observe that
although the prediction quality drops for data of unseen
subjects, overall, the predicted and actual lower-limb motions
remain well aligned. While the predictors demonstrated here
cover the largest range of locomotion behaviors reported to
date, we achieve this improvement not by better network design
but simply by training on more data. This outcome clearly
supports the notion that the fastest route to obtain truly general
network predictors of lower-limb motion is by focusing time
and effort on the rapid growth and sharing of data sets of
locomotion behaviors encountered in daily life.


U.S. has started approving some exemptions to Huawei blacklist
Commerce Department says approval and denial letters are going out
by Katy Stech FerekWASHINGTON — The Trump administration has given permission to some U.S. suppliers to Huawei Technologies Co. to resume shipping to the Chinese telecom giant, easing export restrictions while U.S. negotiators struggle to wrap up the first stage of a trade deal, the Commerce Department said Wednesday.
Commerce officials put Huawei on an export blacklist in May, citing national security concerns. U.S. officials have warned that Huawei products could be used to spy on or disrupt telecommunications networks, which the telecom giant denies. But President Donald Trump, meeting with Chinese President Xi Jinping on the sidelines of the Group of 20 summit in Osaka, Japan, on June 29, agreed to ease the blacklisting for cases that didn’t involve national security.
Commerce Secretary Wilbur Ross said late Tuesday on Fox Business Network that his agency had received nearly 300 requests for exemptions, and that he had begun approving some of those license applications. “We’ve now been starting to send out the 20-day intent-to-deny letters and some approvals,” he said.
A Commerce spokesperson said Wednesday that the approved licenses “authorize limited and specific activities which do not pose a significant risk to the national security or foreign policy interests of the United States.”
An expanded version of this report appears on WSJ.com.
Also popular on WSJ.com:


Ive always been a big fan of ghost stories and horror fiction/movies. I enjoy this as it claims true stories and photos. Its called yourghoststories.com. From an aesthetic point of view I enjoy the flow and visual simplicity.
Click the apparition to enter and you decide.
Google.com may seem like an obvious and boring choice but I appreciate that it does not assualt the viewer with images and ads and instead presents a simple and creative daily theme. Its a gateway to another place and where it leads you is up to you.
Arizonahikingtrails.com is another favorite of mine for similar reasons to the other two mentioned. Great content and a user freindly design. In this example simple is simply better. Click the picture below for some great hiking adventures in Arizona.