hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0ecd708202f060e28b6debe25cb1fa143feb06e8 | 1,016 | tsx | TypeScript | docs/src/routes/Layout/index.tsx | 7coil/react-uwp | d4326d0f0b2d6e425a4a495c0c8474e31fb86179 | [
"MIT"
] | 1,282 | 2017-01-29T23:00:55.000Z | 2022-03-30T12:15:53.000Z | docs/src/routes/Layout/index.tsx | 7coil/react-uwp | d4326d0f0b2d6e425a4a495c0c8474e31fb86179 | [
"MIT"
] | 97 | 2017-05-31T15:29:55.000Z | 2022-02-26T01:33:19.000Z | docs/src/routes/Layout/index.tsx | 7coil/react-uwp | d4326d0f0b2d6e425a4a495c0c8474e31fb86179 | [
"MIT"
] | 113 | 2017-06-19T12:34:12.000Z | 2022-03-23T03:58:09.000Z | import * as React from "react";
import * as PropTypes from "prop-types";
import MarkdownRender from "react-uwp/MarkdownRender";
import * as README from "!raw!./README.md";
export interface DataProps {}
export interface LayoutProps extends DataProps, React.HTMLAttributes<HTMLDivElement> {}
export default class Layout extends React.Component<LayoutProps> {
static contextTypes = { theme: PropTypes.object };
context: { theme: ReactUWP.ThemeType };
render() {
const {
...attributes
} = this.props;
const { theme } = this.context;
const styles = getStyles(this);
return (
<div
{...attributes}
style={styles.root}
>
<MarkdownRender text={README as any} />
</div>
);
}
}
function getStyles(layout: Layout): {
root?: React.CSSProperties;
} {
const {
context: { theme },
props: { style }
} = layout;
const { prefixStyle } = theme;
return {
root: prefixStyle({
padding: 20,
...style
})
};
}
| 20.32 | 87 | 0.620079 |
2644797f4cc1e29a89f4f035ae0ce15025e66e96 | 1,961 | java | Java | src/test/java/com/binance/dex/api/client/examples/TransactionExample.java | far2away/java-sdk | 96132d40154ccf9ffb04aae6c3b5793c41b0ab40 | [
"Apache-2.0"
] | 102 | 2019-02-10T16:34:38.000Z | 2022-01-23T21:35:30.000Z | src/test/java/com/binance/dex/api/client/examples/TransactionExample.java | far2away/java-sdk | 96132d40154ccf9ffb04aae6c3b5793c41b0ab40 | [
"Apache-2.0"
] | 47 | 2019-03-04T05:55:49.000Z | 2022-02-14T02:58:56.000Z | src/test/java/com/binance/dex/api/client/examples/TransactionExample.java | far2away/java-sdk | 96132d40154ccf9ffb04aae6c3b5793c41b0ab40 | [
"Apache-2.0"
] | 70 | 2019-02-10T16:34:29.000Z | 2022-01-05T07:10:58.000Z | package com.binance.dex.api.client.examples;
import com.binance.dex.api.client.BinanceDexApiClientFactory;
import com.binance.dex.api.client.BinanceDexApiRestClient;
import com.binance.dex.api.client.BinanceDexEnvironment;
import com.binance.dex.api.client.domain.TransactionPage;
import com.binance.dex.api.client.domain.TransactionPageV2;
import com.binance.dex.api.client.domain.request.TransactionsRequest;
import com.binance.dex.api.client.utils.converter.TransactionConverterFactory;
public class TransactionExample {
public static void main(String[] args) {
BinanceDexApiRestClient client =
BinanceDexApiClientFactory.newInstance().newRestClient(BinanceDexEnvironment.TEST_NET.getBaseUrl());
//Get transactions in last 24 hours
TransactionPageV2 transactions = client.getTransactions("tbnb135mqtf9gef879nmjlpwz6u2fzqcw4qlzrqwgvw");
System.out.println(transactions);
//Get transactions by criteria
//Refer to this for more: https://docs.binance.org/api-reference/dex-api/block-service.html#apiv1txs
TransactionsRequest request = new TransactionsRequest();
request.setStartTime(1629272621945L);
request.setEndTime(1629359021945L);
request.setType("ORACLE_CLAIM");
request.setAddress("tbnb135mqtf9gef879nmjlpwz6u2fzqcw4qlzrqwgvw");
request.setAddressType("FROM");
request.setOffset(5);
request.setLimit(1);
transactions = client.getTransactions(request);
System.out.println(transactions);
//Get transaction a block
transactions = client.getTransactionsInBlock(15759101);
System.out.println(transactions);
//Convert transaction to previous models
TransactionConverterFactory converterFactory = new TransactionConverterFactory();
TransactionPage transactionPage = converterFactory.convert(transactions);
System.out.println(transactionPage);
}
}
| 45.604651 | 116 | 0.751147 |
7b781563da823b784002ce0c6adc10411a6939cc | 276 | css | CSS | fonts/google/noto-emoji/variable.css | DecliningLotus/fontsource | 8a859a1334272304004bae0cde7e1b375215b517 | [
"MIT"
] | 80 | 2020-05-16T18:15:12.000Z | 2020-07-21T22:00:50.000Z | fonts/google/noto-emoji/variable.css | DecliningLotus/fontsource | 8a859a1334272304004bae0cde7e1b375215b517 | [
"MIT"
] | 3 | 2020-06-16T09:07:11.000Z | 2020-07-22T11:51:42.000Z | fonts/google/noto-emoji/variable.css | DecliningLotus/fontsource | 8a859a1334272304004bae0cde7e1b375215b517 | [
"MIT"
] | 2 | 2020-07-10T17:31:01.000Z | 2020-07-21T19:15:54.000Z | /* noto-emoji-emoji-variable-wghtOnly-normal */
@font-face {
font-family: 'Noto EmojiVariable';
font-style: normal;
font-display: swap;
font-weight: 300 700;
src: url('./files/noto-emoji-emoji-variable-wghtOnly-normal.woff2') format('woff2');
unicode-range: ;
}
| 27.6 | 86 | 0.695652 |
c7f21f0fd706f0700d98cb762296bf88e0dee2d0 | 182 | py | Python | home/urls.py | xeddmc/pastebin-django | 5e38637e5a417ab907a353af8544f64a0ad2b127 | [
"Unlicense"
] | 11 | 2016-11-27T06:26:33.000Z | 2021-05-30T05:28:51.000Z | home/urls.py | xeddmc/pastebin-django | 5e38637e5a417ab907a353af8544f64a0ad2b127 | [
"Unlicense"
] | 1 | 2015-04-16T15:00:28.000Z | 2015-10-28T19:49:09.000Z | home/urls.py | xeddmc/pastebin-django | 5e38637e5a417ab907a353af8544f64a0ad2b127 | [
"Unlicense"
] | 12 | 2015-08-20T05:08:38.000Z | 2021-09-14T04:32:26.000Z | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from home import views
urlpatterns = [
url(r'^$', views.home, name="home"),
]
| 20.222222 | 51 | 0.730769 |
2f0331e034c23798593b91414a57b353d74e9531 | 1,183 | php | PHP | src/CompilerPass/EntityRepositoryCompilerPass.php | LYDIC-GROUP/rapid-api-crud-bundle | da33c753b36f4e218a174614607e629e64ae994d | [
"MIT"
] | 3 | 2021-04-29T21:07:12.000Z | 2021-07-05T16:04:21.000Z | src/CompilerPass/EntityRepositoryCompilerPass.php | LYDIC-GROUP/rapid-api-crud-bundle | da33c753b36f4e218a174614607e629e64ae994d | [
"MIT"
] | 15 | 2021-04-29T21:11:12.000Z | 2021-07-27T18:01:39.000Z | src/CompilerPass/EntityRepositoryCompilerPass.php | LYDIC-GROUP/rapid-api-crud-bundle | da33c753b36f4e218a174614607e629e64ae994d | [
"MIT"
] | null | null | null | <?php
/**
* Created by PhpStorm.
* User: Willem Turkstra
* Date: 6/24/2021
* Time: 11:32 PM
*/
namespace LydicGroup\RapidApiCrudBundle\CompilerPass;
use LydicGroup\RapidApiCrudBundle\Factory\CriteriaFactory;
use LydicGroup\RapidApiCrudBundle\Factory\EntityRepositoryFactory;
use LydicGroup\RapidApiCrudBundle\Factory\SortFactory;
use LydicGroup\RapidApiCrudBundle\Repository\EntityRepositoryInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
class EntityRepositoryCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
$container->registerForAutoconfiguration(EntityRepositoryInterface::class)->addTag('rapid.api.entity.repository');
$definition = $container->findDefinition(EntityRepositoryFactory::class);
$taggedServices = $container->findTaggedServiceIds('rapid.api.entity.repository');
foreach($taggedServices as $id => $tags) {
$definition->addMethodCall('addEntityRepository', [new Reference($id)]);
}
}
}
| 34.794118 | 122 | 0.78191 |
09b4ca7f6a97e39c6ea06dd2935b42f1e46ca2a2 | 2,517 | swift | Swift | Navigation/AppDelegate.swift | odrowonz/IndustrialDevelopment | 6dada57e8fe4cfbe5f4de98d70b22cd026abf30e | [
"MIT"
] | null | null | null | Navigation/AppDelegate.swift | odrowonz/IndustrialDevelopment | 6dada57e8fe4cfbe5f4de98d70b22cd026abf30e | [
"MIT"
] | 1 | 2021-05-05T12:30:13.000Z | 2021-05-05T14:34:55.000Z | Navigation/AppDelegate.swift | odrowonz/IndustrialDevelopment | 6dada57e8fe4cfbe5f4de98d70b22cd026abf30e | [
"MIT"
] | null | null | null | //
// AppDelegate.swift
// Navigation
//
// Created by Andrey Antipov on 18.10.2020.
// Copyright © 2020 Andrey Antipov. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var mainCoordinator: MainCoordinator?
lazy var tabBarController = UITabBarController()
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// send that into our main coordinator so that it can control flow coordinators
mainCoordinator = AppCoordinator(tabBarController: tabBarController)
// tell the coordinator to take over control
mainCoordinator?.start()
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = mainCoordinator?.tabBarController
window?.makeKeyAndVisible()
return true
}
func applicationWillEnterForeground(_ application: UIApplication) {
print(type(of: self), #function)
}
func applicationDidBecomeActive(_ application: UIApplication) {
print(type(of: self), #function)
}
func applicationWillResignActive(_ application: UIApplication) {
print(type(of: self), #function)
}
func applicationDidEnterBackground(_ application: UIApplication) {
// 2020-12-17 04:21:29.838874+0300 Navigation copy[13417:5468445]
// [BackgroundTask] Background Task 3 ("Called by Navigation copy,
// from $s15Navigation_copy18FeedViewControllerC22registerBackgroundTaskyyF"),
// was created over 30 seconds ago. In applications running in the background,
// this creates a risk of termination.
// Remember to call UIApplication.endBackgroundTask(_:)
// for your task in a timely manner to avoid this.
print(type(of: self), #function)
}
func application(_ app: UIApplication, open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
print(type(of: self), #function)
return true
}
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
print(type(of: self), #function)
return true
}
}
| 37.014706 | 115 | 0.672626 |
b93afee81455db9a81598f07dd57ca997cd0eb23 | 5,734 | swift | Swift | TwitterDemo/TweetsViewController.swift | javierbustillo/Twitter-Client | 4747147564cd7aa126ae6875a36fac1a21ecd8d5 | [
"Apache-2.0"
] | null | null | null | TwitterDemo/TweetsViewController.swift | javierbustillo/Twitter-Client | 4747147564cd7aa126ae6875a36fac1a21ecd8d5 | [
"Apache-2.0"
] | 2 | 2016-02-21T19:17:44.000Z | 2016-03-02T17:07:09.000Z | TwitterDemo/TweetsViewController.swift | javierbustillo/Twitter-Client | 4747147564cd7aa126ae6875a36fac1a21ecd8d5 | [
"Apache-2.0"
] | null | null | null | //
// TweetsViewController.swift
// TwitterDemo
//
// Created by Javier Bustillo on 2/19/16.
// Copyright © 2016 Javier Bustillo. All rights reserved.
//
import UIKit
import MBProgressHUD
class TweetsViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
var tweets: [Tweet]?
@IBOutlet weak var tweetButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
TwitterClient.sharedInstance.homeTimeLine({ (tweets: [Tweet]) -> () in
self.tweets = tweets
for tweet in tweets{
print(tweet.text)
self.tableView.reloadData()
}
}) { (error: NSError) -> () in
print(error.localizedDescription)
}
tableView.delegate = self
tableView.dataSource = self
self.tableView.reloadData()
// Do any additional setup after loading the view.
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action:"refreshControlAction:",forControlEvents: UIControlEvents.ValueChanged)
self.tableView.insertSubview(refreshControl, atIndex: 0)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func onLogoutButton(sender: AnyObject) {
TwitterClient.sharedInstance.logout()
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if let tweets = self.tweets{
return tweets.count
}
return 0
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
let cell = tableView.dequeueReusableCellWithIdentifier("TweetCell", forIndexPath: indexPath) as! TweetCell
cell.selectionStyle = .None
cell.tweet = tweets![indexPath.row]
return cell
}
func tweetInfo(){
TwitterClient.sharedInstance.homeTimeLine({ (tweets: [Tweet]) -> () in
self.tweets = tweets
for tweet in tweets{
print(tweet.text)
self.tableView.reloadData()
}
}) { (error: NSError) -> () in
print(error.localizedDescription)
}
}
func refreshControlAction(refreshControl: UIRefreshControl) {
//let apiKey = "a07e22bc18f5cb106bfe4cc1f83ad8ed"
//let url = NSURL(string: "https://api.themoviedb.org/3/movie/\(endpoint)?api_key=\(apiKey)")
let url = NSURL(tweetInfo())
let request = NSURLRequest(URL: url)
let session = NSURLSession(
configuration: NSURLSessionConfiguration.defaultSessionConfiguration(),
delegate:nil,
delegateQueue:NSOperationQueue.mainQueue()
)
let task : NSURLSessionDataTask = session.dataTaskWithRequest(request,
completionHandler: { (data, response, error) in
self.tableView.reloadData()
refreshControl.endRefreshing()
});
task.resume()
}
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "segue"{
let cell = sender as! UITableViewCell
let indexPath = tableView.indexPathForCell(cell)
let index = indexPath!.row
let tweetViewController = segue.destinationViewController as! TweetViewController
tweetViewController.tweets = tweets
tweetViewController.index = index
}
if segue.identifier == "compose"{
segue.destinationViewController as! ComposeTweetViewController
}
/* if segue.identifier == "reply"{
let button = sender as! UIButton
let buttonFrame = button.convertRect(button.bounds, toView: self.tableView)
if let indexPath = self.tableView.indexPathForRowAtPoint(buttonFrame.origin) {
let composeTweetViewController = segue.destinationViewController as! ComposeTweetViewController
let selectedRow = indexPath.row as NSInteger
let tweet = tweets![selectedRow]
let replyName = "@\(tweet.screenname!) " as String
composeTweetViewController.tweetId = (tweet.tweetID!)
composeTweetViewController.replyFor = replyName
composeTweetViewController.reply = true
}*/
if segue.identifier == "user"{
let button = sender as! UIButton
let buttonFrame = button.convertRect(button.bounds, toView: self.tableView)
if let indexPath = self.tableView.indexPathForRowAtPoint(buttonFrame.origin) {
let userControllerView = segue.destinationViewController as! UserViewController
let selectedRow = indexPath.row as NSInteger
userControllerView.tweets = tweets
userControllerView.index = selectedRow
}
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
}
}
| 33.532164 | 117 | 0.595221 |
3935470ecf11daf13792e99bcda01ff1be92451b | 16,665 | html | HTML | risky/geo-analyzer/cobertura/au.gov.amsa.geo.OperatorCellValuesToBytes.html | amsa-code/amsa-code.github.io | 1a8f63784bf292c98b4dcb369590b3f11a0229fe | [
"Apache-2.0"
] | 1 | 2020-12-14T22:24:32.000Z | 2020-12-14T22:24:32.000Z | risky/geo-analyzer/cobertura/au.gov.amsa.geo.OperatorCellValuesToBytes.html | amsa-code/amsa-code.github.io | 1a8f63784bf292c98b4dcb369590b3f11a0229fe | [
"Apache-2.0"
] | null | null | null | risky/geo-analyzer/cobertura/au.gov.amsa.geo.OperatorCellValuesToBytes.html | amsa-code/amsa-code.github.io | 1a8f63784bf292c98b4dcb369590b3f11a0229fe | [
"Apache-2.0"
] | null | null | null | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - au.gov.amsa.geo.OperatorCellValuesToBytes</h5>
<div class="separator"> </div>
<table class="report">
<thead><tr> <td class="heading">Classes in this File</td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
<tr><td><a href="au.gov.amsa.geo.OperatorCellValuesToBytes.html">OperatorCellValuesToBytes</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">100%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">21/21</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">1.1428571428571428;</span>1.143</td></tr>
<tr><td><a href="au.gov.amsa.geo.OperatorCellValuesToBytes.html">OperatorCellValuesToBytes$1</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">80%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:80px"><span class="text">8/10</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">50%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:50px"><span class="text">1/2</span></div></div></td></tr></table></td><td class="value"><span class="hidden">1.1428571428571428;</span>1.143</td></tr>
</table>
<div class="separator"> </div>
<table cellspacing="0" cellpadding="0" class="src">
<tr> <td class="numLine"> 1</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">package</span> au.gov.amsa.geo;</pre></td></tr>
<tr> <td class="numLine"> 2</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 3</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> java.nio.ByteBuffer;</pre></td></tr>
<tr> <td class="numLine"> 4</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> java.util.concurrent.atomic.AtomicBoolean;</pre></td></tr>
<tr> <td class="numLine"> 5</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 6</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> rx.Observable.Operator;</pre></td></tr>
<tr> <td class="numLine"> 7</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> rx.Observer;</pre></td></tr>
<tr> <td class="numLine"> 8</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> rx.Subscriber;</pre></td></tr>
<tr> <td class="numLine"> 9</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> rx.observers.Subscribers;</pre></td></tr>
<tr> <td class="numLine"> 10</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> au.gov.amsa.geo.model.Bounds;</pre></td></tr>
<tr> <td class="numLine"> 11</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> au.gov.amsa.geo.model.CellValue;</pre></td></tr>
<tr> <td class="numLine"> 12</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">import</span> au.gov.amsa.geo.model.Options;</pre></td></tr>
<tr> <td class="numLine"> 13</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 14</td> <td class="nbHitsCovered"> 4</td> <td class="src"><pre class="src"> <span class="keyword">public</span> <span class="keyword">class</span> OperatorCellValuesToBytes <span class="keyword">implements</span> Operator<<span class="keyword">byte</span>[], CellValue> {</pre></td></tr>
<tr> <td class="numLine"> 15</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 16</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">private</span> <span class="keyword">final</span> Options options;</pre></td></tr>
<tr> <td class="numLine"> 17</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 18</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> <span class="keyword">public</span> OperatorCellValuesToBytes(Options options) {</pre></td></tr>
<tr> <td class="numLineCover"> 19</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> <span class="keyword">this</span>.options = options;</pre></td></tr>
<tr> <td class="numLineCover"> 20</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 21</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 22</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> @Override</pre></td></tr>
<tr> <td class="numLine"> 23</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">public</span> Subscriber<? <span class="keyword">super</span> CellValue> call(</pre></td></tr>
<tr> <td class="numLine"> 24</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">final</span> Subscriber<? <span class="keyword">super</span> <span class="keyword">byte</span>[]> child) {</pre></td></tr>
<tr> <td class="numLine"> 25</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 26</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> Subscriber<CellValue> parent = Subscribers</pre></td></tr>
<tr> <td class="numLineCover"> 27</td> <td class="nbHitsCovered"> 2</td> <td class="src"><pre class="src"> .from(<span class="keyword">new</span> Observer<CellValue>() {</pre></td></tr>
<tr> <td class="numLine"> 28</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 29</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> <span class="keyword">final</span> AtomicBoolean first = <span class="keyword">new</span> AtomicBoolean(<span class="keyword">true</span>);</pre></td></tr>
<tr> <td class="numLine"> 30</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 31</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> @Override</pre></td></tr>
<tr> <td class="numLine"> 32</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">public</span> <span class="keyword">void</span> onCompleted() {</pre></td></tr>
<tr> <td class="numLineCover"> 33</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> child.onCompleted();</pre></td></tr>
<tr> <td class="numLineCover"> 34</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 35</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 36</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> @Override</pre></td></tr>
<tr> <td class="numLine"> 37</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">public</span> <span class="keyword">void</span> onError(Throwable e) {</pre></td></tr>
<tr> <td class="numLineCover"> 38</td> <td class="nbHitsUncovered"> 0</td> <td class="src"><pre class="src"><span class="srcUncovered"> child.onError(e);</span></pre></td></tr>
<tr> <td class="numLineCover"> 39</td> <td class="nbHitsUncovered"> 0</td> <td class="src"><pre class="src"><span class="srcUncovered"> }</span></pre></td></tr>
<tr> <td class="numLine"> 40</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 41</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> @Override</pre></td></tr>
<tr> <td class="numLine"> 42</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">public</span> <span class="keyword">void</span> onNext(CellValue cv) {</pre></td></tr>
<tr> <td class="numLineCover"> 43</td> <td class="nbHitsUncovered"><a title="Line 43: Conditional coverage 50% (1/2)."> 1</a></td> <td class="src"><pre class="src"><span class="srcUncovered"> <a title="Line 43: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (first.getAndSet(<span class="keyword">false</span>))</a></span></pre></td></tr>
<tr> <td class="numLineCover"> 44</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> child.onNext(toBytes(options));</pre></td></tr>
<tr> <td class="numLineCover"> 45</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> child.onNext(toBytes(cv));</pre></td></tr>
<tr> <td class="numLineCover"> 46</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 47</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> });</pre></td></tr>
<tr> <td class="numLineCover"> 48</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> child.add(parent);</pre></td></tr>
<tr> <td class="numLineCover"> 49</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> <span class="keyword">return</span> parent;</pre></td></tr>
<tr> <td class="numLine"> 50</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 51</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 52</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">byte</span>[] toBytes(Options options) {</pre></td></tr>
<tr> <td class="numLineCover"> 53</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> ByteBuffer bb = ByteBuffer.allocate(40);</pre></td></tr>
<tr> <td class="numLineCover"> 54</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> Bounds b = options.getBounds();</pre></td></tr>
<tr> <td class="numLineCover"> 55</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putDouble(options.getCellSizeDegreesAsDouble());</pre></td></tr>
<tr> <td class="numLineCover"> 56</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putDouble(b.getTopLeftLat());</pre></td></tr>
<tr> <td class="numLineCover"> 57</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putDouble(b.getTopLeftLon());</pre></td></tr>
<tr> <td class="numLineCover"> 58</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putDouble(b.getBottomRightLat());</pre></td></tr>
<tr> <td class="numLineCover"> 59</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putDouble(b.getBottomRightLon());</pre></td></tr>
<tr> <td class="numLineCover"> 60</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> <span class="keyword">return</span> bb.array();</pre></td></tr>
<tr> <td class="numLine"> 61</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 62</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 63</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">byte</span>[] toBytes(CellValue cv) {</pre></td></tr>
<tr> <td class="numLineCover"> 64</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> ByteBuffer bb = ByteBuffer.allocate(16);</pre></td></tr>
<tr> <td class="numLineCover"> 65</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putFloat((<span class="keyword">float</span>) cv.getCentreLat());</pre></td></tr>
<tr> <td class="numLineCover"> 66</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putFloat((<span class="keyword">float</span>) cv.getCentreLon());</pre></td></tr>
<tr> <td class="numLineCover"> 67</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> bb.putDouble(cv.getValue());</pre></td></tr>
<tr> <td class="numLineCover"> 68</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> <span class="keyword">return</span> bb.array();</pre></td></tr>
<tr> <td class="numLine"> 69</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 70</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
</table>
<div class="footer">Report generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a> 2.1.1 on 9/11/20 4:04 PM.</div>
</body>
</html>
| 122.536765 | 966 | 0.60372 |
5f4ad402313ed483c1b4e91da4d796fb8017885a | 172 | ts | TypeScript | lib/pipes/data-grid-pipe.pipe.d.ts | amn31/ma-data-grid | c2a94e6a31bc6de32f9a96c0b7b9e3d3ae4fb2dd | [
"MIT"
] | 1 | 2021-12-24T13:01:44.000Z | 2021-12-24T13:01:44.000Z | lib/pipes/data-grid-pipe.pipe.d.ts | amn31/ma-data-grid | c2a94e6a31bc6de32f9a96c0b7b9e3d3ae4fb2dd | [
"MIT"
] | null | null | null | lib/pipes/data-grid-pipe.pipe.d.ts | amn31/ma-data-grid | c2a94e6a31bc6de32f9a96c0b7b9e3d3ae4fb2dd | [
"MIT"
] | null | null | null | import { PipeTransform } from '@angular/core';
export declare class DataGridPipePipe implements PipeTransform {
transform(value: any, row?: any, col?: any): unknown;
}
| 34.4 | 64 | 0.738372 |
b5b2b258a19560e48daf3769d7385cc726ea1d7f | 819 | kt | Kotlin | core-kotlin-modules/core-kotlin-lang-oop-2/src/main/kotlin/com/baeldung/sealedclasses/vs/enums/OsEnum.kt | harihar/kotlin-tutorials | 634db45ae3450b2cb5b2ad17670ae6d9a7ad4503 | [
"MIT"
] | 204 | 2020-05-01T15:19:24.000Z | 2022-03-27T17:35:58.000Z | core-kotlin-modules/core-kotlin-lang-oop-2/src/main/kotlin/com/baeldung/sealedclasses/vs/enums/OsEnum.kt | harihar/kotlin-tutorials | 634db45ae3450b2cb5b2ad17670ae6d9a7ad4503 | [
"MIT"
] | 18 | 2020-05-13T12:06:31.000Z | 2022-02-11T09:46:15.000Z | core-kotlin-modules/core-kotlin-lang-oop-2/src/main/kotlin/com/baeldung/sealedclasses/vs/enums/OsEnum.kt | harihar/kotlin-tutorials | 634db45ae3450b2cb5b2ad17670ae6d9a7ad4503 | [
"MIT"
] | 189 | 2020-05-07T12:04:42.000Z | 2022-03-31T22:43:31.000Z | package com.baeldung.sealedclasses.vs.enums
enum class OsEnum(val releaseYear: Int = 0, val company: String = "") {
Linux(0, "Open-Source") {
override fun getText(value: Int): String {
return "Linux by $company - value=$value"
}
},
Windows(0, "Microsoft") {
override fun getText(value: Int): String {
return "Windows by $company - value=$value"
}
},
Mac(2001, "Apple") {
override fun getText(value: Int): String {
return "Mac by $company - released at $releaseYear"
}
},
Unknown {
override fun getText(value: Int): String {
return ""
}
};
abstract fun getText(value: Int): String
fun getTextParent(): String {
return "Called from parent enum class"
}
} | 27.3 | 71 | 0.56044 |
cdba227e25aca6724756f8b8c91a4bc1b866441e | 557 | rs | Rust | server/src/systems.rs | svenstaro/zombenum | f5f04a5de19481a0dc7bc42031923149f149e3a9 | [
"MIT"
] | null | null | null | server/src/systems.rs | svenstaro/zombenum | f5f04a5de19481a0dc7bc42031923149f149e3a9 | [
"MIT"
] | 5 | 2017-07-12T14:30:11.000Z | 2021-03-19T18:23:46.000Z | server/src/systems.rs | svenstaro/zombenum | f5f04a5de19481a0dc7bc42031923149f149e3a9 | [
"MIT"
] | 1 | 2019-07-16T00:39:59.000Z | 2019-07-16T00:39:59.000Z | use legion::*;
use rand::prelude::*;
use zombenum_shared::components::*;
use crate::ScheduledUpdates;
#[system(for_each)]
pub fn movement(
id: &GameEntityId,
pos: &mut Position,
#[resource] scheduled_updates: &mut ScheduledUpdates,
) {
pos.0.x = thread_rng().gen_range(-10.0..10.0);
pos.0.y = thread_rng().gen_range(-10.0..10.0);
// Schedule the updated component for transmission
scheduled_updates.add_critical_component(
PlayerId::all_users(),
id.clone(),
Component::Position(pos.clone()),
);
}
| 23.208333 | 57 | 0.653501 |
39c06be70d694b2fb2fe38934728ef22a3b58f27 | 186 | js | JavaScript | test.js | yoshuawuyts/playground-wercker | 69d465d99f26c9bcb33af7da6fafd9e5e0c9b3eb | [
"MIT"
] | 1 | 2015-07-16T22:16:17.000Z | 2015-07-16T22:16:17.000Z | test.js | yoshuawuyts/playground-wercker | 69d465d99f26c9bcb33af7da6fafd9e5e0c9b3eb | [
"MIT"
] | null | null | null | test.js | yoshuawuyts/playground-wercker | 69d465d99f26c9bcb33af7da6fafd9e5e0c9b3eb | [
"MIT"
] | null | null | null | /*eslint no-unused-expressions: 0*/
/**
* Module dependencies
*/
var wercker-neo4j = require('./index');
/**
* Test
*/
describe('', function() {
it('', function() {
});
});
| 10.333333 | 39 | 0.543011 |
410afc298618d3bb46c79d88e0bcc1c4e61f72f0 | 538 | h | C | RXVerifyExample/RXVerifyExample/RXPersonal/RXAFNetworking/NSURLSession/RXAFCompatibilityMacros.h | Explorer1092/RXVerifyExample | 344f954c155457c34d52db6831f928b5ac400bbc | [
"MIT"
] | null | null | null | RXVerifyExample/RXVerifyExample/RXPersonal/RXAFNetworking/NSURLSession/RXAFCompatibilityMacros.h | Explorer1092/RXVerifyExample | 344f954c155457c34d52db6831f928b5ac400bbc | [
"MIT"
] | null | null | null | RXVerifyExample/RXVerifyExample/RXPersonal/RXAFNetworking/NSURLSession/RXAFCompatibilityMacros.h | Explorer1092/RXVerifyExample | 344f954c155457c34d52db6831f928b5ac400bbc | [
"MIT"
] | null | null | null | //
// RXAFCompatibilityMacros.h
// RXVerifyExample
//
// Created by Rush.D.Xzj on 2018/12/22.
// Copyright © 2018 Rush.D.Xzj. All rights reserved.
//
#ifndef RXAFCompatibilityMacros_h
#define RXAFCompatibilityMacros_h
#ifdef API_UNAVAILABLE
#define RXAF_API_UNAVAILABLE(x) API_UNAVAILABLE(x)
#else
#define RXAF_API_UNAVAILABLE(x)
#endif // API_UNAVAILABLE
#if __has_warning("-Wunguarded-availability-new")
#define RXAF_CAN_USE_AT_AVAILABLE 1
#else
#define RXAF_CAN_USE_AT_AVAILABLE 0
#endif
#endif /* RXAFCompatibilityMacros_h */
| 21.52 | 53 | 0.786245 |
7055358a16ea58250798aef48e142e33ff724aab | 43 | go | Go | ydboss/src/github.com/cweill/gotests/testdata/invalidtest/invalid_test.go | XianCreationAndToBeSuccessfulCompany/Boss-System | 0021da5242af4eac5fa91ed1d8f8499cf9e2ce28 | [
"Apache-2.0"
] | 21 | 2017-09-05T07:13:12.000Z | 2021-11-07T20:25:35.000Z | ydboss/src/github.com/cweill/gotests/testdata/invalidtest/invalid_test.go | yellowFarLu/Boss-System | 0021da5242af4eac5fa91ed1d8f8499cf9e2ce28 | [
"Apache-2.0"
] | null | null | null | ydboss/src/github.com/cweill/gotests/testdata/invalidtest/invalid_test.go | yellowFarLu/Boss-System | 0021da5242af4eac5fa91ed1d8f8499cf9e2ce28 | [
"Apache-2.0"
] | 13 | 2017-10-30T11:58:53.000Z | 2021-05-05T13:12:38.000Z | package invalidtest
This is not Go code. | 14.333333 | 20 | 0.767442 |
f5ce610f1711dc236915adfa02734091e205a975 | 11,898 | kt | Kotlin | view/src/main/java/com/example/view/bezier/ThreeView.kt | yudengwei/Demo | d6d644e330f5f2b3d43e2451933a30987a5d373e | [
"Apache-2.0"
] | null | null | null | view/src/main/java/com/example/view/bezier/ThreeView.kt | yudengwei/Demo | d6d644e330f5f2b3d43e2451933a30987a5d373e | [
"Apache-2.0"
] | null | null | null | view/src/main/java/com/example/view/bezier/ThreeView.kt | yudengwei/Demo | d6d644e330f5f2b3d43e2451933a30987a5d373e | [
"Apache-2.0"
] | null | null | null | package com.example.view.bezier
import android.animation.Animator
import android.animation.TypeEvaluator
import android.animation.ValueAnimator
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View
class ThreeView @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null, defStyleAttr: Int = 0)
: View(context, attributeSet, defStyleAttr) {
private var mBigListener : BigListener? = null
private val mPaint = Paint().also {
it.isAntiAlias = true
it.style = Paint.Style.STROKE
it.color = Color.WHITE
}
private val StringTextBIG = "呼气"
private var StringTextSHRINK = "吸气"
private var mCurrentText = StringTextBIG
private val mTextPaint = Paint().apply {
this.style = Paint.Style.FILL
this.strokeWidth = 4f
this.textSize = 50f
this.textAlign = Paint.Align.CENTER
this.color = Color.WHITE
this.isAntiAlias = true
}
private val mPath = Path()
private var mCenterPoint = Point()
private val mPoints = Array(12) {
Point()
}
private val mInitPoints = Array(12) {
Point()
}
private val mRadius = 200
private val mBigRadius = 100
private var mIsShrink = false
private var mIsRunning = false
private val mBigAnimator = ValueAnimator().also {
it.duration = 4000
it.addUpdateListener { value ->
val realPoints = value.animatedValue as Array<Point>
for (i in mPoints.indices) {
when(i) {
0 -> {
mPoints[0].y = realPoints[0].y
}
3 -> {
mPoints[3].x = realPoints[3].x
}
6 -> {
mPoints[6].y = realPoints[6].y
}
9 -> {
mPoints[9].x = realPoints[9].x
}
else -> {
mPoints[i].x = realPoints[i].x
mPoints[i].y = realPoints[i].y
}
}
}
invalidate()
}
it.addListener(object : Animator.AnimatorListener {
override fun onAnimationStart(p0: Animator?) {
mIsRunning = true
}
override fun onAnimationEnd(p0: Animator?) {
mBigListener?.let {
it.bigAnimatorEnd()
}
for (i in mInitPoints.indices) {
mInitPoints[i].x = mPoints[i].x
mInitPoints[i].y = mPoints[i].y
}
mIsRunning = false
mCurrentText = StringTextSHRINK
mIsShrink = true
mShrinkAnimator.setObjectValues(mInitPoints, mInitPoints)
mShrinkAnimator.setEvaluator(bigEvaluator)
mShrinkAnimator.start()
}
override fun onAnimationCancel(p0: Animator?) {
}
override fun onAnimationRepeat(p0: Animator?) {
}
})
}
private val mShrinkAnimator = ValueAnimator().also {
it.duration = 4000
it.addUpdateListener { value ->
val realPoints = value.animatedValue as Array<Point>
for (i in mPoints.indices) {
when(i) {
0 -> {
mPoints[0].y = realPoints[0].y
}
3 -> {
mPoints[3].x = realPoints[3].x
}
6 -> {
mPoints[6].y = realPoints[6].y
}
9 -> {
mPoints[9].x = realPoints[9].x
}
else -> {
mPoints[i].x = realPoints[i].x
mPoints[i].y = realPoints[i].y
}
}
}
invalidate()
}
it.addListener(object : Animator.AnimatorListener {
override fun onAnimationStart(p0: Animator?) {
mIsRunning = true
}
override fun onAnimationEnd(p0: Animator?) {
for (i in mInitPoints.indices) {
mInitPoints[i].x = mPoints[i].x
mInitPoints[i].y = mPoints[i].y
}
mIsRunning = false
mCurrentText = StringTextBIG
mIsShrink = false
invalidate()
}
override fun onAnimationCancel(p0: Animator?) {
}
override fun onAnimationRepeat(p0: Animator?) {
}
})
}
private val bigEvaluator = BigEvaluator()
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
mCenterPoint.x = w / 2
mCenterPoint.y = 500
setInitialPoints()
}
override fun onDraw(canvas: Canvas) {
mPath.reset()
mPath.moveTo(mPoints[0].x.toFloat(), mPoints[0].y.toFloat())
var i = 1
while (i < mPoints.size) {
val endPoint = if (i != 10) mPoints[i + 2] else mPoints[0]
val controlPoint1 = mPoints[i]
val controlPoint2 = mPoints[i + 1]
cubicTo(controlPoint1, controlPoint2, endPoint)
i += 3
}
canvas.drawPath(mPath, mPaint)
val fontMetrics: Paint.FontMetrics = mTextPaint.fontMetrics
val distance = (fontMetrics.bottom - fontMetrics.top) / 2 - fontMetrics.bottom
val baseline: Float = mCenterPoint.y + distance
canvas.drawText(mCurrentText, mCenterPoint.x.toFloat(), baseline, mTextPaint)
}
private fun cubicTo(controlPoint1: Point, controlPoint2: Point, endPoint: Point) {
mPath.cubicTo(controlPoint1.x.toFloat(), controlPoint1.y.toFloat(), controlPoint2.x.toFloat(), controlPoint2.y.toFloat(), endPoint.x.toFloat(), endPoint.y.toFloat())
}
private fun setInitialPoints() {
mPoints[0].x = mCenterPoint.x
mPoints[0].y = mCenterPoint.y - mRadius
mInitPoints[0].x = mPoints[0].x
mInitPoints[0].y = mPoints[0].y
mPoints[1].x = mCenterPoint.x + mRadius / 2
mPoints[1].y = mCenterPoint.y - mRadius
mInitPoints[1].x = mPoints[1].x
mInitPoints[1].y = mPoints[1].y
mPoints[2].x = mCenterPoint.x + mRadius
mPoints[2].y = mCenterPoint.y - mRadius / 2
mInitPoints[2].x = mPoints[2].x
mInitPoints[2].y = mPoints[2].y
mPoints[3].x = mCenterPoint.x + mRadius
mPoints[3].y = mCenterPoint.y
mInitPoints[3].x = mPoints[3].x
mInitPoints[3].y = mPoints[3].y
mPoints[4].x = mCenterPoint.x + mRadius
mPoints[4].y = mCenterPoint.y + mRadius / 2
mInitPoints[4].x = mPoints[4].x
mInitPoints[4].y = mPoints[4].y
mPoints[5].x = mCenterPoint.x + mRadius / 2
mPoints[5].y = mCenterPoint.y + mRadius
mInitPoints[5].x = mPoints[5].x
mInitPoints[5].y = mPoints[5].y
mPoints[6].x = mCenterPoint.x
mPoints[6].y = mCenterPoint.y + mRadius
mInitPoints[6].x = mPoints[6].x
mInitPoints[6].y = mPoints[6].y
mPoints[7].x = mCenterPoint.x - mRadius / 2
mPoints[7].y = mCenterPoint.y + mRadius
mInitPoints[7].x = mPoints[7].x
mInitPoints[7].y = mPoints[7].y
mPoints[8].x = mCenterPoint.x - mRadius
mPoints[8].y = mCenterPoint.y + mRadius / 2
mInitPoints[8].x = mPoints[8].x
mInitPoints[8].y = mPoints[8].y
mPoints[9].x = mCenterPoint.x - mRadius
mPoints[9].y = mCenterPoint.y
mInitPoints[9].x = mPoints[9].x
mInitPoints[9].y = mPoints[9].y
mPoints[10].x = mCenterPoint.x - mRadius
mPoints[10].y = mCenterPoint.y - mRadius / 2
mInitPoints[10].x = mPoints[10].x
mInitPoints[10].y = mPoints[10].y
mPoints[11].x = mCenterPoint.x - mRadius / 2
mPoints[11].y = mCenterPoint.y - mRadius
mInitPoints[11].x = mPoints[11].x
mInitPoints[11].y = mPoints[11].y
}
fun big() {
if (mIsRunning) {
return
}
mBigAnimator.setObjectValues(mInitPoints, mInitPoints)
mBigAnimator.setEvaluator(bigEvaluator)
mBigAnimator.start()
}
fun isBig() = mIsShrink
private inner class BigEvaluator : TypeEvaluator<Array<Point>> {
override fun evaluate(p0: Float, p1: Array<Point>, p2: Array<Point>): Array<Point> {
return Array(12) {
var endValueX = 0
var endValueY = 0
when (it) {
0 -> {
endValueY = if (!mIsShrink) p1[it].y - mBigRadius else p1[it].y + mBigRadius
}
1 -> {
endValueX = if (!mIsShrink) p1[it].x + mBigRadius / 2 else p1[it].x - mBigRadius / 2
endValueY = if (!mIsShrink) p1[it].y - mBigRadius else p1[it].y + mBigRadius
}
2 -> {
endValueX = if (!mIsShrink) p1[it].x + mBigRadius else p1[it].x - mBigRadius
endValueY = if (!mIsShrink) p1[it].y - mBigRadius / 2 else p1[it].y + mBigRadius / 2
}
3 -> {
endValueX = if (!mIsShrink) p1[it].x + mBigRadius else p1[it].x - mBigRadius
}
4 -> {
endValueX = if (!mIsShrink) p1[it].x + mBigRadius else p1[it].x - mBigRadius
endValueY = if (!mIsShrink) p1[it].y + mBigRadius / 2 else p1[it].y - mBigRadius / 2
}
5 -> {
endValueX = if (!mIsShrink) p1[it].x + mBigRadius / 2 else p1[it].x - mBigRadius / 2
endValueY = if (!mIsShrink) p1[it].y + mBigRadius else p1[it].y - mBigRadius
}
6 -> {
endValueY = if (!mIsShrink) p1[it].y + mBigRadius else p1[it].y - mBigRadius
}
7 -> {
endValueX = if (!mIsShrink) p1[it].x - mBigRadius / 2 else p1[it].x + mBigRadius / 2
endValueY = if (!mIsShrink) p1[it].y + mBigRadius else p1[it].y - mBigRadius
}
8 -> {
endValueX = if (!mIsShrink) p1[it].x - mBigRadius else p1[it].x + mBigRadius
endValueY = if (!mIsShrink) p1[it].y + mBigRadius / 2 else p1[it].y - mBigRadius / 2
}
9 -> {
endValueX = if (!mIsShrink) p1[it].x - mBigRadius else p1[it].x + mBigRadius
}
10 -> {
endValueX = if (!mIsShrink) p1[it].x - mBigRadius else p1[it].x + mBigRadius
endValueY = if (!mIsShrink) p1[it].y - mBigRadius / 2 else p1[it].y + mBigRadius / 2
}
11 -> {
endValueX = if (!mIsShrink) p1[it].x - mBigRadius / 2 else p1[it].x + mBigRadius / 2
endValueY = if (!mIsShrink) p1[it].y - mBigRadius else p1[it].y + mBigRadius
}
}
val x = (p1[it].x + p0 * (endValueX - p1[it].x)).toInt()
val y = (p1[it].y + p0 * (endValueY - p1[it].y)).toInt()
Point(x, y)
}
}
}
fun setListener(bigListener : BigListener) {
this.mBigListener = bigListener
}
interface BigListener {
fun bigAnimatorEnd()
}
} | 35.622754 | 173 | 0.499328 |
f038aecec6086a490e6f5aeaa3b33d1f7b60af51 | 488 | js | JavaScript | app/wordseer/static/wordseer_app/view/search/SentenceSetsComboBox.js | Wordseer/wordseer | a45102c1848c93360d3815187783756dc5e16156 | [
"Unlicense"
] | 38 | 2015-02-26T02:21:04.000Z | 2022-02-03T16:29:00.000Z | app/wordseer/static/wordseer_app/view/search/SentenceSetsComboBox.js | Wordseer/wordseer | a45102c1848c93360d3815187783756dc5e16156 | [
"Unlicense"
] | 106 | 2015-03-06T20:23:32.000Z | 2016-10-04T21:46:51.000Z | app/wordseer/static/wordseer_app/view/search/SentenceSetsComboBox.js | Wordseer/wordseer | a45102c1848c93360d3815187783756dc5e16156 | [
"Unlicense"
] | 18 | 2015-08-17T02:29:57.000Z | 2022-02-03T16:29:30.000Z | /* Copyright 2012 Aditi Muralidharan. See the file "LICENSE" for the full license governing this code. */
Ext.define('WordSeer.view.search.SentenceSetComboBox',{
requires: [ 'WordSeer.view.search.DocumentSetsComboBox' ],
extend:'WordSeer.view.search.DocumentSetsComboBox',
alias:'widget.sentence-collections-combobox',
initComponent:function(){
this.callParent();
this.store = SENTENCE_COLLECTIONS_LIST_STORE;
this.store.refreshStore();
},
});
| 40.666667 | 105 | 0.719262 |
a1f97f9b31085f53189e89c7eeea27137a90393d | 724 | asm | Assembly | src/dlls/mscoree/i386/handlers.asm | CyberSys/coreclr-mono | 83b2cb83b32faa45b4f790237b5c5e259692294a | [
"MIT"
] | 10 | 2015-11-03T16:35:25.000Z | 2021-07-31T16:36:29.000Z | src/dlls/mscoree/i386/handlers.asm | CyberSys/coreclr-mono | 83b2cb83b32faa45b4f790237b5c5e259692294a | [
"MIT"
] | 1 | 2019-03-05T18:50:09.000Z | 2019-03-05T18:50:09.000Z | src/dlls/mscoree/i386/handlers.asm | CyberSys/coreclr-mono | 83b2cb83b32faa45b4f790237b5c5e259692294a | [
"MIT"
] | 4 | 2015-10-28T12:26:26.000Z | 2021-09-04T11:36:04.000Z | ;
; Copyright (c) Microsoft. All rights reserved.
; Licensed under the MIT license. See LICENSE file in the project root for full license information.
;
; ==++==
;
;
; ==--==
;
; This file contains definitions for each CLR exception handler.
; The assembler marks all functions in this file as safe-exception
; handler.
;
.686
.model flat
COMPlusFrameHandler proto c
.safeseh COMPlusFrameHandler
COMPlusNestedExceptionHandler proto c
.safeseh COMPlusNestedExceptionHandler
FastNExportExceptHandler proto c
.safeseh FastNExportExceptHandler
UMThunkPrestubHandler proto c
.safeseh UMThunkPrestubHandler
ifdef FEATURE_COMINTEROP
COMPlusFrameHandlerRevCom proto c
.safeseh COMPlusFrameHandlerRevCom
endif
end
| 18.564103 | 101 | 0.794199 |
f082f97017dd469928617efda67490dacef988de | 1,135 | js | JavaScript | assets/js/rotation.js | boardingschool/boardingschool.github.io | 7c8aee829b294bf8ab9f1f02fb7efee5859b0382 | [
"CC-BY-3.0"
] | null | null | null | assets/js/rotation.js | boardingschool/boardingschool.github.io | 7c8aee829b294bf8ab9f1f02fb7efee5859b0382 | [
"CC-BY-3.0"
] | null | null | null | assets/js/rotation.js | boardingschool/boardingschool.github.io | 7c8aee829b294bf8ab9f1f02fb7efee5859b0382 | [
"CC-BY-3.0"
] | null | null | null | $(window).load(function() { //start after HTML, images have loaded
var InfiniteRotator =
{
init: function()
{
//initial fade-in time (in milliseconds)
var initialFadeIn = 0;
//interval between items (in milliseconds)
var itemInterval = 5000;
//cross-fade time (in milliseconds)
var fadeTime = 2500;
//count number of items
var numberOfItems = $('.img-item').length;
//set current item
var currentItem = 0;
//show first item
$('.img-item').eq(currentItem).fadeIn(initialFadeIn);
//loop through the items
var infiniteLoop = setInterval(function(){
$('.img-item').eq(currentItem).fadeOut(fadeTime);
if(currentItem == numberOfItems -1){
currentItem = 0;
}else{
currentItem++;
}
$('.img-item').eq(currentItem).fadeIn(fadeTime);
}, itemInterval);
}
};
InfiniteRotator.init();
}); | 27.02381 | 66 | 0.489868 |
0bdce382402fcedf20f03783e06ed8e6a1898b6c | 1,843 | js | JavaScript | src/commands/__tests__/init.test.js | Bloodb0ne/bolt | 3e2c9d85afad78d8f8e420d81716a990b7ed9024 | [
"MIT"
] | 2,182 | 2017-09-26T05:58:52.000Z | 2022-03-31T19:11:16.000Z | src/commands/__tests__/init.test.js | Bloodb0ne/bolt | 3e2c9d85afad78d8f8e420d81716a990b7ed9024 | [
"MIT"
] | 191 | 2017-09-26T09:29:58.000Z | 2022-03-21T07:35:21.000Z | src/commands/__tests__/init.test.js | agrublev/bolt-ag | f61c659e88960088411c6df868f559e448355933 | [
"MIT"
] | 113 | 2017-10-10T19:49:51.000Z | 2022-03-25T01:43:28.000Z | // @flow
import { init, toInitOptions } from '../init';
import * as yarn from '../../utils/yarn';
import * as prompts from '../../utils/prompts';
import Package from '../../Package';
jest.mock('../../utils/yarn');
jest.mock('../../utils/prompts');
const dummyPath = '/dummyPattern/dummyPath';
describe('bolt init', () => {
it('should be able to pass yes to yarn when y flag is passed', async () => {
await init(toInitOptions([], { cwd: dummyPath, y: true }));
expect(yarn.cliCommand).toHaveBeenCalledWith(dummyPath, 'init', [
'-s',
'-y'
]);
});
it('should be able to pass yes to yarn when yes flag is passes', async () => {
await init(toInitOptions([], { cwd: dummyPath, yes: true }));
expect(yarn.cliCommand).toHaveBeenCalledWith(dummyPath, 'init', [
'-s',
'-y'
]);
});
it('should be able to pass private to yarn when p flag is passed', async () => {
await init(toInitOptions([], { cwd: dummyPath, p: true }));
expect(yarn.cliCommand).toHaveBeenCalledWith(dummyPath, 'init', [
'-s',
'-p'
]);
});
it('should be able to pass private to yarn when private flag is passes', async () => {
await init(toInitOptions([], { cwd: dummyPath, private: true }));
expect(yarn.cliCommand).toHaveBeenCalledWith(dummyPath, 'init', [
'-s',
'-p'
]);
});
it('should be able to pass yes and private to yarn when private and yes flag is passes', async () => {
await init(toInitOptions([], { cwd: dummyPath, private: true, yes: true }));
expect(yarn.cliCommand).toHaveBeenCalledWith(dummyPath, 'init', [
'-s',
'-p',
'-y'
]);
});
it('should be able to add workspaces', async () => {
await init(toInitOptions([], { cwd: dummyPath }));
expect(prompts.isWorkspaceNeeded).toHaveBeenCalledTimes(1);
});
});
| 31.775862 | 104 | 0.601194 |
3b9b909a7e5b41dd4fe29b380ff508bf34e9701c | 698 | h | C | nimbro_apc/control/apc_control/include/apc_control/states/picking/retract.h | warehouse-picking-automation-challenges/nimbro_picking | 857eee602beea9eebee45bbb67fce423b28f9db6 | [
"BSD-3-Clause"
] | 19 | 2017-11-02T03:05:51.000Z | 2020-12-02T19:40:15.000Z | nimbro_apc/control/apc_control/include/apc_control/states/picking/retract.h | warehouse-picking-automation-challenges/nimbro_picking | 857eee602beea9eebee45bbb67fce423b28f9db6 | [
"BSD-3-Clause"
] | null | null | null | nimbro_apc/control/apc_control/include/apc_control/states/picking/retract.h | warehouse-picking-automation-challenges/nimbro_picking | 857eee602beea9eebee45bbb67fce423b28f9db6 | [
"BSD-3-Clause"
] | 9 | 2017-09-16T02:20:39.000Z | 2020-05-24T14:06:35.000Z | // Retract state for APC
// Author: Christian Lenz <chrislenz@uni-bonn.de>
#ifndef APC_RETRACT_STATE_H
#define APC_RETRACT_STATE_H
#include <apc_control/states/move_arm.h>
#include <nimbro_fsm/fsm_ros.h>
namespace apc_control
{
class Retract : public MoveArm
{
public:
explicit Retract(bool retry = true);
nimbro_fsm::StateBase* execute() override;
virtual void enter() override;
virtual void exit() override;
private:
nimbro_keyframe_server::PlayMotionGoal computeGoal() override;
nimbro_fsm::StateBase* nextState() override;
nimbro_fsm::StateBase* onProtectiveStop(const nimbro_keyframe_server::PlayMotionResultConstPtr& result) override;
bool m_retry;
};
}
#endif
| 20.529412 | 115 | 0.769341 |
5ff6de56801abd152f3729dbdc7e3b95ee1c1426 | 790 | css | CSS | src/app/forms/salesForm/sales-form.component.css | romarionelson/Prootype | 4cee8b4e4e2c76446b529487fce345efddd2d3a5 | [
"MIT"
] | null | null | null | src/app/forms/salesForm/sales-form.component.css | romarionelson/Prootype | 4cee8b4e4e2c76446b529487fce345efddd2d3a5 | [
"MIT"
] | null | null | null | src/app/forms/salesForm/sales-form.component.css | romarionelson/Prootype | 4cee8b4e4e2c76446b529487fce345efddd2d3a5 | [
"MIT"
] | null | null | null |
div.flex{
display: flex;
}
div.flex > md-input-container, div.flex > md-select{
flex: 1;
margin: 0 7px;
font-size: 15px;
}
div.flex > md-select{
margin-bottom: 7px;
}
/*.DivHeader{
position: relative;
display: block;
width: 100%;
background-color: lightblue;
}*/
.DivLogo{
background-color: lightblue;
padding: 15px 15px;
border: 2px solid lightblue;
}
.DivHeader{
position: relative;
}
div.bodycard{
position: relative;
}
.row > div, .row > div md-input-container, .row > div md-select {
width: 100%;
margin: 0 7px;
font-size: 15px;
flex: 1;
}
.errorMessages{
color: red;
font-size: 0.8em;
width: 100%;
margin-top: -10px;
margin-left: 6px;
}
.tab{
margin-top: 7px;
}
| 14.107143 | 67 | 0.58481 |
2071c20c7a05a49756591816498d8f49c810e7e7 | 3,127 | css | CSS | assets/css/footer.css | Lameck1/jivinjari | b2a7ff6f32c53fcd1fb39aff1c2a50d185637659 | [
"MIT"
] | 8 | 2020-10-19T08:39:24.000Z | 2021-08-07T06:02:45.000Z | assets/css/footer.css | Lameck1/jivinjari | b2a7ff6f32c53fcd1fb39aff1c2a50d185637659 | [
"MIT"
] | 1 | 2020-10-26T16:02:45.000Z | 2020-10-26T16:02:45.000Z | assets/css/footer.css | Lameck1/jivinjari | b2a7ff6f32c53fcd1fb39aff1c2a50d185637659 | [
"MIT"
] | 1 | 2021-08-07T06:02:50.000Z | 2021-08-07T06:02:50.000Z | footer {
background-color: var(--color-black);
font-family: var(--font-family-secondary);
padding: 2em 0 10px;
}
/* footer-top */
.footer-links {
flex-direction: column;
justify-content: space-between;
border-top: 2px solid var(--color-darkergray);
border-bottom: 2px solid var(--color-darkergray);
margin-bottom: 2vw;
position: relative;
}
.f-links-container {
color: var(--color-white);
text-transform: uppercase;
}
.f-links-left li,
.f-links-right li {
display: inline;
padding: 1%;
}
.f-logo {
background-color: var(--color-black);
border: 2px solid var(--color-darkergray);
border-radius: 50%;
color: var(--color-white);
position: absolute;
top: -3em;
}
.f-logo i {
font-size: 2rem;
}
@media only screen and (min-width: 768px) {
.f-links-left {
justify-content: flex-start;
}
.f-links-right {
justify-content: flex-end;
}
.f-links-left li {
display: inline;
margin-right: 4%;
}
.f-links-right li {
display: inline;
margin-left: 4%;
}
.subscribe form {
flex-direction: row;
}
.subscribe form input {
margin-bottom: 0;
}
.footer-links {
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
.f-links-container {
padding: 0.5vw 0;
}
.footer-top {
max-width: 100%;
margin: 0 auto;
}
.f-logo {
width: 60px;
height: 60px;
left: 45%;
top: auto;
}
.f-logo i {
font-size: 3rem;
}
.footer-bottom {
flex-direction: row;
justify-content: space-between;
}
}
@media only screen and (max-width: 1023px) {
/* footer-middle */
.footer-middle {
display: none;
}
/* footer-bottom */
.footer-bottom {
display: none;
}
}
@media only screen and (min-width: 1024px) {
footer {
padding: 4vw 0 0;
}
.footer-top {
max-width: 85%;
}
/* footer-top */
.f-logo {
width: 100px;
height: 100px;
left: 45.5%;
}
/* footer-middle */
.footer-middle {
align-items: flex-start;
justify-content: space-between;
color: var(--color-darkgray);
width: 85%;
margin: 0 auto;
}
.footer-middle h3 {
padding: 2.2vw;
}
.footer-middle div {
flex-direction: column;
justify-content: center;
align-items: center;
width: 30%;
}
.subscribe form {
flex-wrap: wrap;
justify-content: center;
}
.subscribe form input {
border: 1px solid var(--color-darkgray);
padding: 0.6vh;
}
.subscribe form button {
color: var(--color-white);
border: 0;
background-color: var(--color-darkgray);
padding: 0.6vh;
}
.contact span {
color: var(--color-sienna);
}
.contact p,
.about p {
text-align: center;
line-height: 1.7;
}
/* footer-bottom */
.footer-bottom {
background-color: var(--color-darkergray);
padding: 1vw;
margin-top: 2vw;
}
.footer-social {
color: var(--color-darkgray);
width: 30%;
padding: 0.5vw;
}
.footer-social a {
padding: 0 4%;
}
.footer-copyright {
color: var(--color-darkgray);
text-align: center;
padding: 1vw;
}
}
| 15.635 | 51 | 0.590662 |
4553e7fad0f97a06c9baa4052d08628ea3a6f478 | 3,080 | sql | SQL | sig (1).sql | aknanta/sig | e6f514e1eaff8d86a6fd42cae331472f9241dc98 | [
"MIT"
] | null | null | null | sig (1).sql | aknanta/sig | e6f514e1eaff8d86a6fd42cae331472f9241dc98 | [
"MIT"
] | null | null | null | sig (1).sql | aknanta/sig | e6f514e1eaff8d86a6fd42cae331472f9241dc98 | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 27 Jul 2021 pada 20.10
-- Versi server: 10.4.17-MariaDB
-- Versi PHP: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sig`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `marker`
--
CREATE TABLE `marker` (
`id` int(11) NOT NULL,
`nama` varchar(50) NOT NULL,
`alamat` varchar(255) NOT NULL,
`latitude` varchar(255) NOT NULL,
`longitude` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `marker`
--
INSERT INTO `marker` (`id`, `nama`, `alamat`, `latitude`, `longitude`) VALUES
(2, 'Amaris Hotel Solo', 'Jl. Kebangkitan Nasional No.24, Sriwedari, Kec. Laweyan, Kota Surakarta, Jawa Tengah 57141', '-7.569908430066403', '110.81557571944462'),
(4, 'Novotel Solo', 'Jl. Slamet Riyadi No.272, Timuran, Kec. Banjarsari, Kota Surakarta, Jawa Tengah 57141', '-7.567727679474065', '110.81721337193753'),
(5, 'Museum Batik Danar Hadi', 'Jl. Slamet Riyadi No.261, Sriwedari, Kec. Laweyan, Kota Surakarta, Jawa Tengah 57141', '-7.568535968081199', '110.81630142090566'),
(6, 'Bank BRI Solo Slamet Riyadi', 'Jl. Slamet Riyadi No.236, Sriwedari, Kec. Laweyan, Kota Surakarta, Jawa Tengah 57141', '-7.56745115933963', '110.81473501089799'),
(7, 'Gor Sritex Arena', 'Jl. Abiyoso No.21, Sriwedari, Kec. Laweyan, Kota Surakarta, Jawa Tengah 57141', '-7.57081193053898', '110.81499250292518'),
(8, 'Pasar Kembang Solo', 'Jl. Honggowongso, Kemlayan, Kec. Serengan, Kota Surakarta, Jawa Tengah 57141', '-7.572364683046225', '110.81648381108316'),
(9, 'Museum Keris Solo', 'Jl. Bhayangkara No.2, Sriwedari, Kec. Laweyan, Kota Surakarta, Jawa Tengah 57141', '-7.568812487580887', '110.8108833587655'),
(10, 'RS PKU Muhammadiyah Surakarta', 'Jl. Ronggowarsito No.130, Timuran, Kec. Banjarsari, Kota Surakarta, Jawa Tengah 57131', '-7.5653985235117025', '110.81683786268248'),
(11, 'Hotel Sahid Jaya Solo', 'Jl. Gajahmada No.82, Ketelan, Kec. Banjarsari, Kota Surakarta, Jawa Tengah 57132', '-7.563484139366497', '110.81941278340011'),
(12, 'Polsek Banjarsari', 'Jl. Kartini No.65, Timuran, Kec. Banjarsari, Kota Surakarta, Jawa Tengah 57131', '-7.566727952008968', '110.82094700692734');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `marker`
--
ALTER TABLE `marker`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `marker`
--
ALTER TABLE `marker`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 39.487179 | 172 | 0.703896 |
e75062653272dcc2e6825a1cd35c04a78851a822 | 870 | js | JavaScript | models/mongodb/FHIRDataTypesSchema/Account_Guarantor.js | Chinlinlee/Burni | f5ba4faa77bafcc266d929ad72c7a6184c6da620 | [
"Apache-2.0"
] | 10 | 2021-11-19T09:14:52.000Z | 2022-03-09T16:28:28.000Z | models/mongodb/FHIRDataTypesSchema/Account_Guarantor.js | cylab-tw/Burni | f5ba4faa77bafcc266d929ad72c7a6184c6da620 | [
"Apache-2.0"
] | 1 | 2022-02-20T20:23:04.000Z | 2022-02-21T13:31:48.000Z | models/mongodb/FHIRDataTypesSchema/Account_Guarantor.js | cylab-tw/Burni | f5ba4faa77bafcc266d929ad72c7a6184c6da620 | [
"Apache-2.0"
] | 2 | 2021-09-29T01:44:57.000Z | 2021-09-29T11:31:49.000Z | const mongoose = require('mongoose');
const {
Extension
} = require('../FHIRDataTypesSchemaExport/allTypeSchemaTopDef');
const {
Reference
} = require('../FHIRDataTypesSchemaExport/allTypeSchemaTopDef');
const boolean = require('../FHIRDataTypesSchema/boolean');
const {
Period
} = require('../FHIRDataTypesSchemaExport/allTypeSchemaTopDef');
const {
Account_Guarantor
} = require("../FHIRDataTypesSchemaExport/allTypeSchemaTopDef");
Account_Guarantor.add({
extension: {
type: [Extension],
default: void 0
},
modifierExtension: {
type: [Extension],
default: void 0
},
party: {
type: Reference,
required: true,
default: void 0
},
onHold: boolean,
period: {
type: Period,
default: void 0
}
});
module.exports.Account_Guarantor = Account_Guarantor; | 24.166667 | 64 | 0.648276 |
d272b67bfa1137eb6c3871e24aadb62b6fb72ffa | 12,498 | php | PHP | parser.php | hylandry/opensimstuff | 18f5fc5d2399b14d464066b1754b096ce8db9c2d | [
"MIT"
] | null | null | null | parser.php | hylandry/opensimstuff | 18f5fc5d2399b14d464066b1754b096ce8db9c2d | [
"MIT"
] | 1 | 2020-06-09T17:27:35.000Z | 2020-06-09T17:27:35.000Z | parser.php | hylandry/opensimstuff | 18f5fc5d2399b14d464066b1754b096ce8db9c2d | [
"MIT"
] | null | null | null | <?php
//
// Modified for PHP7 and MySQLi
//
// This needs php-curl installed
//
include("databaseinfo.php");
//Supress all Warnings/Errors
//error_reporting(0);
$now = time();
//
// Search DB
//
//
//mysqli_select_db ($db, $DB_NAME);
if (!isset($db)) $db=mysqli_connect ($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
function GetURL($host, $port, $url)
{
$url = "http://$host:$port/$url";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$data = curl_exec($ch);
if (curl_errno($ch) == 0)
{
curl_close($ch);
return $data;
}
curl_close($ch);
return "";
}
function CheckHost($hostname, $port)
{
if (!isset($db)) $db=mysqli_connect ($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
global $now;
$xml = GetURL($hostname, $port, "?method=collector");
if ($xml == "") //No data was retrieved? (CURL may have timed out)
{
$failcounter = "failcounter + 1";
echo "fail: ".$failcounter."<br>\n";
}
else
$failcounter = "0";
//Update nextcheck to be 10 minutes from now. The current OS instance
//won't be checked again until at least this much time has gone by.
$next = $now + 600;
mysqli_query($db, "UPDATE hostsregister SET nextcheck = $next," .
" checked = 1, failcounter = " . $failcounter .
" WHERE host = '" . mysqli_real_escape_string($db, $hostname) . "'" .
" AND port = '" . mysqli_real_escape_string($db, $port) . "'");
if ($xml != "")
parse($hostname, $port, $xml);
}
function parse($hostname, $port, $xml)
{
global $now, $db;
if (!isset($db)) $db=mysqli_connect ($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
///////////////////////////////////////////////////////////////////////
//
// Search engine sim scanner
//
//
// Load XML doc from URL
//
$objDOM = new DOMDocument();
$objDOM->resolveExternals = false;
//Don't try and parse if XML is invalid or we got an HTML 404 error.
if ($objDOM->loadXML($xml) == False)
return;
//
// Get the region data to update
//
$regiondata = $objDOM->getElementsByTagName("regiondata");
//If returned length is 0, collector method may have returned an error
if ($regiondata->length == 0)
return;
$regiondata = $regiondata->item(0);
//
// Update nextcheck so this host entry won't be checked again until after
// the DataSnapshot module has generated a new set of data to be parsed.
//
$expire = $regiondata->getElementsByTagName("expire")->item(0)->nodeValue;
$next = $now + $expire;
$updater = mysqli_query($db, "UPDATE hostsregister SET nextcheck = $next " .
"WHERE host = '" . mysqli_real_escape_string($db, $hostname) . "' AND " .
"port = '" . mysqli_real_escape_string($db, $port) . "'");
//
// Get the region data to be saved in the database
//
$regionlist = $regiondata->getElementsByTagName("region");
foreach ($regionlist as $region)
{
$regioncategory = $region->getAttributeNode("category")->nodeValue;
//
// Start reading the Region info
//
$info = $region->getElementsByTagName("info")->item(0);
$regionuuid = $info->getElementsByTagName("uuid")->item(0)->nodeValue;
$regionname = $info->getElementsByTagName("name")->item(0)->nodeValue;
$regionhandle = $info->getElementsByTagName("handle")->item(0)->nodeValue;
$url = $info->getElementsByTagName("url")->item(0)->nodeValue;
//
// First, check if we already have a region that is the same
//
$check = mysqli_query($db, "SELECT * FROM regions WHERE regionuuid = '" .
mysqli_real_escape_string($db, $regionuuid) . "'");
if (mysqli_num_rows($check) > 0)
{
mysqli_query($db, "DELETE FROM regions WHERE regionuuid = '" .
mysqli_real_escape_string($db, $regionuuid) . "'");
mysqli_query($db, "DELETE FROM parcels WHERE regionuuid = '" .
mysqli_real_escape_string($db, $regionuuid) . "'");
mysqli_query($db, "DELETE FROM allparcels WHERE regionUUID = '" .
mysqli_real_escape_string($db, $regionuuid) . "'");
mysqli_query($db, "DELETE FROM parcelsales WHERE regionUUID = '" .
mysqli_real_escape_string($db, $regionuuid) . "'");
mysqli_query($db, "DELETE FROM objects WHERE regionuuid = '" .
mysqli_real_escape_string($db, $regionuuid) . "'");
}
$data = $region->getElementsByTagName("data")->item(0);
$estate = $data->getElementsByTagName("estate")->item(0);
$username = $estate->getElementsByTagName("name")->item(0)->nodeValue;
$useruuid = $estate->getElementsByTagName("uuid")->item(0)->nodeValue;
$estateid = $estate->getElementsByTagName("id")->item(0)->nodeValue;
//
// Second, add the new info to the database
//
$sql = "INSERT INTO regions VALUES('" .
mysqli_real_escape_string($db, $regionname) . "','" .
mysqli_real_escape_string($db, $regionuuid) . "','" .
mysqli_real_escape_string($db, $regionhandle) . "','" .
mysqli_real_escape_string($db, $url) . "','" .
mysqli_real_escape_string($db, $username) ."','" .
mysqli_real_escape_string($db, $useruuid) ."')";
mysqli_query($db, $sql);
//
// Start reading the parcel info
//
$parcel = $data->getElementsByTagName("parcel");
foreach ($parcel as $value)
{
$parcelname = $value->getElementsByTagName("name")->item(0)->nodeValue;
$parceluuid = $value->getElementsByTagName("uuid")->item(0)->nodeValue;
$infouuid = $value->getElementsByTagName("infouuid")->item(0)->nodeValue;
$parcellanding = $value->getElementsByTagName("location")->item(0)->nodeValue;
$parceldescription = $value->getElementsByTagName("description")->item(0)->nodeValue;
$parcelarea = $value->getElementsByTagName("area")->item(0)->nodeValue;
$parcelcategory = $value->getAttributeNode("category")->nodeValue;
$parcelsaleprice = $value->getAttributeNode("salesprice")->nodeValue;
$dwell = $value->getElementsByTagName("dwell")->item(0)->nodeValue;
$owner = $value->getElementsByTagName("owner")->item(0);
$owneruuid = $owner->getElementsByTagName("uuid")->item(0)->nodeValue;
// Adding support for groups
$group = $value->getElementsByTagName("group")->item(0);
if ($group != "")
{
$groupuuid = $group->getElementsByTagName("groupuuid")->item(0)->nodeValue;
}
else
{
$groupuuid = "00000000-0000-0000-0000-000000000000";
}
//
// Check bits on Public, Build, Script
//
$parcelforsale = $value->getAttributeNode("forsale")->nodeValue;
$parceldirectory = $value->getAttributeNode("showinsearch")->nodeValue;
$parcelbuild = $value->getAttributeNode("build")->nodeValue;
$parcelscript = $value->getAttributeNode("scripts")->nodeValue;
$parcelpublic = $value->getAttributeNode("public")->nodeValue;
//
// Save
//
//$db=mysqli_connect ($DB_HOST, $DB_USER, $DB_PASSWORD);
$sql = "INSERT INTO allparcels VALUES('" .
mysqli_real_escape_string($db, $regionuuid) . "','" .
mysqli_real_escape_string($db, $parcelname) . "','" .
mysqli_real_escape_string($db, $owneruuid) . "','" .
mysqli_real_escape_string($db, $groupuuid) . "','" .
mysqli_real_escape_string($db, $parcellanding) . "','" .
mysqli_real_escape_string($db, $parceluuid) . "','" .
mysqli_real_escape_string($db, $infouuid) . "','" .
mysqli_real_escape_string($db, $parcelarea) . "' )";
mysqli_query($db,$sql);
if ($parceldirectory == "true")
{
$sql = "INSERT INTO parcels VALUES('" .
mysqli_real_escape_string($db, $regionuuid) . "','" .
mysqli_real_escape_string($db, $parcelname) . "','" .
mysqli_real_escape_string($db, $parceluuid) . "','" .
mysqli_real_escape_string($db, $parcellanding) . "','" .
mysqli_real_escape_string($db, $parceldescription) . "','" .
mysqli_real_escape_string($db, $parcelcategory) . "','" .
mysqli_real_escape_string($db, $parcelbuild) . "','" .
mysqli_real_escape_string($db, $parcelscript) . "','" .
mysqli_real_escape_string($db, $parcelpublic) . "','".
mysqli_real_escape_string($db, $dwell) . "','" .
mysqli_real_escape_string($db, $infouuid) . "','" .
mysqli_real_escape_string($db, $regioncategory) . "')";
mysqli_query($db, $sql);
}
if ($parcelforsale == "true")
{
$sql = "INSERT INTO parcelsales VALUES('" .
mysqli_real_escape_string($db, $regionuuid) . "','" .
mysqli_real_escape_string($db, $parcelname) . "','" .
mysqli_real_escape_string($db, $parceluuid) . "','" .
mysqli_real_escape_string($db, $parcelarea) . "','" .
mysqli_real_escape_string($db, $parcelsaleprice) . "','" .
mysqli_real_escape_string($db, $parcellanding) . "','" .
mysqli_real_escape_string($db, $infouuid) . "', '" .
mysqli_real_escape_string($db, $dwell) . "', '" .
mysqli_real_escape_string($db, $estateid) . "', '" .
mysqli_real_escape_string($db, $regioncategory) . "')";
mysqli_query($db, $sql);
}
}
//
// Handle objects
//
$objects = $data->getElementsByTagName("object");
foreach ($objects as $value)
{
$uuid = $value->getElementsByTagName("uuid")->item(0)->nodeValue;
$regionuuid = $value->getElementsByTagName("regionuuid")->item(0)->nodeValue;
$parceluuid = $value->getElementsByTagName("parceluuid")->item(0)->nodeValue;
$location = $value->getElementsByTagName("location")->item(0)->nodeValue;
$title = $value->getElementsByTagName("title")->item(0)->nodeValue;
$description = $value->getElementsByTagName("description")->item(0)->nodeValue;
$flags = $value->getElementsByTagName("flags")->item(0)->nodeValue;
mysqli_query($db, "INSERT INTO objects VALUES('" .
mysqli_real_escape_string($db, $uuid) . "','" .
mysqli_real_escape_string($db, $parceluuid) . "','" .
mysqli_real_escape_string($db, $location) . "','" .
mysqli_real_escape_string($db, $title) . "','" .
mysqli_real_escape_string($db, $description) . "','" .
mysqli_real_escape_string($db, $regionuuid) . "')");
}
}
}
$sql = "SELECT host, port FROM hostsregister " .
"WHERE nextcheck < $now AND checked = 0 LIMIT 0,10";
$jobsearch = mysqli_query($db,$sql);
//
// If the sql query returns no rows, all entries in the hostsregister
// table have been checked. Reset the checked flag and re-run the
// query to select the next set of hosts to be checked.
//
if (mysqli_num_rows($jobsearch) == 0)
{
mysqli_query($db, "UPDATE hostsregister SET checked = 0");
$jobsearch = mysqli_query($db,$sql);
}
while ($jobs = mysqli_fetch_row($jobsearch))
CheckHost($jobs[0], $jobs[1]);
?>
| 36.976331 | 97 | 0.552088 |
16231a97aaf6f24631b1e649919585efdeb9e02b | 1,139 | ts | TypeScript | node_modules/svelte-native/dom/basicdom/ViewNode.d.ts | ikoc4562/svelte_ShopApp | ef1a34016604fdbb98257c78ce352e6873c24e66 | [
"Apache-2.0"
] | null | null | null | node_modules/svelte-native/dom/basicdom/ViewNode.d.ts | ikoc4562/svelte_ShopApp | ef1a34016604fdbb98257c78ce352e6873c24e66 | [
"Apache-2.0"
] | null | null | null | node_modules/svelte-native/dom/basicdom/ViewNode.d.ts | ikoc4562/svelte_ShopApp | ef1a34016604fdbb98257c78ce352e6873c24e66 | [
"Apache-2.0"
] | null | null | null | import DocumentNode from './DocumentNode';
export declare function normalizeElementName(elementName: string): string;
export declare function elementIterator(el: ViewNode): Iterable<ViewNode>;
export default class ViewNode {
nodeType: number;
_tagName: string;
parentNode: ViewNode;
childNodes: ViewNode[];
prevSibling: ViewNode;
nextSibling: ViewNode;
_ownerDocument: DocumentNode;
_attributes: {
[index: string]: any;
};
constructor();
hasAttribute(name: string): boolean;
removeAttribute(name: string): void;
toString(): string;
tagName: any;
readonly firstChild: ViewNode;
readonly lastChild: ViewNode;
readonly ownerDocument: DocumentNode;
getAttribute(key: string): any;
setAttribute(key: string, value: any): void;
setText(text: string): void;
onInsertedChild(childNode: ViewNode, index: number): void;
onRemovedChild(childNode: ViewNode): void;
insertBefore(childNode: ViewNode, referenceNode: ViewNode): void;
appendChild(childNode: ViewNode): void;
removeChild(childNode: ViewNode): void;
firstElement(): ViewNode;
}
| 34.515152 | 74 | 0.714662 |
f6e87f6a796bf357f86a7c4f276060b5ec057383 | 575 | sql | SQL | analytics-box/weblog-analytics/queries/proc_2711_update_mst_tduid_device_step1.sql | ryanmaclean/treasure-boxes | 034270a5184094fe086315da4b79225c4ffce027 | [
"MIT"
] | 52 | 2019-07-27T07:59:29.000Z | 2022-02-20T16:32:35.000Z | analytics-box/weblog-analytics/queries/proc_2711_update_mst_tduid_device_step1.sql | nomuryo7159/treasure-boxes | e6797f9855d588aac7803c95601eef7f5da2ccaa | [
"MIT"
] | 62 | 2019-07-23T08:18:32.000Z | 2022-02-10T01:48:24.000Z | analytics-box/weblog-analytics/queries/proc_2711_update_mst_tduid_device_step1.sql | nomuryo7159/treasure-boxes | e6797f9855d588aac7803c95601eef7f5da2ccaa | [
"MIT"
] | 54 | 2019-07-23T14:22:09.000Z | 2022-01-19T21:28:21.000Z | WITH log AS (
SELECT
td_uid
, MIN_BY(td_user_agent, IF(td_user_agent IS NULL, 99999999999, access_time)) AS td_user_agent
FROM
tmp_incr_trs_session
GROUP BY
td_uid
)
SELECT
td_uid
, REGEXP_REPLACE(COALESCE(TD_PARSE_AGENT(td_user_agent)['category'], 'unknown'), 'UNKNOWN', 'unknown') AS device_category
, REGEXP_REPLACE(COALESCE(TD_PARSE_AGENT(td_user_agent)['os'], 'unknown'), 'UNKNOWN', 'unknown') AS device_detail
, REGEXP_REPLACE(COALESCE(TD_PARSE_AGENT(td_user_agent)['name'], 'unknown'), 'UNKNOWN', 'unknown') AS device_browser
FROM
log
| 31.944444 | 123 | 0.74087 |
7a396a507b1594708d62b4b98b364b736ceffd40 | 1,794 | kt | Kotlin | Android_Zone_Test/src/com/example/mylib_test/activity/touch/ViewDragStudyActivity2.kt | luhaoaimama1/ZoneStudio24444 | 420b2bac6c7272997a0d95fe1ffcba7b957f7a19 | [
"MIT"
] | 69 | 2016-10-01T16:12:01.000Z | 2021-11-08T11:50:21.000Z | Android_Zone_Test/src/com/example/mylib_test/activity/touch/ViewDragStudyActivity2.kt | luhaoaimama1/ZoneStudio24444 | 420b2bac6c7272997a0d95fe1ffcba7b957f7a19 | [
"MIT"
] | 2 | 2017-01-18T08:09:31.000Z | 2017-01-23T02:33:25.000Z | Android_Zone_Test/src/com/example/mylib_test/activity/touch/ViewDragStudyActivity2.kt | luhaoaimama1/ZoneStudio24444 | 420b2bac6c7272997a0d95fe1ffcba7b957f7a19 | [
"MIT"
] | 18 | 2017-01-20T04:37:39.000Z | 2021-06-13T09:27:05.000Z | package com.example.mylib_test.activity.touch
import android.view.View
import com.example.mylib_test.R
import com.zone.lib.utils.activity_fragment_ui.ToastUtils
import androidx.customview.widget.ViewDragHelper
import com.zone.lib.base.controller.activity.BaseFeatureActivity
import com.zone.lib.base.controller.activity.controller.SwipeBackActivityController
import kotlinx.android.synthetic.main.a_viewdragstudy2.*
/**
* Created by Zone on 2016/1/29.
*/
class ViewDragStudyActivity2 : BaseFeatureActivity() {
override fun initBaseControllers() {
super.initBaseControllers()
unRegisterPrestener(SwipeBackActivityController::class.java)
}
override fun setContentView() {
setContentView(R.layout.a_viewdragstudy2)
}
override fun initData() {
}
override fun setListener() {
}
override fun onClick(v: View?) {
super.onClick(v)
when (v?.id) {
R.id.tv_back -> viewDragStudyFrame.toggle()
R.id.tv_moveEnable -> if (viewDragStudyFrame.isEnableMove) {
viewDragStudyFrame.isEnableMove = false
tv_moveEnable.text = "不!可以滑动"
} else {
viewDragStudyFrame.isEnableMove = true
tv_moveEnable.text = "可以滑动"
}
R.id.tv_mMenuView -> ToastUtils.showLong(this, "没有tryCaptureView 可以点击")
R.id.tv_leftOrRight -> if (viewDragStudyFrame.moveType == ViewDragHelper.EDGE_RIGHT) {
viewDragStudyFrame!!.moveType = ViewDragHelper.EDGE_LEFT
tv_leftOrRight.text = "左滑"
} else {
viewDragStudyFrame!!.moveType = ViewDragHelper.EDGE_RIGHT
tv_leftOrRight.text = "右滑"
}
else -> {
}
}
}
}
| 32.035714 | 98 | 0.645485 |
70ba56dd3bbfdee11e69d29bc32bdfd1cb247ff4 | 842 | h | C | include/Integrators/VolPathIntegrator.h | Jerry-Shen0527/SimpleRayTracer | a016c33ad456dcbd2dde633e616874bf9e5ee19a | [
"Apache-2.0"
] | null | null | null | include/Integrators/VolPathIntegrator.h | Jerry-Shen0527/SimpleRayTracer | a016c33ad456dcbd2dde633e616874bf9e5ee19a | [
"Apache-2.0"
] | null | null | null | include/Integrators/VolPathIntegrator.h | Jerry-Shen0527/SimpleRayTracer | a016c33ad456dcbd2dde633e616874bf9e5ee19a | [
"Apache-2.0"
] | null | null | null | //#pragma once
//
//#include "SamplerIntegrator.h"
//
//class VolPathIntegrator :public SamplerIntegrator
//{
//public:
// VolPathIntegrator(int maxDepth, std::shared_ptr<const Camera> camera,
// std::shared_ptr<Sampler> sampler,
// const Bounds2i& pixelBounds, Float rrThreshold = 1,
// const std::string& lightSampleStrategy = "spatial")
// : SamplerIntegrator(camera, sampler, pixelBounds),
// maxDepth(maxDepth),
// rrThreshold(rrThreshold),
// lightSampleStrategy(lightSampleStrategy) { }
//
// Spectrum Li(const RayDifferential& ray, const Scene& scene, Sampler& sampler, MemoryArena& arena,
// int depth) const override;
//
//private:
// // VolPathIntegrator Private Data
// const int maxDepth;
// const Float rrThreshold;
// const std::string lightSampleStrategy;
// std::unique_ptr<LightDistribution> lightDistribution;
//};
| 31.185185 | 100 | 0.736342 |
3c8f5b4df116e459e6fd3ec3ee2092ea9be986df | 2,357 | rs | Rust | socksx/examples/client.rs | onnovalkering/socksx | b7241cdbc9bd029f31a3f4fce33baf4d4e79e54f | [
"MIT"
] | 2 | 2021-07-24T10:11:38.000Z | 2021-08-19T08:03:21.000Z | socksx/examples/client.rs | onnovalkering/socksx | b7241cdbc9bd029f31a3f4fce33baf4d4e79e54f | [
"MIT"
] | null | null | null | socksx/examples/client.rs | onnovalkering/socksx | b7241cdbc9bd029f31a3f4fce33baf4d4e79e54f | [
"MIT"
] | 1 | 2021-08-17T09:28:46.000Z | 2021-08-17T09:28:46.000Z | use anyhow::Result;
use clap::{App, Arg};
use socksx::{Socks5Client, Socks6Client};
use tokio::io::AsyncWriteExt;
#[tokio::main]
async fn main() -> Result<()> {
let args = App::new("Client")
.arg(
Arg::new("VERSION")
.short('s')
.long("socks")
.help("The SOCKS version to use")
.possible_values(&["5", "6"])
.default_value("6"),
)
.arg(
Arg::new("PROXY_HOST")
.help("The IP/hostname of the proxy")
.default_value("127.0.0.1"),
)
.arg(
Arg::new("PROXY_PORT")
.help("The port of the proxy server")
.default_value("1080"),
)
.arg(
Arg::new("DEST_HOST")
.help("The IP/hostname of the destination")
.default_value("127.0.0.1"),
)
.arg(
Arg::new("DEST_PORT")
.help("The port of the destination server")
.default_value("12345"),
)
.get_matches();
let proxy_host = args.value_of("PROXY_HOST").unwrap();
let proxy_port = args.value_of("PROXY_PORT").unwrap();
let proxy_addr = format!("{}:{}", proxy_host, proxy_port);
let dest_host = args.value_of("DEST_HOST").unwrap();
let dest_port = args.value_of("DEST_PORT").unwrap();
let dest_addr = format!("{}:{}", dest_host, dest_port);
match args.value_of("VERSION") {
Some("5") => connect_v5(proxy_addr, dest_addr).await,
Some("6") => connect_v6(proxy_addr, dest_addr).await,
Some(version) => panic!("Unsupported version: {}", version),
None => unreachable!(),
}
}
///
///
///
async fn connect_v5(
proxy_addr: String,
dest_addr: String,
) -> Result<()> {
let client = Socks5Client::new(proxy_addr, None).await?;
let (mut outgoing, _) = client.connect(dest_addr).await?;
outgoing.write(String::from("Hello, world!\n").as_bytes()).await?;
Ok(())
}
///
///
///
async fn connect_v6(
proxy_addr: String,
dest_addr: String,
) -> Result<()> {
let client = Socks6Client::new(proxy_addr, None).await?;
let (mut outgoing, _) = client.connect(dest_addr, None, None).await?;
outgoing.write(String::from("Hello, world!\n").as_bytes()).await?;
Ok(())
}
| 28.059524 | 73 | 0.538821 |
d1ee41abb4ad4aef263bbf3933995013a39448e0 | 851 | swift | Swift | JSONConverter/Classes/Macros/Enums.swift | JmoVxia/JSONConverter | e35273379c8492da3f3378a06bb7cbdc8932a3e4 | [
"MIT"
] | 269 | 2020-09-02T06:53:28.000Z | 2022-03-01T02:18:46.000Z | JSONConverter/Classes/Macros/Enums.swift | JmoVxia/JSONConverter | e35273379c8492da3f3378a06bb7cbdc8932a3e4 | [
"MIT"
] | 18 | 2020-09-05T05:49:27.000Z | 2022-03-02T03:10:28.000Z | JSONConverter/Classes/Macros/Enums.swift | JmoVxia/JSONConverter | e35273379c8492da3f3378a06bb7cbdc8932a3e4 | [
"MIT"
] | 47 | 2020-09-04T01:58:26.000Z | 2022-02-15T05:56:29.000Z | //
// Enums.swift
// JSONConverter
//
// Created by DevYao on 2020/9/9.
// Copyright © 2020 DevYao. All rights reserved.
//
import Foundation
enum LangType: Int {
case Swift = 0
case HandyJSON
case SwiftyJSON
case ObjectMapper
case ObjC
case Flutter
case Codable
var language: String! {
switch self {
case .Swift, .HandyJSON, .SwiftyJSON, .ObjectMapper, .Codable:
return "swift"
case .ObjC:
return "objectivec"
case .Flutter:
return "dart"
}
}
}
enum StructType: Int {
case `struct` = 0
case `class`
}
struct LangStruct {
var langType: LangType
var structType: StructType
init(langType: LangType, structType: StructType) {
self.langType = langType
self.structType = structType
}
}
| 18.5 | 70 | 0.59342 |
c7cfca04a6d46c8657fca251fdef016d7c180a06 | 7,637 | py | Python | src/main.py | FranciscoCharles/doom-fire-simulator | fccd45e5c96d37de00a6979ec00a5e13a668d4d9 | [
"MIT"
] | 1 | 2021-05-19T16:12:37.000Z | 2021-05-19T16:12:37.000Z | src/main.py | FranciscoCharles/doom-fire-simulator | fccd45e5c96d37de00a6979ec00a5e13a668d4d9 | [
"MIT"
] | null | null | null | src/main.py | FranciscoCharles/doom-fire-simulator | fccd45e5c96d37de00a6979ec00a5e13a668d4d9 | [
"MIT"
] | null | null | null | #_*_coding:utf-8_*_
#created by FranciscoCharles in april,2021.
from os import environ
if 'PYGAME_HIDE_SUPPORT_PROMPT' not in environ:
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = 'hidden'
del environ
import pygame
import colorsys
import numpy as np
from menu import Menu, HslColor
from fire import FireColorArray
from random import randint
from typing import Tuple, List, Optional, NewType
RgbColor = Tuple[int,int,int]
def rgb_to_float(r:int, g:int, b:int) ->[HslColor]:
return (r/255, g/255, b/255)
def rgb_to_int(r:int, g:int, b:int) -> RgbColor:
return (int(r*255), int(g*255), int(b*255))
class DoomFireSimulator:
def __init__(self) -> None:
pygame.init()
pygame.font.init()
self.SCREEN_W = 830
self.SCREEN_H = 480
pygame.display.set_caption('FireDoomSimaltor v1.0.1')
self.display = pygame.display.set_mode((self.SCREEN_W,self.SCREEN_H))
icon = pygame.image.load('images/icon32.png')
pygame.display.set_icon(icon)
self.clock = pygame.time.Clock()
self.FPS = 20
self.on_fire = True
self.fire_size = (8,8)
self.fire_x = 40
self.fire_y = 40
self.decay_value = 3
self.wind_force = 7
self.wind_mi_force = 0
self.colors = self.selectColorPalette()
self.fire_array = FireColorArray(40,50)
self.setBaseFlameValue(len(self.colors)-1)
self.menu = Menu(len(self.colors)-1)
def selectColorPalette(self, options: Optional[HslColor] = None) -> List[RgbColor]:
self.colors = [
(7,7,7),(31,7,7),(47,15,7),(71,15,7),(87,23,7),(103,31,7),(119,31,7),(143,39,7),(159,47,7),(175,63,7),
(191,71,7),(199,71,7),(223,79,7),(223,87,7),(223,87,7),(215,95,7),(215,95,7),(215,103,15),(207,111,15),
(207,119,15),(207,127,15),(207,135,23),(199,135,23),(199,143,23),(199,151,31),(191,159,31),(191,159,31),
(191,167,39),(191,167,39),(191,175,47),(183,175,47),(183,183,47),(183,183,55),(207,207,111),(223,223,159),
(239,239,199),(255,255,255)]
if isinstance(options, tuple) and len(options)==3:
(shift_color, decay_l,decay_s) = options
shift_color = (shift_color%360)/360
result = []
for cor in self.colors:
cor = rgb_to_float(*cor)
(_,l,s) = colorsys.rgb_to_hls(*cor)
cor = colorsys.hls_to_rgb(shift_color, decay_l*l, decay_s*s)
result.append(rgb_to_int(*cor))
self.colors = result
return self.colors
def setBaseFlameValue(self, value: int) -> None:
row,columns = self.fire_array.shape
row -= 1
for column in range(columns):
self.fire_array[row,column] = value
def updatePixelFire(self, row: int, column: int) -> None:
decay = randint(0, self.decay_value)
shift = column + randint(self.wind_mi_force, self.wind_force)
self.fire_array[row, shift] = (self.fire_array[row+1, column]-decay)
if self.fire_array[row, shift]<0:
self.fire_array[row, shift] = 0
return shift
def evaporateFire(self) -> None:
rows,columns = self.fire_array.shape
for row in range(rows-1):
for column in range(columns):
self.updatePixelFire(row, column)
def drawFire(self) -> None:
rows,columns = self.fire_array.shape
w,h = self.fire_size
for row in range(rows):
for column in range(columns):
color = self.fire_array[row,column]
rect = (self.fire_x+column*w,self.fire_y+row*h,w,h)
pygame.draw.rect(self.display, self.colors[color], rect)
self.evaporateFire()
@property
def rectFire(self) -> Tuple[int,int,int,int]:
h,w = self.fire_array.shape
return (self.fire_x, self.fire_y, w*self.fire_size[0], h*self.fire_size[1])
def run(self) -> None:
ticks = 0
game = True
draw_menu = True
valid_keys = ['q','w','a','s','z','left','right','up','down']
key_pressed = ''
(x,y,w,h) = self.rectFire
fire_rect = (x-1, y-1, w+2, h+2)
rect_menu = (399, 39, 392, 402)
positions = self.menu.getListPositionMenu(620, 94)
pygame.draw.rect(self.display, (0xaaaaaa), fire_rect, 1)
while game:
self.clock.tick(self.FPS)
for e in pygame.event.get():
if e.type == pygame.QUIT:
game = False
break
elif e.type == pygame.KEYDOWN:
key = pygame.key.name(e.key)
if key == 'escape':
game = False
break
elif key in valid_keys:
ticks = pygame.time.get_ticks()
key_pressed = key
getattr(self, key_pressed)()
draw_menu = True
elif e.type == pygame.KEYUP:
key_pressed = ''
if key_pressed and (pygame.time.get_ticks()-ticks)>500:
getattr(self, key_pressed)()
draw_menu = True
if game:
if draw_menu:
pygame.draw.rect(self.display, (0), rect_menu)
self.menu.draw(self.display, positions)
pygame.draw.rect(self.display, (0xaaaaaa), rect_menu, 1)
pygame.display.update(rect_menu)
draw_menu = False
self.drawFire()
pygame.display.update(fire_rect)
self.stop()
def changePalette(self) -> None:
color = None
if self.menu['color intensity']['value']:
color = self.menu.currentColorValue()
self.selectColorPalette(color)
def updateSimulationValues(self) -> None:
name = self.menu.name
if name=='FPS':
self.FPS = self.menu['FPS']['value']
elif name=='decay':
self.decay_value = self.menu['decay']['value']
elif name=='wind direction':
type_index = self.menu['wind direction']['value']
type_value = self.menu['wind direction']['types'][type_index]
wind_force = self.menu['wind force']['value']
if type_value=='left':
self.wind_mi_force = 0
self.wind_force = wind_force
elif type_value=='right':
self.wind_mi_force = -wind_force
self.wind_force = 0
else:
self.wind_force = wind_force
self.wind_mi_force = -wind_force
elif name=='wind force':
self.wind_force = self.menu['wind force']['value']
elif name in ['H','S','L','color intensity']:
self.changePalette()
def left(self) -> None:
self.menu.decrement()
self.updateSimulationValues()
def right(self) -> None:
self.menu.increment()
self.updateSimulationValues()
def up(self) -> None:
self.menu.up()
def down(self) -> None:
self.menu.down()
def a(self) -> None:
self.left()
def s(self) -> None:
self.right()
def w(self) -> None:
self.up()
def z(self) -> None:
self.down()
def q(self) -> None:
self.on_fire = not self.on_fire
self.setBaseFlameValue((len(self.colors)-1) if self.on_fire else 0)
def stop(self) -> None:
pygame.quit()
if __name__ == '__main__':
DoomFireSimulator().run()
| 35.52093 | 118 | 0.552573 |
b1676af4281c36f8f0dabaa1553902603df72ed8 | 5,593 | h | C | NeoMathEngine/src/CPU/x86/avx/src/JitDebug.h | FedyuninV/neoml | b77bbd8d188ca3830d6c2dd5d54e79936b4a7a90 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | NeoMathEngine/src/CPU/x86/avx/src/JitDebug.h | FedyuninV/neoml | b77bbd8d188ca3830d6c2dd5d54e79936b4a7a90 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | NeoMathEngine/src/CPU/x86/avx/src/JitDebug.h | FedyuninV/neoml | b77bbd8d188ca3830d6c2dd5d54e79936b4a7a90 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | /* Copyright © 2017-2020 ABBYY Production LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--------------------------------------------------------------------------------------------------------------*/
#pragma once
#include <map>
#include <chrono>
namespace NeoML {
#ifdef JIT_DEBUG
static bool printTimers = getenv( "PRINT_TIMERS" ) != nullptr;
#endif
class CJitDebug {
public:
struct CKey{
int filterCount;
int channelCount;
int filterHeight;
int filterWidth;
int paddingHeight;
int paddingWidth;
int strideHeight;
int strideWidth;
int dilationHeight;
int dilationWidth;
int resultHeight;
int resultWidth;
bool operator==( const CKey& lhs ) const {
return memcmp( this, &lhs, sizeof( CKey ) ) == 0;
}
struct Hasher
{
size_t operator()( const CKey& key ) const {
size_t hash = 0;
const size_t* keyPtr = reinterpret_cast<const size_t*>( &key );
for( int i = 0; i < sizeof( key ) / sizeof( size_t ); i++ ) {
hash ^= keyPtr[i];
}
return hash;
}
};
};
struct CResult{
CResult() : count( 0 ), reuseCount( 0 ), prepareMs( 0.0f ), processMs( 0.0f ), codeSize( 0 ) {}
size_t count;
size_t reuseCount;
std::chrono::duration<float> prepareMs;
std::chrono::duration<float> processMs;
size_t codeSize;
};
public:
#ifndef JIT_DEBUG
CJitDebug( ... ) {}
~CJitDebug() {}
void StartPrepare() {}
void StopPrepare() {}
void StartProcess() {}
void StopProcess() {}
void SetCodeSize( size_t ) {}
void PrintResult() {}
# else
CJitDebug( int filterCount, int channelCount, int filterHeight, int filterWidth,
int paddingHeight, int paddingWidth, int strideHeight, int strideWidth,
int dilationHeight, int dilationWidth, int resultHeight, int resultWidth
) : key{ filterCount, channelCount, filterHeight, filterWidth,
paddingHeight, paddingWidth, strideHeight, strideWidth,
dilationHeight, dilationWidth, resultHeight, resultWidth },
prepareMs( 0.0f ), processMs( 0.0f ), codeSize( 0 ) {}
~CJitDebug() {
auto& inst = res[key];
inst.count++;
inst.prepareMs += prepareMs;
inst.processMs += processMs;
inst.codeSize += codeSize;
if( codeSize == 0 ) {
inst.reuseCount++;
}
}
void StartPrepare() {
prepareMsStart = Time::now();
}
void StopPrepare() {
prepareMs += Time::now() - prepareMsStart;
}
void StartProcess() {
processMsStart = Time::now();
}
void StopProcess() {
processMs += Time::now() - processMsStart;
}
void SetCodeSize( size_t _codeSize ) {
codeSize = _codeSize;
}
static void PrintResult() {
if( printTimers ) {
printf( "FC;C;FW;FH;DW;DH;SW;SH;PW;PH;RW;RH;_jit_;count;reuse count;prepare, ms;process, ms;code size, B\n" );
for( auto& item : res ) {
printf( "%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;_jit_;%lu;%lu;%.4f;%.4f;%lu\n",
item.first.filterCount,
item.first.channelCount,
item.first.filterHeight,
item.first.filterWidth,
item.first.dilationHeight,
item.first.dilationWidth,
item.first.strideHeight,
item.first.strideWidth,
item.first.paddingHeight,
item.first.paddingWidth,
item.first.resultHeight,
item.first.resultWidth,
item.second.count,
item.second.reuseCount,
std::chrono::duration_cast<us>( item.second.prepareMs ).count() / 1000.,
std::chrono::duration_cast<us>( item.second.processMs ).count() / 1000.,
item.second.codeSize );
}
}
}
private:
typedef std::chrono::high_resolution_clock Time;
typedef std::chrono::microseconds us;
typedef std::chrono::duration<float> fsec;
CKey key;
std::chrono::duration<float> prepareMs;
std::chrono::time_point<std::chrono::system_clock> prepareMsStart;
std::chrono::duration<float> processMs;
std::chrono::time_point<std::chrono::system_clock> processMsStart;
size_t codeSize;
#endif
private:
static std::unordered_map<CKey, CResult, CKey::Hasher> res;
};
std::unordered_map<CJitDebug::CKey, CJitDebug::CResult, CJitDebug::CKey::Hasher> CJitDebug::res;
class CJitDebugHolder {
public:
CJitDebugHolder() {}
~CJitDebugHolder() {
#ifdef JIT_DEBUG
CJitDebug::PrintResult();
#endif
}
};
static CJitDebugHolder jitDebugHolder;
} // namespace NeoML
| 33.094675 | 122 | 0.562846 |
c15a6e9e5bf48fae118e367c551d05a9e44796ea | 33,563 | rs | Rust | src/libcollections/trie.rs | renato-zannon/rust | 61d65cd56e5a6563161b373d10be7501548a52f1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | src/libcollections/trie.rs | renato-zannon/rust | 61d65cd56e5a6563161b373d10be7501548a52f1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | src/libcollections/trie.rs | renato-zannon/rust | 61d65cd56e5a6563161b373d10be7501548a52f1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Ordered containers with integer keys, implemented as radix tries (`TrieSet` and `TrieMap` types)
use core::prelude::*;
use alloc::owned::Box;
use core::mem::zeroed;
use core::mem;
use core::uint;
use slice::{Items, MutItems};
use slice;
// FIXME: #5244: need to manually update the TrieNode constructor
static SHIFT: uint = 4;
static SIZE: uint = 1 << SHIFT;
static MASK: uint = SIZE - 1;
static NUM_CHUNKS: uint = uint::BITS / SHIFT;
enum Child<T> {
Internal(Box<TrieNode<T>>),
External(uint, T),
Nothing
}
#[allow(missing_doc)]
pub struct TrieMap<T> {
root: TrieNode<T>,
length: uint
}
impl<T> Container for TrieMap<T> {
/// Return the number of elements in the map
#[inline]
fn len(&self) -> uint { self.length }
}
impl<T> Mutable for TrieMap<T> {
/// Clear the map, removing all values.
#[inline]
fn clear(&mut self) {
self.root = TrieNode::new();
self.length = 0;
}
}
impl<T> Map<uint, T> for TrieMap<T> {
/// Return a reference to the value corresponding to the key
#[inline]
fn find<'a>(&'a self, key: &uint) -> Option<&'a T> {
let mut node: &'a TrieNode<T> = &self.root;
let mut idx = 0;
loop {
match node.children[chunk(*key, idx)] {
Internal(ref x) => node = &**x,
External(stored, ref value) => {
if stored == *key {
return Some(value)
} else {
return None
}
}
Nothing => return None
}
idx += 1;
}
}
}
impl<T> MutableMap<uint, T> for TrieMap<T> {
/// Return a mutable reference to the value corresponding to the key
#[inline]
fn find_mut<'a>(&'a mut self, key: &uint) -> Option<&'a mut T> {
find_mut(&mut self.root.children[chunk(*key, 0)], *key, 1)
}
/// Insert a key-value pair from the map. If the key already had a value
/// present in the map, that value is returned. Otherwise None is returned.
fn swap(&mut self, key: uint, value: T) -> Option<T> {
let ret = insert(&mut self.root.count,
&mut self.root.children[chunk(key, 0)],
key, value, 1);
if ret.is_none() { self.length += 1 }
ret
}
/// Removes a key from the map, returning the value at the key if the key
/// was previously in the map.
fn pop(&mut self, key: &uint) -> Option<T> {
let ret = remove(&mut self.root.count,
&mut self.root.children[chunk(*key, 0)],
*key, 1);
if ret.is_some() { self.length -= 1 }
ret
}
}
impl<T> TrieMap<T> {
/// Create an empty TrieMap
#[inline]
pub fn new() -> TrieMap<T> {
TrieMap{root: TrieNode::new(), length: 0}
}
/// Visit all key-value pairs in reverse order
#[inline]
pub fn each_reverse<'a>(&'a self, f: |&uint, &'a T| -> bool) -> bool {
self.root.each_reverse(f)
}
/// Get an iterator over the key-value pairs in the map
pub fn iter<'a>(&'a self) -> Entries<'a, T> {
let mut iter = unsafe {Entries::new()};
iter.stack[0] = self.root.children.iter();
iter.length = 1;
iter.remaining_min = self.length;
iter.remaining_max = self.length;
iter
}
/// Get an iterator over the key-value pairs in the map, with the
/// ability to mutate the values.
pub fn mut_iter<'a>(&'a mut self) -> MutEntries<'a, T> {
let mut iter = unsafe {MutEntries::new()};
iter.stack[0] = self.root.children.mut_iter();
iter.length = 1;
iter.remaining_min = self.length;
iter.remaining_max = self.length;
iter
}
}
// FIXME #5846 we want to be able to choose between &x and &mut x
// (with many different `x`) below, so we need to optionally pass mut
// as a tt, but the only thing we can do with a `tt` is pass them to
// other macros, so this takes the `& <mutability> <operand>` token
// sequence and forces their evaluation as an expression. (see also
// `item!` below.)
macro_rules! addr { ($e:expr) => { $e } }
macro_rules! bound {
($iterator_name:ident,
// the current treemap
self = $this:expr,
// the key to look for
key = $key:expr,
// are we looking at the upper bound?
is_upper = $upper:expr,
// method names for slicing/iterating.
slice_from = $slice_from:ident,
iter = $iter:ident,
// see the comment on `addr!`, this is just an optional mut, but
// there's no 0-or-1 repeats yet.
mutability = $($mut_:tt)*) => {
{
// # For `mut`
// We need an unsafe pointer here because we are borrowing
// mutable references to the internals of each of these
// mutable nodes, while still using the outer node.
//
// However, we're allowed to flaunt rustc like this because we
// never actually modify the "shape" of the nodes. The only
// place that mutation is can actually occur is of the actual
// values of the TrieMap (as the return value of the
// iterator), i.e. we can never cause a deallocation of any
// TrieNodes so the raw pointer is always valid.
//
// # For non-`mut`
// We like sharing code so much that even a little unsafe won't
// stop us.
let this = $this;
let mut node = addr!(& $($mut_)* this.root as * $($mut_)* TrieNode<T>);
let key = $key;
let mut it = unsafe {$iterator_name::new()};
// everything else is zero'd, as we want.
it.remaining_max = this.length;
// this addr is necessary for the `Internal` pattern.
addr!(loop {
let children = unsafe {addr!(& $($mut_)* (*node).children)};
// it.length is the current depth in the iterator and the
// current depth through the `uint` key we've traversed.
let child_id = chunk(key, it.length);
let (slice_idx, ret) = match children[child_id] {
Internal(ref $($mut_)* n) => {
node = addr!(& $($mut_)* **n as * $($mut_)* TrieNode<T>);
(child_id + 1, false)
}
External(stored, _) => {
(if stored < key || ($upper && stored == key) {
child_id + 1
} else {
child_id
}, true)
}
Nothing => {
(child_id + 1, true)
}
};
// push to the stack.
it.stack[it.length] = children.$slice_from(slice_idx).$iter();
it.length += 1;
if ret { return it }
})
}
}
}
impl<T> TrieMap<T> {
// If `upper` is true then returns upper_bound else returns lower_bound.
#[inline]
fn bound<'a>(&'a self, key: uint, upper: bool) -> Entries<'a, T> {
bound!(Entries, self = self,
key = key, is_upper = upper,
slice_from = slice_from, iter = iter,
mutability = )
}
/// Get an iterator pointing to the first key-value pair whose key is not less than `key`.
/// If all keys in the map are less than `key` an empty iterator is returned.
pub fn lower_bound<'a>(&'a self, key: uint) -> Entries<'a, T> {
self.bound(key, false)
}
/// Get an iterator pointing to the first key-value pair whose key is greater than `key`.
/// If all keys in the map are not greater than `key` an empty iterator is returned.
pub fn upper_bound<'a>(&'a self, key: uint) -> Entries<'a, T> {
self.bound(key, true)
}
// If `upper` is true then returns upper_bound else returns lower_bound.
#[inline]
fn mut_bound<'a>(&'a mut self, key: uint, upper: bool) -> MutEntries<'a, T> {
bound!(MutEntries, self = self,
key = key, is_upper = upper,
slice_from = mut_slice_from, iter = mut_iter,
mutability = mut)
}
/// Get an iterator pointing to the first key-value pair whose key is not less than `key`.
/// If all keys in the map are less than `key` an empty iterator is returned.
pub fn mut_lower_bound<'a>(&'a mut self, key: uint) -> MutEntries<'a, T> {
self.mut_bound(key, false)
}
/// Get an iterator pointing to the first key-value pair whose key is greater than `key`.
/// If all keys in the map are not greater than `key` an empty iterator is returned.
pub fn mut_upper_bound<'a>(&'a mut self, key: uint) -> MutEntries<'a, T> {
self.mut_bound(key, true)
}
}
impl<T> FromIterator<(uint, T)> for TrieMap<T> {
fn from_iter<Iter: Iterator<(uint, T)>>(iter: Iter) -> TrieMap<T> {
let mut map = TrieMap::new();
map.extend(iter);
map
}
}
impl<T> Extendable<(uint, T)> for TrieMap<T> {
fn extend<Iter: Iterator<(uint, T)>>(&mut self, mut iter: Iter) {
for (k, v) in iter {
self.insert(k, v);
}
}
}
#[allow(missing_doc)]
pub struct TrieSet {
map: TrieMap<()>
}
impl Container for TrieSet {
/// Return the number of elements in the set
#[inline]
fn len(&self) -> uint { self.map.len() }
}
impl Mutable for TrieSet {
/// Clear the set, removing all values.
#[inline]
fn clear(&mut self) { self.map.clear() }
}
impl Set<uint> for TrieSet {
#[inline]
fn contains(&self, value: &uint) -> bool {
self.map.contains_key(value)
}
#[inline]
fn is_disjoint(&self, other: &TrieSet) -> bool {
self.iter().all(|v| !other.contains(&v))
}
#[inline]
fn is_subset(&self, other: &TrieSet) -> bool {
self.iter().all(|v| other.contains(&v))
}
#[inline]
fn is_superset(&self, other: &TrieSet) -> bool {
other.is_subset(self)
}
}
impl MutableSet<uint> for TrieSet {
#[inline]
fn insert(&mut self, value: uint) -> bool {
self.map.insert(value, ())
}
#[inline]
fn remove(&mut self, value: &uint) -> bool {
self.map.remove(value)
}
}
impl TrieSet {
/// Create an empty TrieSet
#[inline]
pub fn new() -> TrieSet {
TrieSet{map: TrieMap::new()}
}
/// Visit all values in reverse order
#[inline]
pub fn each_reverse(&self, f: |&uint| -> bool) -> bool {
self.map.each_reverse(|k, _| f(k))
}
/// Get an iterator over the values in the set
#[inline]
pub fn iter<'a>(&'a self) -> SetItems<'a> {
SetItems{iter: self.map.iter()}
}
/// Get an iterator pointing to the first value that is not less than `val`.
/// If all values in the set are less than `val` an empty iterator is returned.
pub fn lower_bound<'a>(&'a self, val: uint) -> SetItems<'a> {
SetItems{iter: self.map.lower_bound(val)}
}
/// Get an iterator pointing to the first value that key is greater than `val`.
/// If all values in the set are not greater than `val` an empty iterator is returned.
pub fn upper_bound<'a>(&'a self, val: uint) -> SetItems<'a> {
SetItems{iter: self.map.upper_bound(val)}
}
}
impl FromIterator<uint> for TrieSet {
fn from_iter<Iter: Iterator<uint>>(iter: Iter) -> TrieSet {
let mut set = TrieSet::new();
set.extend(iter);
set
}
}
impl Extendable<uint> for TrieSet {
fn extend<Iter: Iterator<uint>>(&mut self, mut iter: Iter) {
for elem in iter {
self.insert(elem);
}
}
}
struct TrieNode<T> {
count: uint,
children: [Child<T>, ..SIZE]
}
impl<T> TrieNode<T> {
#[inline]
fn new() -> TrieNode<T> {
// FIXME: #5244: [Nothing, ..SIZE] should be possible without implicit
// copyability
TrieNode{count: 0,
children: [Nothing, Nothing, Nothing, Nothing,
Nothing, Nothing, Nothing, Nothing,
Nothing, Nothing, Nothing, Nothing,
Nothing, Nothing, Nothing, Nothing]}
}
}
impl<T> TrieNode<T> {
fn each_reverse<'a>(&'a self, f: |&uint, &'a T| -> bool) -> bool {
for elt in self.children.iter().rev() {
match *elt {
Internal(ref x) => if !x.each_reverse(|i,t| f(i,t)) { return false },
External(k, ref v) => if !f(&k, v) { return false },
Nothing => ()
}
}
true
}
}
// if this was done via a trait, the key could be generic
#[inline]
fn chunk(n: uint, idx: uint) -> uint {
let sh = uint::BITS - (SHIFT * (idx + 1));
(n >> sh) & MASK
}
fn find_mut<'r, T>(child: &'r mut Child<T>, key: uint, idx: uint) -> Option<&'r mut T> {
match *child {
External(stored, ref mut value) if stored == key => Some(value),
External(..) => None,
Internal(ref mut x) => find_mut(&mut x.children[chunk(key, idx)], key, idx + 1),
Nothing => None
}
}
fn insert<T>(count: &mut uint, child: &mut Child<T>, key: uint, value: T,
idx: uint) -> Option<T> {
// we branch twice to avoid having to do the `replace` when we
// don't need to; this is much faster, especially for keys that
// have long shared prefixes.
match *child {
Nothing => {
*count += 1;
*child = External(key, value);
return None;
}
Internal(ref mut x) => {
return insert(&mut x.count, &mut x.children[chunk(key, idx)], key, value, idx + 1);
}
External(stored_key, ref mut stored_value) if stored_key == key => {
// swap in the new value and return the old.
return Some(mem::replace(stored_value, value));
}
_ => {}
}
// conflict, an external node with differing keys: we have to
// split the node, so we need the old value by value; hence we
// have to move out of `child`.
match mem::replace(child, Nothing) {
External(stored_key, stored_value) => {
let mut new = box TrieNode::new();
insert(&mut new.count,
&mut new.children[chunk(stored_key, idx)],
stored_key, stored_value, idx + 1);
let ret = insert(&mut new.count, &mut new.children[chunk(key, idx)],
key, value, idx + 1);
*child = Internal(new);
return ret;
}
_ => fail!("unreachable code"),
}
}
fn remove<T>(count: &mut uint, child: &mut Child<T>, key: uint,
idx: uint) -> Option<T> {
let (ret, this) = match *child {
External(stored, _) if stored == key => {
match mem::replace(child, Nothing) {
External(_, value) => (Some(value), true),
_ => fail!()
}
}
External(..) => (None, false),
Internal(ref mut x) => {
let ret = remove(&mut x.count, &mut x.children[chunk(key, idx)],
key, idx + 1);
(ret, x.count == 0)
}
Nothing => (None, false)
};
if this {
*child = Nothing;
*count -= 1;
}
return ret;
}
/// Forward iterator over a map
pub struct Entries<'a, T> {
stack: [slice::Items<'a, Child<T>>, .. NUM_CHUNKS],
length: uint,
remaining_min: uint,
remaining_max: uint
}
/// Forward iterator over the key-value pairs of a map, with the
/// values being mutable.
pub struct MutEntries<'a, T> {
stack: [slice::MutItems<'a, Child<T>>, .. NUM_CHUNKS],
length: uint,
remaining_min: uint,
remaining_max: uint
}
// FIXME #5846: see `addr!` above.
macro_rules! item { ($i:item) => {$i}}
macro_rules! iterator_impl {
($name:ident,
iter = $iter:ident,
mutability = $($mut_:tt)*) => {
impl<'a, T> $name<'a, T> {
// Create new zero'd iterator. We have a thin gilding of safety by
// using init rather than uninit, so that the worst that can happen
// from failing to initialise correctly after calling these is a
// segfault.
#[cfg(target_word_size="32")]
unsafe fn new() -> $name<'a, T> {
$name {
remaining_min: 0,
remaining_max: 0,
length: 0,
// ick :( ... at least the compiler will tell us if we screwed up.
stack: [zeroed(), zeroed(), zeroed(), zeroed(), zeroed(),
zeroed(), zeroed(), zeroed()]
}
}
#[cfg(target_word_size="64")]
unsafe fn new() -> $name<'a, T> {
$name {
remaining_min: 0,
remaining_max: 0,
length: 0,
stack: [zeroed(), zeroed(), zeroed(), zeroed(),
zeroed(), zeroed(), zeroed(), zeroed(),
zeroed(), zeroed(), zeroed(), zeroed(),
zeroed(), zeroed(), zeroed(), zeroed()]
}
}
}
item!(impl<'a, T> Iterator<(uint, &'a $($mut_)* T)> for $name<'a, T> {
// you might wonder why we're not even trying to act within the
// rules, and are just manipulating raw pointers like there's no
// such thing as invalid pointers and memory unsafety. The
// reason is performance, without doing this we can get the
// bench_iter_large microbenchmark down to about 30000 ns/iter
// (using .unsafe_ref to index self.stack directly, 38000
// ns/iter with [] checked indexing), but this smashes that down
// to 13500 ns/iter.
//
// Fortunately, it's still safe...
//
// We have an invariant that every Internal node
// corresponds to one push to self.stack, and one pop,
// nested appropriately. self.stack has enough storage
// to store the maximum depth of Internal nodes in the
// trie (8 on 32-bit platforms, 16 on 64-bit).
fn next(&mut self) -> Option<(uint, &'a $($mut_)* T)> {
let start_ptr = self.stack.as_mut_ptr();
unsafe {
// write_ptr is the next place to write to the stack.
// invariant: start_ptr <= write_ptr < end of the
// vector.
let mut write_ptr = start_ptr.offset(self.length as int);
while write_ptr != start_ptr {
// indexing back one is safe, since write_ptr >
// start_ptr now.
match (*write_ptr.offset(-1)).next() {
// exhausted this iterator (i.e. finished this
// Internal node), so pop from the stack.
//
// don't bother clearing the memory, because the
// next time we use it we'll've written to it
// first.
None => write_ptr = write_ptr.offset(-1),
Some(child) => {
addr!(match *child {
Internal(ref $($mut_)* node) => {
// going down a level, so push
// to the stack (this is the
// write referenced above)
*write_ptr = node.children.$iter();
write_ptr = write_ptr.offset(1);
}
External(key, ref $($mut_)* value) => {
self.remaining_max -= 1;
if self.remaining_min > 0 {
self.remaining_min -= 1;
}
// store the new length of the
// stack, based on our current
// position.
self.length = (write_ptr as uint
- start_ptr as uint) /
mem::size_of_val(&*write_ptr);
return Some((key, value));
}
Nothing => {}
})
}
}
}
}
return None;
}
#[inline]
fn size_hint(&self) -> (uint, Option<uint>) {
(self.remaining_min, Some(self.remaining_max))
}
})
}
}
iterator_impl! { Entries, iter = iter, mutability = }
iterator_impl! { MutEntries, iter = mut_iter, mutability = mut }
/// Forward iterator over a set
pub struct SetItems<'a> {
iter: Entries<'a, ()>
}
impl<'a> Iterator<uint> for SetItems<'a> {
fn next(&mut self) -> Option<uint> {
self.iter.next().map(|(key, _)| key)
}
fn size_hint(&self) -> (uint, Option<uint>) {
self.iter.size_hint()
}
}
#[cfg(test)]
mod test_map {
use std::prelude::*;
use std::iter::range_step;
use std::uint;
use super::{TrieMap, TrieNode, Internal, External, Nothing};
fn check_integrity<T>(trie: &TrieNode<T>) {
assert!(trie.count != 0);
let mut sum = 0;
for x in trie.children.iter() {
match *x {
Nothing => (),
Internal(ref y) => {
check_integrity(&**y);
sum += 1
}
External(_, _) => { sum += 1 }
}
}
assert_eq!(sum, trie.count);
}
#[test]
fn test_find_mut() {
let mut m = TrieMap::new();
assert!(m.insert(1, 12));
assert!(m.insert(2, 8));
assert!(m.insert(5, 14));
let new = 100;
match m.find_mut(&5) {
None => fail!(), Some(x) => *x = new
}
assert_eq!(m.find(&5), Some(&new));
}
#[test]
fn test_find_mut_missing() {
let mut m = TrieMap::new();
assert!(m.find_mut(&0).is_none());
assert!(m.insert(1, 12));
assert!(m.find_mut(&0).is_none());
assert!(m.insert(2, 8));
assert!(m.find_mut(&0).is_none());
}
#[test]
fn test_step() {
let mut trie = TrieMap::new();
let n = 300u;
for x in range_step(1u, n, 2) {
assert!(trie.insert(x, x + 1));
assert!(trie.contains_key(&x));
check_integrity(&trie.root);
}
for x in range_step(0u, n, 2) {
assert!(!trie.contains_key(&x));
assert!(trie.insert(x, x + 1));
check_integrity(&trie.root);
}
for x in range(0u, n) {
assert!(trie.contains_key(&x));
assert!(!trie.insert(x, x + 1));
check_integrity(&trie.root);
}
for x in range_step(1u, n, 2) {
assert!(trie.remove(&x));
assert!(!trie.contains_key(&x));
check_integrity(&trie.root);
}
for x in range_step(0u, n, 2) {
assert!(trie.contains_key(&x));
assert!(!trie.insert(x, x + 1));
check_integrity(&trie.root);
}
}
#[test]
fn test_each_reverse() {
let mut m = TrieMap::new();
assert!(m.insert(3, 6));
assert!(m.insert(0, 0));
assert!(m.insert(4, 8));
assert!(m.insert(2, 4));
assert!(m.insert(1, 2));
let mut n = 4;
m.each_reverse(|k, v| {
assert_eq!(*k, n);
assert_eq!(*v, n * 2);
n -= 1;
true
});
}
#[test]
fn test_each_reverse_break() {
let mut m = TrieMap::new();
for x in range(uint::MAX - 10000, uint::MAX).rev() {
m.insert(x, x / 2);
}
let mut n = uint::MAX - 1;
m.each_reverse(|k, v| {
if n == uint::MAX - 5000 { false } else {
assert!(n > uint::MAX - 5000);
assert_eq!(*k, n);
assert_eq!(*v, n / 2);
n -= 1;
true
}
});
}
#[test]
fn test_swap() {
let mut m = TrieMap::new();
assert_eq!(m.swap(1, 2), None);
assert_eq!(m.swap(1, 3), Some(2));
assert_eq!(m.swap(1, 4), Some(3));
}
#[test]
fn test_pop() {
let mut m = TrieMap::new();
m.insert(1, 2);
assert_eq!(m.pop(&1), Some(2));
assert_eq!(m.pop(&1), None);
}
#[test]
fn test_from_iter() {
let xs = vec![(1u, 1i), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
let map: TrieMap<int> = xs.iter().map(|&x| x).collect();
for &(k, v) in xs.iter() {
assert_eq!(map.find(&k), Some(&v));
}
}
#[test]
fn test_iteration() {
let empty_map : TrieMap<uint> = TrieMap::new();
assert_eq!(empty_map.iter().next(), None);
let first = uint::MAX - 10000;
let last = uint::MAX;
let mut map = TrieMap::new();
for x in range(first, last).rev() {
map.insert(x, x / 2);
}
let mut i = 0;
for (k, &v) in map.iter() {
assert_eq!(k, first + i);
assert_eq!(v, k / 2);
i += 1;
}
assert_eq!(i, last - first);
}
#[test]
fn test_mut_iter() {
let mut empty_map : TrieMap<uint> = TrieMap::new();
assert!(empty_map.mut_iter().next().is_none());
let first = uint::MAX - 10000;
let last = uint::MAX;
let mut map = TrieMap::new();
for x in range(first, last).rev() {
map.insert(x, x / 2);
}
let mut i = 0;
for (k, v) in map.mut_iter() {
assert_eq!(k, first + i);
*v -= k / 2;
i += 1;
}
assert_eq!(i, last - first);
assert!(map.iter().all(|(_, &v)| v == 0));
}
#[test]
fn test_bound() {
let empty_map : TrieMap<uint> = TrieMap::new();
assert_eq!(empty_map.lower_bound(0).next(), None);
assert_eq!(empty_map.upper_bound(0).next(), None);
let last = 999u;
let step = 3u;
let value = 42u;
let mut map : TrieMap<uint> = TrieMap::new();
for x in range_step(0u, last, step) {
assert!(x % step == 0);
map.insert(x, value);
}
for i in range(0u, last - step) {
let mut lb = map.lower_bound(i);
let mut ub = map.upper_bound(i);
let next_key = i - i % step + step;
let next_pair = (next_key, &value);
if i % step == 0 {
assert_eq!(lb.next(), Some((i, &value)));
} else {
assert_eq!(lb.next(), Some(next_pair));
}
assert_eq!(ub.next(), Some(next_pair));
}
let mut lb = map.lower_bound(last - step);
assert_eq!(lb.next(), Some((last - step, &value)));
let mut ub = map.upper_bound(last - step);
assert_eq!(ub.next(), None);
for i in range(last - step + 1, last) {
let mut lb = map.lower_bound(i);
assert_eq!(lb.next(), None);
let mut ub = map.upper_bound(i);
assert_eq!(ub.next(), None);
}
}
#[test]
fn test_mut_bound() {
let empty_map : TrieMap<uint> = TrieMap::new();
assert_eq!(empty_map.lower_bound(0).next(), None);
assert_eq!(empty_map.upper_bound(0).next(), None);
let mut m_lower = TrieMap::new();
let mut m_upper = TrieMap::new();
for i in range(0u, 100) {
m_lower.insert(2 * i, 4 * i);
m_upper.insert(2 * i, 4 * i);
}
for i in range(0u, 199) {
let mut lb_it = m_lower.mut_lower_bound(i);
let (k, v) = lb_it.next().unwrap();
let lb = i + i % 2;
assert_eq!(lb, k);
*v -= k;
}
for i in range(0u, 198) {
let mut ub_it = m_upper.mut_upper_bound(i);
let (k, v) = ub_it.next().unwrap();
let ub = i + 2 - i % 2;
assert_eq!(ub, k);
*v -= k;
}
assert!(m_lower.mut_lower_bound(199).next().is_none());
assert!(m_upper.mut_upper_bound(198).next().is_none());
assert!(m_lower.iter().all(|(_, &x)| x == 0));
assert!(m_upper.iter().all(|(_, &x)| x == 0));
}
}
#[cfg(test)]
mod bench_map {
use std::prelude::*;
use std::rand::{weak_rng, Rng};
use test::Bencher;
use super::TrieMap;
#[bench]
fn bench_iter_small(b: &mut Bencher) {
let mut m = TrieMap::<uint>::new();
let mut rng = weak_rng();
for _ in range(0, 20) {
m.insert(rng.gen(), rng.gen());
}
b.iter(|| for _ in m.iter() {})
}
#[bench]
fn bench_iter_large(b: &mut Bencher) {
let mut m = TrieMap::<uint>::new();
let mut rng = weak_rng();
for _ in range(0, 1000) {
m.insert(rng.gen(), rng.gen());
}
b.iter(|| for _ in m.iter() {})
}
#[bench]
fn bench_lower_bound(b: &mut Bencher) {
let mut m = TrieMap::<uint>::new();
let mut rng = weak_rng();
for _ in range(0, 1000) {
m.insert(rng.gen(), rng.gen());
}
b.iter(|| {
for _ in range(0, 10) {
m.lower_bound(rng.gen());
}
});
}
#[bench]
fn bench_upper_bound(b: &mut Bencher) {
let mut m = TrieMap::<uint>::new();
let mut rng = weak_rng();
for _ in range(0, 1000) {
m.insert(rng.gen(), rng.gen());
}
b.iter(|| {
for _ in range(0, 10) {
m.upper_bound(rng.gen());
}
});
}
#[bench]
fn bench_insert_large(b: &mut Bencher) {
let mut m = TrieMap::<[uint, .. 10]>::new();
let mut rng = weak_rng();
b.iter(|| {
for _ in range(0, 1000) {
m.insert(rng.gen(), [1, .. 10]);
}
})
}
#[bench]
fn bench_insert_large_low_bits(b: &mut Bencher) {
let mut m = TrieMap::<[uint, .. 10]>::new();
let mut rng = weak_rng();
b.iter(|| {
for _ in range(0, 1000) {
// only have the last few bits set.
m.insert(rng.gen::<uint>() & 0xff_ff, [1, .. 10]);
}
})
}
#[bench]
fn bench_insert_small(b: &mut Bencher) {
let mut m = TrieMap::<()>::new();
let mut rng = weak_rng();
b.iter(|| {
for _ in range(0, 1000) {
m.insert(rng.gen(), ());
}
})
}
#[bench]
fn bench_insert_small_low_bits(b: &mut Bencher) {
let mut m = TrieMap::<()>::new();
let mut rng = weak_rng();
b.iter(|| {
for _ in range(0, 1000) {
// only have the last few bits set.
m.insert(rng.gen::<uint>() & 0xff_ff, ());
}
})
}
}
#[cfg(test)]
mod test_set {
use std::prelude::*;
use std::uint;
use super::TrieSet;
#[test]
fn test_sane_chunk() {
let x = 1;
let y = 1 << (uint::BITS - 1);
let mut trie = TrieSet::new();
assert!(trie.insert(x));
assert!(trie.insert(y));
assert_eq!(trie.len(), 2);
let expected = [x, y];
for (i, x) in trie.iter().enumerate() {
assert_eq!(expected[i], x);
}
}
#[test]
fn test_from_iter() {
let xs = vec![9u, 8, 7, 6, 5, 4, 3, 2, 1];
let set: TrieSet = xs.iter().map(|&x| x).collect();
for x in xs.iter() {
assert!(set.contains(x));
}
}
}
| 31.484991 | 100 | 0.481602 |
332ec3ad83ab42693d9db460bc909a8573da26d4 | 1,210 | py | Python | src/model/synapses/numba_backend/VoltageJump.py | Fassial/pku-intern | 4463e7d5a5844c8002f7e3d01b4fadc3a20e2038 | [
"MIT"
] | null | null | null | src/model/synapses/numba_backend/VoltageJump.py | Fassial/pku-intern | 4463e7d5a5844c8002f7e3d01b4fadc3a20e2038 | [
"MIT"
] | null | null | null | src/model/synapses/numba_backend/VoltageJump.py | Fassial/pku-intern | 4463e7d5a5844c8002f7e3d01b4fadc3a20e2038 | [
"MIT"
] | null | null | null | """
Created on 12:39, June. 4th, 2021
Author: fassial
Filename: VoltageJump.py
"""
import brainpy as bp
__all__ = [
"VoltageJump",
]
class VoltageJump(bp.TwoEndConn):
target_backend = ['numpy', 'numba', 'numba-parallel', 'numba-cuda']
def __init__(self, pre, post, conn,
weight = 1., delay = 0., **kwargs
):
# init params
self.weight = weight
self.delay = delay
# init connections
self.conn = conn(pre.size, post.size)
self.pre_ids, self.post_ids = self.conn.requires("pre_ids", "post_ids")
self.size = len(self.pre_ids)
# init vars
self.Isyn = self.register_constant_delay("Isyn",
size = self.size,
delay_time = self.delay
)
# init super
super(VoltageJump, self).__init__(pre = pre, post = post, **kwargs)
def update(self, _t):
# set post.V
for i in range(self.size):
pre_id, post_id = self.pre_ids[i], self.post_ids[i]
self.Isyn.push(i,
self.pre.spike[pre_id] * self.weight
)
if not self.post.refractory[post_id]:
self.post.V[post_id] += self.Isyn.pull(i)
| 26.304348 | 79 | 0.566116 |
cb1d9e1b42e4dbd9abc96049d184c399b42660a8 | 5,049 | go | Go | controllers/syncbinding_controller.go | arikkfir/syncer | 2181fdcf1fdead71fc017456ef3e2f0c290c26dd | [
"Unlicense"
] | null | null | null | controllers/syncbinding_controller.go | arikkfir/syncer | 2181fdcf1fdead71fc017456ef3e2f0c290c26dd | [
"Unlicense"
] | null | null | null | controllers/syncbinding_controller.go | arikkfir/syncer | 2181fdcf1fdead71fc017456ef3e2f0c290c26dd | [
"Unlicense"
] | null | null | null | /*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package controllers
import (
"context"
"fmt"
"github.com/go-logr/logr"
"k8s.io/client-go/dynamic"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
syncerv1 "github.com/arikkfir/syncer/api/v1"
)
const (
looperFinalizerName = "looper.finalizers." + syncerv1.Group
)
// SyncBindingReconciler reconciles a SyncBinding object
type SyncBindingReconciler struct {
client client.Client
dynamicClient dynamic.Interface
log logr.Logger
loops map[string]*looper
}
//+kubebuilder:rbac:groups=syncer.k8s.kfirs.com,resources=syncbindings,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=syncer.k8s.kfirs.com,resources=syncbindings/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=syncer.k8s.kfirs.com,resources=syncbindings/finalizers,verbs=update
// Reconcile is the reconciliation loop implementation aiming to continuously
// move the current state of the cluster closer to the desired state, which in
// the SyncBinding controller's view means ensure a reconciliation loop is running
// for each binding.
// TODO: support status
func (r *SyncBindingReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
logger := r.log.WithValues("syncbinding", req.NamespacedName)
binding := &syncerv1.SyncBinding{}
if err := r.client.Get(ctx, req.NamespacedName, binding); err != nil {
logger.V(1).Info("Failed fetching binding resource")
return ctrl.Result{}, client.IgnoreNotFound(err)
}
// If object is being deleted, perform finalization (if haven't already)
if !binding.ObjectMeta.DeletionTimestamp.IsZero() {
if containsString(binding.ObjectMeta.Finalizers, looperFinalizerName) {
// Stop sync loop
if err := r.removeLooperFor(binding); err != nil {
return ctrl.Result{}, fmt.Errorf("failed stopping sync loop: %w", err)
}
// Remove our finalizer
binding.ObjectMeta.Finalizers = removeString(binding.ObjectMeta.Finalizers, looperFinalizerName)
if err := r.client.Update(context.Background(), binding); err != nil {
return ctrl.Result{}, fmt.Errorf("failed removing finalizer: %w", err)
}
}
// Stop reconciliation as the item is being deleted
return ctrl.Result{}, nil
}
// Object is not being deleted! but ensure our finalizer is listed
if !containsString(binding.ObjectMeta.Finalizers, looperFinalizerName) {
binding.ObjectMeta.Finalizers = append(binding.ObjectMeta.Finalizers, looperFinalizerName)
if err := r.client.Update(context.Background(), binding); err != nil {
return ctrl.Result{}, fmt.Errorf("failed adding finalizer: %w", err)
}
}
// Ensure a sync loop exists for this binding
if err := r.ensureLooperFor(binding); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to create/update sync loop: %w", err)
}
return ctrl.Result{}, nil
}
// SetupWithManager sets up the controller with the Manager.
func (r *SyncBindingReconciler) SetupWithManager(mgr ctrl.Manager) error {
r.loops = make(map[string]*looper)
r.client = mgr.GetClient()
r.dynamicClient = dynamic.NewForConfigOrDie(mgr.GetConfig())
r.log = ctrl.Log.WithName("controllers").WithName("SyncBinding")
return ctrl.NewControllerManagedBy(mgr).
For(&syncerv1.SyncBinding{}).
Complete(r)
}
// Register creates or updates the looper associated with the given binding.
// TODO: ensure thread-safety
func (r *SyncBindingReconciler) ensureLooperFor(binding *syncerv1.SyncBinding) error {
key := binding.Namespace + "/" + binding.Name
l, ok := r.loops[key]
if ok {
err := l.stop()
if err != nil {
return fmt.Errorf("failed updating binding: %w", err)
}
l.binding = binding
err = l.start()
if err != nil {
return fmt.Errorf("failed updating binding: %w", err)
}
return nil
} else {
l = &looper{
log: r.log.WithValues("syncbinding", binding.Namespace+"/"+binding.Name),
binding: binding,
dynamicClient: r.dynamicClient,
}
r.loops[key] = l
err := l.start()
if err != nil {
return fmt.Errorf("failed creating sync loop: %w", err)
}
return nil
}
}
// Unregister stops & removes the looper associated with the given binding.
// TODO: ensure thread-safety
func (r *SyncBindingReconciler) removeLooperFor(binding *syncerv1.SyncBinding) error {
key := binding.Namespace + "/" + binding.Name
looper, ok := r.loops[key]
if ok {
err := looper.stop()
if err != nil {
return fmt.Errorf("failed stopping binding reconciliation loop: %w", err)
}
}
return nil
}
| 33.217105 | 118 | 0.728659 |
264fb4fae5668d5018ebd3d6295b9a9a8cc53e54 | 451 | java | Java | src/main/java/com/example/demo/DbSeeder.java | oussama-zaoui/MiniAPI | a93219696ed9dad4f57eca05005d616e0d401552 | [
"MIT"
] | 9 | 2019-01-03T23:30:35.000Z | 2019-04-22T15:23:03.000Z | src/main/java/com/example/demo/DbSeeder.java | oussama-zaoui/MiniAPI | a93219696ed9dad4f57eca05005d616e0d401552 | [
"MIT"
] | null | null | null | src/main/java/com/example/demo/DbSeeder.java | oussama-zaoui/MiniAPI | a93219696ed9dad4f57eca05005d616e0d401552 | [
"MIT"
] | 1 | 2019-01-29T11:54:40.000Z | 2019-01-29T11:54:40.000Z | package com.example.demo;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
@Component
public class DbSeeder implements CommandLineRunner
{
private UserRepository userRepository;
public DbSeeder(UserRepository userRepository)
{
this.userRepository=userRepository;
}
@Override
public void run(String... args) throws Exception
{
}
}
| 14.548387 | 50 | 0.791574 |
fb4d89f2b3dd7c8cafd155c3bbf65b4ade0786cb | 301 | h | C | checkbox.h | Radnyx/GEM | 020419bdd986a1a50ed52ddabe0955af8dffb0e8 | [
"MIT"
] | null | null | null | checkbox.h | Radnyx/GEM | 020419bdd986a1a50ed52ddabe0955af8dffb0e8 | [
"MIT"
] | null | null | null | checkbox.h | Radnyx/GEM | 020419bdd986a1a50ed52ddabe0955af8dffb0e8 | [
"MIT"
] | null | null | null | #ifndef CHECKBOX_H
#define CHECKBOX_H
#include "component.h"
class CheckBox : public Component
{
public:
bool* check = nullptr;
CheckBox(int32_t x, int32_t y);
void (*oncheck)(Debugger*);
void update(Debugger*);
void draw(Debugger*);
};
#endif // CHECKBOX_H
| 15.842105 | 36 | 0.634551 |
03bb5ca6fe03a4bbdfcc4e65f46110556a6f7c72 | 141 | kt | Kotlin | http4k-cloudevents/src/main/kotlin/io/cloudevents/core/format/cloudEventsExtensions.kt | kiyadotdev/http4k | 01ce07a94f30bcca93cea63c89090642810dc416 | [
"Apache-2.0"
] | 2,134 | 2017-05-08T14:21:10.000Z | 2022-03-31T22:57:07.000Z | http4k-cloudevents/src/main/kotlin/io/cloudevents/core/format/cloudEventsExtensions.kt | kiyadotdev/http4k | 01ce07a94f30bcca93cea63c89090642810dc416 | [
"Apache-2.0"
] | 490 | 2017-05-19T07:49:00.000Z | 2022-03-24T15:31:29.000Z | http4k-cloudevents/src/main/kotlin/io/cloudevents/core/format/cloudEventsExtensions.kt | kiyadotdev/http4k | 01ce07a94f30bcca93cea63c89090642810dc416 | [
"Apache-2.0"
] | 241 | 2017-05-10T15:00:33.000Z | 2022-03-26T18:13:29.000Z | package io.cloudevents.core.format
import org.http4k.core.ContentType
fun EventFormat.contentType() = ContentType(serializedContentType())
| 23.5 | 68 | 0.829787 |
22e04f14b65b4703af921a217be825f2cb32eafc | 453 | lua | Lua | Themes/_fallback/BGAnimations/ScreenTestInput underlay.lua | kangalioo/etterna | 11630aa1c23bad46b2da993602b06f8b659a4961 | [
"MIT"
] | 1 | 2020-11-09T21:58:28.000Z | 2020-11-09T21:58:28.000Z | Themes/_fallback/BGAnimations/ScreenTestInput underlay.lua | kangalioo/etterna | 11630aa1c23bad46b2da993602b06f8b659a4961 | [
"MIT"
] | null | null | null | Themes/_fallback/BGAnimations/ScreenTestInput underlay.lua | kangalioo/etterna | 11630aa1c23bad46b2da993602b06f8b659a4961 | [
"MIT"
] | null | null | null | return Def.ActorFrame {
--Def.ControllerStateDisplay {
-- InitCommand=function(self)
-- self:LoadGameController()
--end,
--};
Def.DeviceList {
Font = "Common Normal",
InitCommand = function(self)
self:x(SCREEN_LEFT + 20):y(SCREEN_TOP + 80):zoom(0.8):halign(0)
end
},
Def.InputList {
Font = "Common Normal",
InitCommand = function(self)
self:x(SCREEN_CENTER_X - 250):y(SCREEN_CENTER_Y):zoom(1):halign(0):vertspacing(8)
end
}
}
| 22.65 | 84 | 0.679912 |
6e49233eed70cb896f438af705be430861bfd735 | 2,862 | html | HTML | admin.html | dannyswat/adi | eae931cddd939d5defd01a4e7973532b5466f5d2 | [
"MIT"
] | null | null | null | admin.html | dannyswat/adi | eae931cddd939d5defd01a4e7973532b5466f5d2 | [
"MIT"
] | null | null | null | admin.html | dannyswat/adi | eae931cddd939d5defd01a4e7973532b5466f5d2 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Admin Panel</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="css/admin.css" type="text/css" asp-append-version="true" />
</head>
<body>
<div class="page">
<header class="bg-blue">
<div class="logo">
<i class="fa fa-cube"></i><span class="brand">Das</span><span class="statement">Mgmt System</span>
</div>
<nav class="top-menu">
<ul class="icon-nav">
<li><i class="fa fa-line-chart"></i></li>
<li><i class="fa fa-bell"></i><span class="num">2</span></li>
<li><i class="fa fa-cog"></i></li>
<li><i class="fa fa-user"></i><span class="username">Dannys</span></li>
</ul>
</nav>
</header>
<main class="">
<nav class="side-menu bg-grey">
<h3 class="bg-green">Section</h3>
<ul class="nav vertical">
<li><a href="#">Header 1</a>
<ul class="sub-nav vertical">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</li>
<li><a href="#">Header 2</a></li>
<li><a href="#">Header 3</a></li>
<li><a href="#">Header 4</a></li>
</ul>
<h3 class="bg-green">Section</h3>
<ul class="nav vertical">
<li><a href="#">Header 1</a></li>
<li><a href="#">Header 2</a></li>
<li><a href="#">Header 3</a></li>
<li><a href="#">Header 4</a></li>
</ul>
</nav>
<div class="content">
<div class="tabs page-tabs"><a class="tab page-tab active" href="#">Website Banner</a><a class="tab page-tab" href="#">Banner HTML</a></div>
<div class="content-panel">
<div class="content-wrapper">
<h1>Website Banner Management</h1>
<table class="data-grid">
<tr><th>Name</th><th>Content</th><th></th></tr>
<tr><td>Top Banner</td><td>Hello World</td><td class="center"><a href="#">View Detail</a></td></tr>
</table>
</div>
</div>
</div>
</main>
<footer class="bg-grey">
© Das 2017
</footer>
</div>
</body>
</html>
| 42.716418 | 156 | 0.417191 |
d281f3a1c6bd67efd356604f280a4c201fc1996a | 3,108 | php | PHP | src/Controller/InfoAdminClientController.php | Anthony5997/luxury-services | 6fae2877b27c5ac0db7229aebc7c333a0b46094d | [
"MIT"
] | null | null | null | src/Controller/InfoAdminClientController.php | Anthony5997/luxury-services | 6fae2877b27c5ac0db7229aebc7c333a0b46094d | [
"MIT"
] | null | null | null | src/Controller/InfoAdminClientController.php | Anthony5997/luxury-services | 6fae2877b27c5ac0db7229aebc7c333a0b46094d | [
"MIT"
] | null | null | null | <?php
namespace App\Controller;
use App\Entity\InfoAdminClient;
use App\Form\InfoAdminClientType;
use App\Repository\ClientRepository;
use App\Repository\InfoAdminClientRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route("/info/admin/client")
*/
class InfoAdminClientController extends AbstractController
{
/**
* @Route("/", name="info_admin_client_index", methods={"GET"})
*/
public function index(InfoAdminClientRepository $infoAdminClientRepository): Response
{
return $this->render('info_admin_client/index.html.twig', [
'info_admin_clients' => $infoAdminClientRepository->findAll(),
]);
}
/**
* @Route("/new", name="info_admin_client_new", methods={"GET","POST"})
*/
public function new(Request $request, ClientRepository $clientRepository): Response
{
$client = $clientRepository->findOneBy(['id'=> $request->get('id')]);
$infoAdminClient = new InfoAdminClient();
if ($request->get('id') && $request->get('notes')) {
$entityManager = $this->getDoctrine()->getManager();
$infoAdminClient-> setNotes($request->get('notes'));
$infoAdminClient-> setClient($client);
$entityManager->persist($infoAdminClient);
$entityManager->flush();
return $this->redirectToRoute('admin');
}
return $this->render('info_admin_candidate/new.html.twig', [
'info_admin_candidate' => $infoAdminClient,
]);
}
/**
* @Route("/{id}", name="info_admin_client_show", methods={"GET"})
*/
public function show(InfoAdminClient $infoAdminClient): Response
{
return $this->render('info_admin_client/show.html.twig', [
'info_admin_client' => $infoAdminClient,
]);
}
/**
* @Route("/{id}/edit", name="info_admin_client_edit", methods={"GET","POST"})
*/
public function edit(Request $request, InfoAdminClient $infoAdminClient): Response
{
$form = $this->createForm(InfoAdminClientType::class, $infoAdminClient);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->getDoctrine()->getManager()->flush();
return $this->redirectToRoute('info_admin_client_index');
}
return $this->render('info_admin_client/edit.html.twig', [
'info_admin_client' => $infoAdminClient,
'form' => $form->createView(),
]);
}
/**
* @Route("/delete/{id}", name="info_admin_client_delete", methods={"GET"})
*/
public function delete(Request $request, InfoAdminClient $infoAdminClient): Response
{
$entityManager = $this->getDoctrine()->getManager();
$entityManager->remove($infoAdminClient);
$entityManager->flush();
return $this->redirectToRoute('admin');
}
}
| 32.715789 | 89 | 0.625161 |
933b8cf1f4dec391694145449d9199fbc3eee24a | 735 | sql | SQL | employee.sql | PierreParienteDimitrov/employee_tracker | c70256c8ac94d5b9d22d3fa71027b96ebfdc4cf9 | [
"MIT"
] | null | null | null | employee.sql | PierreParienteDimitrov/employee_tracker | c70256c8ac94d5b9d22d3fa71027b96ebfdc4cf9 | [
"MIT"
] | null | null | null | employee.sql | PierreParienteDimitrov/employee_tracker | c70256c8ac94d5b9d22d3fa71027b96ebfdc4cf9 | [
"MIT"
] | null | null | null | DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
USE employee_db;
CREATE TABLE department(
id INTEGER AUTO_INCREMENT NOT NULL,
department_name VARCHAR(30) NULL,
PRIMARY KEY (id)
);
CREATE TABLE role(
id INTEGER AUTO_INCREMENT NOT NULL,
title VARCHAR(30) NULL,
salary DECIMAL (10, 2) NULL,
department_id INTEGER NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE employee(
id INTEGER AUTO_INCREMENT NOT NULL,
first_name VARCHAR(30) NULL,
last_name VARCHAR (30) NULL,
role_id INTEGER NULL,
manager_id INTEGER DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE manager(
id INTEGER AUTO_INCREMENT NOT NULL,
manager_name VARCHAR(30) NULL,
PRIMARY KEY (id)
);
| 21 | 39 | 0.707483 |
bcd3a542c8f496b0409aa02968b1858fece07b03 | 1,279 | js | JavaScript | src/components/links/CtaLink/index.js | AliFrank608-TMW/RacingReact | 8044d418964934c92acb96425881efee2c1180a7 | [
"Apache-2.0"
] | 2 | 2021-05-17T18:07:37.000Z | 2021-05-17T18:15:58.000Z | src/components/links/CtaLink/index.js | AliFrank608-TMW/RacingReact | 8044d418964934c92acb96425881efee2c1180a7 | [
"Apache-2.0"
] | null | null | null | src/components/links/CtaLink/index.js | AliFrank608-TMW/RacingReact | 8044d418964934c92acb96425881efee2c1180a7 | [
"Apache-2.0"
] | null | null | null | import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'utils/classnames'
import { Link } from 'react-router-dom'
import { HashLink } from 'react-router-hash-link'
const CtaLink = props => {
const {
className,
modifier,
href,
children,
nativeLink,
hashLink,
...rest
} = props
const modifiedClassNames = classNames('link', className, modifier)
if (nativeLink) {
return (
<a href={href} className={modifiedClassNames} {...rest}>
{children}
</a>
)
} else
if (hashLink) {
return (
<HashLink to={href} className={modifiedClassNames} {...rest}>
{children}
</HashLink>
)
} else {
return (
<Link to={href} className={modifiedClassNames} {...rest}>
{children}
</Link>
)
}
}
CtaLink.propTypes = {
className: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string)
]),
modifier: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string)
]),
href: PropTypes.string,
nativeLink: PropTypes.bool,
hashLink: PropTypes.bool
}
CtaLink.defaultProps = {
className: '',
modifier: '',
href: '/',
nativeLink: false,
hashLink: false
}
export default CtaLink
| 18.536232 | 68 | 0.627834 |
fb62ace929471e9bd8e0676dcf771eaa382781da | 302 | c | C | src/loader/event_loader.c | Mikatech/my_rpg | 89d4d8ee362aeb247ad328cada032b01cb83f782 | [
"MIT"
] | 7 | 2021-07-05T20:19:50.000Z | 2021-10-15T12:29:49.000Z | src/loader/event_loader.c | Davphla/my_rpg | 89d4d8ee362aeb247ad328cada032b01cb83f782 | [
"MIT"
] | null | null | null | src/loader/event_loader.c | Davphla/my_rpg | 89d4d8ee362aeb247ad328cada032b01cb83f782 | [
"MIT"
] | 1 | 2021-07-05T20:46:04.000Z | 2021-07-05T20:46:04.000Z | /*
** EPITECH PROJECT, 2021
** B-MUL-200-LYN-2-1-myrpg-david.gozlan
** File description:
** main_2_loader
*/
#include "rpg.h"
event_t *event_initialize(void)
{
event_t *event = malloc(sizeof(event_t));
event->key_input = 0;
event->mouse_coords = (sfVector2f){0, 0};
return (event);
} | 17.764706 | 45 | 0.655629 |
fea027e63c8ec137410b07cae121edd763bbcdf7 | 1,270 | kt | Kotlin | buildSrc/src/main/kotlin/MarkdownUtil.kt | StanleyProjects/AndroidExtension.UserInterface | 245a7c3c8f7518ddcf17f02629b01404800852da | [
"Apache-2.0"
] | null | null | null | buildSrc/src/main/kotlin/MarkdownUtil.kt | StanleyProjects/AndroidExtension.UserInterface | 245a7c3c8f7518ddcf17f02629b01404800852da | [
"Apache-2.0"
] | 11 | 2021-12-19T13:37:00.000Z | 2022-01-13T16:00:59.000Z | buildSrc/src/main/kotlin/MarkdownUtil.kt | StanleyProjects/AndroidExtension.UserInterface | 245a7c3c8f7518ddcf17f02629b01404800852da | [
"Apache-2.0"
] | null | null | null | object MarkdownUtil {
fun url(
text: String,
value: String
): String {
return "[$text]($value)"
}
fun image(
text: String,
url: String
): String {
return "!" + url(text = text, value = url)
}
fun table(
heads: List<String>,
dividers: List<String>,
rows: List<List<String>>
): String {
require(heads.size > 1) { "Size of heads must be more than 1!" }
require(heads.size == dividers.size) {
"Size of heads and size of dividers must be equal!"
}
val firstRow = rows.firstOrNull()
requireNotNull(firstRow) { "Rows must be exist!" }
for (i in 1 until rows.size) {
require(firstRow.size == rows[i].size) {
"Size of columns in all rows must be equal!"
}
}
require(heads.size == firstRow.size) {
"Size of heads and size of rows must be equal!"
}
val result = mutableListOf(
heads.joinToString(separator = "|"),
dividers.joinToString(separator = "|")
)
result.addAll(rows.map { it.joinToString(separator = "|") })
return result.joinToString(separator = SystemUtil.newLine)
}
}
| 29.534884 | 72 | 0.531496 |
4e0cf10ba62a61bbde206ff0ae503fbef4c0c6dc | 1,953 | asm | Assembly | Microcontroller_Lab/Lab_6/Lab_6/Read_Code_With_Comments.asm | MuhammadAlBarham/pic16f778_projects | c12e15e48a62cd16f869cbe9411728a4eea8f499 | [
"MIT"
] | null | null | null | Microcontroller_Lab/Lab_6/Lab_6/Read_Code_With_Comments.asm | MuhammadAlBarham/pic16f778_projects | c12e15e48a62cd16f869cbe9411728a4eea8f499 | [
"MIT"
] | null | null | null | Microcontroller_Lab/Lab_6/Lab_6/Read_Code_With_Comments.asm | MuhammadAlBarham/pic16f778_projects | c12e15e48a62cd16f869cbe9411728a4eea8f499 | [
"MIT"
] | null | null | null | Include "p16F84A.inc"
; ----------------------------------------------------------
; General Purpose RAM Assignments
; ----------------------------------------------------------
cblock 0x0C
Counter
Endc
; ----------------------------------------------------------
; Macro Definitions
; ----------------------------------------------------------
Read_EEPROM macro
Bcf STATUS, RP0 ;Go to Bank 0
Clrf EEADR ;Clear EEADR (EEADR=0)
Bsf STATUS, RP0 ;Go to Bank 1
Bsf EECON1, RD ;Begin Read
Bcf STATUS, RP0 ;Go to Bank 0
Endm
; ----------------------------------------------------------
; Vector definition
; ----------------------------------------------------------
org 0x000
nop
goto Main
INT_Routine org 0x004
goto INT_Routine
; ----------------------------------------------------------
; The main Program
; ----------------------------------------------------------
Main
Read_EEPROM
Clrf Counter ;Clear the counter
Bsf STATUS, RP0 ;Go to Bank 1
Clrf TRISB ;Make PORTB as OUTPUT
Bcf STATUS, RP0 ;Go to BANK 0
Movlw A'H' ;Move Character to W-Reg
Subwf EEDATA,w ;Check If the first char. is H
Btfsc STATUS,Z ;If Yes goto finish
Goto Finish
Incf Counter,f
Movlw A'M'
Subwf EEDATA,w
Btfsc STATUS,Z
Finish
Incf Counter,f
Call Look_Up
Movwf PORTB
Loop
Goto Loop
; ----------------------------------------------------------
; Sub Routine Definitions
; ----------------------------------------------------------
;This Look_Up table for 7-Seg. Display
Look_Up
Movf Counter,w
Addwf PCL,f
Retlw B'00111111' ; Number 0
Retlw B'00000110' ; Number 1
Retlw B'01011011' ; Number 2
Retlw B'01001111' ; Number 3
Retlw B'01100110' ; Number 4
Retlw B'01101101' ; Number 5
end
| 29.149254 | 61 | 0.410138 |
11db6035616a9cf473737119e0811732c0ab3de3 | 2,885 | html | HTML | committee.html | intaset/enfht | 56b2d5418d7df323a10306d518dce23e459980a0 | [
"MIT"
] | null | null | null | committee.html | intaset/enfht | 56b2d5418d7df323a10306d518dce23e459980a0 | [
"MIT"
] | null | null | null | committee.html | intaset/enfht | 56b2d5418d7df323a10306d518dce23e459980a0 | [
"MIT"
] | null | null | null | ---
layout: default
title: ENFHT'18 - Scientific Committee
meta: The scientific committee members of ENFHT'18.
keyword: experimental flow conference, expiremental heat transfer conference, numerical heat transfer conference, numerical flow conference, cfd conference, heat transfer enhancement, porous media conference, nanofluids conference, non-newtonian flow conference, non-newtonian heat transfer conference, polymer processing conference, renewable energy conference, turbulent flow conference, experimental flow, numerical flow, heat transfer, expiremental heat transfer, numerical heat transfer, cfd, heat transfer enhancement conference, porous media, nanofluids, non-newtonian flow, non-newtonian heat transfer, polymer processing, renewable energy, turbulent flow, fluid flow, fluid flow conference, flow, flow conference, fluid mechanics, fluid mechanics conference, fluid dynamics, fluid dynamics conference
---
<div class="unit unit-s-1 unit-m-1-4-1 unit-l-1-4-1">
<div class="unit-spacer content">
<p class="body">The Scientific Committee list is currently being updated. We appreciate your patience!</p>
<p class="bold"></p>
<div class="unit unit-s-1 unit-m-1 unit-l-1">
<img src="../img/Cheng.jpg" width="150" align="left" style="padding-right: 1em;"><p class="body">
<br>
<b>Scientific Committee Chair:<br>
<br>
Dr. Lixin Cheng</b><br>
Sheffield Hallam University, UK<br>
</p>
<br><br<br><br>
</div>
<p class="bold">Scientific Committee Members:</p><br>
<p class="body"><b>Dr. Panagiota Angeli,</b> University College London, UK </p>
<p class="body"><b>Dr. Rayhaneh Akhavan,</b> University of Michigan, USA </p>
<p class="body"><b>Dr. Jun Cao,</b> Ryerson University, Canada </p>
<p class="body"><b>Dr. Selva Çavus,</b> Istanbul University, Turkey </p>
<p class="body"><b>Dr. John Chai,</b> University of Huddersfield, UK </p>
<p class="body"><b>Dr. Guoqian Chen,</b> Peking University, China </p>
<p class="body"><b>Dr. Arend Dubbelboer,</b> Danone Nutricia Research, Netherlands </p>
<p class="body"><b>Dr. Mohammad Hamdan,</b> American University of Sharjah, United Arab Emirates </p>
<p class="body"><b>Dr. Mohammad Hojjat,</b> University of Isfahan, Iran </p>
<p class="body"><b>Dr. Jerhuan Jang,</b> Ming Chi University of Technology, Taiwan </p>
<p class="body"><b>Dr. Mark Jermy,</b> University of Canterbury, New Zealand </p>
<p class="body"><b>Dr. Alexander Liberson,</b> Rocheste Institute of Technology, USA </p>
<p class="body"><b>Dr. Anthony Robinson,</b> Trinity College Dublin, Ireland </p>
<p class="body"><b>Dr. Mathieu Sellier,</b> University of Canterbury, New Zealand </p>
<p class="body"><b>Dr. Hiroshi Yokoyama,</b> Toyohashi University of Technology, Japan</p>
</div>
</div> | 67.093023 | 809 | 0.692201 |
fdaf633a2d6691a5cac79970a134936e25b5c10c | 3,480 | lua | Lua | src/scripts/client/gameplay/viz_handlers/flash_units.lua | Psimage/Lovely-Camera-Mod | 7ecb1c354c3e00091ef6005d53eb19d0fcf7f56e | [
"MIT"
] | null | null | null | src/scripts/client/gameplay/viz_handlers/flash_units.lua | Psimage/Lovely-Camera-Mod | 7ecb1c354c3e00091ef6005d53eb19d0fcf7f56e | [
"MIT"
] | null | null | null | src/scripts/client/gameplay/viz_handlers/flash_units.lua | Psimage/Lovely-Camera-Mod | 7ecb1c354c3e00091ef6005d53eb19d0fcf7f56e | [
"MIT"
] | null | null | null | ----------------------------------------------------------------
-- Copyright (c) 2012 Klei Entertainment Inc.
-- All Rights Reserved.
-- SPY SOCIETY.
----------------------------------------------------------------
local viz_thread = include( "gameplay/viz_thread" )
local array = include( "modules/array" )
local cdefs = include( "client_defs" )
local util = include( "client_util" )
local simdefs = include( "sim/simdefs" )
local simquery = include( "sim/simquery" )
---------------------------------------------------------------
local flash_units = class( viz_thread )
function flash_units:init( boardrig, viz, rig, duration )
viz_thread.init( self, viz, self.onResume )
viz:registerHandler( simdefs.EV_FRAME_UPDATE, self )
self.boardrig = boardrig
self.rig = rig
self.duration = duration
--move rig from layers["main"] to layers["ceiling"]
--increment usage_count and enable fullscreen darkening overlay if 1
local rigProp = rig:getProp()
local main = boardrig._layers["main"]
local ceiling = boardrig._layers["ceiling"]
main:removeProp( rigProp )
ceiling:insertProp( rigProp )
rigProp:setPriority( 110000 )
if not boardrig._flashThreadCount or boardrig._flashThreadCount == 0 then
boardrig._flashThreadCount = 1
--print( "inserting dimmer" )
--local bSoundPlayed = false
local timer = MOAITimer.new()
timer:setSpan( duration / (60*2) )
timer:setMode( MOAITimer.PING_PONG )
timer:start()
local uniformDriver = function( uniforms )
local t = timer:getTime() / (duration / (60*2) )
t = math.min(0.7,t*3)
uniforms:setUniformFloat( "ease", t )
--print('dimmer ease', t )
end
local uniforms = KLEIShaderUniforms.new()
uniforms:setUniformDriver( uniformDriver )
local dimmerProp = KLEIFullscreenProp.new()
dimmerProp:setShader( MOAIShaderMgr.getShader( MOAIShaderMgr.KLEI_POST_PROCESS_PASS_THROUGH_EASE ) )
dimmerProp:setShaderUniforms( uniforms )
dimmerProp:setTexture( "data/images/the_darkness.png" )
dimmerProp:setBlendMode( MOAIProp.BLEND_NORMAL )
dimmerProp:setPriority( 100000 )
ceiling:insertProp( dimmerProp )
boardrig._dimmerProp = dimmerProp
else
boardrig._flashThreadCount = boardrig._flashThreadCount + 1
end
end
function flash_units:onStop()
self.rig:refreshRenderFilter()
--move rig from layers["ceiling"] to layers["main"]
--decrement usage_count and disable fullscreen darkening overlay if 0
local rigProp = self.rig:getProp()
local main = self.boardrig._layers["main"]
local ceiling = self.boardrig._layers["ceiling"]
ceiling:removeProp( rigProp )
main:insertProp( rigProp )
local count = self.boardrig._flashThreadCount - 1
self.boardrig._flashThreadCount = count
if count <= 0 then
--print( "deleting dimmer" )
local dimmerProp = self.boardrig._dimmerProp
ceiling:removeProp( dimmerProp )
self.boardrig._dimmerProp = nil
end
end
function flash_units:onResume( ev )
while self.duration > 0 do
if self.duration % 20 == 0 then
self.rig:getProp():setRenderFilter( cdefs.RENDER_FILTERS["focus_highlite"] )
elseif self.duration % 10 == 0 then
self.rig:refreshRenderFilter()
end
self.duration = self.duration - 1
coroutine.yield()
end
end
return flash_units
| 31.926606 | 109 | 0.641092 |
f4df560444f8ac8d34f4994237282dc2be0c8aea | 1,087 | swift | Swift | Sources/BaseSwift/Mutex.swift | nallick/BaseSwift | b7d11109ab44382fbb8bf6562eebc6ff866c3c95 | [
"MIT"
] | null | null | null | Sources/BaseSwift/Mutex.swift | nallick/BaseSwift | b7d11109ab44382fbb8bf6562eebc6ff866c3c95 | [
"MIT"
] | null | null | null | Sources/BaseSwift/Mutex.swift | nallick/BaseSwift | b7d11109ab44382fbb8bf6562eebc6ff866c3c95 | [
"MIT"
] | null | null | null | //
// Mutex.swift
//
// Copyright © 2018-2020 Purgatory Design. Licensed under the MIT License.
//
import Foundation
public final class Mutex {
@inlinable public func lock() {
pthread_mutex_lock(&self.mutex)
}
@inlinable public func unlock() {
pthread_mutex_unlock(&self.mutex)
}
@inlinable public func tryLock() -> Bool {
return pthread_mutex_trylock(&self.mutex) == 0
}
@discardableResult
public func sync<Result>(_ function: () -> Result) -> Result {
self.lock()
defer { self.unlock() }
return function()
}
public init(recursive: Bool = false) {
var attributes = pthread_mutexattr_t()
pthread_mutexattr_init(&attributes)
if recursive {
pthread_mutexattr_settype(&attributes, Int32(PTHREAD_MUTEX_RECURSIVE))
}
self.mutex = pthread_mutex_t()
pthread_mutex_init(&self.mutex, &attributes)
}
@inlinable deinit {
pthread_mutex_destroy(&self.mutex)
}
@usableFromInline internal var mutex: pthread_mutex_t
}
| 23.12766 | 82 | 0.634775 |
90c3e100ca4a5b963f60e1642e99e286ff9f15e0 | 4,187 | kt | Kotlin | educational-core/src/com/jetbrains/edu/learning/stepik/course/StartStepikCourseAction.kt | varsy/edu-for-kotlin | c92a4519275344e8dfa31fa6df0c6e4b060bef31 | [
"Apache-2.0"
] | 3 | 2016-01-13T14:08:13.000Z | 2016-04-06T20:01:42.000Z | educational-core/src/com/jetbrains/edu/learning/stepik/course/StartStepikCourseAction.kt | varsy/edu-for-kotlin | c92a4519275344e8dfa31fa6df0c6e4b060bef31 | [
"Apache-2.0"
] | 13 | 2015-10-13T11:53:55.000Z | 2016-02-05T12:17:32.000Z | educational-core/src/com/jetbrains/edu/learning/stepik/course/StartStepikCourseAction.kt | varsy/edu-for-kotlin | c92a4519275344e8dfa31fa6df0c6e4b060bef31 | [
"Apache-2.0"
] | null | null | null | package com.jetbrains.edu.learning.stepik.course
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.ui.Messages
import com.jetbrains.edu.learning.*
import com.jetbrains.edu.learning.compatibility.CourseCompatibility.Companion.validateLanguage
import com.jetbrains.edu.learning.compatibility.CourseCompatibility.Compatible
import com.jetbrains.edu.learning.compatibility.CourseCompatibility.IncompatibleVersion
import com.jetbrains.edu.learning.configuration.EduConfiguratorManager
import com.jetbrains.edu.learning.courseFormat.EduCourse
import com.jetbrains.edu.learning.messages.EduCoreBundle.message
import com.jetbrains.edu.learning.stepik.StepikNames
import com.jetbrains.edu.learning.stepik.hyperskill.JBA_DEFAULT_URL
class StartStepikCourseAction : StartCourseAction(StepikNames.STEPIK) {
override val dialog: ImportCourseDialog
get() = ImportStepikCourseDialog(courseConnector)
override val courseConnector: CourseConnector = StepikCourseConnector
override fun importCourse(): EduCourse? {
val course = super.importCourse() ?: return null
if (course.isAdaptive) {
showAdaptiveCoursesAreNotSupportedNotification(course.name)
return null
}
if (course is StepikCourse) {
val language = getLanguageForStepikCourse(course)
language?.let {
course.type = "${StepikNames.PYCHARM_PREFIX}${JSON_FORMAT_VERSION} ${language.id}"
course.programmingLanguage = "${language.id} ${language.version}".trim()
}
course.validateLanguage().onError {
Messages.showErrorDialog(it, message("error.failed.to.import.course"))
return null
}
if (language?.language == null || language.language?.id !in EduConfiguratorManager.supportedEduLanguages) return null
return course
}
else if (isCompatibleEduCourse(course)) {
return course
}
return null
}
private fun getLanguageForStepikCourse(course: StepikCourse): EduLanguage? {
val languages = getLanguagesUnderProgress(course).onError {
Messages.showErrorDialog(it, message("error.failed.to.import.course"))
return null
}
if (languages.isEmpty()) {
Messages.showErrorDialog(message("error.no.supported.languages", course.name), message("error.failed.to.import.course"))
return null
}
return chooseLanguageIfNeeded(languages, course)
}
private fun isCompatibleEduCourse(course: EduCourse): Boolean {
return when (course.compatibility) {
Compatible -> true
IncompatibleVersion -> {
showFailedImportCourseMessage(message("error.update.plugin", course.name))
false
}
// TODO: allow to install/enable plugins here
else -> {
showFailedImportCourseMessage(message("error.programming.language.not.supported", course.name))
false
}
}
}
private fun chooseLanguageIfNeeded(languages: List<EduLanguage>, course: StepikCourse): EduLanguage? {
return if (languages.size == 1) {
languages[0]
}
else {
val supportedLanguages = languages.filter { it.language?.id in EduConfiguratorManager.supportedEduLanguages }
val chooseLanguageDialog = ChooseStepikCourseLanguageDialog(supportedLanguages, course.name)
if (chooseLanguageDialog.showAndGet()) {
chooseLanguageDialog.selectedLanguage()
}
else {
null
}
}
}
private fun showAdaptiveCoursesAreNotSupportedNotification(courseName: String) {
Messages.showErrorDialog(message("error.adaptive.courses.not.supported.message", courseName, JBA_DEFAULT_URL, EduNames.JBA),
message("error.adaptive.courses.not.supported.title"))
}
private fun getLanguagesUnderProgress(course: StepikCourse): Result<List<EduLanguage>, String> {
return ProgressManager.getInstance().runProcessWithProgressSynchronously<Result<List<EduLanguage>, String>, RuntimeException>(
{
ProgressManager.getInstance().progressIndicator.isIndeterminate = true
EduUtils.execCancelable {
StepikCourseConnector.getSupportedLanguages(course)
}
}, message("stepik.getting.languages"), true, null)
}
} | 39.5 | 130 | 0.736327 |
40ae558bc2a066a470320b7d80dcfa41f2b9f3a9 | 165 | py | Python | problem0090.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0090.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0090.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #90 Cube digit pairs - Project Euler
# https://projecteuler.net/problem=90
#
# Code by Kevin Marciniak
#
###########################
| 18.333333 | 38 | 0.466667 |
3ac6fdda39effd934cad9c3b2f626c3e2273a439 | 5,494 | asm | Assembly | Transynther/x86/_processed/NC/_ht_/i9-9900K_12_0xa0.log_21829_1401.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_ht_/i9-9900K_12_0xa0.log_21829_1401.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_ht_/i9-9900K_12_0xa0.log_21829_1401.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x41f5, %rsi
lea addresses_WC_ht+0xe207, %rdi
nop
nop
and %r8, %r8
mov $106, %rcx
rep movsq
cmp %r13, %r13
lea addresses_WC_ht+0x1a813, %rcx
inc %r9
mov $0x6162636465666768, %rsi
movq %rsi, (%rcx)
add %r13, %r13
lea addresses_A_ht+0xd4f7, %r13
nop
nop
nop
nop
inc %r9
movb (%r13), %r8b
nop
sub %r8, %r8
lea addresses_A_ht+0xd4f, %r13
nop
and $53830, %rbx
mov (%r13), %di
nop
sub %r13, %r13
lea addresses_normal_ht+0xae87, %rcx
clflush (%rcx)
add $52628, %r13
mov (%rcx), %r8d
nop
nop
sub $28644, %r8
lea addresses_normal_ht+0x31b7, %rsi
cmp $12690, %r13
mov (%rsi), %cx
nop
nop
nop
sub $24486, %rcx
lea addresses_WC_ht+0xd527, %rsi
nop
nop
nop
nop
nop
inc %rcx
mov (%rsi), %r9
sub $31144, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %r9
push %rax
push %rsi
// Faulty Load
mov $0x1ca4d10000000237, %r9
nop
nop
nop
nop
xor $55325, %r8
vmovups (%r9), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rax
lea oracles, %r15
and $0xff, %rax
shlq $12, %rax
mov (%r15,%rax,1), %rax
pop %rsi
pop %rax
pop %r9
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}}
{'src': {'NT': True, 'same': False, 'congruent': 5, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': True, 'same': False, 'congruent': 2, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': True, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': True, 'same': False, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'46': 21829}
46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46
*/
| 46.559322 | 2,999 | 0.655624 |
412d2a52ec2d5259851869c80c946d85ee15d44f | 1,937 | swift | Swift | COVID-19/Views/Statistics views/Pickers/GlobalCountryPicker.swift | miladgolchinpour/Covid-19 | 6efdd5137473a9b98313c4d33ebeb32dcfb8950d | [
"MIT"
] | 1 | 2021-08-08T18:28:57.000Z | 2021-08-08T18:28:57.000Z | COVID-19/Views/Statistics views/Pickers/GlobalCountryPicker.swift | miladgolchinpour/Covid-19 | 6efdd5137473a9b98313c4d33ebeb32dcfb8950d | [
"MIT"
] | null | null | null | COVID-19/Views/Statistics views/Pickers/GlobalCountryPicker.swift | miladgolchinpour/Covid-19 | 6efdd5137473a9b98313c4d33ebeb32dcfb8950d | [
"MIT"
] | null | null | null | //
// GlobalCountryPicker.swift
// COVID-19
//
// Created by Milad Golchinpour on 7/1/21.
// Copyright © 2021 Milad Golchinpour. All rights reserved.
//
import SwiftUI
enum GlobalCountryPickerSelection: String, CaseIterable {
case global = "Global"
case country = "My Country"
}
struct GlobalCountryPicker: View {
@EnvironmentObject var app: AppSettings
@Environment(\.horizontalSizeClass) var hSizeClass
var widthMinus: CGFloat {
hSizeClass == .regular ? 200 : 0
}
var width: CGFloat {
UIScreen.main.bounds.width - widthMinus
}
var body: some View {
ZStack {
Capsule()
.foregroundStyle(.ultraThinMaterial)
.frame(width: width/1.3, height: 55)
HStack {
ForEach(GlobalCountryPickerSelection.allCases, id: \.self) { item in
ZStack {
Capsule()
.frame(width: ((width/1.3)/2)-10, height: 45)
.foregroundStyle(app.statSelection == item ? .white : .clear)
Text(item.rawValue)
.font(.headline)
.foregroundColor(app.statSelection == item ? .black : .white)
.contentShape(Rectangle())
.onTapGesture {
withAnimation { app.statSelection = item }
}
}
}
}
}
}
}
struct GlobalCountryPicker_Previews: PreviewProvider {
static var previews: some View {
VStack{
GlobalCountryPicker()
.environmentObject(AppSettings())
}
.preferredColorScheme(.light)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.indigo)
}
}
| 28.910448 | 89 | 0.505421 |
da1f4b82540846bf3b10497980830f102e02fe01 | 2,018 | lua | Lua | resources/[scripts]/[hoppe]/[jobs]/hpp_cet/towtruck.lua | HoppeDevz/bclrp | acc33ae5032fb2488dacfa49046470feb8cac32e | [
"MIT"
] | 4 | 2020-09-15T17:43:21.000Z | 2022-01-14T16:49:16.000Z | resources/[scripts]/[hoppe]/[jobs]/hpp_cet/towtruck.lua | kFxDaKing/bclrp | acc33ae5032fb2488dacfa49046470feb8cac32e | [
"MIT"
] | null | null | null | resources/[scripts]/[hoppe]/[jobs]/hpp_cet/towtruck.lua | kFxDaKing/bclrp | acc33ae5032fb2488dacfa49046470feb8cac32e | [
"MIT"
] | 4 | 2020-09-14T11:47:50.000Z | 2021-02-15T20:39:45.000Z |
RegisterCommand("towtruck", function()
vehicle = GetVehiclePedIsUsing(GetPlayerPed(-1))
vehicletow = GetDisplayNameFromVehicleModel(GetEntityModel(GetVehiclePedIsUsing(GetPlayerPed(-1))))
end)
local reboque = nil
local rebocado = nil
RegisterCommand("tow",function(source,args)
--local vehicle = GetPlayersLastVehicle()
--local vehicletow = IsVehicleModel(vehicle,GetHashKey("flatbed"))
if vehicletow and not IsPedInAnyVehicle(PlayerPedId()) then
--rebocado = getVehicleInDirection(GetEntityCoords(PlayerPedId()),GetOffsetFromEntityInWorldCoords(PlayerPedId(),0.0,5.0,0.0))
rebocado = GetPlayersLastVehicle()
if reboque == nil then
if vehicle ~= rebocado then
local min,max = GetModelDimensions(GetEntityModel(rebocado))
AttachEntityToEntity(rebocado,vehicle,GetEntityBoneIndexByName(vehicle,"bodyshell"),0,-2.2,0.4-min.z,0,0,0,1,1,0,1,0,1)
reboque = rebocado
end
else
AttachEntityToEntity(reboque,vehicle,20,-0.5,-15.0,-0.3,0.0,0.0,0.0,false,false,true,false,20,true)
DetachEntity(reboque,false,false)
PlaceObjectOnGroundProperly(reboque)
reboque = nil
rebocado = nil
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if enablemechud then
if vehicletow == nil then
vehicletow = "NENHUM"
end
rebocado = GetDisplayNameFromVehicleModel(GetEntityModel(GetPlayersLastVehicle()))
if rebocado == nil then
rebocado = "NENHUM"
elseif rebocado == "FLATBED" then
rebocado = "NENHUM"
end
--print(vehicletow)
--print(rebocado)
if vehicletow ~= "FLATBED" then
drawTxt("REBOQUE:~r~"..vehicletow,4,0.5,0.93,0.50,255,255,255,255)
elseif vehicletow == "FLATBED" then
drawTxt("REBOQUE:~g~"..vehicletow,4,0.5,0.93,0.50,255,255,255,255)
end
drawTxt("REBOCADO:~r~"..rebocado,4,0.5,0.96,0.50,255,255,255,255)
end
end
end)
enablemechud = false
RegisterCommand("towhud", function()
if not enablemechud then
enablemechud = true
elseif enablemechud then
enablemechud = false
end
end) | 29.246377 | 128 | 0.730426 |
fb1d5c4ea3afb1fa2a7d6ae0aa425f2f79006f5d | 207 | c | C | opcode/opcode13.c | 1847123212/fppa-pdk-tools | 670e7bc9c1b33469fe8c80cd4c1eeb053d20c191 | [
"MIT"
] | 35 | 2018-11-27T11:48:29.000Z | 2021-09-22T22:46:41.000Z | opcode/opcode13.c | 1847123212/fppa-pdk-tools | 670e7bc9c1b33469fe8c80cd4c1eeb053d20c191 | [
"MIT"
] | 6 | 2019-01-06T23:19:25.000Z | 2021-02-07T10:35:12.000Z | opcode/opcode13.c | 1847123212/fppa-pdk-tools | 670e7bc9c1b33469fe8c80cd4c1eeb053d20c191 | [
"MIT"
] | 4 | 2019-10-18T12:04:24.000Z | 2020-03-05T19:05:33.000Z | #include <stdint.h>
#include <stdbool.h>
#include "emucpu.h"
//execute next 13 bit opcode and advanced PC
int opcode13(struct emuCPU *cpu)
{
emuCPUexception(cpu,EXCEPTION_ILLEGAL_OPCODE);
return -1;
}
| 17.25 | 48 | 0.73913 |
b89f9543ecb27486610847a26f0dea237fce7656 | 3,804 | rs | Rust | days/day25/src/lib.rs | dfm/adventofcode | ab2c4228229988d79ba7a9034069961650830031 | [
"Apache-2.0"
] | 2 | 2020-12-05T23:14:48.000Z | 2021-12-27T04:39:33.000Z | days/day25/src/lib.rs | dfm/adventofcode | ab2c4228229988d79ba7a9034069961650830031 | [
"Apache-2.0"
] | null | null | null | days/day25/src/lib.rs | dfm/adventofcode | ab2c4228229988d79ba7a9034069961650830031 | [
"Apache-2.0"
] | 1 | 2019-12-24T04:56:27.000Z | 2019-12-24T04:56:27.000Z | use aoc::solver::Solver;
pub struct Day25;
#[derive(Copy, Clone)]
enum Cell {
Empty,
East,
South,
}
struct Grid {
width: usize,
height: usize,
value: Vec<Cell>,
}
impl Grid {
fn new(data: &str) -> Self {
let width = data.lines().next().unwrap().trim().len();
let mut grid = Grid {
width,
height: 0,
value: Vec::new(),
};
for line in data.lines() {
for c in line.trim().chars() {
grid.value.push(match c {
'>' => Cell::East,
'v' => Cell::South,
_ => Cell::Empty,
});
}
}
grid.height = grid.value.len() / width;
grid
}
fn east(&self, n: usize) -> usize {
if n % self.width == self.width - 1 {
n + 1 - self.width
} else {
n + 1
}
}
fn south(&self, n: usize) -> usize {
if n >= (self.height - 1) * self.width {
n % self.width
} else {
n + self.width
}
}
fn step(&self) -> (usize, Self) {
let mut count = 0;
let mut grid = Grid {
width: self.width,
height: self.height,
value: Vec::new(),
};
grid.value.resize(self.width * self.height, Cell::Empty);
for (n, v) in self.value.iter().enumerate() {
if matches!(v, Cell::East) {
let target = self.east(n);
if matches!(self.value[target], Cell::Empty) {
grid.value[target] = Cell::East;
count += 1;
} else {
grid.value[n] = Cell::East;
}
}
}
for (n, v) in self.value.iter().enumerate() {
if matches!(v, Cell::South) {
let target = self.south(n);
if matches!(grid.value[target], Cell::Empty)
&& !matches!(self.value[target], Cell::South)
{
grid.value[target] = Cell::South;
count += 1;
} else {
grid.value[n] = Cell::South;
}
}
}
(count, grid)
}
}
impl std::fmt::Display for Cell {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(
f,
"{}",
match self {
Cell::Empty => '.',
Cell::East => '>',
Cell::South => 'v',
}
)
}
}
impl std::fmt::Display for Grid {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let mut n = 0;
let mut result = String::new();
for _ in 0..self.height {
for _ in 0..self.width {
let line = format!("{}", self.value[n]);
n += 1;
result.push_str(&line);
}
result.push('\n');
}
write!(f, "{}", result)
}
}
impl Solver<&str> for Day25 {
fn part1(data: &str) -> usize {
let mut count = 0;
let mut grid = Grid::new(data);
loop {
let result = grid.step();
count += 1;
if result.0 == 0 {
break;
}
grid = result.1;
}
count
}
fn part2(_data: &str) -> usize {
0
}
}
#[cfg(test)]
mod tests {
use super::*;
const DATA: &str = "v...>>.vv>
.vv>>.vv..
>>.>v>...v
>>v>>.>.v.
v>v.vv.v..
>.>>..v...
.vv..>.>v.
v.v..>>v.v
....v..v.>
";
#[test]
fn test_part1() {
assert_eq!(Day25::part1(DATA), 58);
}
#[test]
fn test_part2() {
assert_eq!(Day25::part2(DATA), 0);
}
}
| 22.508876 | 68 | 0.398002 |
5f471a3686be88dd0ba9218962260cc738a05c40 | 5,216 | ts | TypeScript | mock/data/ledereMock.ts | navikt/syfomodiaperson | 5d99a9a618779284f813c66fb1a479be02305c15 | [
"MIT"
] | null | null | null | mock/data/ledereMock.ts | navikt/syfomodiaperson | 5d99a9a618779284f813c66fb1a479be02305c15 | [
"MIT"
] | 111 | 2020-02-26T15:17:37.000Z | 2022-03-30T11:34:02.000Z | mock/data/ledereMock.ts | navikt/syfomodiaperson | 5d99a9a618779284f813c66fb1a479be02305c15 | [
"MIT"
] | null | null | null | export enum NarmesteLederRelasjonStatus {
INNMELDT_AKTIV = "INNMELDT_AKTIV",
DEAKTIVERT = "DEAKTIVERT",
DEAKTIVERT_ARBEIDSTAKER = "DEAKTIVERT_ARBEIDSTAKER",
DEAKTIVERT_ARBEIDSTAKER_INNSENDT_SYKMELDING = "DEAKTIVERT_ARBEIDSTAKER_INNSENDT_SYKMELDING",
DEAKTIVERT_LEDER = "DEAKTIVERT_LEDER",
DEAKTIVERT_ARBEIDSFORHOLD = "DEAKTIVERT_ARBEIDSFORHOLD",
DEAKTIVERT_NY_LEDER = "DEAKTIVERT_NY_LEDER",
}
export const ledereMock = [
{
uuid: "1",
arbeidstakerPersonIdentNumber: "19026900010",
virksomhetsnummer: "110110110",
virksomhetsnavn: "PONTYPANDY FIRE SERVICE",
narmesteLederPersonIdentNumber: "02690001002",
narmesteLederTelefonnummer: "110",
narmesteLederEpost: "steele@pontypandyfire.gov.uk",
narmesteLederNavn: "Station Officer Steele",
aktivFom: "2018-12-02",
aktivTom: "2019-12-04",
arbeidsgiverForskuttererLoenn: true,
timestamp: "2019-12-02T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.DEAKTIVERT,
},
{
uuid: "2",
arbeidstakerPersonIdentNumber: "19026900010",
virksomhetsnummer: "110110110",
virksomhetsnavn: "PONTYPANDY FIRE SERVICE",
narmesteLederPersonIdentNumber: "02690001008",
narmesteLederTelefonnummer: "12345678",
narmesteLederEpost: "test2@test.no",
narmesteLederNavn: "Are Arbeidsgiver",
aktivFom: "2019-12-04",
aktivTom: "2020-02-06",
arbeidsgiverForskuttererLoenn: false,
timestamp: "2020-02-03T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.DEAKTIVERT_NY_LEDER,
},
{
uuid: "3",
arbeidstakerPersonIdentNumber: "19026900010",
virksomhetsnummer: "110110110",
virksomhetsnavn: "PONTYPANDY FIRE SERVICE",
narmesteLederPersonIdentNumber: "02690001009",
narmesteLederTelefonnummer: "12345666",
narmesteLederEpost: "test3@test.no",
narmesteLederNavn: "Tatten Tattover",
aktivFom: "2020-02-06",
aktivTom: null,
arbeidsgiverForskuttererLoenn: false,
timestamp: "2020-02-06T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.INNMELDT_AKTIV,
},
{
uuid: "4",
arbeidstakerPersonIdentNumber: "19026900001",
virksomhetsnummer: "555666444",
virksomhetsnavn: "BRANN OG BIL AS",
narmesteLederPersonIdentNumber: "02690001009",
narmesteLederTelefonnummer: "87654321",
narmesteLederEpost: "test3@test.no",
narmesteLederNavn: "Lene Leder",
aktivFom: "2019-03-10",
aktivTom: null,
arbeidsgiverForskuttererLoenn: true,
timestamp: "2019-03-10T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.INNMELDT_AKTIV,
},
{
uuid: "5",
arbeidstakerPersonIdentNumber: "19026900002",
virksomhetsnummer: "000999000",
virksomhetsnavn: "KONKURS BEDRIFT OG VENNER AS",
narmesteLederPersonIdentNumber: "02690001009",
narmesteLederTelefonnummer: "87654329",
narmesteLederEpost: "test4@test.no",
narmesteLederNavn: "F. Orrige Leder",
aktivFom: "2020-01-01",
aktivTom: "2020-02-02",
arbeidsgiverForskuttererLoenn: null,
timestamp: "2020-02-02T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.DEAKTIVERT_LEDER,
},
{
uuid: "6",
arbeidstakerPersonIdentNumber: "19026900002",
virksomhetsnummer: "000999000",
virksomhetsnavn: "KONKURS BEDRIFT OG VENNER AS",
narmesteLederPersonIdentNumber: "02690001009",
narmesteLederTelefonnummer: "87654321",
narmesteLederEpost: "test6@test.no",
narmesteLederNavn: "He-man",
aktivFom: "2020-02-02",
aktivTom: "2020-03-03",
arbeidsgiverForskuttererLoenn: null,
timestamp: "2020-03-03T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.DEAKTIVERT_ARBEIDSTAKER,
},
{
uuid: "7",
arbeidstakerPersonIdentNumber: "19026900002",
virksomhetsnummer: "000999000",
virksomhetsnavn: "KONKURS BEDRIFT OG VENNER AS",
narmesteLederPersonIdentNumber: "02690001009",
narmesteLederTelefonnummer: "87654329",
narmesteLederEpost: "test4@test.no",
narmesteLederNavn: "F. Orrige Leder",
aktivFom: "2020-03-03",
aktivTom: "2020-04-04",
arbeidsgiverForskuttererLoenn: null,
timestamp: "2020-04-04T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.DEAKTIVERT_ARBEIDSFORHOLD,
},
{
uuid: "8",
arbeidstakerPersonIdentNumber: "19026900003",
virksomhetsnummer: "170100000",
virksomhetsnavn: "USS Enterprise",
narmesteLederPersonIdentNumber: "02690001009",
narmesteLederTelefonnummer: "87654321",
narmesteLederEpost: "test5@test.no",
narmesteLederNavn: "Jean-Luc Picard",
aktivFom: "2019-02-04",
aktivTom: null,
arbeidsgiverForskuttererLoenn: null,
timestamp: "2019-02-04T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.INNMELDT_AKTIV,
},
{
uuid: "9",
arbeidstakerPersonIdentNumber: "19026900004",
virksomhetsnummer: "912345678",
virksomhetsnavn: "Skomaker Andersen",
narmesteLederPersonIdentNumber: "02690001009",
narmesteLederTelefonnummer: "87654321",
narmesteLederEpost: "test6@test.no",
narmesteLederNavn: "He-man",
aktivFom: "2021-07-01",
aktivTom: null,
arbeidsgiverForskuttererLoenn: null,
timestamp: "2021-07-01T12:00:00+01:00",
status: NarmesteLederRelasjonStatus.INNMELDT_AKTIV,
},
];
| 35.243243 | 94 | 0.724693 |
b156345f812e80c4199551982bf4bc47bc72fad8 | 1,984 | h | C | sorce/mikey/Opera/Grass.h | montoyamoraga/shbobo | 3469747603dfead376111f38b455af1250365848 | [
"MIT"
] | 16 | 2020-12-21T04:52:20.000Z | 2022-02-28T10:15:34.000Z | sorce/mikey/Opera/Grass.h | montoyamoraga/shbobo | 3469747603dfead376111f38b455af1250365848 | [
"MIT"
] | 8 | 2021-01-02T01:01:26.000Z | 2021-12-19T01:40:34.000Z | sorce/mikey/Opera/Grass.h | montoyamoraga/shbobo | 3469747603dfead376111f38b455af1250365848 | [
"MIT"
] | 4 | 2021-01-01T15:27:43.000Z | 2021-08-10T21:14:29.000Z |
struct BistaTranz {
float squl, squr;
bool state;
BistaTranz (){squl=squr=0;}
float calx(float fmm, float den) {
if (state) {
squl += fmm;
if (squl >= den) {
squr = -den;
state = !state;
}
} else {
squr += fmm;
if (squr >= den) {
squl = -den;
state = !state;
}
} return squl;
}
};
struct Bista : Opero {
BistaTranz bt;
shOpr mul, add, fmo, den;
Bista(lua_State *L): Opero() {
broinger(L, 1, "fre", &fmo);
broinger(L, 2, "den", &den, 1.0);
broinger(L, 3, "mul", &mul,1.0);
broinger(L, 4, "add", &add);
}
float calx(float sr) {
mint = 0;
float fmm = 4*fmo->calx(sr)/sr;
float deno = fabs(den->calx(sr));
bt.calx(fmm,deno);
mint = bt.squr * mul->calx(sr) + add->calx(sr);
return mint;
}
static const char className[];
const char * getClassName() { return className; }
};
const char Bista::className[] = "Bista";
struct RunglTranz {
unsigned char pattern;
float mint;
float lastcar;
RunglTranz(){pattern=rand();}
float calx(bool car, bool mod) {
if (car && !lastcar)
pattern = (pattern << 1) | (mod ? 1 : 0);
lastcar = car;
//printf("patternfloat%d\n",pattern);
mint = (float)pattern / 256;
return mint;
}
};
struct Grass : Opero {
BistaTranz square[4];
RunglTranz castle[4];
static const char className[];
shOpr mul, add, fmo, cha;
Grass(lua_State *L): Opero() {
broinger(L, 1, "fre", &fmo);
broinger(L, 2, "cha", &cha);
broinger(L, 3, "mul", &mul,1.0);
broinger(L, 4, "add", &add);
}
float calx(float sr) {
mint = 0;
float chaos = cha->calx(sr);
//printf("chaos%f\n",chaos);
float fmm = 4*fmo->calx(sr)/sr;
for (int i = 0; i < 4; i++) {
square[i].calx(
fmm*(1+chaos*castle[i].calx(
square[(i+2)%4].state, square[(i+1)%4].state)),
1+(float)i/10);
}
float mullo = mul->calx(sr);
mint = square[0].squl*mullo + add->calx(sr);
return mint;
}
const char * getClassName() { return className; }
};
const char Grass::className[] = "Grass"; | 22.545455 | 52 | 0.583669 |
98a35d420bd8a7b85bf17238ab1dd281c15701ea | 926 | html | HTML | manuscript/page-39/body.html | marvindanig/the-people-of-the-abyss | ddcf467f42bf295a0171f041c0d3992782a28701 | [
"CECILL-B"
] | null | null | null | manuscript/page-39/body.html | marvindanig/the-people-of-the-abyss | ddcf467f42bf295a0171f041c0d3992782a28701 | [
"CECILL-B"
] | null | null | null | manuscript/page-39/body.html | marvindanig/the-people-of-the-abyss | ddcf467f42bf295a0171f041c0d3992782a28701 | [
"CECILL-B"
] | null | null | null | <div class="leaf flex"><div class="inner justify"><p>I shall not give you the address of Johnny Upright. Let it suffice that he lives in the most respectable street in the East End—a street that would be considered very mean in America, but a veritable oasis in the desert of East London. It is surrounded on every side by close-packed squalor and streets jammed by a young and vile and dirty generation; but its own pavements are comparatively bare of the children who have no other place to play, while it has an air of desertion, so few are the people that come and go.</p><p>Each house in this street, as in all the streets, is shoulder to shoulder with its neighbours. To each house there is but one entrance, the front door; and each house is about eighteen feet wide, with a bit of a brick-walled yard behind, where, when it is not raining, one may look at a slate-coloured sky.</p></div> </div> | 926 | 926 | 0.772138 |
5dfb1bace744182036361c4426647afc69aa2b48 | 373 | asm | Assembly | programs/oeis/070/A070383.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/070/A070383.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/070/A070383.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A070383: a(n) = 5^n mod 36.
; 1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17,13,29,1,5,25,17
mov $1,1
mov $2,$0
lpb $2
mul $1,5
mod $1,36
sub $2,1
lpe
mov $0,$1
| 31.083333 | 267 | 0.589812 |
ef53113206ffe662ae977a2dee15a9f65785ecd4 | 1,950 | pls | SQL | home/lib/python/exemple/plgrader/one.pls | PremierLangage/premierlangage | 7134a2aadffee2bf264abee6c4b23ea33f1b390b | [
"CECILL-B"
] | 8 | 2019-01-30T13:51:59.000Z | 2022-01-08T03:26:53.000Z | apps/misc_tests/resources/lib/python/exemple/plgrader/one.pls | PremierLangage/premierlangage | 7134a2aadffee2bf264abee6c4b23ea33f1b390b | [
"CECILL-B"
] | 286 | 2019-01-18T21:35:51.000Z | 2022-03-24T18:53:59.000Z | apps/misc_tests/resources/lib/python/exemple/plgrader/one.pls | PremierLangage/premierlangage | 7134a2aadffee2bf264abee6c4b23ea33f1b390b | [
"CECILL-B"
] | 4 | 2019-02-11T13:38:30.000Z | 2021-03-02T20:59:00.000Z | from playexo.strategy import StrategyAPI
def get_last_answered_index(request, activity):
strat = StrategyAPI(activity)
pls = strat.get_pl_list()
i = 0
for pl in pls:
if not strat.get_last_good_answer(pl, request):
return i
i += 1
return 0
def strategy(request, activity):
""" Process request to determine what do to. Should return an HttpResponse. """
strat = StrategyAPI(activity)
current = get_last_answered_index(request, activity)
if request.method == 'GET': # Request changing which exercise will be loaded
action = request.GET.get("action", None)
if action == "pl":
strat.set_pl(strat.get_pl_sha1(request.GET.get("pl_sha1", None)), request)
return HttpResponseRedirect("/playexo/activity/") # Remove get parameters from url
elif action == "pltp":
pl = strat.get_current_pl(request)
if (pl):
can_do = pl.sha1;
strat.set_pl(None, request)
dic = strat.get_pl_dic(strat.get_current_pl(request))
if 'oneshot' in dic and dic['oneshot'] == 'True':
seed = None
else:
seed = strat.get_seed_from_answer(strat.get_last_answer(strat.get_current_pl(request), request))
exercise = strat.load_exercise(request, seed)
if request.method == 'GET': # Request changing or interacting an exercise
if action == "reset":
strat.reset_pl(exercise)
elif action == "next":
pl = strat.get_next_pl(request)
strat.set_pl(pl, request)
return HttpResponseRedirect("/playexo/activity/") # Remove get parameters from url
if request.method == 'POST':
state, feedback = strat.evaluate(exercise, request)
return strat.send_evaluate_feedback(state, feedback)
strat.add_to_context(exercise, 'current_auth', current)
return strat.render(exercise, request)
| 38.235294 | 104 | 0.640513 |
e78125a9eed85a9d56f890e7edbb48bc14b0eef4 | 1,461 | js | JavaScript | lambda/park/GET/index.js | marklise/bcparks-ar-api | 7313adb4696c6ffe5c6f7db5d834c465cc16b324 | [
"Apache-2.0"
] | null | null | null | lambda/park/GET/index.js | marklise/bcparks-ar-api | 7313adb4696c6ffe5c6f7db5d834c465cc16b324 | [
"Apache-2.0"
] | null | null | null | lambda/park/GET/index.js | marklise/bcparks-ar-api | 7313adb4696c6ffe5c6f7db5d834c465cc16b324 | [
"Apache-2.0"
] | null | null | null | const AWS = require('aws-sdk');
const { runQuery, TABLE_NAME } = require('../../dynamoUtil');
const { sendResponse } = require('../../responseUtil');
exports.handler = async (event, context) => {
console.log('GET: Park', event);
let queryObj = {
TableName: TABLE_NAME
};
try {
if (!event.queryStringParameters) {
// Get me a list of parks, with subareas
queryObj.ExpressionAttributeValues = {};
queryObj.ExpressionAttributeValues[':pk'] = { S: 'park' };
queryObj.KeyConditionExpression = 'pk =:pk';
const parkData = await runQuery(queryObj);
return sendResponse(200, parkData, context);
} else if (event.queryStringParameters?.orcs) {
// Get me a list of this parks' subareas with activities details, including config details
queryObj.ExpressionAttributeValues = {};
queryObj.ExpressionAttributeValues[':pk'] = { S: 'park::' + event.queryStringParameters?.orcs };
queryObj.KeyConditionExpression = 'pk =:pk';
if (event.queryStringParameters?.subAreaName) {
// sk for month or a range
queryObj.ExpressionAttributeValues[':sk'] = { S: `${event.queryStringParameters?.subAreaName}` };
queryObj.KeyConditionExpression += ' AND sk =:sk';
}
const parkData = await runQuery(queryObj);
return sendResponse(200, parkData, context);
}
} catch (err) {
console.log("EEE:", err);
return sendResponse(400, err, context);
}
}; | 36.525 | 105 | 0.652977 |
8c1cd1193490b6043dceafbc312e302e08e02328 | 1,496 | kt | Kotlin | java-time/src/main/kotlin/com/github/debop/javatimes/PeriodExtensions.kt | debop/joda-time-kotlin | cbb0efedaa53bdf9d77b230d8477cb0ae0d7abd7 | [
"ECL-2.0",
"Apache-2.0"
] | 91 | 2016-07-15T03:06:17.000Z | 2021-12-07T11:16:44.000Z | java-time/src/main/kotlin/com/github/debop/javatimes/PeriodExtensions.kt | debop/joda-time-kotlin | cbb0efedaa53bdf9d77b230d8477cb0ae0d7abd7 | [
"ECL-2.0",
"Apache-2.0"
] | 11 | 2016-11-23T11:04:30.000Z | 2021-05-18T13:07:11.000Z | java-time/src/main/kotlin/com/github/debop/javatimes/PeriodExtensions.kt | debop/joda-time-kotlin | cbb0efedaa53bdf9d77b230d8477cb0ae0d7abd7 | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2017-01-23T13:35:25.000Z | 2020-06-08T06:26:48.000Z | package com.github.debop.javatimes
import java.time.Period
import java.time.temporal.Temporal
operator fun Period.unaryMinus(): Period = this.negated()
@Suppress("UNCHECKED_CAST")
operator fun <T : Temporal> Period.plus(instant: T): T = addTo(instant) as T
@Suppress("UNCHECKED_CAST")
operator fun <T : Temporal> Period.minus(instant: T): T = subtractFrom(instant) as T
@JvmOverloads
fun periodOf(years: Int, months: Int = 0, days: Int = 0): Period = Period.of(years, months, days)
/**
* year sequence of `Period`
*/
suspend fun Period.yearSequence(): Sequence<Int> = sequence {
var year = 0
val years = this@yearSequence.years
if(years > 0) {
while(year < years) {
yield(year++)
}
} else {
while(year > years) {
yield(year--)
}
}
}
/**
* month sequence of `java.time.Period`
*/
suspend fun Period.monthSequence(): Sequence<Int> = sequence {
var month = 0
val months = this@monthSequence.months
if(months > 0) {
while(month < months) {
yield(month++)
}
} else {
while(month > months) {
yield(month--)
}
}
}
/**
* day sequence of `java.time.Period`
*/
suspend fun Period.daySequence(): Sequence<Int> = sequence {
var day = 0
val days = this@daySequence.days
if(days > 0) {
while(day < days) {
yield(day++)
}
} else {
while(day > days) {
yield(day--)
}
}
} | 22.666667 | 97 | 0.57754 |
5f7a69cbbbb8ee7c899422ea37bef9ab9122e016 | 1,207 | swift | Swift | Sources/Additions/Inactive/WeakAny.swift | MutatingFunc/Additions | da23bcc0ac650af6081a910cd3d203fd332d55c6 | [
"MIT"
] | null | null | null | Sources/Additions/Inactive/WeakAny.swift | MutatingFunc/Additions | da23bcc0ac650af6081a910cd3d203fd332d55c6 | [
"MIT"
] | null | null | null | Sources/Additions/Inactive/WeakAny.swift | MutatingFunc/Additions | da23bcc0ac650af6081a910cd3d203fd332d55c6 | [
"MIT"
] | null | null | null | //
// WeakAny.swift
// Additions
//
// Created by James Froggatt on 22.09.2016.
//
//
/*
inactive - no valid use found
*/
//private, to avoid explicit case access
private enum _WeakAny<Type> {
case valueType(Type?)
case referenceType(Weak<AnyObject>)
init(target: Type?) {
//this cast will succeed only if the passed target is a non-nil reference, no matter the static value of Type, as long as Foundation is not imported
if let unwrapped = target, type(of: unwrapped) is AnyClass {
self = .referenceType(Weak(unwrapped as AnyObject))
} else {
self = .valueType(target)
}
}
var target: Type? {
get {
switch self {
case .referenceType(let weak): return weak.target as? Type
case .valueType(let value): return value
}
}
set {
self = .init(target: newValue)
}
}
}
///acts as a weak wrapper around a reference-type, or a regular wrapper around a value-type
public struct WeakAny<Type> {
private var data: _WeakAny<Type>
///the contained value, stored weakly if value is a reference type
public var target: Type? {
get {return data.target}
set {data.target = newValue}
}
public init(_ target: Type?) {
self.data = _WeakAny(target: target)
}
}
| 22.351852 | 150 | 0.68517 |
ddb15c7ec1b8fe1e7ef296f7b340a217ed323ff3 | 1,376 | php | PHP | src/Support/Helpers/Json.php | movoin/one-swoole | b9b175963ead91416cc50902a04e05ff3ef571de | [
"Apache-2.0"
] | null | null | null | src/Support/Helpers/Json.php | movoin/one-swoole | b9b175963ead91416cc50902a04e05ff3ef571de | [
"Apache-2.0"
] | null | null | null | src/Support/Helpers/Json.php | movoin/one-swoole | b9b175963ead91416cc50902a04e05ff3ef571de | [
"Apache-2.0"
] | null | null | null | <?php
/**
* This file is part of the One package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package One\Support\Helpers
* @author Allen Luo <movoin@gmail.com>
* @since 0.1
*/
namespace One\Support\Helpers;
use One\Support\Exceptions\JsonException;
final class Json
{
/**
* 对内容进行 JSON 编码
*
* @param mixed $value
*
* @return string
* @throws \One\Support\Exceptions\JsonException
*/
public static function encode($value): string
{
$flags = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
| (defined('JSON_PRESERVE_ZERO_FRACTION') ? JSON_PRESERVE_ZERO_FRACTION : 0);
$json = json_encode($value, $flags);
if ($error = json_last_error()) {
throw new JsonException(json_last_error_msg(), $error);
}
return $json;
}
/**
* 对 JSON 进行解码
*
* @param string $json
*
* @return mixed
* @throws \One\Support\Exceptions\JsonException
*/
public static function decode(string $json)
{
$value = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);
if ($error = json_last_error()) {
throw new JsonException(json_last_error_msg(), $error);
}
return $value;
}
}
| 22.933333 | 89 | 0.603198 |
0802da7ea8466fcaef8aac84e2e1797171251f03 | 54,026 | html | HTML | docs/E04011561/index.html | digital-land/parish | d10189d218f6ab8a28551fd4a41eb159387d222b | [
"MIT"
] | null | null | null | docs/E04011561/index.html | digital-land/parish | d10189d218f6ab8a28551fd4a41eb159387d222b | [
"MIT"
] | 2 | 2021-06-03T16:03:09.000Z | 2021-06-03T16:03:10.000Z | docs/E04011561/index.html | digital-land/parish | d10189d218f6ab8a28551fd4a41eb159387d222b | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="en" class="govuk-template ">
<head>
<meta charset="utf-8">
<title>St. Keverne | Parish | Digital Land</title>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="theme-color" content="#0b0c0c"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" sizes="48x48" href="/images/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" sizes="32x32" href="/images/favicon-32x32.png" type="image/png">
<link rel="shortcut icon" sizes="16x16" href="/images/favicon-16x16.png" type="image/png">
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png">
<meta name="digital-land:template" content="page-per-thing/record.html">
<script src="https://polyfill.io/v3/polyfill.min.js?features=fetch%2CPromise%2Ces6%2Ces5%2Ces2015%2Ces2016%2CURL%2CURLSearchParams%2CObject.entries%2CObject.fromEntries%2CAbortController"></script>
<!-- should make this optional, no need to load if not showing a map -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin="" />
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script>
<!-- assets needed for fullscreen maps -->
<script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js'></script>
<link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css' rel='stylesheet' />
<!-- script needed for recentring map -->
<script src="https://digital-land.github.io/javascripts/Leaflet.recentre.js"></script>
<script src="https://digital-land.github.io/javascripts/dl-maps.js"></script> <link href="https://digital-land.github.io/stylesheets/dl-frontend.css" rel="stylesheet" /> <meta property="og:image" content="/images/govuk-opengraph-image.png">
</head>
<body class="govuk-template__body ">
<script>document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');</script>
<a href="#main-content" class="govuk-skip-link">Skip to main content</a>
<!-- Cookie banner partial version 1.0.1 -->
<div id="global-cookie-message" class="govuk-clearfix global-cookie-message" data-module="cookie-banner" role="region" aria-label="cookie banner" data-nosnippet="">
<div id="cookie-banner" class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="cookie-banner__message govuk-!-margin-top-6">
<h2 class="govuk-heading-m">Tell us whether you accept cookies</h2>
<p class="govuk-body">We use <a class="govuk-link" href="/cookies">cookies to collect information</a> about how you use the Digital Land website to make the website work as well as possible.</p>
</div>
<div class="cooke-banner__buttons govuk-grid-row">
<div class="govuk-grid-column-one-half">
<button class="govuk-button" onclick="acceptCookies();showCookieConfirmation();">Accept all cookies</button>
</div>
<div class="govuk-grid-column-one-half">
<a class="govuk-button" href="/cookies">Set cookie preferences</a>
</div>
</div>
</div>
</div>
</div>
<div id="cookie-confirmation" class="govuk-width-container govuk-!-padding-top-6" tabindex="-1" style="display: none;">
<p class="cookie-banner__confirmation-message govuk-body">You’ve accepted all cookies. You can <a class="govuk-link" href="/cookies">change your cookie settings</a> at any time.</p>
<button class="cookie-banner__hide-button govuk-button govuk-button--secondary" onclick="document.getElementById('cookie-confirmation').style.display='none';">Hide</button>
</div>
</div><header role="banner" id="global-header" class="govuk-header with-proposition dl-header" data-module="govuk-header">
<div class="govuk-header__container govuk-width-container">
<div class="header-proposition">
<div class="govuk-header__content">
<a href="https://digital-land.github.io/" class="govuk-header__link govuk-header__link--service-name">
Digital Land
</a>
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button> <nav>
<ul id="navigation" class="govuk-header__navigation" aria-label="Top Level Navigation">
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/about">Team</a>
</li>
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/project/">Projects</a>
</li>
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/weeknote/">Weeknotes</a>
</li>
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/blog-post/">Blog</a>
</li>
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/guidance/">Guidance</a>
</li>
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/dataset/">Datasets</a>
</li>
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/organisation/">Organisations</a>
</li>
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="/map/">Map</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="govuk-width-container ">
<div class="govuk-phase-banner">
<p class="govuk-phase-banner__content"><strong class="govuk-tag govuk-phase-banner__content__tag ">
prototype
</strong><span class="govuk-phase-banner__text">
This is a prototype. Please provide feedback to the Digital Land team.
</span>
</p>
</div><div class="govuk-breadcrumbs ">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="/">Digital Land</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="../">Parish</a>
</li>
<li class="govuk-breadcrumbs__list-item" aria-current="page">parish:E04011561</li>
</ol>
</div> <main class="govuk-main-wrapper " id="main-content" role="main">
<span class="govuk-caption-xl">Parish</span>
<h1 class="govuk-heading-xl">St. Keverne</h1>
<div class="govuk-tabs" data-module="dlf-subnav">
<h2 class="govuk-tabs__title">
Contents
</h2>
<nav class="dlf-subnav" aria-label="Sub navigation">
<ul class="dlf-subnav__list">
<li class="dlf-subnav__list-item dlf-subnav__list-item--selected">
<a class="dlf-subnav__list-item__link" href="#record" data-module-sub-nav="tab">
Record
</a>
</li> <li class="dlf-subnav__list-item">
<a class="dlf-subnav__list-item__link" href="#history" data-module-sub-nav="tab">
History
</a>
</li><li class="dlf-subnav__list-item">
<a class="dlf-subnav__list-item__link" href="#referenced-by" data-module-sub-nav="tab">
0 References
</a>
</li>
</ul>
</nav>
<div id="record">
<div class="govuk-grid-row"> <div class="govuk-grid-column-two-thirds">
<!-- this section can probably be removed. Entities no longer have a resource field --><article class="data-record govuk-!-margin-bottom-6">
<h4 class="govuk-heading-s data-record__identifier">#/parish/E04011561</h4>
<dl class="govuk-summary-list data-record__properties"> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Reference
</dt>
<dd class="govuk-summary-list__value"> E04011561 </dd>
</div> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Name
</dt>
<dd class="govuk-summary-list__value"> St. Keverne </dd>
</div> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Organisation
</dt>
<dd class="govuk-summary-list__value"><a href="/entity/?slug=/organisation/government-organisation/D303" class="govuk-link">Office for National Statistics</a>
<span title="Organisation identifier: government-organisation:D303" class="govuk-!-font-size-16 secondary-text data-reference">(<span class="govuk-visually-hidden">Organisation identifier is </span>government-organisation:D303)</span>
</dd>
</div> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Geography
</dt>
<dd class="govuk-summary-list__value"> parish:E04011561 </dd>
</div> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Entity
</dt>
<dd class="govuk-summary-list__value"> 10037 </dd>
</div> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Entry date
</dt>
<dd class="govuk-summary-list__value"> 2021-02-12 </dd>
</div>
</dl></article>
</div>
</div>
<h2 class="govuk-heading-m">Geographical area</h2>
<div class="dl-map__wrapper govuk-!-margin-top-4 dl-map__wrapper--bottom-margin" style="min-height: 460px;"><div
class="dl-map"
id="dlMap"
data-module="boundary-map"
>
<noscript>To view this map, you need to enable JavaScript.</noscript>
</div>
<a class="js-hidden dl-link-national-map" href="#">See on national map.</a>
</div>
<div class="govuk-!-margin-top-2 govuk-!-margin-bottom-6">
<a class="dl-page-action-button" href="geometry.geojson">Download geojson</a>
</div>
<h3 class="govuk-heading-m">Associated information</h3>
<ul class="govuk-list govuk-list--bullet">
<li><a href="https://digital-land.github.io/specification/schema/geography/">View the geography schema</a></li></ul>
</div><div id="history"><h2 class="govuk-heading-m dlf-subnav__heading">History</h2>
<div class="data-table__wrapper" data-module="data-table">
<div class="data-table-left-shadow with-transition"></div>
<div class="wide-table">
<table class="data-table">
<thead>
<tr>
<th>entry-date</th>
<th>resource</th>
<th>line</th>
<th>geography</th>
<th>name</th>
<th>reference</th>
<th>organisation</th>
<th>geometry</th>
</tr>
</thead>
<tbody> <tr>
<td>2021-02-12</td>
<td><a href="https://github.com/digital-land/parish-collection/tree/main/transformed/parish/abba36cb6dc0396e50358a9461382dd5756e79871284d1cc2a959ecdb1ba0a69.csv#L9158">abba36cb6dc0...</a></td>
<td>9157</td>
<td>parish:E04011561</td>
<td>St. Keverne</td>
<td>E04011561</td>
<td>government-organisation:D303</td>
<td class="data-table__notes-cell data-table__cell--min-width-4">
<details class="govuk-details">
<summary class="govuk-details__summary">
<span class="govuk-details__summary-text">
See WKT
</span>
</summary>
<div class="govuk-details__text">
MULTIPOLYGON (((-5.156669 50.007539,-5.156113 50.007673,-5.155965 50.007683,-5.155847 50.007783,-5.155557 50.007694,-5.155346 50.007741,-5.155266 50.007604,-5.155168 50.007572,-5.155093 50.007621,-5.155074 50.007695,-5.154878 50.007622,-5.154844 50.007555,-5.154742 50.007579,-5.154534 50.007492,-5.154464 50.007430,-5.154439 50.007355,-5.154340 50.007322,-5.153987 50.007316,-5.153996 50.007244,-5.153952 50.007177,-5.153698 50.007026,-5.153586 50.007017,-5.153402 50.007081,-5.153263 50.006974,-5.153049 50.006981,-5.152993 50.007040,-5.152787 50.007025,-5.152747 50.006891,-5.152786 50.006822,-5.152643 50.006686,-5.152564 50.006756,-5.152466 50.006951,-5.152365 50.006978,-5.152270 50.006943,-5.152187 50.006848,-5.151962 50.006864,-5.151870 50.006902,-5.151757 50.006783,-5.151667 50.006747,-5.151559 50.006754,-5.151513 50.006827,-5.151630 50.006946,-5.151719 50.006983,-5.151756 50.007048,-5.151541 50.007023,-5.151519 50.006954,-5.151389 50.006822,-5.151301 50.006761,-5.151198 50.006775,-5.151139 50.006831,-5.151129 50.006906,-5.151192 50.007044,-5.151112 50.007177,-5.150812 50.007117,-5.150755 50.007054,-5.150533 50.007039,-5.150448 50.006991,-5.150356 50.007035,-5.149764 50.007101,-5.149699 50.007082,-5.149715 50.006931,-5.149752 50.006862,-5.149719 50.006798,-5.149608 50.006793,-5.149466 50.006986,-5.149357 50.006959,-5.149327 50.006894,-5.149356 50.006825,-5.149262 50.006788,-5.149221 50.006723,-5.149020 50.006777,-5.148971 50.006917,-5.148981 50.006993,-5.148887 50.007037,-5.148769 50.007040,-5.148696 50.007101,-5.148691 50.007170,-5.148598 50.007208,-5.148351 50.007265,-5.148151 50.007205,-5.147718 50.007238,-5.147571 50.007352,-5.147363 50.007403,-5.147201 50.007513,-5.146680 50.007612,-5.146605 50.007661,-5.146405 50.007640,-5.146369 50.007704,-5.145811 50.007733,-5.145825 50.007872,-5.145627 50.007819,-5.145536 50.007861,-5.145521 50.007940,-5.145416 50.007964,-5.145116 50.007881,-5.145011 50.007901,-5.144861 50.007798,-5.144839 50.007727,-5.144750 50.007683,-5.144638 50.007717,-5.144569 50.007775,-5.144199 50.007791,-5.144081 50.007825,-5.143892 50.007754,-5.143567 50.007716,-5.143359 50.007925,-5.143280 50.007720,-5.143098 50.007637,-5.142877 50.007644,-5.142925 50.007846,-5.142871 50.007908,-5.142704 50.007899,-5.142384 50.007751,-5.142059 50.007761,-5.142085 50.007683,-5.141998 50.007551,-5.141725 50.007535,-5.141196 50.007636,-5.140753 50.007869,-5.140365 50.007934,-5.140111 50.007892,-5.139932 50.007967,-5.139748 50.007922,-5.139604 50.007809,-5.139485 50.007772,-5.138957 50.007705,-5.138760 50.007762,-5.138586 50.007881,-5.138455 50.007989,-5.138455 50.008057,-5.138369 50.008156,-5.137906 50.008198,-5.137708 50.008139,-5.137535 50.007948,-5.137520 50.007863,-5.137441 50.007818,-5.137312 50.007808,-5.137086 50.007849,-5.136899 50.007778,-5.136812 50.007820,-5.136617 50.007790,-5.136637 50.007722,-5.136442 50.007556,-5.136551 50.007563,-5.136577 50.007495,-5.136256 50.007271,-5.136232 50.007342,-5.136132 50.007368,-5.135963 50.007286,-5.135762 50.007338,-5.135717 50.007402,-5.135623 50.007369,-5.135517 50.007397,-5.135498 50.007467,-5.135396 50.007489,-5.135298 50.007357,-5.135378 50.007147,-5.135478 50.007011,-5.135401 50.006964,-5.135514 50.006769,-5.135464 50.006708,-5.135553 50.006664,-5.135462 50.006604,-5.135357 50.006585,-5.135296 50.006641,-5.135330 50.006712,-5.135297 50.006777,-5.135175 50.006797,-5.135046 50.006762,-5.135126 50.006552,-5.135005 50.006567,-5.134991 50.006496,-5.134899 50.006445,-5.134794 50.006433,-5.135059 50.006301,-5.135091 50.006235,-5.134986 50.006215,-5.134873 50.006236,-5.134764 50.006355,-5.134657 50.006339,-5.134548 50.006233,-5.134581 50.006163,-5.134557 50.006096,-5.134647 50.006058,-5.134594 50.005998,-5.134656 50.005938,-5.134619 50.005869,-5.134674 50.005728,-5.134567 50.005750,-5.134533 50.005817,-5.134436 50.005845,-5.134271 50.005738,-5.134179 50.005772,-5.133840 50.005783,-5.133865 50.005715,-5.133767 50.005687,-5.133672 50.005724,-5.133630 50.005646,-5.133526 50.005634,-5.133456 50.005567,-5.133350 50.005567,-5.133311 50.005502,-5.133396 50.005459,-5.133434 50.005392,-5.133398 50.005323,-5.133280 50.005309,-5.133189 50.005344,-5.133212 50.005418,-5.133176 50.005483,-5.133178 50.005626,-5.132957 50.005622,-5.132865 50.005582,-5.132849 50.005507,-5.132887 50.005438,-5.132832 50.005372,-5.132666 50.005265,-5.132535 50.005223,-5.132497 50.005288,-5.132544 50.005357,-5.132445 50.005380,-5.132475 50.005518,-5.132554 50.005567,-5.132496 50.005638,-5.132621 50.005652,-5.132690 50.005704,-5.132672 50.005771,-5.132754 50.005912,-5.132865 50.005915,-5.132934 50.005972,-5.132867 50.006104,-5.132789 50.006154,-5.132835 50.006219,-5.132806 50.006286,-5.132895 50.006325,-5.132858 50.006399,-5.132864 50.006480,-5.133119 50.006621,-5.133152 50.006687,-5.132949 50.006724,-5.132962 50.006856,-5.133105 50.006955,-5.133256 50.007147,-5.133168 50.007187,-5.132955 50.007194,-5.132936 50.007264,-5.132823 50.007275,-5.132740 50.007322,-5.132775 50.007396,-5.133015 50.007416,-5.133261 50.007552,-5.133050 50.007578,-5.133087 50.007642,-5.133287 50.007670,-5.133329 50.007737,-5.133291 50.007806,-5.133297 50.007881,-5.133241 50.007942,-5.133132 50.007966,-5.132846 50.007934,-5.132685 50.007792,-5.132580 50.007802,-5.132538 50.007865,-5.132654 50.007995,-5.132551 50.008022,-5.132110 50.008025,-5.131942 50.007942,-5.131894 50.008009,-5.131924 50.008079,-5.131855 50.008134,-5.131668 50.008053,-5.131632 50.007981,-5.131521 50.007983,-5.131474 50.008095,-5.131560 50.008147,-5.131519 50.008141,-5.131546 50.008173,-5.131433 50.008131,-5.131219 50.008137,-5.131170 50.008199,-5.130825 50.008206,-5.130707 50.008087,-5.130490 50.008077,-5.130419 50.008211,-5.130317 50.008249,-5.129472 50.008091,-5.129240 50.008107,-5.129131 50.008140,-5.129109 50.008215,-5.129155 50.008284,-5.129307 50.008382,-5.129550 50.008443,-5.129611 50.008488,-5.129609 50.008561,-5.129690 50.008604,-5.129582 50.008627,-5.129547 50.008705,-5.129334 50.008731,-5.129162 50.008622,-5.128989 50.008559,-5.128812 50.008546,-5.128294 50.008542,-5.128053 50.008587,-5.127970 50.008642,-5.127861 50.008637,-5.127868 50.008564,-5.127795 50.008513,-5.127697 50.008228,-5.127509 50.008144,-5.127287 50.007884,-5.126873 50.007709,-5.126623 50.007682,-5.126499 50.007709,-5.126090 50.007549,-5.125646 50.007480,-5.125514 50.007529,-5.125247 50.007881,-5.125224 50.007958,-5.125154 50.008018,-5.124711 50.008075,-5.124593 50.008046,-5.124502 50.008002,-5.124459 50.007935,-5.124326 50.007895,-5.124215 50.007882,-5.124109 50.007926,-5.124037 50.008065,-5.123963 50.008123,-5.123955 50.008194,-5.124026 50.008333,-5.124117 50.008369,-5.124183 50.008505,-5.123872 50.008472,-5.123488 50.008595,-5.123388 50.008569,-5.123373 50.008501,-5.123293 50.008453,-5.123175 50.008466,-5.123094 50.008523,-5.123093 50.008591,-5.123250 50.008711,-5.123285 50.008804,-5.123289 50.009099,-5.123246 50.009177,-5.123203 50.009112,-5.123173 50.008885,-5.123102 50.008817,-5.122895 50.008735,-5.122783 50.008743,-5.122669 50.008628,-5.122582 50.008593,-5.122485 50.008622,-5.122529 50.008941,-5.122596 50.009007,-5.122630 50.009102,-5.122587 50.009239,-5.122412 50.009197,-5.122234 50.009104,-5.121703 50.009011,-5.121632 50.008941,-5.121510 50.008927,-5.121484 50.008784,-5.121573 50.008822,-5.121572 50.008751,-5.121201 50.008592,-5.121157 50.008519,-5.121184 50.008368,-5.121094 50.008324,-5.120972 50.008531,-5.120769 50.008479,-5.120661 50.008358,-5.120449 50.008336,-5.120196 50.008009,-5.120257 50.007952,-5.120260 50.007883,-5.120144 50.007764,-5.120132 50.007693,-5.120209 50.007557,-5.120292 50.007510,-5.120104 50.007300,-5.119820 50.007160,-5.119693 50.006995,-5.119164 50.006705,-5.118893 50.006628,-5.118538 50.006589,-5.118307 50.006622,-5.118054 50.006462,-5.118059 50.006413,-5.117919 50.006380,-5.117520 50.006384,-5.117550 50.006287,-5.117446 50.006278,-5.117348 50.006305,-5.117289 50.006361,-5.117243 50.006595,-5.117140 50.006641,-5.116890 50.006672,-5.116796 50.006722,-5.116664 50.006736,-5.116720 50.006576,-5.116684 50.006501,-5.116492 50.006410,-5.116399 50.006279,-5.116289 50.006260,-5.115979 50.006323,-5.115877 50.006383,-5.115761 50.006511,-5.115676 50.006548,-5.115548 50.006579,-5.115424 50.006540,-5.115344 50.006359,-5.115337 50.006252,-5.115246 50.006069,-5.115218 50.005738,-5.115153 50.005516,-5.115216 50.005358,-5.115169 50.005057,-5.114735 50.004601,-5.114511 50.004540,-5.114352 50.004434,-5.114121 50.004378,-5.114115 50.004307,-5.114237 50.004184,-5.114212 50.004111,-5.114064 50.003996,-5.113875 50.003877,-5.113662 50.003840,-5.113607 50.003752,-5.113312 50.003632,-5.113194 50.003495,-5.113027 50.003388,-5.112700 50.003287,-5.112456 50.003261,-5.112387 50.003209,-5.112458 50.003157,-5.112796 50.003081,-5.112852 50.002980,-5.112789 50.002923,-5.112386 50.002802,-5.112177 50.002798,-5.112079 50.002831,-5.111969 50.002811,-5.111912 50.002879,-5.111703 50.002914,-5.111438 50.003036,-5.111093 50.003051,-5.110760 50.002998,-5.110563 50.002919,-5.110535 50.002852,-5.110359 50.002670,-5.110389 50.002597,-5.110365 50.002530,-5.110258 50.002552,-5.109970 50.002456,-5.109735 50.002468,-5.109658 50.002522,-5.109670 50.002592,-5.109973 50.002650,-5.110122 50.002786,-5.110323 50.002856,-5.110053 50.002845,-5.109973 50.002890,-5.109769 50.002869,-5.109702 50.002927,-5.109586 50.003066,-5.109605 50.003136,-5.109701 50.003182,-5.109661 50.003278,-5.109802 50.003363,-5.109718 50.003404,-5.109464 50.003320,-5.109244 50.003325,-5.109149 50.003474,-5.109221 50.003636,-5.109166 50.003700,-5.109097 50.003753,-5.108928 50.003678,-5.108851 50.003742,-5.108933 50.003883,-5.108822 50.003878,-5.108637 50.004012,-5.108053 50.004204,-5.107872 50.004340,-5.107557 50.004506,-5.107322 50.004790,-5.107159 50.004869,-5.107039 50.004798,-5.106928 50.004810,-5.106849 50.004862,-5.106699 50.004828,-5.106609 50.004868,-5.106669 50.004952,-5.106885 50.004990,-5.106594 50.005064,-5.106575 50.004990,-5.106409 50.004791,-5.106236 50.004818,-5.106280 50.004954,-5.106350 50.005004,-5.106319 50.005070,-5.106371 50.005130,-5.106343 50.005152,-5.106245 50.005087,-5.106198 50.004947,-5.106123 50.004898,-5.105824 50.004841,-5.105463 50.004840,-5.104929 50.004956,-5.104347 50.004944,-5.104178 50.004837,-5.103412 50.004646,-5.102924 50.004697,-5.102821 50.004651,-5.102753 50.004578,-5.102777 50.004509,-5.102608 50.004320,-5.102243 50.004253,-5.101950 50.004147,-5.101625 50.004161,-5.101404 50.004212,-5.101310 50.004248,-5.101093 50.004430,-5.101036 50.004583,-5.100958 50.004659,-5.100756 50.004771,-5.100636 50.004900,-5.100520 50.004898,-5.100528 50.004967,-5.100463 50.005020,-5.100379 50.005297,-5.100285 50.005350,-5.100453 50.005438,-5.100503 50.005499,-5.100485 50.005586,-5.100320 50.005907,-5.100232 50.005962,-5.100023 50.006012,-5.099916 50.006213,-5.100095 50.006284,-5.100145 50.006345,-5.099933 50.006711,-5.099946 50.007130,-5.099746 50.007426,-5.099716 50.007509,-5.099765 50.007656,-5.099726 50.007721,-5.099549 50.007621,-5.099458 50.007658,-5.099059 50.007596,-5.098984 50.007648,-5.098941 50.007820,-5.099099 50.007887,-5.099135 50.007953,-5.099130 50.008022,-5.099020 50.008136,-5.098898 50.008179,-5.098390 50.008250,-5.098334 50.008312,-5.098362 50.008452,-5.098325 50.008384,-5.098231 50.008350,-5.098059 50.008431,-5.098056 50.008505,-5.098125 50.008636,-5.098005 50.008839,-5.098150 50.008937,-5.098258 50.009077,-5.098206 50.009139,-5.098192 50.009220,-5.097935 50.009366,-5.097872 50.009441,-5.097870 50.009583,-5.097833 50.009657,-5.097679 50.009770,-5.097637 50.009842,-5.097675 50.009906,-5.097639 50.009975,-5.097594 50.010036,-5.097486 50.010053,-5.097548 50.010113,-5.097532 50.010185,-5.097629 50.010321,-5.097529 50.010591,-5.097527 50.010663,-5.097610 50.010718,-5.097427 50.010793,-5.097467 50.010859,-5.097369 50.010824,-5.097353 50.010891,-5.097566 50.011063,-5.097447 50.011201,-5.097562 50.011327,-5.097352 50.011353,-5.097289 50.011414,-5.097322 50.011492,-5.097542 50.011640,-5.097409 50.011765,-5.097383 50.011833,-5.097396 50.011906,-5.097477 50.011961,-5.097448 50.012026,-5.097524 50.012166,-5.097530 50.012249,-5.097438 50.012207,-5.097427 50.012276,-5.097508 50.012328,-5.097403 50.012325,-5.097627 50.012576,-5.097538 50.012704,-5.097555 50.012777,-5.097482 50.012841,-5.097472 50.012912,-5.097406 50.012970,-5.097210 50.013051,-5.097280 50.013184,-5.097193 50.013321,-5.097080 50.013294,-5.097019 50.013234,-5.096913 50.013234,-5.096987 50.013363,-5.096971 50.013445,-5.097007 50.013508,-5.097110 50.013522,-5.097096 50.013673,-5.097169 50.013722,-5.097136 50.014010,-5.097092 50.014075,-5.096993 50.014121,-5.096899 50.014245,-5.096677 50.014409,-5.096561 50.014431,-5.096483 50.014481,-5.096399 50.014609,-5.096476 50.014656,-5.096499 50.014722,-5.096378 50.014835,-5.096217 50.014926,-5.096199 50.015062,-5.096134 50.015192,-5.096042 50.015245,-5.095938 50.015236,-5.095873 50.015306,-5.095947 50.015389,-5.095889 50.015451,-5.095789 50.015481,-5.095828 50.015557,-5.095803 50.015624,-5.095727 50.015675,-5.095611 50.015680,-5.095571 50.015746,-5.095630 50.015802,-5.095376 50.015958,-5.095256 50.015995,-5.095043 50.016029,-5.094301 50.015984,-5.093274 50.015701,-5.092716 50.015379,-5.092078 50.015193,-5.091679 50.015255,-5.091445 50.015336,-5.091235 50.015517,-5.091211 50.015649,-5.091161 50.015713,-5.091149 50.015876,-5.091269 50.016159,-5.091526 50.016381,-5.091717 50.016328,-5.091923 50.016370,-5.092019 50.016341,-5.092338 50.016429,-5.092563 50.016422,-5.093050 50.016610,-5.093279 50.016723,-5.093516 50.016944,-5.093953 50.017086,-5.094221 50.017235,-5.094422 50.017441,-5.094525 50.017705,-5.094741 50.017934,-5.094738 50.018088,-5.094863 50.018225,-5.095000 50.018465,-5.095117 50.018832,-5.095332 50.019316,-5.095477 50.019974,-5.095850 50.020304,-5.096052 50.020793,-5.096059 50.020874,-5.095928 50.021018,-5.095494 50.021314,-5.094876 50.021530,-5.094394 50.021655,-5.094181 50.021609,-5.093797 50.021605,-5.093606 50.021691,-5.093415 50.021834,-5.093424 50.021997,-5.093384 50.022065,-5.092853 50.022286,-5.092789 50.022491,-5.092727 50.022549,-5.092829 50.022684,-5.092851 50.022616,-5.093102 50.022785,-5.093347 50.022685,-5.093465 50.022673,-5.093625 50.022718,-5.093732 50.022809,-5.093762 50.022903,-5.094274 50.023024,-5.094433 50.023006,-5.093928 50.022847,-5.093929 50.022708,-5.094051 50.022693,-5.094007 50.022590,-5.094100 50.022542,-5.094323 50.022522,-5.094562 50.022546,-5.094644 50.022638,-5.094644 50.022705,-5.094844 50.022836,-5.094943 50.022860,-5.095035 50.022826,-5.095116 50.022746,-5.095323 50.022746,-5.095400 50.022776,-5.095656 50.022925,-5.095747 50.023103,-5.096002 50.023128,-5.095885 50.023253,-5.095986 50.023288,-5.096556 50.023153,-5.096775 50.023192,-5.097116 50.023362,-5.097315 50.023650,-5.097414 50.023921,-5.097485 50.024505,-5.097488 50.024812,-5.097364 50.025319,-5.097265 50.025592,-5.097218 50.025617,-5.097241 50.025626,-5.097052 50.026038,-5.096803 50.026367,-5.096239 50.026843,-5.095724 50.027222,-5.095645 50.027271,-5.095432 50.027306,-5.095407 50.027373,-5.095210 50.027558,-5.094755 50.027785,-5.094534 50.027801,-5.094465 50.027946,-5.093946 50.028363,-5.093619 50.028463,-5.093541 50.028533,-5.093339 50.028492,-5.093351 50.028626,-5.093113 50.028608,-5.093153 50.028674,-5.093082 50.028741,-5.092599 50.029072,-5.092370 50.029115,-5.092315 50.029185,-5.092052 50.029293,-5.091889 50.029396,-5.091757 50.029411,-5.091661 50.029462,-5.091742 50.029508,-5.091450 50.029608,-5.091457 50.029675,-5.091589 50.029764,-5.091533 50.029902,-5.091077 50.030152,-5.090958 50.030318,-5.090836 50.030404,-5.090538 50.030516,-5.090468 50.030625,-5.090317 50.030618,-5.090225 50.030756,-5.090127 50.030790,-5.090140 50.030858,-5.090023 50.030827,-5.089901 50.030927,-5.089792 50.030931,-5.089833 50.030993,-5.089511 50.030916,-5.089401 50.030937,-5.089329 50.031008,-5.089474 50.031192,-5.089474 50.031263,-5.089394 50.031332,-5.089200 50.031282,-5.089116 50.031331,-5.088872 50.031288,-5.088532 50.031446,-5.087125 50.031846,-5.085559 50.032199,-5.085170 50.032214,-5.084720 50.032181,-5.084388 50.032070,-5.084141 50.032063,-5.083912 50.032136,-5.083734 50.032125,-5.083733 50.031970,-5.083694 50.031898,-5.083563 50.031874,-5.083447 50.031892,-5.083358 50.031932,-5.083436 50.031985,-5.083441 50.032055,-5.083349 50.032098,-5.083225 50.032099,-5.082572 50.032252,-5.081784 50.032306,-5.080735 50.032534,-5.079630 50.032837,-5.078945 50.032849,-5.078486 50.033041,-5.078275 50.033205,-5.078056 50.033574,-5.077819 50.033780,-5.077363 50.033939,-5.077072 50.033977,-5.076256 50.033949,-5.073758 50.034311,-5.073439 50.034336,-5.072655 50.034324,-5.071621 50.034503,-5.070358 50.034594,-5.069637 50.034755,-5.068842 50.035109,-5.068312 50.035879,-5.068168 50.036185,-5.068121 50.036390,-5.068175 50.036538,-5.068326 50.036675,-5.068839 50.036870,-5.069086 50.037043,-5.069277 50.037253,-5.069444 50.037537,-5.069538 50.037935,-5.069560 50.038369,-5.069762 50.038931,-5.069641 50.039955,-5.069409 50.040337,-5.068987 50.040910,-5.069113 50.041022,-5.068971 50.041223,-5.068756 50.041427,-5.068493 50.041574,-5.068089 50.041702,-5.067788 50.041625,-5.067660 50.041351,-5.067599 50.041318,-5.067578 50.041235,-5.067384 50.041001,-5.067326 50.041014,-5.067369 50.041088,-5.067264 50.041122,-5.067008 50.041502,-5.066920 50.041554,-5.066942 50.041695,-5.067006 50.041754,-5.066977 50.041978,-5.067093 50.042111,-5.067145 50.042329,-5.066981 50.042550,-5.067135 50.042646,-5.067105 50.042719,-5.066954 50.042717,-5.066791 50.042892,-5.066666 50.042844,-5.066630 50.042974,-5.066437 50.043069,-5.066316 50.042880,-5.066206 50.042897,-5.066141 50.042956,-5.066143 50.043025,-5.066039 50.043040,-5.065967 50.043091,-5.065843 50.043425,-5.065838 50.043615,-5.065992 50.043664,-5.066031 50.043728,-5.065935 50.043756,-5.065685 50.043731,-5.065643 50.043793,-5.065633 50.043862,-5.065833 50.043975,-5.065743 50.044014,-5.065774 50.044081,-5.065847 50.044131,-5.066446 50.045118,-5.066897 50.046416,-5.066901 50.046775,-5.066834 50.047051,-5.066630 50.047573,-5.066296 50.048194,-5.066128 50.048421,-5.065526 50.048935,-5.065272 50.049124,-5.065011 50.049183,-5.064912 50.049378,-5.064948 50.049464,-5.064885 50.049518,-5.064923 50.049790,-5.064740 50.050056,-5.064518 50.050282,-5.064328 50.050371,-5.063892 50.050498,-5.063647 50.050492,-5.063528 50.050423,-5.063394 50.050396,-5.062512 50.050610,-5.062406 50.050613,-5.062396 50.050476,-5.062358 50.050411,-5.062153 50.050384,-5.062154 50.050519,-5.062044 50.050636,-5.061932 50.050646,-5.061701 50.050756,-5.061590 50.050741,-5.061599 50.050810,-5.061496 50.050786,-5.061294 50.050924,-5.061083 50.050979,-5.060465 50.050815,-5.060279 50.050880,-5.060012 50.050769,-5.059906 50.050801,-5.059849 50.050863,-5.059741 50.050865,-5.059761 50.051000,-5.059862 50.051051,-5.059803 50.051114,-5.059444 50.050963,-5.059224 50.050982,-5.059137 50.051023,-5.059092 50.051094,-5.059115 50.051161,-5.059197 50.051205,-5.059477 50.051498,-5.059434 50.051567,-5.059189 50.051761,-5.058878 50.052121,-5.058819 50.052134,-5.058723 50.052100,-5.058617 50.052127,-5.058585 50.052191,-5.058675 50.052339,-5.058594 50.052295,-5.058517 50.052342,-5.058504 50.052486,-5.058375 50.052667,-5.058220 50.052580,-5.057998 50.052594,-5.057917 50.052640,-5.057817 50.052779,-5.057968 50.052918,-5.058148 50.052944,-5.058207 50.053001,-5.058262 50.053307,-5.058328 50.053435,-5.058185 50.053573,-5.058249 50.053635,-5.058376 50.053661,-5.058314 50.053719,-5.058317 50.053789,-5.058391 50.053850,-5.058461 50.053893,-5.058577 50.053890,-5.058654 50.053929,-5.058862 50.053925,-5.058929 50.054053,-5.058848 50.054097,-5.058833 50.054165,-5.059012 50.054239,-5.059062 50.054310,-5.059172 50.054331,-5.059309 50.054283,-5.059484 50.054455,-5.059802 50.054379,-5.059685 50.054492,-5.059613 50.054695,-5.059613 50.054780,-5.059744 50.054890,-5.059849 50.054888,-5.059873 50.054961,-5.059945 50.055012,-5.059986 50.055094,-5.060113 50.055036,-5.060395 50.055230,-5.060471 50.055204,-5.060611 50.055109,-5.060499 50.054985,-5.060499 50.054913,-5.060668 50.054982,-5.060850 50.055175,-5.060880 50.055307,-5.061053 50.055379,-5.061230 50.055382,-5.061905 50.055248,-5.062696 50.054972,-5.062675 50.055027,-5.062882 50.055041,-5.063046 50.054939,-5.063494 50.055058,-5.063590 50.055126,-5.063920 50.055215,-5.064070 50.055325,-5.064094 50.055397,-5.064206 50.055507,-5.064366 50.055893,-5.064401 50.056159,-5.064397 50.056380,-5.064282 50.056502,-5.064298 50.056603,-5.064258 50.056669,-5.064096 50.056764,-5.063863 50.056839,-5.063452 50.056554,-5.063381 50.056589,-5.063508 50.056724,-5.063441 50.056793,-5.063444 50.056920,-5.063393 50.056851,-5.063349 50.056926,-5.063357 50.056994,-5.063321 50.056920,-5.063229 50.056858,-5.063110 50.056975,-5.063262 50.057187,-5.063151 50.057158,-5.063075 50.057065,-5.062819 50.056989,-5.062740 50.057067,-5.062719 50.057135,-5.062734 50.057218,-5.062888 50.057354,-5.062761 50.057399,-5.062821 50.057458,-5.062697 50.057467,-5.062608 50.057430,-5.062432 50.057509,-5.062413 50.057610,-5.062513 50.057655,-5.062431 50.057698,-5.062332 50.057720,-5.062128 50.057682,-5.061838 50.057784,-5.061900 50.057907,-5.061760 50.057897,-5.061680 50.057924,-5.061643 50.058036,-5.061547 50.058168,-5.061635 50.058265,-5.061902 50.058365,-5.061800 50.058374,-5.061601 50.058469,-5.061619 50.058537,-5.061701 50.058590,-5.061733 50.058661,-5.061657 50.058712,-5.061631 50.058779,-5.061681 50.058850,-5.061888 50.058855,-5.061790 50.058893,-5.061748 50.058955,-5.061796 50.059022,-5.061993 50.059123,-5.062016 50.059266,-5.061837 50.059359,-5.061811 50.059425,-5.061626 50.059587,-5.061672 50.059651,-5.061798 50.059718,-5.062023 50.059760,-5.062101 50.059817,-5.062103 50.059936,-5.062080 50.060080,-5.061968 50.060223,-5.061775 50.060285,-5.061555 50.060294,-5.061471 50.060338,-5.061466 50.060408,-5.061575 50.060523,-5.061676 50.060548,-5.061966 50.060442,-5.062181 50.060489,-5.062228 50.060552,-5.062057 50.060695,-5.062087 50.060760,-5.061925 50.060724,-5.061891 50.060788,-5.062039 50.060885,-5.061949 50.060923,-5.061886 50.060991,-5.062116 50.061089,-5.062198 50.061157,-5.062046 50.061173,-5.061818 50.061135,-5.061732 50.061182,-5.061938 50.061217,-5.061963 50.061283,-5.061913 50.061295,-5.061953 50.061324,-5.061602 50.061362,-5.061527 50.061457,-5.061683 50.061531,-5.061654 50.061603,-5.061769 50.061583,-5.061772 50.061651,-5.061835 50.061706,-5.062136 50.061583,-5.062202 50.061524,-5.062314 50.061506,-5.062424 50.061380,-5.062520 50.061407,-5.062629 50.061842,-5.062723 50.061933,-5.062711 50.062005,-5.062756 50.062070,-5.062875 50.061928,-5.063433 50.062072,-5.063491 50.062210,-5.063585 50.062255,-5.063843 50.062295,-5.064048 50.062256,-5.064243 50.062314,-5.064638 50.062268,-5.064918 50.062401,-5.065138 50.062396,-5.065128 50.062527,-5.065372 50.062543,-5.065393 50.062664,-5.065602 50.062827,-5.065491 50.063025,-5.065602 50.063187,-5.065746 50.063294,-5.065850 50.063280,-5.065818 50.063350,-5.066202 50.063447,-5.066377 50.063588,-5.066449 50.063739,-5.066510 50.063988,-5.066564 50.064578,-5.066524 50.065146,-5.066388 50.065280,-5.066490 50.065333,-5.066608 50.065334,-5.066631 50.065408,-5.066540 50.065444,-5.066529 50.065512,-5.066428 50.065533,-5.066353 50.065600,-5.066342 50.065669,-5.066411 50.065720,-5.066517 50.065744,-5.066420 50.065781,-5.066348 50.065726,-5.066238 50.065730,-5.066135 50.065888,-5.066176 50.065951,-5.066151 50.066016,-5.066397 50.066178,-5.066464 50.066317,-5.066382 50.066370,-5.067191 50.066363,-5.067101 50.066398,-5.067109 50.066541,-5.067212 50.066507,-5.067174 50.066578,-5.067264 50.066626,-5.067359 50.066582,-5.067304 50.066646,-5.067348 50.066708,-5.067532 50.066619,-5.067426 50.066742,-5.067444 50.066845,-5.067607 50.066859,-5.067720 50.066770,-5.067835 50.066754,-5.067745 50.066859,-5.067526 50.066959,-5.067444 50.067050,-5.067517 50.067130,-5.067873 50.067219,-5.067637 50.067209,-5.067594 50.067267,-5.067586 50.067418,-5.067655 50.067480,-5.067734 50.067625,-5.067882 50.067660,-5.067985 50.067614,-5.068065 50.067482,-5.068049 50.067413,-5.068168 50.067298,-5.068353 50.067373,-5.068412 50.067317,-5.068506 50.067349,-5.068654 50.067448,-5.068657 50.067525,-5.068786 50.067641,-5.068980 50.067692,-5.069048 50.067746,-5.069274 50.067749,-5.069448 50.067714,-5.069418 50.067853,-5.069501 50.067905,-5.069699 50.067831,-5.069809 50.067853,-5.070168 50.067735,-5.070515 50.067685,-5.070721 50.067617,-5.070830 50.067620,-5.070951 50.067684,-5.071102 50.067665,-5.071183 50.067730,-5.071239 50.067945,-5.071429 50.068034,-5.071839 50.067966,-5.071812 50.068035,-5.071917 50.068025,-5.072282 50.067800,-5.072531 50.067889,-5.072738 50.067798,-5.072851 50.067815,-5.073130 50.067760,-5.073222 50.067808,-5.073581 50.067592,-5.073842 50.067535,-5.074076 50.067543,-5.074240 50.067782,-5.074344 50.067794,-5.075319 50.067817,-5.075416 50.067884,-5.075857 50.067856,-5.076344 50.067967,-5.076990 50.067868,-5.077482 50.067862,-5.077733 50.067897,-5.078062 50.067992,-5.078474 50.068234,-5.078828 50.068242,-5.079054 50.068300,-5.079289 50.068452,-5.079594 50.068793,-5.079705 50.069050,-5.079733 50.069226,-5.079693 50.069367,-5.079621 50.069488,-5.079536 50.069529,-5.079293 50.069526,-5.078978 50.069681,-5.078985 50.069750,-5.079054 50.069804,-5.079071 50.069872,-5.079051 50.070086,-5.079026 50.070170,-5.078860 50.070260,-5.079022 50.070369,-5.079372 50.070400,-5.079304 50.070453,-5.079624 50.070498,-5.079716 50.070543,-5.079721 50.070610,-5.079553 50.070737,-5.079515 50.070801,-5.079544 50.070866,-5.079086 50.070873,-5.078961 50.070938,-5.078912 50.071001,-5.079008 50.071072,-5.079004 50.071140,-5.078913 50.071180,-5.079082 50.071284,-5.078938 50.071481,-5.078961 50.071553,-5.079009 50.071475,-5.079125 50.071499,-5.079189 50.071553,-5.079174 50.071625,-5.079043 50.071610,-5.079005 50.071673,-5.079180 50.071747,-5.079066 50.071753,-5.079176 50.071867,-5.078934 50.071803,-5.079039 50.071999,-5.078763 50.071943,-5.078631 50.071955,-5.078709 50.072005,-5.078634 50.072053,-5.078688 50.072117,-5.078983 50.072196,-5.079102 50.072177,-5.079101 50.072247,-5.079024 50.072297,-5.078930 50.072502,-5.079007 50.072551,-5.078908 50.072575,-5.078856 50.072638,-5.078908 50.072736,-5.078984 50.072784,-5.079421 50.072746,-5.079435 50.072813,-5.079225 50.072939,-5.079334 50.073002,-5.079290 50.073208,-5.079198 50.073411,-5.079085 50.073437,-5.079058 50.073502,-5.078985 50.073555,-5.078940 50.073754,-5.078958 50.073831,-5.078883 50.073883,-5.078851 50.074022,-5.078957 50.074083,-5.079254 50.074035,-5.079434 50.074051,-5.079356 50.074096,-5.079363 50.074164,-5.079391 50.074265,-5.079479 50.074304,-5.079190 50.074375,-5.079123 50.074428,-5.079029 50.074383,-5.078894 50.074393,-5.078808 50.074437,-5.078839 50.074502,-5.079034 50.074580,-5.079195 50.074741,-5.079281 50.074781,-5.079188 50.074816,-5.079288 50.074843,-5.079280 50.074912,-5.078946 50.074978,-5.079262 50.075049,-5.079356 50.075093,-5.079385 50.075159,-5.079377 50.075337,-5.079312 50.075486,-5.079164 50.075573,-5.079041 50.075549,-5.079040 50.075617,-5.079135 50.075660,-5.079077 50.075822,-5.079137 50.075882,-5.079244 50.075921,-5.079398 50.076081,-5.079420 50.076327,-5.079290 50.076486,-5.079175 50.076738,-5.079091 50.076801,-5.078736 50.076692,-5.078630 50.076707,-5.078451 50.076810,-5.078468 50.076902,-5.078422 50.076967,-5.078552 50.076998,-5.078456 50.077042,-5.077756 50.077089,-5.077602 50.077185,-5.077777 50.077307,-5.077627 50.077275,-5.077511 50.077288,-5.077417 50.077242,-5.077203 50.077448,-5.077306 50.077477,-5.077300 50.077547,-5.076911 50.077638,-5.076707 50.077800,-5.076726 50.077877,-5.076950 50.077884,-5.076829 50.077890,-5.076789 50.077955,-5.076898 50.077979,-5.076959 50.078042,-5.076848 50.078032,-5.076783 50.078110,-5.076896 50.078087,-5.076985 50.078135,-5.077214 50.078131,-5.077129 50.078208,-5.077028 50.078242,-5.077008 50.078318,-5.076924 50.078368,-5.077036 50.078374,-5.077046 50.078442,-5.077275 50.078410,-5.077359 50.078462,-5.077253 50.078499,-5.077245 50.078572,-5.077358 50.078667,-5.077385 50.078824,-5.077498 50.079065,-5.077502 50.079136,-5.077620 50.079260,-5.077764 50.079308,-5.077791 50.079381,-5.077636 50.079444,-5.077555 50.079375,-5.077193 50.079340,-5.077116 50.079465,-5.076992 50.079515,-5.076924 50.079587,-5.077056 50.079599,-5.076854 50.079652,-5.076755 50.079719,-5.076791 50.079795,-5.076681 50.079738,-5.076351 50.079958,-5.076305 50.080029,-5.076341 50.080094,-5.076563 50.080107,-5.076781 50.080060,-5.076766 50.080090,-5.076427 50.080147,-5.076233 50.080320,-5.076225 50.080391,-5.076489 50.080561,-5.076453 50.080633,-5.076247 50.080562,-5.076192 50.080621,-5.076085 50.080603,-5.076008 50.080653,-5.075911 50.080819,-5.075914 50.080887,-5.076329 50.081032,-5.076311 50.081128,-5.076039 50.081074,-5.075738 50.081083,-5.075608 50.081017,-5.075584 50.081129,-5.075629 50.081192,-5.075326 50.081395,-5.074993 50.081528,-5.074956 50.081595,-5.075133 50.081762,-5.075133 50.081897,-5.075203 50.081949,-5.075114 50.082076,-5.075130 50.082156,-5.075199 50.082214,-5.075467 50.082315,-5.075589 50.082439,-5.075759 50.082469,-5.075829 50.082545,-5.075932 50.082567,-5.075991 50.082628,-5.075971 50.082696,-5.076267 50.082821,-5.076453 50.082955,-5.076648 50.083252,-5.076856 50.083331,-5.077065 50.083312,-5.077112 50.083453,-5.076918 50.083535,-5.076962 50.083612,-5.077303 50.083752,-5.077292 50.083828,-5.077377 50.083870,-5.077291 50.083918,-5.077376 50.083959,-5.077378 50.084101,-5.077114 50.084059,-5.077099 50.084126,-5.077172 50.084178,-5.077049 50.084176,-5.077138 50.084254,-5.076903 50.084351,-5.076891 50.084425,-5.076955 50.084495,-5.076800 50.084609,-5.076811 50.084678,-5.076711 50.084704,-5.076713 50.084834,-5.076628 50.084874,-5.076663 50.085006,-5.076798 50.085156,-5.076823 50.085231,-5.076700 50.085239,-5.076362 50.085130,-5.076272 50.085166,-5.076228 50.085229,-5.076130 50.085177,-5.076020 50.085271,-5.076019 50.085339,-5.075935 50.085385,-5.075938 50.085515,-5.075999 50.085581,-5.076323 50.085617,-5.076662 50.085578,-5.076776 50.085594,-5.076881 50.085658,-5.076897 50.085743,-5.077296 50.085791,-5.077422 50.085767,-5.077356 50.085705,-5.077594 50.085623,-5.077710 50.085615,-5.077824 50.085494,-5.078330 50.085205,-5.078587 50.084938,-5.078695 50.084779,-5.078986 50.084575,-5.079197 50.084202,-5.079289 50.084160,-5.079186 50.084127,-5.079241 50.084048,-5.079246 50.083968,-5.079309 50.083911,-5.079299 50.083793,-5.079221 50.083731,-5.079234 50.083636,-5.079350 50.083636,-5.079638 50.083550,-5.079715 50.083502,-5.079742 50.083436,-5.080235 50.083268,-5.080315 50.083224,-5.080348 50.083157,-5.080456 50.083160,-5.080453 50.083078,-5.080572 50.083071,-5.080689 50.083115,-5.080767 50.083053,-5.080829 50.083110,-5.081024 50.083042,-5.081234 50.083122,-5.081766 50.083129,-5.082530 50.083287,-5.082889 50.083398,-5.083600 50.083735,-5.083915 50.083834,-5.084315 50.083855,-5.085299 50.084023,-5.085845 50.084301,-5.086146 50.084516,-5.086815 50.085167,-5.086898 50.085358,-5.087021 50.085334,-5.087123 50.085358,-5.087225 50.085422,-5.087274 50.085499,-5.087274 50.085588,-5.087367 50.085652,-5.087662 50.085708,-5.087858 50.085437,-5.087955 50.085064,-5.088054 50.084931,-5.088238 50.084747,-5.088666 50.084444,-5.089483 50.083605,-5.089331 50.083407,-5.089343 50.083319,-5.089428 50.083294,-5.089785 50.083296,-5.089935 50.083264,-5.090030 50.083177,-5.090003 50.082571,-5.090335 50.082522,-5.090312 50.081441,-5.090208 50.080699,-5.090328 50.080678,-5.091578 50.080074,-5.091478 50.079885,-5.091265 50.078765,-5.091085 50.078103,-5.090981 50.078001,-5.090710 50.077929,-5.090867 50.077686,-5.091520 50.076927,-5.091788 50.076648,-5.092551 50.076002,-5.093394 50.075974,-5.093689 50.075993,-5.094973 50.076220,-5.095307 50.076237,-5.095302 50.076120,-5.095508 50.075651,-5.096012 50.074877,-5.096088 50.074785,-5.096542 50.074593,-5.096805 50.074404,-5.097198 50.073956,-5.097496 50.073461,-5.097680 50.072672,-5.097951 50.071053,-5.098143 50.070511,-5.098200 50.070153,-5.098267 50.069937,-5.098757 50.069569,-5.099839 50.069182,-5.100931 50.068336,-5.102220 50.067628,-5.103440 50.066777,-5.104513 50.066197,-5.105094 50.065946,-5.105336 50.066041,-5.107563 50.065417,-5.108041 50.065868,-5.108698 50.066246,-5.108989 50.066157,-5.109304 50.065951,-5.110538 50.065843,-5.111335 50.065810,-5.112012 50.065717,-5.113155 50.066983,-5.113372 50.067199,-5.113694 50.067416,-5.114111 50.067236,-5.114886 50.066982,-5.115798 50.066827,-5.116219 50.066631,-5.117012 50.066175,-5.117578 50.065986,-5.118485 50.065383,-5.119075 50.065159,-5.120496 50.064705,-5.121047 50.064689,-5.121382 50.064643,-5.121742 50.064704,-5.122106 50.064876,-5.122595 50.065279,-5.122690 50.064710,-5.122970 50.064004,-5.123830 50.063946,-5.123883 50.063776,-5.124351 50.063509,-5.124503 50.063314,-5.124699 50.062967,-5.125102 50.062814,-5.125925 50.062425,-5.125987 50.062361,-5.125758 50.062008,-5.125540 50.061815,-5.124878 50.061384,-5.124589 50.061237,-5.124481 50.061013,-5.124461 50.060858,-5.124444 50.060703,-5.124493 50.060465,-5.124718 50.060435,-5.125619 50.060172,-5.126438 50.060014,-5.126702 50.059998,-5.127102 50.060957,-5.127311 50.061165,-5.127856 50.061210,-5.130021 50.061215,-5.129599 50.061432,-5.129423 50.061714,-5.130111 50.061800,-5.131734 50.062204,-5.133384 50.062491,-5.134516 50.062797,-5.135077 50.063044,-5.135386 50.063323,-5.135762 50.063529,-5.136523 50.063785,-5.138124 50.064151,-5.138102 50.064310,-5.138531 50.064444,-5.138741 50.064686,-5.139028 50.064541,-5.139020 50.064501,-5.139077 50.064429,-5.139919 50.064172,-5.141909 50.063303,-5.142649 50.063020,-5.143111 50.062641,-5.143196 50.062493,-5.143374 50.062290,-5.143417 50.062156,-5.143594 50.062002,-5.143682 50.061854,-5.143760 50.061351,-5.144009 50.061297,-5.144807 50.061320,-5.145094 50.061300,-5.145726 50.061348,-5.146080 50.061271,-5.146854 50.061463,-5.147616 50.061508,-5.147909 50.061472,-5.148413 50.061328,-5.149070 50.061341,-5.149532 50.061275,-5.149819 50.061327,-5.149906 50.061417,-5.150192 50.061124,-5.150465 50.060733,-5.150460 50.060439,-5.150392 50.060113,-5.150536 50.060011,-5.151299 50.059679,-5.152594 50.059333,-5.153945 50.058719,-5.154675 50.058250,-5.154822 50.058148,-5.154955 50.057941,-5.154860 50.057590,-5.154934 50.057390,-5.154838 50.057333,-5.154874 50.057185,-5.155095 50.056948,-5.155381 50.056922,-5.155679 50.056696,-5.155576 50.056565,-5.155875 50.056370,-5.157387 50.055735,-5.158908 50.056459,-5.158872 50.056273,-5.158864 50.055930,-5.159986 50.055374,-5.160763 50.054801,-5.160992 50.054681,-5.161241 50.054854,-5.161917 50.054384,-5.162932 50.053583,-5.165199 50.051708,-5.165433 50.051674,-5.165344 50.051547,-5.165397 50.051455,-5.166486 50.050946,-5.175962 50.047343,-5.173873 50.043337,-5.173607 50.042741,-5.172720 50.041046,-5.171561 50.039883,-5.168858 50.037277,-5.168476 50.036829,-5.167921 50.036287,-5.167286 50.035557,-5.167107 50.035291,-5.168687 50.033594,-5.170892 50.031302,-5.171027 50.031128,-5.169327 50.028732,-5.168912 50.026831,-5.168255 50.026655,-5.165247 50.025657,-5.159145 50.023247,-5.157776 50.020289,-5.157372 50.019460,-5.156850 50.018519,-5.156736 50.018218,-5.156833 50.017969,-5.156994 50.017956,-5.156904 50.017628,-5.156789 50.017417,-5.156738 50.017248,-5.156711 50.016909,-5.156614 50.016779,-5.156645 50.016712,-5.156517 50.016486,-5.156541 50.016173,-5.156401 50.015919,-5.156022 50.015640,-5.155859 50.015468,-5.155865 50.015404,-5.155958 50.015274,-5.155971 50.015078,-5.156085 50.014782,-5.156153 50.013946,-5.156236 50.013612,-5.156339 50.013408,-5.156422 50.013120,-5.156566 50.012915,-5.156682 50.012804,-5.157465 50.012482,-5.157509 50.012391,-5.157746 50.012200,-5.157827 50.012083,-5.158094 50.012003,-5.158105 50.011949,-5.157998 50.011795,-5.158313 50.011304,-5.158557 50.011048,-5.158533 50.010890,-5.158133 50.010342,-5.158041 50.009908,-5.157551 50.009613,-5.157513 50.009532,-5.157518 50.009308,-5.157643 50.009054,-5.157704 50.008792,-5.157645 50.008655,-5.157181 50.008433,-5.156944 50.007863,-5.156669 50.007539)))
</div>
</details>
</td>
</tr> </tbody>
</table>
</div>
<div class="data-table-right-shadow visible with-transition"></div>
</div>
</div><div id="referenced-by">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-m dlf-subnav__heading">Referenced by</h2>
<p class="govuk-body">This record is referenced by 0 other planning related data records.</p>
</div>
</div>
</div>
</main>
</div>
<div class="dlf-feedback__wrapper">
<div class="dlf-feedback">
<div class="dlf-feedback__prompt">
<div class="dlf-feedback__prompt-content">
<span class="dlf-feedback__prompt-content__text">Spotted an issue? Let us know so we can improve the data.</span>
</div>
<div class="dlf-feedback__prompt-action">
<a href="mailto:digitalLand@communities.gov.uk?subject=Feedback on (geography) St. Keverne -- parish" class="govuk-button dlf-feedback__prompt__link">There is something wrong with the data</a>
</div>
</div>
</div>
</div>
<footer class="govuk-footer " role="contentinfo"
>
<div class="govuk-width-container ">
<div class="govuk-footer__meta">
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
<h2 class="govuk-visually-hidden">Support links</h2> <ul class="govuk-footer__inline-list">
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/cookies">
Cookies
</a>
</li>
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/accessibility-statement">
Accessibility statement
</a>
</li>
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/design-system">
Design system
</a>
</li>
</ul>
<div class="govuk-footer__meta-custom">
The <a class="govuk-footer__link" href="https://github.com/digital-land/digital-land/">software</a> and <a class="govuk-footer__link" href="https://github.com/digital-land/digital-land/">data</a> used to build these pages is <a class="govuk-footer__link" href="https://github.com/digital-land/digital-land/blob/master/LICENSE">open source</a>.
</div>
<svg
role="presentation"
focusable="false"
class="govuk-footer__licence-logo"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 483.2 195.7"
height="17"
width="41"
>
<path
fill="currentColor"
d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"
/>
</svg>
<span class="govuk-footer__licence-description">
All content is available under the
<a
class="govuk-footer__link"
href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
rel="license"
>Open Government Licence v3.0</a>, except where otherwise stated
</span>
</div>
<div class="govuk-footer__meta-item">
<a
class="govuk-footer__link govuk-footer__copyright-logo"
href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/"
>© Crown copyright</a>
</div>
</div>
</div>
</footer>
<script src="https://digital-land.github.io/javascripts/dl-cookies.js"></script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- end google analytics -->
<script src="https://digital-land.github.io/javascripts/govuk/govuk-frontend.min.js"></script>
<script>
// initiate all GOVUK components
window.GOVUKFrontend.initAll();
</script>
<script src="https://digital-land.github.io/javascripts/dl-frontend.js"></script>
<script>
// adds any necessary polyfills
window.DLFrontend.polyfill();
</script>
<script>
const datasetName = "parish"
const $mapElement = document.querySelector('[data-module="boundary-map"]')
const $nationalMapLink = document.querySelector('.dl-link-national-map')
const mapParams = {
initZoomCallback: function (featureGroup, map) {
console.log("initial load completed")
// do we need to check there isn't more than one shape?
const center = featureGroup.getBounds().getCenter()
const zoom = map.getZoom()
let url = `http://digital-land.github.io/map?layer=${datasetName}#${center.lat},${center.lng},${zoom}z`
console.log(url)
if ($nationalMapLink) {
// only show this for the datasets we've added to the national map
$nationalMapLink.href = url
$nationalMapLink.classList.remove("js-hidden")
}
}
}
mapParams.geojsonURLs = ["geometry.geojson"]
const mapComponent = new DLMaps.Map($mapElement).init(mapParams)
</script>
<script>
// Initialise back to top
var $data_tables = document.querySelectorAll('[data-module*="data-table"]')
$data_tables.forEach(data_table => {
new window.DLFrontend.ScrollableTables(data_table).init()
})
</script>
<script>
const $subNavTabs = document.querySelector('[data-module="dlf-subnav"]')
const subNavTabsComponent = new DLFrontend.SubNavTabs($subNavTabs).init({})
</script> </body>
</html> | 140.327273 | 35,882 | 0.707548 |
ce591bfd00ce1f8e69e7ff1a852d148911ab6939 | 1,702 | sql | SQL | apps/memberships/models/tables/structures/sql/tbl_membership.sql | wvanheemstra/core | 8461e49e392b73f841058514414dd0cf74e55033 | [
"Unlicense",
"MIT"
] | 1 | 2018-03-15T15:01:39.000Z | 2018-03-15T15:01:39.000Z | apps/memberships/models/tables/structures/sql/tbl_membership.sql | wvanheemstra/core | 8461e49e392b73f841058514414dd0cf74e55033 | [
"Unlicense",
"MIT"
] | null | null | null | apps/memberships/models/tables/structures/sql/tbl_membership.sql | wvanheemstra/core | 8461e49e392b73f841058514414dd0cf74e55033 | [
"Unlicense",
"MIT"
] | null | null | null | /*
Navicat MySQL Data Transfer
Source Server : wvanheem_core_local
Source Server Version : 50509
Source Host : 127.0.0.1
Source Database : core
Target Server Version : 50509
File Encoding : utf-8
Date: 06/29/2012 12:38:37 PM
*/
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `tbl_membership`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_membership`;
CREATE TABLE `tbl_membership` (
`kp_MembershipID` int(11) NOT NULL AUTO_INCREMENT,
`kf_PersonID` int(11) NOT NULL DEFAULT 0,
`kf_OrganisationID` int(11) NOT NULL DEFAULT 0,
`kf_MultimediaID` int(11) NOT NULL DEFAULT 0,
`gKindOfContactID_telephone` int(11) NOT NULL DEFAULT 0,
`gKindOfContactID_fax` int(11) NOT NULL DEFAULT 0,
`gKindOfContactID_email` int(11) NOT NULL DEFAULT 0,
`gKindOfContactID_mobile` int(11) NOT NULL DEFAULT 0,
`gKindOfRoleID_occupation` int(11) NOT NULL DEFAULT 0,
`ts_Created` datetime DEFAULT NULL,
`ts_Updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (`kf_PersonID`) REFERENCES `tbl_person` (`kp_PersonID`) ON DELETE CASCADE,
PRIMARY KEY (`kp_MembershipID`),
UNIQUE KEY `kp_MembershipID` (`kp_MembershipID`) USING BTREE,
KEY `kf_PersonID` (`kf_PersonID`) USING BTREE,
KEY `kf_OrganisationID` (`kf_OrganisationID`) USING BTREE,
KEY `kf_MultimediaID` (`kf_MultimediaID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
delimiter ;;
CREATE TRIGGER `Membership.ts_Created` BEFORE INSERT ON `tbl_membership` FOR EACH ROW BEGIN
SET NEW.ts_Created = CURRENT_TIMESTAMP();
END;
;;
delimiter ;
SET FOREIGN_KEY_CHECKS = 1;
| 34.734694 | 91 | 0.716804 |
718b41734b04ae8851880511446c1a6a9eff24c1 | 428 | ts | TypeScript | src/metas/metas.module.ts | EquilibrioApp/Equilibrio-BackEnd | 36b9d07db923a499ed75a36448f5e1b785d516f0 | [
"MIT"
] | null | null | null | src/metas/metas.module.ts | EquilibrioApp/Equilibrio-BackEnd | 36b9d07db923a499ed75a36448f5e1b785d516f0 | [
"MIT"
] | null | null | null | src/metas/metas.module.ts | EquilibrioApp/Equilibrio-BackEnd | 36b9d07db923a499ed75a36448f5e1b785d516f0 | [
"MIT"
] | null | null | null | import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { MetaEntity } from './meta.entity';
import { MetasController } from './metas.controller';
import { MetasService } from './metas.service';
@Module({
imports:[
TypeOrmModule.forFeature([MetaEntity]),
],
exports: [MetasService],
providers: [MetasService],
controllers: [MetasController]
})
export class MetasModule {}
| 26.75 | 53 | 0.705607 |
3fc4bb0354f563eff7271dc381883e49ef0a9610 | 5,913 | h | C | CS301/LCD/Inc/user_setting.h | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS301/LCD/Inc/user_setting.h | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS301/LCD/Inc/user_setting.h | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | /*
* user_setting.h
*
* Created on: 02-Jul-2019
* Author: poe
*/
#ifndef USER_SETTING_H_
#define USER_SETTING_H_
#define RD_PORT GPIOC
#define RD_PIN GPIO_PIN_6
#define WR_PORT GPIOC
#define WR_PIN GPIO_PIN_7
#define CD_PORT GPIOC // RS PORT
#define CD_PIN GPIO_PIN_10 // RS PIN
#define CS_PORT GPIOC
#define CS_PIN GPIO_PIN_9
#define RESET_PORT GPIOC
#define RESET_PIN GPIO_PIN_8
#define D0_PORT GPIOB
#define D0_PIN GPIO_PIN_0
#define D1_PORT GPIOB
#define D1_PIN GPIO_PIN_1
#define D2_PORT GPIOB
#define D2_PIN GPIO_PIN_2
#define D3_PORT GPIOB
#define D3_PIN GPIO_PIN_3
#define D4_PORT GPIOB
#define D4_PIN GPIO_PIN_4
#define D5_PORT GPIOB
#define D5_PIN GPIO_PIN_5
#define D6_PORT GPIOB
#define D6_PIN GPIO_PIN_6
#define D7_PORT GPIOB
#define D7_PIN GPIO_PIN_7
#define WIDTH ((uint16_t)320)
#define HEIGHT ((uint16_t)480)
/****************** delay in microseconds ***********************/
extern TIM_HandleTypeDef htim1;
void delay (uint32_t time)
{
/* change your code here for the delay in microseconds */
__HAL_TIM_SET_COUNTER(&htim1, 0);
while ((__HAL_TIM_GET_COUNTER(&htim1))<time);
}
// configure macros for the data pins.
/* First of all clear all the LCD_DATA pins i.e. LCD_D0 to LCD_D7
* We do that by writing the HIGHER bits in BSRR Register
*
* For example :- To clear Pins B3, B4 , B8, B9, we have to write GPIOB->BSRR = 0b0000001100011000 <<16
*
*
*
* To write the data to the respective Pins, we have to write the lower bits of BSRR :-
*
* For example say the PIN LCD_D4 is connected to PB7, and LCD_D6 is connected to PB2
*
* GPIOB->BSRR = (data & (1<<4)) << 3. Here first select 4th bit of data (LCD_D4), and than again shift left by 3 (Total 4+3 =7 i.e. PB7)
*
* GPIOB->BSRR = (data & (1<<6)) >> 4. Here first select 6th bit of data (LCD_D6), and than again shift Right by 4 (Total 6-4 =2 i.e. PB2)
*
*
*/
#define write_8(d) { \
GPIOA->BSRR = 0b1000000000100000 << 16; \
GPIOB->BSRR = 0b0000000001111011 << 16; \
GPIOA->BSRR = (((d) & (1<<2)) << 13) \
| (((d) & (1<<7)) >> 2); \
GPIOB->BSRR = (((d) & (1<<0)) << 0) \
| (((d) & (1<<1)) << 0) \
| (((d) & (1<<3)) << 0) \
| (((d) & (1<<4)) << 0) \
| (((d) & (1<<5)) << 0) \
| (((d) & (1<<6)) << 0); \
}
/* To read the data from the Pins, we have to read the IDR Register
*
* Take the same example say LCD_D4 is connected to PB7, and LCD_D6 is connected to PB2
*
* To read data we have to do the following
*
* GPIOB->IDR & (1<<7) >> 3. First read the PIN (1<<7 means we are reading PB7) than shift it to the position, where it is connected to
* and in this example, that would be 4 (LCD_D4). (i.e. 7-3=4)
*
* GPIOB->IDR & (1<<2) << 4. First read the PIN (1<<2 means we are reading PB2) than shift it to the position, where it is connected to
* and in this case, that would be 6 (LCD_D6). (i.e. 2+4= 6). Shifting in the same direction
*
*/
#define read_8() ( (((GPIOB->IDR & (1<<0)) >> 0) \
| ((GPIOB->IDR & (1<<1)) >> 0) \
| ((GPIOA->IDR & (1<<15)) >> 13) \
| ((GPIOB->IDR & (1<<3)) >> 0) \
| ((GPIOB->IDR & (1<<4)) >> 0) \
| ((GPIOB->IDR & (1<<5)) >> 0) \
| ((GPIOB->IDR & (1<<6)) >> 0) \
| ((GPIOA->IDR & (1<<5)) << 2)))
/********************* For 180 MHz *****************************/
//#define WRITE_DELAY { WR_ACTIVE8; }
//#define READ_DELAY { RD_ACTIVE16;}
/************************** For 72 MHZ ****************************/
#define WRITE_DELAY { }
#define READ_DELAY { RD_ACTIVE; }
/************************** For 100 MHZ ****************************/
//#define WRITE_DELAY { WR_ACTIVE2; }
//#define READ_DELAY { RD_ACTIVE4; }
/************************** For 216 MHZ ****************************/
//#define WRITE_DELAY { WR_ACTIVE8; WR_ACTIVE8; } //216MHz
//#define IDLE_DELAY { WR_IDLE4;WR_IDLE4; }
//#define READ_DELAY { RD_ACTIVE16;RD_ACTIVE16;RD_ACTIVE16;}
/************************** For 48 MHZ ****************************/
//#define WRITE_DELAY { }
//#define READ_DELAY { }
/***************************** DEFINES FOR DIFFERENT TFTs ****************************************************/
//#define SUPPORT_0139 //S6D0139 +280 bytes
//#define SUPPORT_0154 //S6D0154 +320 bytes
//#define SUPPORT_1289 //SSD1289,SSD1297 (ID=0x9797) +626 bytes, 0.03s
//#define SUPPORT_1580 //R61580 Untested
//#define SUPPORT_1963 //only works with 16BIT bus anyway
//#define SUPPORT_4532 //LGDP4532 +120 bytes. thanks Leodino
//#define SUPPORT_4535 //LGDP4535 +180 bytes
//#define SUPPORT_68140 //RM68140 +52 bytes defaults to PIXFMT=0x55
//#define SUPPORT_7735
//#define SUPPORT_7781 //ST7781 +172 bytes
//#define SUPPORT_8230 //UC8230 +118 bytes
//#define SUPPORT_8347D //HX8347-D, HX8347-G, HX8347-I, HX8367-A +520 bytes, 0.27s
//#define SUPPORT_8347A //HX8347-A +500 bytes, 0.27s
//#define SUPPORT_8352A //HX8352A +486 bytes, 0.27s
//#define SUPPORT_8352B //HX8352B
//#define SUPPORT_8357D_GAMMA //monster 34 byte
//#define SUPPORT_9163 //
//#define SUPPORT_9225 //ILI9225-B, ILI9225-G ID=0x9225, ID=0x9226, ID=0x6813 +380 bytes
//#define SUPPORT_9326_5420 //ILI9326, SPFD5420 +246 bytes
#define SUPPORT_9342 //costs +114 bytes
//#define SUPPORT_9806 //UNTESTED
//#define SUPPORT_9488_555 //costs +230 bytes, 0.03s / 0.19s
//#define SUPPORT_B509_7793 //R61509, ST7793 +244 bytes
//#define OFFSET_9327 32 //costs about 103 bytes, 0.08s
#endif /* USER_SETTING_H_ */
| 34.377907 | 139 | 0.559784 |
27e0e1bdc49eab4fdb1dfb4431fe18bd1c9bc125 | 6,115 | kt | Kotlin | app/src/main/java/com/starline/hamsteradoption/HamsterDetailActivity.kt | MaxNeverSleep/HamsterAdoption | 38416348921b78c2f51933ddbc287f234fd0ac5c | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/starline/hamsteradoption/HamsterDetailActivity.kt | MaxNeverSleep/HamsterAdoption | 38416348921b78c2f51933ddbc287f234fd0ac5c | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/starline/hamsteradoption/HamsterDetailActivity.kt | MaxNeverSleep/HamsterAdoption | 38416348921b78c2f51933ddbc287f234fd0ac5c | [
"Apache-2.0"
] | null | null | null | package com.starline.hamsteradoption
import android.graphics.Paint
import android.os.Bundle
import android.util.Log
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.graphics.scaleMatrix
import com.starline.hamsteradoption.ui.theme.HamsterAdoptionTheme
val hamsterAae = arrayOf(
"3 months",
"4 months",
"1 year 4 months",
"2 years",
"3 months",
"5 months",
"7 months",
"1 1moneths",
"1 months",
"3 months",
"8 months",
"1 months",
)
class HamsterDetailActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val name = intent.getStringExtra("HAMSTER_NAME")
val desc = intent.getStringExtra("HAMSTER_DESC")
var detailImage1: Int = 0
var detailImage2: Int = 0
var age: String = "1 months"
when (name) {
"Sussy" -> {
detailImage1 = R.mipmap.hamster_preview_1
detailImage2 = R.mipmap.hamster_1_1
age = "1 months"
}
"Jack" -> {
detailImage1 = R.mipmap.hamster_preview_2
detailImage2 = R.mipmap.hamster_2_1
age = "3 months"
}
"David" -> {
detailImage1 = R.mipmap.hamster_preview_3
detailImage2 = R.mipmap.hamster_3_1
age = "6 months"
}
"Stephen" -> {
detailImage1 = R.mipmap.hamster_preview_4
detailImage2 = R.mipmap.hamster_4_1
age = "4 months"
}
"Kiro" -> {
detailImage1 = R.mipmap.hamster_preview_5
detailImage2 = R.mipmap.hamster_5_1
age = "2 months"
}
"Warden" -> {
detailImage1 = R.mipmap.hamster_preview_6
detailImage2 = R.mipmap.hamster_6_1
age = "4 months"
}
"Love" -> {
detailImage1 = R.mipmap.hamster_preview_7
detailImage2 = R.mipmap.hamster_7_1
age = "2 months"
}
"Cookie" -> {
detailImage1 = R.mipmap.hamster_preview_8
detailImage2 = R.mipmap.hamster_8_1
age = "5 months"
}
"Hamster007" -> {
detailImage1 = R.mipmap.hamster_preview_9
detailImage2 = R.mipmap.hamster_5_1
age = "4 months"
}
"SweetHamster" -> {
detailImage1 = R.mipmap.hamster_preview_10
detailImage2 = R.mipmap.hamster_4_1
age = "6 months"
}
"Lam" -> {
detailImage1 = R.mipmap.hamster_preview_11
detailImage2 = R.mipmap.hamster_1_1
age = "7 months"
}
"Pinkie" -> {
detailImage1 = R.mipmap.hamster_preview_12
detailImage2 = R.mipmap.hamster_6_1
age = "12 months"
}
}
setContent {
HamsterAdoptionTheme {
MyDetail(name, age, detailImage1, detailImage2, { back() })
}
}
}
private fun back() {
Log.i("test", "finish activity结束")
super.finish()
}
}
@Composable
fun MyDetail(
name: String?,
age: String?,
detailImage1: Int,
detailImage2: Int,
onClick: () -> Unit
) {
Surface(color = MaterialTheme.colors.background) {
Column {
TopAppBar(
navigationIcon = {
IconButton(onClick = { onClick }) {
Icon(Icons.Filled.ArrowBack, "back")
}
},
title = {
Text(
text = "$name's Detail",
fontWeight = FontWeight.Bold
)
}
)
Row {
Image(
painter = painterResource(id = detailImage1),
contentDescription = name,
Modifier
.width(180.dp)
.height(180.dp)
.padding(30.dp, 30.dp),
contentScale = ContentScale.FillBounds
)
Text(
text = "Name : $name\r\n\nAge : $age\r\n\nDistance : 4.5km",
Modifier.padding(top = 40.dp),
fontWeight = FontWeight.Bold,
fontSize = 18.sp
)
}
Text(
text = "$name ,she’s really light for a dwarf, do not mistake her weight for her looks as when she arrived, she looks a lil preggie ...Turns out after 4 weeks, she just has a food baby and big hips (yes #bodygoals) Therefore, pls give Wheelington a chance even if you’re looking for a round hammy, light hams can be chonky too!",
Modifier.padding(horizontal = 30.dp, vertical = 10.dp),
style = MaterialTheme.typography.body2
)
Image(
painter = painterResource(id = detailImage2),
contentDescription = name,
Modifier
.width(400.dp)
.height(280.dp)
.padding(30.dp, 30.dp),
contentScale = ContentScale.FillBounds
)
}
}
}
| 33.598901 | 345 | 0.521668 |
1a69c2c3ce002394f59350a2471f4915c0d2cc57 | 14,676 | kt | Kotlin | src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/unidecode/xe1.kt | jpd236/kotwords | ff3f29b7178afa2b774ee06bdf37a3a7899ff03a | [
"Apache-2.0"
] | 9 | 2021-06-11T21:19:09.000Z | 2021-12-09T14:18:55.000Z | src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/unidecode/xe1.kt | jpd236/kotwords | ff3f29b7178afa2b774ee06bdf37a3a7899ff03a | [
"Apache-2.0"
] | 29 | 2018-08-06T00:28:04.000Z | 2022-03-29T03:08:44.000Z | src/commonMain/kotlin/com/jeffpdavidson/kotwords/formats/unidecode/xe1.kt | jpd236/kotwords | ff3f29b7178afa2b774ee06bdf37a3a7899ff03a | [
"Apache-2.0"
] | 2 | 2020-09-25T17:12:24.000Z | 2021-06-12T05:40:07.000Z | package com.jeffpdavidson.kotwords.formats.unidecode
internal val xe1 = arrayOf(
// 0xe100: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe101: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe102: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe103: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe104: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe105: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe106: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe107: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe108: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe109: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe10a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe10b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe10c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe10d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe10e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe10f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe110: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe111: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe112: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe113: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe114: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe115: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe116: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe117: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe118: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe119: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe11a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe11b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe11c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe11d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe11e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe11f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe120: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe121: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe122: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe123: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe124: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe125: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe126: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe127: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe128: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe129: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe12a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe12b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe12c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe12d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe12e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe12f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe130: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe131: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe132: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe133: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe134: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe135: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe136: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe137: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe138: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe139: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe13a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe13b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe13c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe13d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe13e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe13f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe140: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe141: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe142: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe143: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe144: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe145: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe146: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe147: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe148: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe149: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe14a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe14b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe14c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe14d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe14e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe14f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe150: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe151: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe152: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe153: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe154: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe155: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe156: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe157: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe158: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe159: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe15a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe15b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe15c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe15d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe15e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe15f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe160: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe161: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe162: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe163: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe164: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe165: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe166: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe167: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe168: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe169: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe16a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe16b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe16c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe16d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe16e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe16f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe170: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe171: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe172: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe173: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe174: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe175: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe176: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe177: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe178: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe179: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe17a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe17b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe17c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe17d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe17e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe17f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe180: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe181: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe182: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe183: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe184: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe185: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe186: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe187: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe188: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe189: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe18a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe18b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe18c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe18d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe18e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe18f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe190: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe191: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe192: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe193: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe194: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe195: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe196: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe197: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe198: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe199: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe19a: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe19b: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe19c: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe19d: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe19e: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe19f: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a0: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a1: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a2: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a3: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a4: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a5: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a6: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a7: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a8: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1a9: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1aa: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ab: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ac: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ad: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ae: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1af: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b0: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b1: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b2: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b3: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b4: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b5: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b6: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b7: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b8: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1b9: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ba: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1bb: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1bc: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1bd: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1be: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1bf: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c0: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c1: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c2: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c3: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c4: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c5: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c6: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c7: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c8: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1c9: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ca: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1cb: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1cc: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1cd: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ce: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1cf: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d0: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d1: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d2: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d3: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d4: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d5: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d6: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d7: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d8: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1d9: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1da: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1db: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1dc: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1dd: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1de: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1df: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e0: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e1: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e2: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e3: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e4: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e5: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e6: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e7: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e8: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1e9: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ea: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1eb: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ec: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ed: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ee: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ef: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f0: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f1: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f2: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f3: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f4: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f5: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f6: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f7: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f8: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1f9: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1fa: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1fb: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1fc: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1fd: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1fe: => [?]
"\u005b\u003f\u005d\u0020",
// 0xe1ff: => [?]
"\u005b\u003f\u005d\u0020",
)
| 28.386847 | 52 | 0.458163 |
2616f6e5e467598844793334135f8b3ba7292f7c | 2,251 | java | Java | gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/sampling/functions/AddPageRankScoresToVertexCrossFunction.java | hr73vexy/gradoop | 9d8e9afc776919c1856773b220df19783478f332 | [
"Apache-2.0"
] | null | null | null | gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/sampling/functions/AddPageRankScoresToVertexCrossFunction.java | hr73vexy/gradoop | 9d8e9afc776919c1856773b220df19783478f332 | [
"Apache-2.0"
] | 2 | 2018-12-18T14:54:02.000Z | 2019-01-21T15:33:23.000Z | gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/sampling/functions/AddPageRankScoresToVertexCrossFunction.java | hr73vexy/gradoop | 9d8e9afc776919c1856773b220df19783478f332 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright © 2014 - 2018 Leipzig University (Database Research Group)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradoop.flink.model.impl.operators.sampling.functions;
import org.apache.flink.api.common.functions.CrossFunction;
import org.gradoop.common.model.impl.pojo.GraphHead;
import org.gradoop.common.model.impl.pojo.Vertex;
import org.gradoop.flink.model.impl.operators.sampling.SamplingAlgorithm;
/**
* Writes the PageRank-scores stored in the graphHead to all vertices.
*/
public class AddPageRankScoresToVertexCrossFunction
implements CrossFunction<Vertex, GraphHead, Vertex> {
/**
* Writes the PageRank-scores stored in the graphHead to all vertices.
*/
@Override
public Vertex cross(Vertex vertex, GraphHead graphHead) {
double min = graphHead.getPropertyValue(
SamplingAlgorithm.MIN_PAGE_RANK_SCORE_PROPERTY_KEY).getDouble();
double max = graphHead.getPropertyValue(
SamplingAlgorithm.MAX_PAGE_RANK_SCORE_PROPERTY_KEY).getDouble();
double sum = graphHead.getPropertyValue(
SamplingAlgorithm.SUM_PAGE_RANK_SCORE_PROPERTY_KEY).getDouble();
vertex.setProperty(SamplingAlgorithm.MIN_PAGE_RANK_SCORE_PROPERTY_KEY, min);
vertex.setProperty(SamplingAlgorithm.MAX_PAGE_RANK_SCORE_PROPERTY_KEY, max);
vertex.setProperty(SamplingAlgorithm.SUM_PAGE_RANK_SCORE_PROPERTY_KEY, sum);
vertex.setProperty("vertexCount", graphHead.getPropertyValue("vertexCount"));
if (min != max) {
double score = vertex.getPropertyValue(
SamplingAlgorithm.PAGE_RANK_SCORE_PROPERTY_KEY).getDouble();
vertex.setProperty(
SamplingAlgorithm.SCALED_PAGE_RANK_SCORE_PROPERTY_KEY, (score - min) / (max - min));
}
return vertex;
}
}
| 40.196429 | 92 | 0.766326 |
adc3f17b365103baa048d1ec5cd7c469e851a53f | 1,623 | kt | Kotlin | app/src/main/java/com/team8/moviecatalog/ScreenActivity.kt | naufalirfani/PAPB-Tugas-1 | 62e48dc0a76c8d994e8c23a29813a4905ef04d17 | [
"MIT"
] | null | null | null | app/src/main/java/com/team8/moviecatalog/ScreenActivity.kt | naufalirfani/PAPB-Tugas-1 | 62e48dc0a76c8d994e8c23a29813a4905ef04d17 | [
"MIT"
] | 1 | 2021-05-02T05:02:03.000Z | 2021-05-02T05:07:26.000Z | app/src/main/java/com/team8/moviecatalog/ScreenActivity.kt | naufalirfani/papb-team8 | 62e48dc0a76c8d994e8c23a29813a4905ef04d17 | [
"MIT"
] | null | null | null | package com.team8.moviecatalog
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import androidx.appcompat.app.AppCompatDelegate
import com.team8.moviecatalog.databinding.ActivityScreenBinding
import java.util.*
class ScreenActivity : AppCompatActivity() {
private lateinit var binding: ActivityScreenBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityScreenBinding.inflate(layoutInflater)
setContentView(binding.root)
supportActionBar?.hide()
val settingActivity = SettingActivity()
if(settingActivity.getDefaults("isDarkMode", this) == true)
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
else
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
changeLanguage(settingActivity.getDefaultLanguage("country_code", this).toString())
val version = resources.getString(R.string.version) + " " + BuildConfig.VERSION_NAME
binding.tvScreenVersion.text = version
Handler(Looper.getMainLooper()).postDelayed({
val loginIntent = Intent(this, MainActivity::class.java)
startActivity(loginIntent)
finish()
}, 3000)
}
fun changeLanguage(code: String) {
val config = resources.configuration
val locale = Locale(code)
config.setLocale(locale)
resources.updateConfiguration(config, resources.displayMetrics)
}
} | 36.066667 | 92 | 0.727665 |
8e447720674c91b173384fcd9c06cc17164dc87b | 3,122 | rb | Ruby | lib/fastly_nsq/manager.rb | fastly/fastly_nsq | e05d3972ebcfb25f7a42eb0268d482e5142d4658 | [
"MIT"
] | 11 | 2016-01-30T00:59:26.000Z | 2022-03-04T21:48:06.000Z | lib/fastly_nsq/manager.rb | fastly/fastly_nsq | e05d3972ebcfb25f7a42eb0268d482e5142d4658 | [
"MIT"
] | 65 | 2016-02-02T23:27:41.000Z | 2022-02-23T14:32:01.000Z | lib/fastly_nsq/manager.rb | fastly/fastly_nsq | e05d3972ebcfb25f7a42eb0268d482e5142d4658 | [
"MIT"
] | 2 | 2016-04-18T15:36:09.000Z | 2022-03-23T08:17:47.000Z | # frozen_string_literal: true
##
# Interface for tracking listeners and managing the processing pool.
class FastlyNsq::Manager
DEADLINE = 30
# @return [Boolean] Set true when all listeners are stopped
attr_reader :done
# @return [FastlyNsq::PriorityThreadPool]
attr_reader :pool
# @return [Logger]
attr_reader :logger
##
# Create a FastlyNsq::Manager
#
# @param logger [Logger]
# @param max_threads [Integer] Maxiumum number of threads to be used by {FastlyNsq::PriorityThreadPool}
# @param pool_options [Hash] Options forwarded to {FastlyNsq::PriorityThreadPool} constructor.
def initialize(logger: FastlyNsq.logger, max_threads: FastlyNsq.max_processing_pool_threads, **pool_options)
@done = false
@logger = logger
@pool = FastlyNsq::PriorityThreadPool.new(
{ fallback_policy: :caller_runs, max_threads: max_threads }.merge(pool_options),
)
end
##
# Hash of listeners. Keys are topics, values are {FastlyNsq::Listener} instances.
# @return [Hash]
def topic_listeners
@topic_listeners ||= {}
end
##
# Array of listening topic names
# @return [Array]
def topics
topic_listeners.keys
end
##
# Set of {FastlyNsq::Listener} objects
# @return [Set]
def listeners
topic_listeners.values.to_set
end
##
# Stop the manager.
# Terminates the listeners and stops all processing in the pool.
# @param deadline [Integer] Number of seconds to wait for pool to stop processing
def terminate(deadline = DEADLINE)
return if done
stop_listeners
return if pool.shutdown?
stop_processing(deadline)
@done = true
end
##
# Manager state
# @return [Boolean]
def stopped?
done
end
##
# Add a {FastlyNsq::Listener} to the @topic_listeners
# @param listener [FastlyNsq::Listener}
def add_listener(listener)
logger.info { "topic #{listener.topic}, channel #{listener.channel}: listening" }
if topic_listeners[listener.topic]
logger.warn { "topic #{listener.topic}: duplicate listener" }
end
topic_listeners[listener.topic] = listener
end
##
# Transer listeners to a new manager and stop processing from the existing pool.
# @param new_manager [FastlyNsq::Manager] new manager to which listeners will be added
# @param deadline [Integer] Number of seconds to wait for exsiting pool to stop processing
def transfer(new_manager, deadline: DEADLINE)
new_manager.topic_listeners.merge!(topic_listeners)
stop_processing(deadline)
topic_listeners.clear
@done = true
end
##
# Terminate all listeners
def stop_listeners
logger.info { 'Stopping listeners' }
listeners.each(&:terminate)
topic_listeners.clear
end
protected
##
# Shutdown the pool
# @param deadline [Integer] Number of seconds to wait for pool to stop processing
def stop_processing(deadline)
logger.info { 'Stopping processors' }
pool.shutdown
logger.info { 'Waiting for processors to finish...' }
return if pool.wait_for_termination(deadline)
logger.info { 'Killing processors...' }
pool.kill
end
end
| 25.382114 | 110 | 0.704997 |
05d9017169eb2de1df854b62c5c7d74059731e94 | 88 | rb | Ruby | lib/tinderfields_user_impersonate.rb | tinderfields/user_impersonate2 | e796cdc0d4b0e557128037ff6b162b91c4562b3c | [
"MIT"
] | null | null | null | lib/tinderfields_user_impersonate.rb | tinderfields/user_impersonate2 | e796cdc0d4b0e557128037ff6b162b91c4562b3c | [
"MIT"
] | null | null | null | lib/tinderfields_user_impersonate.rb | tinderfields/user_impersonate2 | e796cdc0d4b0e557128037ff6b162b91c4562b3c | [
"MIT"
] | null | null | null | require "tinderfields_user_impersonate/engine"
module TinderfieldsUserImpersonate
end
| 14.666667 | 46 | 0.886364 |
d10b9f91b727abcddaf49a53b06f4619229ff877 | 358 | sql | SQL | openGaussBase/testcase/KEYWORDS/Index/Opengauss_Function_Keyword_Index_Case0031.sql | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/KEYWORDS/Index/Opengauss_Function_Keyword_Index_Case0031.sql | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/KEYWORDS/Index/Opengauss_Function_Keyword_Index_Case0031.sql | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | -- @testpoint:opengauss关键字Index(非保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists explain_test cascade;
--关键字不带引号-合理报错
create table explain_test(id int,name Index);
--关键字带双引号-合理报错
create table explain_test(id int,name "Index");
--关键字带单引号-合理报错
create table explain_test(id int,name 'Index');
--关键字带反引号-合理报错
create table explain_test(id int,name `Index`);
| 21.058824 | 52 | 0.76257 |
a1c36d4488e70952da83751b055e431af1e779f6 | 1,148 | h | C | src/backends/cuda/cuda_texture.h | shiinamiyuki/LuisaCompute | f8358f8ec138950a84f570c0ede24cc76fc159de | [
"BSD-3-Clause"
] | 31 | 2020-11-21T08:16:53.000Z | 2021-09-05T13:46:32.000Z | src/backends/cuda/cuda_texture.h | shiinamiyuki/LuisaCompute | f8358f8ec138950a84f570c0ede24cc76fc159de | [
"BSD-3-Clause"
] | 1 | 2021-03-08T04:15:26.000Z | 2021-03-19T04:40:02.000Z | src/backends/cuda/cuda_texture.h | shiinamiyuki/LuisaCompute | f8358f8ec138950a84f570c0ede24cc76fc159de | [
"BSD-3-Clause"
] | 4 | 2020-12-02T09:41:22.000Z | 2021-03-06T06:36:40.000Z | //
// Created by Mike on 8/1/2021.
//
#pragma once
#include <cuda.h>
#include <core/basic_types.h>
namespace luisa::compute::cuda {
class CUDAHeap;
class CUDATexture {
private:
union {
CUtexObject _handle;
size_t _index;
};
union {
CUarray _array;
CUmipmappedArray _mip_array;
};
CUDAHeap *_heap{nullptr};
uint _dimension{};
public:
explicit CUDATexture(CUtexObject handle, CUarray array, uint dim) noexcept
: _handle{handle}, _array{array}, _dimension{dim} {}
explicit CUDATexture(CUDAHeap *heap, size_t index, CUmipmappedArray mip_array, uint dim) noexcept
: _index{index}, _mip_array{mip_array}, _heap{heap}, _dimension{dim} {}
[[nodiscard]] uint64_t handle() const noexcept;
[[nodiscard]] auto array() const noexcept { return _array; }
[[nodiscard]] auto mip_array() const noexcept { return _mip_array; }
[[nodiscard]] auto heap() const noexcept { return _heap; }
[[nodiscard]] auto index() const noexcept { return _index; }
[[nodiscard]] auto dimension() const noexcept { return _dimension; }
};
}// namespace luisa::compute::cuda
| 27.333333 | 101 | 0.670732 |
15933d6f213fc14f81a0c518961c903744345ae8 | 1,777 | kt | Kotlin | app/src/main/java/com/example/android/politicalpreparedness/data/PoliticalPreparednessProvider.kt | jesstoselli/UdacityNanodegree-PoliticalPreparedness | e18fd827473ffd8bb4ced69d775975a13497fa9a | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/example/android/politicalpreparedness/data/PoliticalPreparednessProvider.kt | jesstoselli/UdacityNanodegree-PoliticalPreparedness | e18fd827473ffd8bb4ced69d775975a13497fa9a | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/example/android/politicalpreparedness/data/PoliticalPreparednessProvider.kt | jesstoselli/UdacityNanodegree-PoliticalPreparedness | e18fd827473ffd8bb4ced69d775975a13497fa9a | [
"Apache-2.0"
] | null | null | null | package com.example.android.politicalpreparedness.data
import com.example.android.politicalpreparedness.data.network.CivicsApiService
import com.example.android.politicalpreparedness.data.network.dataadapters.toDomainModel
import com.example.android.politicalpreparedness.data.network.models.Election
import com.example.android.politicalpreparedness.data.network.models.RepresentativeResponse
import com.example.android.politicalpreparedness.data.network.models.VoterInfo
class PoliticalPreparednessProvider(
private val electionRepository: ElectionRepository,
private val civicsApiService: CivicsApiService
) {
// Elections
suspend fun getFollowedElectionsFromDatabase(): List<Election> {
return electionRepository.getElections()
}
suspend fun getElectionsFromAPI(): List<Election> {
val electionsList = civicsApiService.getElections()
return electionsList.toDomainModel()
}
suspend fun getElectionById(id: Int): Election? {
return electionRepository.getElectionById(id)
}
suspend fun followElection(election: Election) {
electionRepository.followElection(election)
}
suspend fun unfollowElection(id: Int) {
electionRepository.unfollowElection(id)
}
suspend fun unfollowAllElections() {
electionRepository.unfollowAllElections()
}
// Voter Info
suspend fun getVoterInfo(electionId: Int, address: String): VoterInfo {
val voterInfoResponse = civicsApiService.getVoterInfo(electionId, address)
return voterInfoResponse.toDomainModel()
}
// Representatives
suspend fun getRepresentativesList(address: String): RepresentativeResponse {
return civicsApiService.getRepresentativesInfoByAddress(address)
}
}
| 34.173077 | 91 | 0.767023 |
8e737ae56570242a3f766ef3d3cb9f907e9d7dab | 52 | rb | Ruby | config/routes.rb | jameskropp/activity-log | 094bdb9909e4c7639d3a2e6ba29a2dfae239feed | [
"MIT"
] | null | null | null | config/routes.rb | jameskropp/activity-log | 094bdb9909e4c7639d3a2e6ba29a2dfae239feed | [
"MIT"
] | null | null | null | config/routes.rb | jameskropp/activity-log | 094bdb9909e4c7639d3a2e6ba29a2dfae239feed | [
"MIT"
] | null | null | null | Activity::Engine.routes.draw do
# Routes here
end
| 13 | 31 | 0.75 |
6e3870ab06c06913873f24d360407608f81817c4 | 3,632 | html | HTML | src/app/page/landing-layout/form-pages/sign-up-page/sign-up-page.component.html | dutt447utt447/TECHVIEW | b7d6e1f34b692567b1442e503953fa06297eae81 | [
"MIT"
] | 5 | 2021-08-15T15:49:36.000Z | 2022-01-29T21:40:29.000Z | src/app/page/landing-layout/form-pages/sign-up-page/sign-up-page.component.html | dutt447utt447/TECHVIEW | b7d6e1f34b692567b1442e503953fa06297eae81 | [
"MIT"
] | 110 | 2021-02-12T14:47:37.000Z | 2022-03-28T14:33:56.000Z | src/app/page/landing-layout/form-pages/sign-up-page/sign-up-page.component.html | dutt447utt447/TECHVIEW | b7d6e1f34b692567b1442e503953fa06297eae81 | [
"MIT"
] | 1 | 2021-12-06T21:26:37.000Z | 2021-12-06T21:26:37.000Z | <div class="form-page-layout">
<!-- Register -->
<app-hero [contents]="appHeroContents"></app-hero>
<app-card [bodyTemplate]="bodyTemplate">
<!-- Body -->
<ng-template #bodyTemplate>
<div class="body">
<div class="flex-layout-row-wrap flex-center-center auth-social-login-wrapper">
<ng-container *ngFor="let website of websites.slice(0, 4)">
<app-brand-button (click)="socialLogin( website )" [icon]="website.cssClass">
</app-brand-button>
</ng-container>
<ng-container *ngIf="showMoreToggle">
<app-brand-button *ngFor="let website of websites.slice(4)" (click)="socialLogin( website )" [icon]="website.cssClass">
</app-brand-button>
</ng-container>
</div>
<a *ngIf="!showMoreToggle" (click)="showMoreToggle = !showMoreToggle" class="flex-layout-column flex-center-center theme-color-link">
<p i18n="@@signUp.more.text">More</p>
<i aria-hidden="true" class="fas fa-caret-down fa-lg fa-fw"></i>
</a>
<form (ngSubmit)="onSubmit()" [formGroup]="form">
<div class="section">
<div [class.error-input]="submitted && form.controls.username.invalid" class="input-with-icon">
<input formControlName="username" i18n-placeholder="@@signUp.username.placeholder" placeholder="Username..." required type="text">
<i aria-hidden="true" class="fas fa-user fa-lg fa-fw"></i>
</div>
<div [class.error-input]="submitted && form.controls.email.invalid" class="input-with-icon">
<input formControlName="email" i18n-placeholder="@@signUp.email.placeholder" placeholder="Email..." required type="email">
<i aria-hidden="true" class="fas fa-envelope fa-lg fa-fw"></i>
</div>
<div [class.error-input]="submitted && form.controls.password.invalid" class="input-with-icon">
<input formControlName="password" i18n-placeholder="@@signUp.password.placeholder" placeholder="Password..." required type="password">
<i aria-hidden="true" class="fas fa-key fa-lg fa-fw"></i>
</div>
<div [class.error-input]="submitted && form.controls.confirmPassword.invalid" class="input-with-icon">
<input formControlName="confirmPassword" i18n-placeholder="@@signUp.confirmPassword.placeholder" placeholder="Confirm Password..." required type="password">
<i aria-hidden="true" class="fas fa-lock fa-lg fa-fw"></i>
</div>
</div>
<div class="section-submit">
<app-button i18n-text="@@signUp.continue.button" text="CONTINUE"></app-button>
<p>
<small i18n="@@signUp.terms" class="dim">By signing up, you agree
<a class="theme-color-link" rel=noopener routerLink="{{URLS.terms}}" target="_blank">Terms of Use</a>,
<a class="theme-color-link" rel=noopener routerLink="{{URLS.privacyPolicy}}" target="_blank">Privacy
Policy</a>
and
<a class="theme-color-link" rel=noopener routerLink="{{URLS.cookiePolicy}}" target="_blank">Cookie
Policy</a>
</small>
</p>
<hr class="dim"/>
<p i18n="@@signUp.alreadyHaveAccount">
Already have an account?
<a [routerLink]="URLS.login" class="theme-color-link">
Login
</a>
</p>
</div>
</form>
</div>
</ng-template>
</app-card>
</div>
<app-cookies></app-cookies>
| 53.411765 | 170 | 0.581222 |
5462bab9ccc7c88f3c0788fa6b386a99df375523 | 4,939 | go | Go | service/save_daily_info_service.go | myloft/MiniProgram-server-Golang | 43a68a6d189a925ad4a3495204711455d04e12c2 | [
"Apache-2.0"
] | 30 | 2020-03-07T14:15:38.000Z | 2022-03-11T08:22:55.000Z | service/save_daily_info_service.go | myloft/MiniProgram-server-Golang | 43a68a6d189a925ad4a3495204711455d04e12c2 | [
"Apache-2.0"
] | 43 | 2020-03-08T14:59:57.000Z | 2020-04-03T08:56:28.000Z | service/save_daily_info_service.go | myloft/MiniProgram-server-Golang | 43a68a6d189a925ad4a3495204711455d04e12c2 | [
"Apache-2.0"
] | 20 | 2020-03-07T14:13:20.000Z | 2021-02-13T14:22:27.000Z | package service
import (
"Miniprogram-server-Golang/model"
"Miniprogram-server-Golang/serializer"
"database/sql"
"github.com/gin-gonic/gin"
"time"
)
//SaveDailyInfoService 管理每日上传信息服务
type data struct {
IsReturnSchool string `form:"data.is_return_school" json:"is_return_school"`
ReturnTime string `form:"data.return_time" json:"return_time"`
ReturnDormNum string `form:"data.return_dorm_num" json:"return_dorm_num"`
ReturnTrafficInfo string `form:"data.return_traffic_info" json:"return_traffic_info"`
CurrentHealthValue string `form:"data.current_health_value" json:"current_health_value"`
CurrentContagionRiskValue string `form:"data.current_contagion_risk_value" json:"current_contagion_risk_value"`
//ReturnDistrictValue int `form:"data.current_contagion_risk_value" json:"return_district_value"`
CurrentDistrictValue int `form:"data.current_district_value" json:"current_district_value"`
CurrentTemperature string `form:"data.current_temperature" json:"current_temperature"`
PsyStatus string `form:"data.psy_status" json:"psy_status"`
PsyDemand string `form:"data.psy_demand" json:"psy_demand"`
PsyKnowledge string `form:"data.psy_knowledge" json:"psy_knowledge"`
Remarks string `form:"data.remarks" json:"remarks"`
}
type SaveDailyInfoService struct {
Data data `form:"data" json:"data"`
UID int `form:"uid" json:"uid"`
Token string `form:"token" json:"token"`
TemplateCode string `form:"template_code" json:"template_code"`
}
//判断字符串是否为空 用于解决输入数据为空 无法存储到数据库的问题
func CheckValid(s string) bool {
if s != "" {
return true
}
return false
}
// isRegistered 判断用户是否存在
func (service *SaveDailyInfoService) SaveDailyInfo(c *gin.Context) serializer.Response {
if !model.CheckToken(service.UID, service.Token) {
return serializer.ParamErr("token验证错误", nil)
}
//查找用户绑定信息
var orgid, orgname, username, userid string
err := model.DB.QueryRow("select org_id from wx_mp_bind_info where wx_uid =? ", service.UID).Scan(&orgid)
err = model.DB.QueryRow("select corpname from organization where id=?", orgid).Scan(&orgname)
err = model.DB.QueryRow("select name,userid from wx_mp_user where wid =? ", service.UID).Scan(&username, &userid)
//count 用于判断是否重复提交
count := 0
var time = time.Now().Format("2006-01-02")
if service.TemplateCode == "default" {
//学生
//判断是否重复提交
err = model.DB.QueryRow("select count(*) from report_record_default where userID =? and time = ?", userid, time).Scan(&count)
if count > 0 && err == nil {
return serializer.ParamErr("今日您已提交,请勿重复提交", nil)
}
//保存信息
queryStr := "insert into report_record_default(is_return_school,current_health_value,current_contagion_risk_value," +
"current_district_value,current_temperature,remarks,psy_status,psy_demand,psy_knowledge,return_time," +
"wxuid,time,org_id,org_name,name,userID,template_code,return_dorm_num,return_traffic_info)" +
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
if _, err := model.DB.Exec(queryStr, service.Data.IsReturnSchool, service.Data.CurrentHealthValue, service.Data.CurrentContagionRiskValue,
service.Data.CurrentDistrictValue, service.Data.CurrentTemperature, service.Data.Remarks,
service.Data.PsyStatus, service.Data.PsyDemand, service.Data.PsyKnowledge,
sql.NullString{String: service.Data.ReturnTime, Valid: CheckValid(service.Data.ReturnTime)},
service.UID, time, orgid, orgname, username, userid, service.TemplateCode, service.Data.ReturnDormNum,
service.Data.ReturnTrafficInfo); err != nil {
return serializer.ParamErr("上传失败", nil)
}
//企业员工
} else {
//判断是否重复提交
err = model.DB.QueryRow("select count(*) from report_record_company where userID =? and time = ?", userid, time).Scan(&count)
if count > 0 && err == nil {
return serializer.ParamErr("今日您已提交,请勿重复提交", nil)
}
//保存信息
queryStr := "insert into report_record_company(is_return_school,current_health_value,current_contagion_risk_value," +
"current_district_value,current_temperature,remarks,psy_status,psy_demand,psy_knowledge,return_time," +
"wxuid,time,org_id,org_name,name,userID,template_code,return_dorm_num,return_traffic_info)" +
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
if _, err := model.DB.Exec(queryStr, service.Data.IsReturnSchool, service.Data.CurrentHealthValue, service.Data.CurrentContagionRiskValue,
service.Data.CurrentDistrictValue, service.Data.CurrentTemperature, service.Data.Remarks,
service.Data.PsyStatus, service.Data.PsyDemand, service.Data.PsyKnowledge,
sql.NullString{String: service.Data.ReturnTime, Valid: CheckValid(service.Data.ReturnTime)},
service.UID, time, orgid, orgname, username, userid, service.TemplateCode, service.Data.ReturnDormNum,
service.Data.ReturnTrafficInfo); err != nil {
return serializer.ParamErr("上传失败", nil)
}
}
return serializer.BuildSuccessSave()
}
| 48.90099 | 140 | 0.736991 |
bab164ca09e3a1b884571aae19d0443f55df8a86 | 4,186 | swift | Swift | Week 6-7 Multipeer Connectivity/ML_MusicalChairs-master/musicalChairs/IntroCollectionViewFlowLayout.swift | ada10086/Mobile-Lab | 743ca7e7cfd054e3a47e6900a399c6d5aa5baf40 | [
"MIT"
] | null | null | null | Week 6-7 Multipeer Connectivity/ML_MusicalChairs-master/musicalChairs/IntroCollectionViewFlowLayout.swift | ada10086/Mobile-Lab | 743ca7e7cfd054e3a47e6900a399c6d5aa5baf40 | [
"MIT"
] | null | null | null | Week 6-7 Multipeer Connectivity/ML_MusicalChairs-master/musicalChairs/IntroCollectionViewFlowLayout.swift | ada10086/Mobile-Lab | 743ca7e7cfd054e3a47e6900a399c6d5aa5baf40 | [
"MIT"
] | null | null | null | //
// IntroCollectionViewFlowLayout.swift
// musicalChairs
//
// Created by Eva Philips on 3/17/19.
// Copyright © 2019 eva&ada. All rights reserved.
//
import UIKit
class IntroCollectionViewFlowLayout: UICollectionViewFlowLayout {
let activeDistance: CGFloat = 200
let zoomFactor: CGFloat = 0.3
override init() {
super.init()
scrollDirection = .horizontal
minimumLineSpacing = 50
// itemSize = CGSize(width: 150, height: 300)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func prepare() {
guard let introCollectionView = collectionView else { fatalError() }
itemSize = CGSize(width: 250, height: 350)
let verticalInsets = (introCollectionView.frame.height - introCollectionView.adjustedContentInset.top - introCollectionView.adjustedContentInset.bottom - itemSize.height) / 2
let horizontalInsets = (introCollectionView.frame.width - introCollectionView.adjustedContentInset.right - introCollectionView.adjustedContentInset.left - itemSize.width) / 2
sectionInset = UIEdgeInsets(top: verticalInsets, left: horizontalInsets, bottom: verticalInsets, right: horizontalInsets)
super.prepare()
}
override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
guard let introCollectionView = collectionView else { return nil }
let rectAttributes = super.layoutAttributesForElements(in: rect)!.map { $0.copy() as! UICollectionViewLayoutAttributes }
let visibleRect = CGRect(origin: introCollectionView.contentOffset, size: introCollectionView.frame.size)
// Make the cells be zoomed when they reach the center of the screen
for attributes in rectAttributes where attributes.frame.intersects(visibleRect) {
let distance = visibleRect.midX - attributes.center.x
let normalizedDistance = distance / activeDistance
if distance.magnitude < activeDistance {
let zoom = 1 + zoomFactor * (1 - normalizedDistance.magnitude)
attributes.transform3D = CATransform3DMakeScale(zoom, zoom, 1)
attributes.zIndex = Int(zoom.rounded())
}
}
return rectAttributes
}
override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
guard let introCollectionView = collectionView else { return .zero }
// Add some snapping behaviour so that the zoomed cell is always centered
let targetRect = CGRect(x: proposedContentOffset.x, y: 0, width: introCollectionView.frame.width, height: introCollectionView.frame.height)
guard let rectAttributes = super.layoutAttributesForElements(in: targetRect) else { return .zero }
var offsetAdjustment = CGFloat.greatestFiniteMagnitude
let horizontalCenter = proposedContentOffset.x + introCollectionView.frame.width / 2
for layoutAttributes in rectAttributes {
let itemHorizontalCenter = layoutAttributes.center.x
if (itemHorizontalCenter - horizontalCenter).magnitude < offsetAdjustment.magnitude {
offsetAdjustment = itemHorizontalCenter - horizontalCenter
}
}
return CGPoint(x: proposedContentOffset.x + offsetAdjustment, y: proposedContentOffset.y)
}
override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
// Invalidate layout so that every cell get a chance to be zoomed when it reaches the center of the screen
return true
}
override func invalidationContext(forBoundsChange newBounds: CGRect) -> UICollectionViewLayoutInvalidationContext {
let context = super.invalidationContext(forBoundsChange: newBounds) as! UICollectionViewFlowLayoutInvalidationContext
context.invalidateFlowLayoutDelegateMetrics = newBounds.size != collectionView?.bounds.size
return context
}
}
| 45.010753 | 182 | 0.698519 |
dddeb93a2d13885e9520b8ec95b51b16c8564a7f | 781 | phpt | PHP | tests/parallel/functional/004.phpt | symplely/coroutine | 59a8c92599cdf1c35627d9295b12aaaa5739499f | [
"MIT"
] | 37 | 2019-06-02T04:42:58.000Z | 2022-03-28T12:50:03.000Z | tests/parallel/functional/004.phpt | uppes/coroutine | 5b00387985a58b6252eb70af17cfa79937aedadf | [
"MIT"
] | 4 | 2019-09-30T07:39:44.000Z | 2021-12-17T04:18:32.000Z | tests/parallel/functional/004.phpt | symplely/coroutine | 59a8c92599cdf1c35627d9295b12aaaa5739499f | [
"MIT"
] | 5 | 2019-06-02T04:43:01.000Z | 2022-03-04T16:42:58.000Z | --TEST--
Check functional reuse
--SKIPIF--
<?php
if (!extension_loaded('uv')) {
echo 'skip';
}
if (!version_compare(PHP_VERSION, "7.4", ">=")) {
die("skip php 7.4 required");
}?>
--FILE--
<?php
include 'vendor/autoload.php';
$future = \parallel\run(function() {
global $var;
$var = 42;
});
$future->value(); # we know that the
# runtime started for the first
# task is free, the next task
# must reuse the runtime
usleep(1000000/2); # we can't be sure how fast the runtime will become available
# so we sleep a little here to help the test along
# normal code doesn't need to care
\parallel\run(function(){
global $var;
var_dump($var);
});
?>
--EXPECTF--
int(42)
| 21.108108 | 80 | 0.572343 |
5b6a14d810693d7a16b4bec97845a11fde6f1b4c | 850 | lua | Lua | vim/.config/nvim/lua/highlights.lua | simonhughcom/dotfiles | 11a46f064fb2d2d9bc7a8fb4da87b1dfd6e619c9 | [
"MIT"
] | 2 | 2020-10-03T14:05:58.000Z | 2020-11-13T03:46:55.000Z | vim/.config/nvim/lua/highlights.lua | simonhughxyz/dotfiles | d00caa64a32d1468bb4984613ab29ca7c082b752 | [
"MIT"
] | null | null | null | vim/.config/nvim/lua/highlights.lua | simonhughxyz/dotfiles | d00caa64a32d1468bb4984613ab29ca7c082b752 | [
"MIT"
] | null | null | null | -- highlight.lua
hl = require('utils').highlight
-- Make background transparent
hl('Normal', 'NONE', nil, 'NONE', nil, true)
hl('NonText', 'NONE', nil, 'NONE', nil, true)
-- -- -- set color of 80 char width column
hl('ColorColumn', '#303030', nil, '0', nil, true)
-- -- -- change color of cursor line
hl('CursorLine', '#000000', nil, '0', nil, true)
hl('CursorLineNr', '#000000', '#008000', '0', '2', true)
hl('TSString', nil, '#449944', '0', '2', true)
hl('TSVariable', nil, '#bb80bb', '0', '2', true)
-- hl('TSFunction', nil, '#f06030', '0', '2', true)
hl('TSStringRegex', nil, '#aa1111', '0', '2', true)
-- -- Vim Diff colors
hl('DiffAdd', '#000000', '#00c000', '2', '0', true)
hl('DiffChange', '#000000', '#c0c000', '2', '0', true)
hl('DiffDelete', '#000000', '#c00000', '2', '0', true)
hl('DiffDelete', '#ffffff', '#3000a0', '2', '0', true)
| 35.416667 | 56 | 0.58 |
2a6c9282d5e95039e9c6621b94a96fcb4e04992f | 255 | java | Java | src/main/java/libraryejb/exception/UnknownCountryException.java | aleksey-lukyanets/library-ejb | 5641b77b2d760254f25ad5ffebcc741bbdacca38 | [
"MIT"
] | null | null | null | src/main/java/libraryejb/exception/UnknownCountryException.java | aleksey-lukyanets/library-ejb | 5641b77b2d760254f25ad5ffebcc741bbdacca38 | [
"MIT"
] | null | null | null | src/main/java/libraryejb/exception/UnknownCountryException.java | aleksey-lukyanets/library-ejb | 5641b77b2d760254f25ad5ffebcc741bbdacca38 | [
"MIT"
] | null | null | null | package libraryejb.exception;
/**
*
*/
public class UnknownCountryException extends Exception {
public UnknownCountryException() {
super("");
}
public UnknownCountryException(String message) {
super(message);
}
}
| 15.9375 | 56 | 0.643137 |
16a74999cdb1907a816f2014fe92c750394bc36b | 359 | c | C | lec04/returnval1.c | gechoe/class-examples | d7804109b227a322d746df6bc09f5f2c047f21fd | [
"MIT"
] | 1 | 2022-01-20T18:10:51.000Z | 2022-01-20T18:10:51.000Z | lec04/returnval1.c | gechoe/class-examples | d7804109b227a322d746df6bc09f5f2c047f21fd | [
"MIT"
] | null | null | null | lec04/returnval1.c | gechoe/class-examples | d7804109b227a322d746df6bc09f5f2c047f21fd | [
"MIT"
] | 22 | 2022-01-20T18:02:39.000Z | 2022-01-25T18:14:48.000Z | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
char* code(int v) {
char msg[16];
if (v == 0) strcpy(msg, "val0");
else if (v == 1) strcpy(msg, "val1");
else if (v == 2) strcpy(msg, "val2");
return msg;
}
int main() {
srand(time(0));
int val = rand() % 3;
char* m = code(val);
printf("%s\n", m);
return 0;
}
| 17.095238 | 39 | 0.551532 |
402fab453bb9e2ac59ef1604d2cf41a8d383046e | 1,270 | py | Python | move.py | Nexowned/SnakeAI | 95b5d4a9d20df124040ff9335ad09409ca9ff607 | [
"Apache-2.0"
] | null | null | null | move.py | Nexowned/SnakeAI | 95b5d4a9d20df124040ff9335ad09409ca9ff607 | [
"Apache-2.0"
] | null | null | null | move.py | Nexowned/SnakeAI | 95b5d4a9d20df124040ff9335ad09409ca9ff607 | [
"Apache-2.0"
] | null | null | null | from enum import Enum
class Move(Enum):
LEFT = -1
STRAIGHT = 0
RIGHT = 1
class Direction(Enum):
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
def get_new_direction(self, move):
return Direction(self.value + move.value) % 4
def get_xy_manipulation(self):
m = {
Direction.NORTH: (0, -1),
Direction.EAST: (1, 0),
Direction.SOUTH: (0, 1),
Direction.WEST: (-1, 0)
}
return m[self]
def get_xy_moves(self):
m = {
Direction.NORTH: [Direction.NORTH.get_xy_manipulation(), Direction.EAST.get_xy_manipulation(),
Direction.WEST.get_xy_manipulation()],
Direction.EAST: [Direction.NORTH.get_xy_manipulation(), Direction.EAST.get_xy_manipulation(),
Direction.SOUTH.get_xy_manipulation()],
Direction.SOUTH: [Direction.SOUTH.get_xy_manipulation(), Direction.EAST.get_xy_manipulation(),
Direction.WEST.get_xy_manipulation()],
Direction.WEST: [Direction.NORTH.get_xy_manipulation(), Direction.WEST.get_xy_manipulation(),
Direction.SOUTH.get_xy_manipulation()],
}
return m[self]
| 30.238095 | 106 | 0.573228 |
0c7d87c2d7143decedcd6ade00a74af0379219d4 | 902 | py | Python | src/lib/libpasteurize/fixes/fix_newstyle.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 17 | 2017-08-04T15:41:05.000Z | 2020-10-16T18:02:41.000Z | src/lib/libpasteurize/fixes/fix_newstyle.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 3 | 2017-08-04T23:37:37.000Z | 2017-08-04T23:38:34.000Z | src/lib/libpasteurize/fixes/fix_newstyle.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 3 | 2017-12-07T16:30:59.000Z | 2019-06-16T02:48:28.000Z | u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_child(idx, RParen())
node.insert_child(idx, Name(u"object"))
node.insert_child(idx, LParen())
class FixNewstyle(fixer_base.BaseFix):
# Match:
# class Blah:
# and:
# class Blah():
PATTERN = u"classdef< 'class' NAME ['(' ')'] colon=':' any >"
def transform(self, node, results):
colon = results[u"colon"]
idx = node.children.index(colon)
if (node.children[idx - 2].value == '(' and
node.children[idx - 1].value == ')'):
del node.children[idx - 2:idx]
idx -= 2
insert_object(node, idx)
touch_import_top(u'builtins', 'object', node)
| 26.529412 | 65 | 0.599778 |
dda83b2c35d62055796e4e123db761f5ab14e3a9 | 5,711 | go | Go | vendor/github.com/joomcode/redispipe/redis/request_writer.go | anuragprafulla/components-contrib | 91be9ad2a0767526049e0c95225b5afb3791e353 | [
"MIT"
] | 229 | 2018-12-20T09:36:33.000Z | 2022-03-31T18:39:26.000Z | vendor/github.com/joomcode/redispipe/redis/request_writer.go | anuragprafulla/components-contrib | 91be9ad2a0767526049e0c95225b5afb3791e353 | [
"MIT"
] | 12 | 2019-09-27T14:14:19.000Z | 2022-03-10T00:06:20.000Z | vendor/github.com/joomcode/redispipe/redis/request_writer.go | anuragprafulla/components-contrib | 91be9ad2a0767526049e0c95225b5afb3791e353 | [
"MIT"
] | 17 | 2018-12-21T17:34:47.000Z | 2022-02-09T19:07:44.000Z | package redis
import (
"strconv"
"github.com/joomcode/errorx"
)
// AppendRequest appends request to byte slice as RESP request (ie as array of strings).
//
// It could fail if some request value is not nil, integer, float, string or byte slice.
// In case of error it still returns modified buffer, but truncated to original size, it could be used save reallocation.
//
// Note: command could contain single space. In that case, it will be split and last part will be prepended to arguments.
func AppendRequest(buf []byte, req Request) ([]byte, error) {
oldSize := len(buf)
space := -1
for i, c := range []byte(req.Cmd) {
if c == ' ' {
space = i
break
}
}
if space == -1 {
buf = appendHead(buf, '*', len(req.Args)+1)
buf = appendHead(buf, '$', len(req.Cmd))
buf = append(buf, req.Cmd...)
buf = append(buf, '\r', '\n')
} else {
buf = appendHead(buf, '*', len(req.Args)+2)
buf = appendHead(buf, '$', space)
buf = append(buf, req.Cmd[:space]...)
buf = append(buf, '\r', '\n')
buf = appendHead(buf, '$', len(req.Cmd)-space-1)
buf = append(buf, req.Cmd[space+1:]...)
buf = append(buf, '\r', '\n')
}
for i, val := range req.Args {
switch v := val.(type) {
case string:
buf = appendHead(buf, '$', len(v))
buf = append(buf, v...)
case []byte:
buf = appendHead(buf, '$', len(v))
buf = append(buf, v...)
case int:
buf = appendBulkInt(buf, int64(v))
case uint:
buf = appendBulkUint(buf, uint64(v))
case int64:
buf = appendBulkInt(buf, int64(v))
case uint64:
buf = appendBulkUint(buf, uint64(v))
case int32:
buf = appendBulkInt(buf, int64(v))
case uint32:
buf = appendBulkUint(buf, uint64(v))
case int8:
buf = appendBulkInt(buf, int64(v))
case uint8:
buf = appendBulkUint(buf, uint64(v))
case int16:
buf = appendBulkInt(buf, int64(v))
case uint16:
buf = appendBulkUint(buf, uint64(v))
case bool:
if v {
buf = append(buf, "$1\r\n1"...)
} else {
buf = append(buf, "$1\r\n0"...)
}
case float32:
str := strconv.FormatFloat(float64(v), 'f', -1, 32)
buf = appendHead(buf, '$', len(str))
buf = append(buf, str...)
case float64:
str := strconv.FormatFloat(v, 'f', -1, 64)
buf = appendHead(buf, '$', len(str))
buf = append(buf, str...)
case nil:
buf = append(buf, "$0\r\n"...)
default:
return buf[:oldSize], ErrArgumentType.NewWithNoMessage().
WithProperty(EKVal, val).
WithProperty(EKArgPos, i).
WithProperty(EKRequest, req)
}
buf = append(buf, '\r', '\n')
}
return buf, nil
}
func appendInt(b []byte, i int64) []byte {
var u uint64
if i >= 0 && i <= 9 {
b = append(b, byte(i)+'0')
return b
}
if i > 0 {
u = uint64(i)
} else {
b = append(b, '-')
u = uint64(-i)
}
return appendUint(b, u)
}
func appendUint(b []byte, u uint64) []byte {
if u <= 9 {
b = append(b, byte(u)+'0')
return b
}
digits := [20]byte{}
p := 20
for u > 0 {
n := u / 10
p--
digits[p] = byte(u-n*10) + '0'
u = n
}
return append(b, digits[p:]...)
}
func appendHead(b []byte, t byte, i int) []byte {
if i < 0 {
panic("negative length header")
}
b = append(b, t)
b = appendUint(b, uint64(i))
return append(b, '\r', '\n')
}
func appendBulkInt(b []byte, i int64) []byte {
if i >= -99999999 && i <= 999999999 {
b = append(b, '$', '0', '\r', '\n')
} else {
b = append(b, '$', '0', '0', '\r', '\n')
}
l := len(b)
b = appendInt(b, i)
li := byte(len(b) - l)
if li < 10 {
b[l-3] = li + '0'
} else {
d := li / 10
b[l-4] = d + '0'
b[l-3] = li - (d * 10) + '0'
}
return b
}
func appendBulkUint(b []byte, i uint64) []byte {
if i <= 999999999 {
b = append(b, '$', '0', '\r', '\n')
} else {
b = append(b, '$', '0', '0', '\r', '\n')
}
l := len(b)
b = appendUint(b, i)
li := byte(len(b) - l)
if li < 10 {
b[l-3] = li + '0'
} else {
d := li / 10
b[l-4] = d + '0'
b[l-3] = li - (d * 10) + '0'
}
return b
}
// ArgToString returns string representataion of an argument.
// Used in cluster to determine cluster slot.
// Have to be in sync with AppendRequest
func ArgToString(arg interface{}) (string, bool) {
var bufarr [20]byte
var buf []byte
switch v := arg.(type) {
case string:
return v, true
case []byte:
return string(v), true
case int:
buf = appendInt(bufarr[:0], int64(v))
case uint:
buf = appendUint(bufarr[:0], uint64(v))
case int64:
buf = appendInt(bufarr[:0], int64(v))
case uint64:
buf = appendUint(bufarr[:0], uint64(v))
case int32:
buf = appendInt(bufarr[:0], int64(v))
case uint32:
buf = appendUint(bufarr[:0], uint64(v))
case int8:
buf = appendInt(bufarr[:0], int64(v))
case uint8:
buf = appendUint(bufarr[:0], uint64(v))
case int16:
buf = appendInt(bufarr[:0], int64(v))
case uint16:
buf = appendUint(bufarr[:0], uint64(v))
case bool:
if v {
return "1", true
}
return "0", true
case float32:
return strconv.FormatFloat(float64(v), 'f', -1, 32), true
case float64:
return strconv.FormatFloat(v, 'f', -1, 64), true
case nil:
return "", true
default:
return "", false
}
return string(buf), true
}
// CheckRequest checks requests command and arguments to be compatible with connector.
func CheckRequest(req Request, singleThreaded bool) error {
if err := ForbiddenCommand(req.Cmd, singleThreaded); err != nil {
return err.(*errorx.Error).WithProperty(EKRequest, req)
}
for i, arg := range req.Args {
switch val := arg.(type) {
case string, []byte, int, uint, int64, uint64, int32, uint32, int8, uint8, int16, uint16, bool, float32, float64, nil:
// ok
default:
return ErrArgumentType.NewWithNoMessage().
WithProperty(EKVal, val).
WithProperty(EKArgPos, i).
WithProperty(EKRequest, req)
}
}
return nil
}
| 24.097046 | 121 | 0.596393 |
402ca108a9c3f098029d64faeab25fe9ff44caf8 | 2,763 | py | Python | Mesh/System/Entity/Function/Powered.py | ys-warble/Mesh | 115e7391d19ea09db3c627d8b8ed90b3e3bef9b5 | [
"MIT"
] | null | null | null | Mesh/System/Entity/Function/Powered.py | ys-warble/Mesh | 115e7391d19ea09db3c627d8b8ed90b3e3bef9b5 | [
"MIT"
] | 2 | 2019-02-25T00:10:15.000Z | 2019-03-22T20:13:32.000Z | Mesh/System/Entity/Function/Powered.py | ys-warble/Mesh | 115e7391d19ea09db3c627d8b8ed90b3e3bef9b5 | [
"MIT"
] | null | null | null | from enum import Enum
from Mesh.System.Entity.Channel.PowerWire import PowerWire
from Mesh.System.Entity.Function import BaseFunction, Function
from Mesh.System.Entity.Function.Tasked import TaskName, SystemTask
from Mesh.util.TypeList import TypeList
class PowerType(Enum):
ELECTRIC = 101
class Power:
def __init__(self, power_type):
self.power_type = power_type
class ElectricPower(Power):
def __init__(self, voltage):
super().__init__(PowerType.ELECTRIC)
self.voltage = voltage
def __eq__(self, other):
return self.power_type == other.power_type and self.voltage == other.voltage
def __str__(self):
return '%s(voltage=%s)' % (type(self).__name__, self.voltage)
class PowerInput:
identifier = 'PowerInput'
def __init__(self, parent, power=ElectricPower(voltage=0)):
self.parent = parent
self.power = power
self.power_wires = TypeList(PowerWire)
def set_power(self, power=ElectricPower(voltage=0)):
self.power = power
if self.parent.has_function(Function.TASKED):
self.parent.send_task(SystemTask(name=TaskName.SET_POWER, value={'power': power}))
else:
if self.power in self.parent.get_function(Function.POWERED).input_power_ratings:
self.parent.active = True
else:
self.parent.active = False
def get_power(self):
if len(self.power_wires) > 0:
return self.power_wires[0].get_power()
else:
return self.power
class PowerOutput:
identifier = 'PowerOutput'
def __init__(self, parent, power=ElectricPower(voltage=0)):
self.parent = parent
self.power = power
self.power_wires = TypeList(PowerWire)
def get_power(self):
return self.power
def set_power(self, power=ElectricPower(voltage=0)):
self.power = power
for wire in self.power_wires:
wire.set_power(self.power)
class Powered(BaseFunction):
tasks = [
TaskName.SET_POWER,
]
def __init__(self, entity):
super().__init__(entity)
self.power_inputs = TypeList(PowerInput)
self.power_outputs = TypeList(PowerOutput)
self.input_power_ratings = []
self.output_power_ratings = []
def eval(self):
pass
def init(self):
pass
def terminate(self):
pass
def get_power_input(self, index=0):
if index < len(self.power_inputs):
return self.power_inputs[index]
else:
raise IndexError
def get_power_output(self, index=0):
if index < len(self.power_outputs):
return self.power_outputs[index]
else:
raise IndexError
| 26.314286 | 94 | 0.642056 |
2a6bdce1cf2f3b55115579f68963b1a71c7ca905 | 6,015 | java | Java | src/net/java/sip/communicator/impl/gui/main/chat/ChatContact.java | wcicola/jitsi | 8258aa5ae060ae1320d98977b9241002d428b7d6 | [
"Apache-2.0"
] | 3,442 | 2015-01-08T09:51:28.000Z | 2022-03-31T02:48:33.000Z | src/net/java/sip/communicator/impl/gui/main/chat/ChatContact.java | wcicola/jitsi | 8258aa5ae060ae1320d98977b9241002d428b7d6 | [
"Apache-2.0"
] | 577 | 2015-01-27T20:50:12.000Z | 2022-03-11T13:08:45.000Z | src/net/java/sip/communicator/impl/gui/main/chat/ChatContact.java | wcicola/jitsi | 8258aa5ae060ae1320d98977b9241002d428b7d6 | [
"Apache-2.0"
] | 953 | 2015-01-04T05:20:14.000Z | 2022-03-31T14:04:14.000Z | /*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Copyright @ 2015 Atlassian Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.java.sip.communicator.impl.gui.main.chat;
import javax.swing.*;
import net.java.sip.communicator.plugin.desktoputil.*;
/**
* The <tt>ChatContact</tt> is a wrapping class for the <tt>Contact</tt> and
* <tt>ChatRoomMember</tt> interface.
*
* @param <T> the type of the descriptor
*
* @author Yana Stamcheva
* @author Lubomir Marinov
*/
public abstract class ChatContact<T>
{
/**
* The height of the avatar icon.
*/
public static final int AVATAR_ICON_HEIGHT = 25;
/**
* The width of the avatar icon.
*/
public static final int AVATAR_ICON_WIDTH = 25;
/**
* The avatar image corresponding to the source contact in the form of an
* <code>ImageIcon</code>.
*/
private ImageIcon avatar;
/**
* The avatar image corresponding to the source contact in the form of an
* array of bytes.
*/
private byte[] avatarBytes;
/**
* The descriptor being adapted by this instance.
*/
protected final T descriptor;
/**
* If this instance is selected.
*/
private boolean selected;
/**
* Initializes a new <tt>ChatContact</tt> instance with a specific
* descriptor.
*
* @param descriptor the descriptor to be adapted by the new instance
*/
protected ChatContact(T descriptor)
{
this.descriptor = descriptor;
}
/**
* Determines whether a specific <tt>Object</tt> represents the same value
* as this <tt>ChatContact</tt>.
*
* @param obj the <tt>Object</tt> to be checked for value equality with this
* <tt>ChatContact</tt>
* @return <tt>true</tt> if <tt>obj</tt> represents the same value as this
* <tt>ChatContact</tt>; otherwise, <tt>false</tt>.
*/
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
/*
* ChatContact is an adapter so two ChatContacts of the same runtime
* type with equal descriptors are equal.
*/
if (!getClass().isInstance(obj))
return false;
@SuppressWarnings("unchecked")
ChatContact<T> chatContact = (ChatContact<T>) obj;
return getDescriptor().equals(chatContact.getDescriptor());
}
/**
* Returns the avatar image corresponding to the source contact. In the case
* of multi user chat contact returns null.
*
* @return the avatar image corresponding to the source contact. In the case
* of multi user chat contact returns null
*/
public ImageIcon getAvatar()
{
byte[] avatarBytes = getAvatarBytes();
if (this.avatarBytes != avatarBytes)
{
this.avatarBytes = avatarBytes;
this.avatar = null;
}
if ((this.avatar == null)
&& (this.avatarBytes != null) && (this.avatarBytes.length > 0))
this.avatar
= ImageUtils.getScaledRoundedIcon(
this.avatarBytes,
AVATAR_ICON_WIDTH,
AVATAR_ICON_HEIGHT);
return this.avatar;
}
/**
* Gets the avatar image corresponding to the source contact in the form of
* an array of bytes.
*
* @return an array of bytes which represents the avatar image corresponding
* to the source contact
*/
protected abstract byte[] getAvatarBytes();
/**
* Returns the descriptor object corresponding to this chat contact. In the
* case of single chat this could be the <tt>MetaContact</tt> and in the
* case of conference chat this could be the <tt>ChatRoomMember</tt>.
*
* @return the descriptor object corresponding to this chat contact.
*/
public T getDescriptor()
{
return descriptor;
}
/**
* Returns the contact name.
*
* @return the contact name
*/
public abstract String getName();
/**
* Gets the implementation-specific identifier which uniquely specifies this
* contact.
*
* @return an identifier which uniquely specifies this contact
*/
public abstract String getUID();
/**
* Gets a hash code value for this object for the benefit of hashtables.
*
* @return a hash code value for this object
*/
@Override
public int hashCode()
{
/*
* ChatContact is an adapter so two ChatContacts of the same runtime
* type with equal descriptors are equal.
*/
return getDescriptor().hashCode();
}
/**
* Returns <code>true</code> if this is the currently selected contact in
* the list of contacts for the chat, otherwise returns <code>false</code>.
* @return <code>true</code> if this is the currently selected contact in
* the list of contacts for the chat, otherwise returns <code>false</code>.
*/
public boolean isSelected()
{
return selected;
}
/**
* Sets this isSelected property of this chat contact.
*
* @param selected <code>true</code> to indicate that this contact would be
* the selected contact in the list of chat window contacts; otherwise,
* <code>false</code>
*/
public void setSelected(boolean selected)
{
this.selected = selected;
}
}
| 29.199029 | 80 | 0.622444 |
3933424e6e39797e2cb53abce943d0c0f5f1037c | 1,627 | html | HTML | src/index.html | Jmagero/to-dos-list | 91ccaac2ec01cced82ed47ccc01b7f78b120926f | [
"MIT"
] | 1 | 2021-08-03T17:33:46.000Z | 2021-08-03T17:33:46.000Z | src/index.html | Jmagero/to-dos-list | 91ccaac2ec01cced82ed47ccc01b7f78b120926f | [
"MIT"
] | 2 | 2021-07-13T21:30:29.000Z | 2021-07-16T12:51:25.000Z | src/index.html | Jmagero/to-dos-list | 91ccaac2ec01cced82ed47ccc01b7f78b120926f | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css"
integrity="sha384-SZXxX4whJ79/gErwcOYf+zWLeJdY/qpuqC4cAa9rOGUstPomtqpuNWT9wdPEn2fk" crossorigin="anonymous" />
<title>To-dos-List</title>
</head>
<body>
<main class="m-4 w-90">
<div class="border border-secondary d-flex flex-column align-items-center justify-content-center">
<div class="d-flex align-items-center justify-content-around">
<h2 class="py-1 px-2 mx-2">To-Dos</h2>
<i class="fas fa-sync-alt"></i>
</div>
<ul id="tasks" class="d-flex w-50 flex-column list-group"></ul>
<div class="d-flex m-2 w-20" >
<input type="text" class="form-control" id="inputTask" placeholder="Add to your list..." />
</div>
</div>
<a href="#">
<p class="border border-secondary text-center p-1">Clear all completed</p>
</a>
</main>
</body>
</html> | 54.233333 | 214 | 0.651506 |
0bd6b22abe73ce370e2df769db300c6c8603758b | 5,737 | js | JavaScript | client/src/components/Nav/Nav.js | teodorsova/Express-react-webapp | 92d3a29e9425659c0a05e3c06fc839abd8b574b7 | [
"MIT"
] | null | null | null | client/src/components/Nav/Nav.js | teodorsova/Express-react-webapp | 92d3a29e9425659c0a05e3c06fc839abd8b574b7 | [
"MIT"
] | null | null | null | client/src/components/Nav/Nav.js | teodorsova/Express-react-webapp | 92d3a29e9425659c0a05e3c06fc839abd8b574b7 | [
"MIT"
] | null | null | null | import './Nav.css';
import React, { useState, useEffect, useRef } from "react";
import { Link } from 'react-router-dom';
import Form from "react-bootstrap/Form";
import { useNavigate } from "react-router-dom";
import notificationImg from "../../notification.png"
import Axios from 'axios'
function Nav(props) {
const user = (window.localStorage.getItem("userName") === null) ? (props.userName) : (window.localStorage.getItem("userName"));
const usrArr = props.usrArr;
const navigate = useNavigate();
const [navBtn, setNavBtn] = useState("");
const axios = Axios.create();
const cardRef = useRef();
var loggedin;
var notifications = [];
var aboutToExpire = [];
const linkStyle = {
"color": 'white',
"textDecoration": "none",
"paddingLeft": "20px",
"paddingRight": "20px",
"font-size": "20px",
"display": "flex",
"align-items": "center"
};
const setUserName = props.setUserName;
function logOut() {
setUserName("");
//document.cookie = null;
//document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC;";
window.localStorage.removeItem("userName")
//alert("You have been logged out.")
}
function getNotifications() {
setTimeout(() => {
axios.post("http://localhost:3001/api/notifications",
{
userName: user
}
).then((res) => {
if (res.status === 200) {
aboutToExpire = res.data;
checkNotifications()
setTimeout(()=>{getNotifications()}, 1000);
}
})
}, 1000)
}
const isInitialMount = useRef(true);
useEffect(() => {
getNotifications();
}, [])
function changeStyleNone(e) {
cardRef.current.style.display = 'none';
}
function changeStyleBlock(e) {
cardRef.current.style.display = 'inline-block';
}
function checkNotifications() {
notifications = [];
for (let i = 0; i < aboutToExpire.length; i++) {
let dateString = aboutToExpire[i].expirationDate;
let date = Date.parse(dateString)
let today = new Date();
let difference = Math.ceil(Math.abs(today - date) / (1000 * 60 * 60 * 24))
if (difference <= 10) {
notifications.push(aboutToExpire[i])
}
}
aboutToExpire = [];
if (notifications.length > 0) {
setNavBtn(
<><button id="notif" className='notification-btn toggle' onMouseEnter={changeStyleBlock} onMouseLeave={changeStyleNone}>
<img src={notificationImg} height="20px"></img>
</button>
<div ref={cardRef} className="card custom">
<p className='notification-text'>You have {notifications.length} listing(s) about to expire! Check your profile.</p>
</div></>
)
} else {
setNavBtn(
<><button className='notification-btn' onMouseEnter={changeStyleBlock} onMouseLeave={changeStyleNone}>
<img src={notificationImg} height="20px"></img>
</button>
<div ref={cardRef} className="card custom" style={{ height: "80px" }}>
<p className='notification-text'>No new notifications!</p>
</div></>
)
}
}
if (user === "" || user === undefined || user === null) {
console.log(user)
loggedin = (
<ul className="nav-links">
<Link style={linkStyle} to="register">
<li>Register</li>
</Link>
<Link style={linkStyle} to="login">
<li>Login</li>
</Link>
</ul>
)
}
else loggedin = (
<ul className="nav-links">
<Link to="/AddListing">
<button className='btn btn-success text-center' style={{ borderRadius: "10px" }} >
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" className="bi bi-plus" viewBox="0 0 16 16" >
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg>
</button>
</Link>
{navBtn}
<Link style={linkStyle} to="dashboard">
<li>{"Welcome " + user}</li>
</Link>
<Link style={linkStyle} to="/" onClick={logOut}>
<li>Logout</li>
</Link>
</ul>)
return (
<nav>
<div style={{ display: "flex", alignItems: "center", paddingTop: "10px", paddingBottom: "10px" }}>
<Link style={linkStyle} to="/">
<h1>ReFood</h1>
</Link>
{loggedin}
<Form.Group size="lg" controlId="type">
<Form.Label>Go to profile</Form.Label>
<Form.Control as="select" custom onChange={(e) => navigate("/" + e.target.value)}>
<option value="default" disabled hidden selected>Select a user</option>
{
usrArr.map((i) => {
return <option value={i}>{i}</option>
})
}
</Form.Control>
</Form.Group>
</div>
</nav>
)
}
export default Nav | 32.230337 | 147 | 0.487014 |
b0c17de3777c79065b9d41b281b353d09c785a63 | 1,215 | kt | Kotlin | network/src/main/kotlin/rs/dusk/network/rs/codec/game/encode/message/ContainerItemsMessage.kt | dusk-rs/server-old | 4af70ecb731d9ce292d086c81c21eda66bfaa040 | [
"CC-BY-3.0"
] | 52 | 2020-12-09T06:46:47.000Z | 2022-03-19T19:53:53.000Z | network/src/main/kotlin/rs/dusk/network/rs/codec/game/encode/message/ContainerItemsMessage.kt | dusk-rs/server-old | 4af70ecb731d9ce292d086c81c21eda66bfaa040 | [
"CC-BY-3.0"
] | 114 | 2020-12-10T23:02:59.000Z | 2021-06-02T03:02:00.000Z | network/src/main/kotlin/rs/dusk/network/rs/codec/game/encode/message/ContainerItemsMessage.kt | dusk-rs/server-old | 4af70ecb731d9ce292d086c81c21eda66bfaa040 | [
"CC-BY-3.0"
] | 9 | 2020-12-13T21:45:34.000Z | 2022-01-26T18:23:59.000Z | package rs.dusk.network.rs.codec.game.encode.message
import rs.dusk.core.network.model.message.Message
/**
* Sends a list of items to display on a interface item group component
* @param key The id of the container
* @param items List of the item ids to display
* @param amounts List of the item amounts to display
* @param secondary Optional to send to the primary or secondary container
*/
data class ContainerItemsMessage(val key: Int, val items: IntArray, val amounts: IntArray, val secondary: Boolean) : Message {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as ContainerItemsMessage
if (key != other.key) return false
if (!items.contentEquals(other.items)) return false
if (!amounts.contentEquals(other.amounts)) return false
if (secondary != other.secondary) return false
return true
}
override fun hashCode(): Int {
var result = key
result = 31 * result + items.contentHashCode()
result = 31 * result + amounts.contentHashCode()
result = 31 * result + secondary.hashCode()
return result
}
} | 35.735294 | 126 | 0.678189 |
20c084d4b133ed57042b2f90d8091f1ed85cc35b | 52 | css | CSS | public/mycss/site.css | fozoholiver1/customer-system | 46c499ac5c555b3a7e7d051113e2adb6596cb6a2 | [
"MIT"
] | null | null | null | public/mycss/site.css | fozoholiver1/customer-system | 46c499ac5c555b3a7e7d051113e2adb6596cb6a2 | [
"MIT"
] | 4 | 2021-03-09T21:15:23.000Z | 2022-02-26T19:19:55.000Z | public/mycss/site.css | fozoholiver1/customer-system | 46c499ac5c555b3a7e7d051113e2adb6596cb6a2 | [
"MIT"
] | null | null | null | body {
background-image: url('drawing-1.svg');
} | 17.333333 | 43 | 0.634615 |
98cf42f5dcdfd030fb131e8ea22bfc02dd1925aa | 8,365 | kt | Kotlin | app/src/main/java/com/flamyoad/tsukiviewer/ui/search/SearchResultViewModel.kt | androiddevnotesforks/TsukiViewer | 2ad5060d52b758c5c60ab133f1cc7aed49ccca9b | [
"Apache-2.0"
] | 6 | 2020-10-23T16:43:42.000Z | 2021-11-12T12:03:08.000Z | app/src/main/java/com/flamyoad/tsukiviewer/ui/search/SearchResultViewModel.kt | androiddevnotesforks/TsukiViewer | 2ad5060d52b758c5c60ab133f1cc7aed49ccca9b | [
"Apache-2.0"
] | 3 | 2021-05-29T15:45:41.000Z | 2021-06-29T04:30:21.000Z | app/src/main/java/com/flamyoad/tsukiviewer/ui/search/SearchResultViewModel.kt | androiddevnotesforks/TsukiViewer | 2ad5060d52b758c5c60ab133f1cc7aed49ccca9b | [
"Apache-2.0"
] | 1 | 2021-04-02T17:09:47.000Z | 2021-04-02T17:09:47.000Z | package com.flamyoad.tsukiviewer.ui.search
import android.app.Application
import android.content.Context
import androidx.lifecycle.*
import com.flamyoad.tsukiviewer.db.AppDatabase
import com.flamyoad.tsukiviewer.db.dao.IncludedPathDao
import com.flamyoad.tsukiviewer.model.BookmarkGroup
import com.flamyoad.tsukiviewer.model.Doujin
import com.flamyoad.tsukiviewer.model.IncludedPath
import com.flamyoad.tsukiviewer.repository.BookmarkRepository
import com.flamyoad.tsukiviewer.repository.DoujinRepository
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.onCompletion
import kotlinx.coroutines.flow.onStart
import java.util.*
class SearchResultViewModel(private val app: Application) : AndroidViewModel(app) {
private val db: AppDatabase = AppDatabase.getInstance(app)
private val context: Context = app.applicationContext
private val bookmarkRepo = BookmarkRepository(app)
private val doujinRepo = DoujinRepository(app)
private val selectedDoujins = mutableListOf<Doujin>()
private val pathDao: IncludedPathDao
private val includedPathList: LiveData<List<IncludedPath>>
private val doujinList = mutableListOf<Doujin>()
private val searchResult = MutableLiveData<List<Doujin>>()
fun searchedResult(): LiveData<List<Doujin>> = searchResult
private val isLoading = MutableLiveData<Boolean>(false)
fun isLoading(): LiveData<Boolean> = isLoading
private val selectedDoujinsCount = MutableLiveData<Int>()
fun selectionCountText(): LiveData<Int> = selectedDoujinsCount
private var filterJob: Job? = null
private var shouldResetSelections: Boolean = false
private var shouldTickAllSelections: Boolean = false
val snackbarText = MutableLiveData<String>("")
val bookmarkGroupList = MutableLiveData<List<BookmarkGroup>>()
val bookmarkGroupTickStatus = hashMapOf<String, Boolean>()
init {
pathDao = db.includedFolderDao()
includedPathList = pathDao.getAll()
viewModelScope.launch(Dispatchers.IO) {
bookmarkGroupList.postValue(bookmarkRepo.getAllGroupsBlocking())
}
}
@ExperimentalCoroutinesApi
fun submitQuery(keyword: String, tags: String, shouldIncludeAllTags: Boolean) {
viewModelScope.launch(Dispatchers.IO) {
doujinRepo.scanForDoujins(keyword, tags, shouldIncludeAllTags)
.onStart { isLoading.postValue(true) }
.onCompletion { isLoading.postValue(false) }
.collect { postResult(it) }
}
}
/**
* Used in onNewIntent. Clears out previous list for the activity since it's singleTask
*/
@ExperimentalCoroutinesApi
fun clearPrevAndSubmitQuery(keyword: String, tags: String, shouldIncludeAllTags: Boolean) {
viewModelScope.launch {
searchResult.value = emptyList()
submitQuery(keyword, tags, shouldIncludeAllTags)
}
}
/**
* Filters the search result with keyword (again).
* User can only filter the list once the system has finished loading all items.
* (SearchView in the toolbar is hidden until all the items have finished loading)
*/
fun filterList(keyword: String) {
// Resets search result to full list if query is blank
if (keyword.isBlank()) {
searchResult.value = doujinList
}
filterJob?.cancel() // Cancels the job triggered by previous keyword
filterJob = viewModelScope.launch {
val filteredList = doujinList
.filter { doujin -> doujin.title.toLowerCase(Locale.ROOT).contains(keyword) }
searchResult.value = filteredList
}
}
private suspend fun postResult(doujin: Doujin) {
withContext(Dispatchers.Main) {
if (!doujinList.contains(doujin)) {
doujinList.add(doujin)
}
checkItemSelections()
searchResult.value = doujinList
}
}
private suspend fun checkItemSelections() {
if (shouldResetSelections) {
doujinList.forEach { item -> item.isSelected = false }
} else if (shouldTickAllSelections) {
doujinList.forEach { item -> item.isSelected = true }
selectedDoujins.clear()
selectedDoujins.addAll(doujinList)
selectedDoujinsCount.value = selectedDoujins.size
shouldTickAllSelections = false
} else {
// Had to move this to background thread.
// It will hog UI if selectedDoujins has too many items
withContext(Dispatchers.Default) {
doujinList.forEach { item -> item.isSelected = (item in selectedDoujins) }
}
}
searchResult.value = doujinList
shouldResetSelections = false
}
fun tickSelectedDoujinsAll() {
val hasFinishedLoading = isLoading.value == false
if (hasFinishedLoading) {
doujinList.forEach { item -> item.isSelected = true }
searchResult.value = doujinList
selectedDoujins.clear()
selectedDoujins.addAll(doujinList)
selectedDoujinsCount.value = selectedDoujins.size
} else {
shouldTickAllSelections = true
}
}
fun tickSelectedDoujin(doujin: Doujin) {
val hasBeenSelected = selectedDoujins.contains(doujin)
when (hasBeenSelected) {
true -> selectedDoujins.remove(doujin)
false -> selectedDoujins.add(doujin)
}
selectedDoujinsCount.value = selectedDoujins.size
val hasFinishedLoading = isLoading.value == false
if (hasFinishedLoading) {
val index = doujinList.indexOf(doujin)
val doujin = doujinList[index]
doujin.isSelected = !hasBeenSelected
searchResult.value = doujinList // ??
}
}
fun clearSelectedDoujins() {
selectedDoujins.clear()
val hasFinishedLoading = isLoading.value == false
if (hasFinishedLoading) {
for (doujin in doujinList) {
doujin.isSelected = false
}
searchResult.value = doujinList
} else {
shouldResetSelections = true
}
}
fun selectedCount(): Int {
return selectedDoujins.size
}
fun getSelectedDoujins(): List<Doujin> {
return selectedDoujins.toList()
}
fun fetchBookmarkGroup() {
bookmarkGroupTickStatus.clear()
if (selectedDoujins.size == 1) {
val doujinPath = selectedDoujins.first().path
viewModelScope.launch(Dispatchers.IO) {
val tickedBookmarkGroups = bookmarkRepo.getAllGroupsFrom(doujinPath)
withContext(Dispatchers.Main) {
for (group in tickedBookmarkGroups) {
if (group.isTicked) {
bookmarkGroupTickStatus.put(group.name, true)
}
}
bookmarkGroupList.value = tickedBookmarkGroups
}
}
} else {
viewModelScope.launch(Dispatchers.IO) {
val allBookmarkGroups = bookmarkRepo.getAllGroupsBlocking()
withContext(Dispatchers.Main) {
bookmarkGroupList.value = allBookmarkGroups
}
}
}
}
fun insertItemIntoTickedCollections() {
val tickedItems = bookmarkGroupTickStatus
.filter { x -> x.value == true }
.map { x -> x.key }
val untickedItems = bookmarkGroupTickStatus
.filter { x -> x.value == false }
.map { x -> x.key }
val bookmarkGroupsToBeAdded = tickedItems.minus(untickedItems)
viewModelScope.launch(Dispatchers.IO) {
val status: String
if (selectedDoujins.size == 1) {
val doujinPath = selectedDoujins.first().path
status = bookmarkRepo.wipeAndInsertNew(doujinPath, bookmarkGroupTickStatus)
} else {
status = bookmarkRepo.insertAllItems(selectedDoujins.toList(), bookmarkGroupsToBeAdded)
}
withContext(Dispatchers.Main) {
snackbarText.value = status
}
}
}
}
| 33.594378 | 103 | 0.634668 |
1bef23af1d1e1885b3fbe2f77c7b1a3aa023161b | 2,703 | py | Python | tests/test_subscription.py | avito-tech/alert-autoconf | 73d9270c6f9f0655cfc68ae3dac4e7406acf10ae | [
"MIT"
] | null | null | null | tests/test_subscription.py | avito-tech/alert-autoconf | 73d9270c6f9f0655cfc68ae3dac4e7406acf10ae | [
"MIT"
] | null | null | null | tests/test_subscription.py | avito-tech/alert-autoconf | 73d9270c6f9f0655cfc68ae3dac4e7406acf10ae | [
"MIT"
] | null | null | null | from unittest import TestCase
from alert_autoconf.moira import MoiraAlert
def _make_sub(**kwargs):
sub = {
'tags': [],
'contacts': [],
'escalations': [],
'sched': {'startOffset': 0, 'endOffset': 1439, 'tzOffset': 0, 'days': []},
}
sub.update(**kwargs)
return sub
def _make_esc(offset=10, contacts=None):
return {'contacts': contacts or [], 'offset_in_minutes': offset}
class SubscriptionCmpTest(TestCase):
def test_two_empty(self):
s1 = _make_sub()
s2 = _make_sub()
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertTrue(r)
def test_tags_changed(self):
s1 = _make_sub(tags=['t1'])
s2 = _make_sub()
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertFalse(r)
def test_tags_equal(self):
s1 = _make_sub(tags=['t1', 't2'])
s2 = _make_sub(tags=['t1', 't2'])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertTrue(r)
def test_contacts_equal(self):
s1 = _make_sub(contacts=['c1', 'c2'])
s2 = _make_sub(contacts=['c1', 'c2'])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertTrue(r)
def test_tags_and_contacts_equal(self):
s1 = _make_sub(contacts=['c1', 'c2'], tags=['t1'])
s2 = _make_sub(contacts=['c1', 'c2'], tags=['t1'])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertTrue(r)
def test_tags_and_contacts_not_equal(self):
s1 = _make_sub(contacts=['z1', 'c2'], tags=['t1'])
s2 = _make_sub(contacts=['c1', 'c2'], tags=['t1'])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertFalse(r)
def test_escalations_empty(self):
s1 = _make_sub(escalations=[_make_esc()])
s2 = _make_sub(escalations=[_make_esc()])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertTrue(r)
def test_escalations_diff_offsets(self):
s1 = _make_sub(escalations=[_make_esc(20)])
s2 = _make_sub(escalations=[_make_esc()])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertFalse(r)
def test_escalations_order(self):
s1 = _make_sub(escalations=[_make_esc(20), _make_esc(10)])
s2 = _make_sub(escalations=[_make_esc(10), _make_esc(20)])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertTrue(r)
def test_escalations_contacts_order(self):
s1 = _make_sub(escalations=[_make_esc(contacts=['1', '2'])])
s2 = _make_sub(escalations=[_make_esc(contacts=['2', '1'])])
r = MoiraAlert._subscription_not_changed(s1, s2)
self.assertTrue(r)
| 33.37037 | 82 | 0.623381 |
874c3175b3f173d2cffd8838baf2dd3726496259 | 10,103 | html | HTML | lucene/demo/data/wiki-small/en/articles/d/e/c/Decision_analysis_cycle.html | sydneymiyashiro/LuceneCourseProject | 24eb9de02c6cfdde48b13ad74d61e5758d89c770 | [
"Apache-2.0"
] | 1 | 2019-02-28T04:00:39.000Z | 2019-02-28T04:00:39.000Z | lucene/demo/data/wiki-small/en/articles/d/e/c/Decision_analysis_cycle.html | sydneymiyashiro/LuceneCourseProject | 24eb9de02c6cfdde48b13ad74d61e5758d89c770 | [
"Apache-2.0"
] | null | null | null | lucene/demo/data/wiki-small/en/articles/d/e/c/Decision_analysis_cycle.html | sydneymiyashiro/LuceneCourseProject | 24eb9de02c6cfdde48b13ad74d61e5758d89c770 | [
"Apache-2.0"
] | null | null | null | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- headlinks removed -->
<link rel="shortcut icon" href="../../../../misc/favicon.ico"/>
<title>Decision analysis cycle - Wikipedia, the free encyclopedia</title>
<style type="text/css">/*<![CDATA[*/ @import "../../../../skins/offline/main.css"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="../../../../skins/common/commonPrint.css" />
<!--[if lt IE 5.5000]><style type="text/css">@import "../../../../skins/monobook/IE50Fixes.css";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "../../../../skins/monobook/IE55Fixes.css";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "../../../../skins/monobook/IE60Fixes.css";</style><![endif]-->
<!--[if IE]><script type="text/javascript" src="../../../../skins/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type="text/javascript" src="../../../../skins/common/wikibits.js"></script>
<script type="text/javascript" src="../../../../skins/offline/md5.js"></script>
<script type="text/javascript" src="../../../../skins/offline/utf8.js"></script>
<script type="text/javascript" src="../../../../skins/offline/lookup.js"></script>
<script type="text/javascript" src="../../../../raw/gen.js"></script> <style type="text/css">/*<![CDATA[*/
@import "../../../../raw/MediaWiki%7ECommon.css";
@import "../../../../raw/MediaWiki%7EMonobook.css";
@import "../../../../raw/gen.css";
/*]]>*/</style> </head>
<body
class="ns-0">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="contentTop"></a>
<h1 class="firstHeading">Decision analysis cycle</h1>
<div id="bodyContent">
<h3 id="siteSub">From Wikipedia, the free encyclopedia</h3>
<div id="contentSub"></div>
<!-- start content -->
<div class="notice metadata" id="stub" style="clear:both;"><i>This article is a <a href="../../../../articles/s/t/u/Wikipedia%7EStub_72af.html" title="Wikipedia:Stub">stub</a>. You can help Wikipedia by <a href="http://en.wikipedia.org../../../../articles/d/e/c/Decision_analysis_cycle.html" class="external text" title="http://en.wikipedia.org../../../../articles/d/e/c/Decision_analysis_cycle.html" rel="nofollow">expanding it</a></i>.</div>
<p>The <b>decision analysis (DA) cycle</b> is the top-level procedure for carrying out a <a href="../../../../articles/d/e/c/Decision_analysis.html" title="Decision analysis">decision analysis</a>. The traditional cycle consists of four phases:<br /></p>
<ul>
<li>basis development</li>
<li>determinisitic sensitivity analysis</li>
<li><a href="../../../../articles/p/r/o/Probabilistic_analysis.html" class="mw-redirect" title="Probabilistic analysis">probabilistic analysis</a></li>
<li>basis appraisal.</li>
</ul>
<p>A revised form of the cycle consists of an attention-focusing method followed by a <a href="../../../../articles/d/e/c/Decision_method.html" class="mw-redirect" title="Decision method">decision method</a>, each of which is composed of three stages:<br /></p>
<ul>
<li><a href="../../../../articles/f/o/r/Formulation_%28decision_analysis%29.html" class="mw-redirect" title="Formulation (decision analysis)">formulation</a></li>
<li><a href="../../../../articles/e/v/a/Evaluation_%28decision_analysis%29.html" class="mw-redirect" title="Evaluation (decision analysis)">evaluation</a></li>
<li><a href="../../../../articles/a/p/p/Appraisal_%28decision_analysis%29.html" class="mw-redirect" title="Appraisal (decision analysis)">appraisal</a>.</li>
</ul>
<p>See also: <a href="../../../../articles/d/e/c/Decision_model.html" title="Decision model">decision model</a></p>
<!--
NewPP limit report
Preprocessor node count: 8/1000000
Post-expand include size: 101/2048000 bytes
Template argument size: 0/2048000 bytes
Expensive parser function count: 0/500
-->
<div class="printfooter">
</div>
<div id="catlinks"><div id='catlinks' class='catlinks'><div id="mw-normal-catlinks"><a href="../../../../articles/c/a/t/Special%7ECategories_101d.html" title="Special:Categories">Categories</a>: <span dir='ltr'><a href="../../../../articles/d/e/c/Category%7EDecision_theory_stubs_f8bb.html" title="Category:Decision theory stubs">Decision theory stubs</a></span> | <span dir='ltr'><a href="../../../../articles/d/e/c/Category%7EDecision_theory_09f0.html" title="Category:Decision theory">Decision theory</a></span></div></div></div> <!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<div id="column-one">
<div id="p-cactions" class="portlet">
<h5>Views</h5>
<ul>
<li id="ca-nstab-main"
class="selected" ><a href="../../../../articles/d/e/c/Decision_analysis_cycle.html">Article</a></li><li id="ca-talk"
><a href="../../../../articles/d/e/c/Talk%7EDecision_analysis_cycle_a499.html">Discussion</a></li><li id="ca-current"
><a href="http://en.wikipedia.org/wiki/Decision_analysis_cycle">Current revision</a></li> </ul>
</div>
<div class="portlet" id="p-logo">
<a style="background-image: url(../../../../misc/Wiki.png);"
href="../../../../index.html"
title="Main Page"></a>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
<div class='portlet' id='p-navigation'>
<h5>Navigation</h5>
<div class='pBody'>
<ul>
<li id="n-mainpage"><a href="../../../../index.html">Main Page</a></li>
<li id="n-Contents"><a href="../../../../articles/c/o/n/Portal%7EContents_b878.html">Contents</a></li>
<li id="n-featuredcontent"><a href="../../../../articles/f/e/a/Portal%7EFeatured_content_5442.html">Featured content</a></li>
<li id="n-currentevents"><a href="../../../../articles/c/u/r/Portal%7ECurrent_events_bb60.html">Current events</a></li>
</ul>
</div>
</div>
<div class='portlet' id='p-interaction'>
<h5>Interaction</h5>
<div class='pBody'>
<ul>
<li id="n-aboutsite"><a href="../../../../articles/a/b/o/Wikipedia%7EAbout_8d82.html">About Wikipedia</a></li>
<li id="n-portal"><a href="../../../../articles/c/o/m/Wikipedia%7ECommunity_Portal_6a3c.html">Community portal</a></li>
<li id="n-recentchanges"><a href="../../../../articles/r/e/c/Special%7ERecentChanges_e0d0.html">Recent changes</a></li>
<li id="n-contact"><a href="../../../../articles/c/o/n/Wikipedia%7EContact_us_afd6.html">Contact Wikipedia</a></li>
<li id="n-sitesupport"><a href="http://wikimediafoundation.org/wiki/Donate">Donate to Wikipedia</a></li>
<li id="n-help"><a href="../../../../articles/c/o/n/Help%7EContents_22de.html">Help</a></li>
</ul>
</div>
</div>
<div id="p-search" class="portlet">
<h5><label for="searchInput">Search</label></h5>
<div id="searchBody" class="pBody">
<form action="javascript:goToStatic(3)" id="searchform"><div>
<input id="searchInput" name="search" type="text"
accesskey="f" value="" />
<input type='submit' name="go" class="searchButton" id="searchGoButton"
value="Go" />
</div></form>
</div>
</div>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
<div id="footer">
<div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="../../../../skins/common/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" /></a></div> <div id="f-copyrightico"><a href="http://wikimediafoundation.org/"><img src="../../../../misc/wikimedia-button.png" border="0" alt="Wikimedia Foundation"/></a></div> <ul id="f-list">
<li id="f-credits">This page was last modified 14:46, 6 March 2008 by Wikipedia user <a href="../../../../articles/b/e/t/User%7EBetacommandBot_3654.html" title="User:BetacommandBot">BetacommandBot</a>. Based on work by Wikipedia user(s) <a href="../../../../articles/m/a/t/User%7EMatthew_Yeager_dca8.html" title="User:Matthew Yeager">Matthew Yeager</a>, <a href="../../../../articles/c/r/a/User%7ECrashmatrix_fa34.html" title="User:Crashmatrix">Crashmatrix</a>, <a href="../../../../articles/s/i/m/User%7ESimonP_1010.html" title="User:SimonP">SimonP</a> and <a href="../../../../articles/g/j/e/User%7EGJeffery_6806.html" title="User:GJeffery">GJeffery</a> and Anonymous user(s) of Wikipedia.</li> <li id="f-copyright">All text is available under the terms of the <a class='internal' href="http://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License" title="Wikipedia:Text of the GNU Free Documentation License">GNU Free Documentation License</a>. (See <b><a class='internal' href="http://en.wikipedia.org/wiki/Wikipedia:Copyrights" title="Wikipedia:Copyrights">Copyrights</a></b> for details.) <br /> Wikipedia® is a registered trademark of the <a href="http://www.wikimediafoundation.org">Wikimedia Foundation, Inc</a>., a U.S. registered <a class='internal' href="http://en.wikipedia.org/wiki/501%28c%29#501.28c.29.283.29" title="501(c)(3)">501(c)(3)</a> <a href="http://wikimediafoundation.org/wiki/Deductibility_of_donations">tax-deductible</a> <a class='internal' href="http://en.wikipedia.org/wiki/Non-profit_organization" title="Non-profit organization">nonprofit</a> <a href="http://en.wikipedia.org/wiki/Charitable_organization" title="Charitable organization">charity</a>.<br /></li> <li id="f-about"><a href="../../../../articles/a/b/o/Wikipedia%7EAbout_8d82.html" title="Wikipedia:About">About Wikipedia</a></li> <li id="f-disclaimer"><a href="../../../../articles/g/e/n/Wikipedia%7EGeneral_disclaimer_3e44.html" title="Wikipedia:General disclaimer">Disclaimers</a></li> </ul>
</div>
</div>
</body>
</html>
| 80.824 | 2,032 | 0.641196 |
401a38dd9f28d8e3414417c5cde77d6bbee5ea48 | 820 | py | Python | tools/sandbox/c7n_autodoc/setup.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 2,415 | 2018-12-04T00:37:58.000Z | 2022-03-31T12:28:56.000Z | tools/sandbox/c7n_autodoc/setup.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 3,272 | 2018-12-03T23:58:17.000Z | 2022-03-31T21:15:32.000Z | tools/sandbox/c7n_autodoc/setup.py | al3pht/cloud-custodian | ce6613d1b716f336384c5e308eee300389e6bf50 | [
"Apache-2.0"
] | 773 | 2018-12-06T09:43:23.000Z | 2022-03-30T20:44:43.000Z | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from setuptools import setup
import os
description = ""
if os.path.exists('README.md'):
description = open('README.md', 'r').read()
setup(
name="c7n_autodoc",
version='0.3',
description="Cloud Custodian - Automated Policy Documentation",
classifiers=[
"Topic :: System :: Systems Administration",
"Topic :: System :: Distributed Computing"
],
url="https://github.com/cloud-custodian/cloud-custodian",
long_description=description,
long_description_content_type='text/markdown',
author="Ryan Ash",
author_email="ryanash@gmail.com",
license="Apache-2.0",
py_modules=["c7n_autodoc"],
install_requires=["c7n", "pyyaml>=4.2b4", "boto3", "jinja2>=2.11.3", "jsonschema"]
)
| 29.285714 | 86 | 0.676829 |