code stringlengths 3 1.05M | repo_name stringlengths 4 116 | path stringlengths 3 942 | language stringclasses 30 values | license stringclasses 15 values | size int32 3 1.05M | line_mean float64 0.5 100 | line_max int64 1 1k | alpha_frac float64 0.25 1 | autogenerated bool 1 class |
|---|---|---|---|---|---|---|---|---|---|
<?php
require_once('../../global_functions.php');
require_once('../../connections/parameters.php');
try {
if (!isset($_SESSION)) {
session_start();
}
$s2_response = array();
$db = new dbWrapper_v3($hostname_gds_site, $username_gds_site, $password_gds_site, $database_gds_site, true);
if (empty($db)) throw new Exception('No DB!');
$memcached = new Cache(NULL, NULL, $localDev);
checkLogin_v2();
if (empty($_SESSION['user_id64'])) throw new Exception('Not logged in!');
//Check if logged in user is an admin
$adminCheck = adminCheck($_SESSION['user_id64'], 'admin');
$steamIDmanipulator = new SteamID($_SESSION['user_id64']);
$steamID32 = $steamIDmanipulator->getsteamID32();
$steamID64 = $steamIDmanipulator->getsteamID64();
if (
empty($_POST['mod_workshop_link']) ||
empty($_POST['mod_contact_address'])
) {
throw new Exception('Missing or invalid required parameter(s)!');
}
if (!filter_var($_POST['mod_contact_address'], FILTER_VALIDATE_EMAIL)) {
throw new Exception('Invalid email address!');
} else {
$db->q(
'INSERT INTO `gds_users_options`
(
`user_id32`,
`user_id64`,
`user_email`,
`sub_dev_news`,
`date_updated`,
`date_recorded`
)
VALUES (
?,
?,
?,
1,
NULL,
NULL
)
ON DUPLICATE KEY UPDATE
`user_email` = VALUES(`user_email`),
`sub_dev_news` = VALUES(`sub_dev_news`);',
'sss',
array(
$steamID32,
$steamID64,
$_POST['mod_contact_address']
)
);
}
$steamAPI = new steam_webapi($api_key1);
if (!stristr($_POST['mod_workshop_link'], 'steamcommunity.com/sharedfiles/filedetails/?id=')) {
throw new Exception('Bad workshop link');
}
$modWork = htmlentities(rtrim(rtrim(cut_str($_POST['mod_workshop_link'], 'steamcommunity.com/sharedfiles/filedetails/?id='), '/'), '&searchtext='));
$mod_details = $steamAPI->GetPublishedFileDetails($modWork);
if ($mod_details['response']['result'] != 1) {
throw new Exception('Bad steam response. API probably down.');
}
$modName = !empty($mod_details['response']['publishedfiledetails'][0]['title'])
? htmlentities($mod_details['response']['publishedfiledetails'][0]['title'])
: 'UNKNOWN MOD NAME';
$modDesc = !empty($mod_details['response']['publishedfiledetails'][0]['description'])
? htmlentities($mod_details['response']['publishedfiledetails'][0]['description'])
: 'UNKNOWN MOD DESCRIPTION';
$modOwner = !empty($mod_details['response']['publishedfiledetails'][0]['creator'])
? htmlentities($mod_details['response']['publishedfiledetails'][0]['creator'])
: '-1';
$modApp = !empty($mod_details['response']['publishedfiledetails'][0]['consumer_app_id'])
? htmlentities($mod_details['response']['publishedfiledetails'][0]['consumer_app_id'])
: '-1';
if ($_SESSION['user_id64'] != $modOwner && !$adminCheck) {
throw new Exception('Insufficient privilege to add this mod. Login as the mod developer or contact admins via <strong><a class="boldGreenText" href="https://github.com/GetDotaStats/stat-collection/issues" target="_blank">issue tracker</a></strong>!');
}
if ($modApp != 570) {
throw new Exception('Mod is not for Dota2.');
}
if (!empty($_POST['mod_steam_group']) && stristr($_POST['mod_steam_group'], 'steamcommunity.com/groups/')) {
$modGroup = htmlentities(rtrim(cut_str($_POST['mod_steam_group'], 'groups/'), '/'));
} else {
$modGroup = NULL;
}
$insertSQL = $db->q(
'INSERT INTO `mod_list` (`steam_id64`, `mod_identifier`, `mod_name`, `mod_description`, `mod_workshop_link`, `mod_steam_group`)
VALUES (?, ?, ?, ?, ?, ?);',
'ssssss', //STUPID x64 windows PHP is actually x86
array(
$modOwner,
md5($modName . time()),
$modName,
$modDesc,
$modWork,
$modGroup,
)
);
if ($insertSQL) {
$modID = $db->last_index();
$json_response['result'] = 'Success! Found mod and added to DB for approval as #' . $modID;
$db->q(
'INSERT INTO `mod_list_owners` (`mod_id`, `steam_id64`)
VALUES (?, ?);',
'is', //STUPID x64 windows PHP is actually x86
array(
$modID,
$modOwner,
)
);
updateUserDetails($modOwner, $api_key2);
$irc_message = new irc_message($webhook_gds_site_normal);
$message = array(
array(
$irc_message->colour_generator('red'),
'[ADMIN]',
$irc_message->colour_generator(NULL),
),
array(
$irc_message->colour_generator('green'),
'[MOD]',
$irc_message->colour_generator(NULL),
),
array(
$irc_message->colour_generator('bold'),
$irc_message->colour_generator('blue'),
'Pending approval:',
$irc_message->colour_generator(NULL),
$irc_message->colour_generator('bold'),
),
array(
$irc_message->colour_generator('orange'),
'{' . $modID . '}',
$irc_message->colour_generator(NULL),
),
array($modName),
array(' || http://getdotastats.com/#admin__mod_approve'),
);
$message = $irc_message->combine_message($message);
$irc_message->post_message($message, array('localDev' => $localDev));
} else {
$json_response['error'] = 'Mod not added to database. Failed to add mod for approval.';
}
} catch (Exception $e) {
$json_response['error'] = 'Caught Exception: ' . $e->getMessage();
} finally {
if (isset($memcached)) $memcached->close();
if (!isset($json_response)) $json_response = array('error' => 'Unknown exception');
}
try {
header('Content-Type: application/json');
echo utf8_encode(json_encode($json_response));
} catch (Exception $e) {
unset($json_response);
$json_response['error'] = 'Caught Exception: ' . $e->getMessage();
echo utf8_encode(json_encode($json_response));
} | GetDotaStats/site | site_files/s2/my/mod_request_ajax.php | PHP | mit | 6,730 | 34.613757 | 259 | 0.529123 | false |
module Prawn
module Charts
class Bar < Base
attr_accessor :ratio
def initialize pdf, opts = {}
super pdf, opts
@ratio = opts[:ratio] || 0.75
end
def plot_values
return if series.nil?
series.each_with_index do |bar,index|
point_x = first_x_point index
bar[:values].each do |h|
fill_color bar[:color]
fill do
height = value_height(h[:value])
rectangle [point_x,height], bar_width, height
end
point_x += additional_points
end
end
end
def first_x_point index
(bar_width * index) + (bar_space * (index + 1))
end
def additional_points
(bar_space + bar_width) * series.count
end
def x_points
points = nil
series.each_with_index do |bar,index|
tmp = []
tmp << first_x_point(index) + (bar_width / 2)
bar[:values].each do |h|
tmp << tmp.last + additional_points
end
points ||= [0] * tmp.length
tmp.each_with_index do |point, i|
points[i] += point
end
end
points.map do |point|
(point / series.count).to_i
end
end
def bar_width
@bar_width ||= (bounds.width * ratio) / series_length.to_f
end
def bar_space
@bar_space ||= (bounds.width * (1.0 - ratio)) / (series_length + 1).to_f
end
def series_length
series.map { |v| v[:values].length }.max * series.count
end
def value_height val
bounds.height * ((val - min_value) / series_height.to_f)
end
end
end
end
| cajun/prawn-charts | lib/prawn/charts/bar.rb | Ruby | mit | 1,724 | 21.38961 | 80 | 0.50348 | false |
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="@韩雨"/>
<meta name="twitter:title" content="sam的小窝"/>
<meta name="twitter:description" content="学习 &nbsp;&bull;&nbsp; 生活"/>
<meta name="twitter:image" content="http://www.samrainhan.com/images/avatar.png" />
<meta name="author" content="韩雨">
<meta name="description" content="学习 &nbsp;&bull;&nbsp; 生活">
<meta name="generator" content="Hugo 0.41" />
<title>Msbuild · sam的小窝</title>
<link rel="shortcut icon" href="http://www.samrainhan.com/images/favicon.ico">
<link rel="stylesheet" href="http://www.samrainhan.com/css/style.css">
<link rel="stylesheet" href="http://www.samrainhan.com/css/highlight.css">
<link rel="stylesheet" href="http://www.samrainhan.com/css/font-awesome.min.css">
<link href="http://www.samrainhan.com/index.xml" rel="alternate" type="application/rss+xml" title="sam的小窝" />
</head>
<body>
<nav class="main-nav">
<a href='http://www.samrainhan.com/'> <span class="arrow">←</span>Home</a>
<a href='http://www.samrainhan.com/posts'>Archive</a>
<a href='http://www.samrainhan.com/tags'>Tags</a>
<a href='http://www.samrainhan.com/about'>About</a>
<a class="cta" href="http://www.samrainhan.com/index.xml">Subscribe</a>
</nav>
<div class="profile">
<section id="wrapper">
<header id="header">
<a href='http://www.samrainhan.com/about'>
<img id="avatar" class="2x" src="http://www.samrainhan.com/images/avatar.png"/>
</a>
<h1>sam的小窝</h1>
<h2>学习 & 生活</h2>
</header>
</section>
</div>
<section id="wrapper" class="home">
<div class="archive">
<h3>2015</h3>
<ul>
<div class="post-item">
<div class="post-time">Jul 1</div>
<a href="http://www.samrainhan.com/posts/2015-07-01-contrast-of-different-parameters-on-msbuild/" class="post-link">
msbuild参数效果对比
</a>
</div>
</ul>
</div>
<footer id="footer">
<div id="social">
<a class="symbol" href="">
<i class="fa fa-facebook-square"></i>
</a>
<a class="symbol" href="https://github.com/samrain">
<i class="fa fa-github-square"></i>
</a>
<a class="symbol" href="">
<i class="fa fa-twitter-square"></i>
</a>
</div>
<p class="small">
© Copyright 2018 <i class="fa fa-heart" aria-hidden="true"></i> 韩雨
</p>
<p class="small">
Powered by <a href="http://www.gohugo.io/">Hugo</a> Theme By <a href="https://github.com/nodejh/hugo-theme-cactus-plus">nodejh</a>
</p>
</footer>
</section>
<div class="dd">
</div>
<script src="http://www.samrainhan.com/js/jquery-3.3.1.min.js"></script>
<script src="http://www.samrainhan.com/js/main.js"></script>
<script src="http://www.samrainhan.com/js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>
var doNotTrack = false;
if (!doNotTrack) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-37708730-1', 'auto');
ga('send', 'pageview');
}
</script>
</body>
</html>
| samrain/NewBlog | tags/msbuild/index.html | HTML | mit | 3,796 | 23.320261 | 138 | 0.603601 | false |
<!DOCTYPE html>
<!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en" dir="ltr">
<!--<![endif]-->
<!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) -->
<!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca -->
<head>
<!-- Title begins / Début du titre -->
<title>
Industries Chic Inc. -
Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
</title>
<!-- Title ends / Fin du titre -->
<!-- Meta-data begins / Début des métadonnées -->
<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />
<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />
<!-- EPI-11240 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- MCG-202 -->
<meta content="width=device-width,initial-scale=1" name="viewport">
<!-- EPI-11567 -->
<meta name = "format-detection" content = "telephone=no">
<!-- EPI-12603 -->
<meta name="robots" content="noarchive">
<!-- EPI-11190 - Webtrends -->
<script>
var startTime = new Date();
startTime = startTime.getTime();
</script>
<!--[if gte IE 9 | !IE ]><!-->
<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">
<!--<![endif]-->
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">
<!--[if lt IE 9]>
<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script>
<![endif]-->
<!--[if lte IE 9]>
<![endif]-->
<noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript>
<!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER -->
<script>dataLayer1 = [];</script>
<!-- End Google Tag Manager -->
<!-- EPI-11235 -->
<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />
</head>
<body class="home" vocab="http://schema.org/" typeof="WebPage">
<!-- EPIC HEADER BEGIN -->
<!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER -->
<noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script>
<!-- End Google Tag Manager -->
<!-- EPI-12801 -->
<span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span>
<ul id="wb-tphp">
<li class="wb-slc">
<a class="wb-sl" href="#wb-cont">Skip to main content</a>
</li>
<li class="wb-slc visible-sm visible-md visible-lg">
<a class="wb-sl" href="#wb-info">Skip to "About this site"</a>
</li>
</ul>
<header role="banner">
<div id="wb-bnr" class="container">
<section id="wb-lng" class="visible-md visible-lg text-right">
<h2 class="wb-inv">Language selection</h2>
<div class="row">
<div class="col-md-12">
<ul class="list-inline mrgn-bttm-0">
<li><a href="nvgt.do?V_TOKEN=1492293427443&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=22941&V_SEARCH.docsStart=22940&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn//magmi/web/download_file.php?_flId?_flxKy=e1s1&estblmntNo=234567041301&profileId=61&_evId=bck&lang=eng&V_SEARCH.showStricts=false&prtl=1&_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li>
</ul>
</div>
</div>
</section>
<div class="row">
<div class="brand col-xs-8 col-sm-9 col-md-6">
<a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a>
</div>
<section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn">
<h2>Search and menus</h2>
<ul class="list-inline text-right chvrn">
<li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li>
</ul>
<div id="mb-pnl"></div>
</section>
<!-- Site Search Removed -->
</div>
</div>
<nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement">
<h2 class="wb-inv">Topics menu</h2>
<div class="container nvbar">
<div class="row">
<ul class="list-inline menu">
<li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li>
<li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li>
<li><a href="https://travel.gc.ca/">Travel</a></li>
<li><a href="https://www.canada.ca/en/services/business.html">Business</a></li>
<li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li>
<li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li>
<li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li>
<li><a href="https://www.canada.ca/en/services.html">More services</a></li>
</ul>
</div>
</div>
</nav>
<!-- EPIC BODY BEGIN -->
<nav role="navigation" id="wb-bc" class="" property="breadcrumb">
<h2 class="wb-inv">You are here:</h2>
<div class="container">
<div class="row">
<ol class="breadcrumb">
<li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li>
<li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li>
<li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li>
</ol>
</div>
</div>
</nav>
</header>
<main id="wb-cont" role="main" property="mainContentOfPage" class="container">
<!-- End Header -->
<!-- Begin Body -->
<!-- Begin Body Title -->
<!-- End Body Title -->
<!-- Begin Body Head -->
<!-- End Body Head -->
<!-- Begin Body Content -->
<br>
<!-- Complete Profile -->
<!-- Company Information above tabbed area-->
<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>
<h1 id="wb-cont">
Company profile - Canadian Company Capabilities
</h1>
<div class="profileInfo hidden-print">
<ul class="list-inline">
<li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&rstBtn.x=" class="btn btn-link">New Search</a> |</li>
<li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">
<input type="hidden" name="lang" value="eng" />
<input type="hidden" name="profileId" value="" />
<input type="hidden" name="prtl" value="1" />
<input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" />
<input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />
<input type="hidden" name="V_SEARCH.depth" value="1" />
<input type="hidden" name="V_SEARCH.showStricts" value="false" />
<input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />
</form></li>
<li>| <a href="nvgt.do?V_SEARCH.docsStart=22939&V_DOCUMENT.docRank=22940&V_SEARCH.docsCount=3&lang=eng&prtl=1&sbPrtl=&profile=cmpltPrfl&V_TOKEN=1492293448527&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=%2fprfl.do&estblmntNo=123456009329&profileId=&key.newSearchLabel=">Previous Company</a></li>
<li>| <a href="nvgt.do?V_SEARCH.docsStart=22941&V_DOCUMENT.docRank=22942&V_SEARCH.docsCount=3&lang=eng&prtl=1&sbPrtl=&profile=cmpltPrfl&V_TOKEN=1492293448527&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=%2fprfl.do&estblmntNo=234567032347&profileId=&key.newSearchLabel=">Next Company</a></li>
</ul>
</div>
<details>
<summary>Third-Party Information Liability Disclaimer</summary>
<p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p>
</details>
<h2>
Industries Chic Inc.
</h2>
<div class="row">
<div class="col-md-5">
<h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2>
<p>Industries Chic Inc.</p>
<div class="mrgn-tp-md"></div>
<p class="mrgn-bttm-0" ><a href="http://www.industrieschic.net"
target="_blank" title="Website URL">http://www.industrieschic.net</a></p>
<p><a href="mailto:ind.chic@videotron.ca" title="ind.chic@videotron.ca">ind.chic@videotron.ca</a></p>
</div>
<div class="col-md-4 mrgn-sm-sm">
<h2 class="h5 mrgn-bttm-0">Mailing Address:</h2>
<address class="mrgn-bttm-md">
3214, route 170<br/>
LATERRIÈRE,
Quebec<br/>
G7N 1A9
<br/>
</address>
<h2 class="h5 mrgn-bttm-0">Location Address:</h2>
<address class="mrgn-bttm-md">
3214, route 170<br/>
LATERRIÈRE,
Quebec<br/>
G7N 1A9
<br/>
</address>
<p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>:
(418) 549-5027
</p>
<p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>:
(418) 678-2248</p>
</div>
<div class="col-md-3 mrgn-tp-md">
</div>
</div>
<div class="row mrgn-tp-md mrgn-bttm-md">
<div class="col-md-12">
</div>
</div>
<!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> -->
<div class="wb-tabs ignore-session">
<div class="tabpanels">
<details id="details-panel1">
<summary>
Full profile
</summary>
<!-- Tab 1 -->
<h2 class="wb-invisible">
Full profile
</h2>
<!-- Contact Information -->
<h3 class="page-header">
Contact information
</h3>
<section class="container-fluid">
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
DENIS
LAROUCHE
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
<!--if client gender is not null or empty we use gender based job title-->
Director
</div>
</div>
</section>
<p class="mrgn-tp-lg text-right small hidden-print">
<a href="#wb-cont">top of page</a>
</p>
<!-- Company Description -->
<h3 class="page-header">
Company description
</h3>
<section class="container-fluid">
<div class="row">
<div class="col-md-5">
<strong>
Country of Ownership:
</strong>
</div>
<div class="col-md-7">
Canada
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Exporting:
</strong>
</div>
<div class="col-md-7">
No
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Industry (NAICS):
</strong>
</div>
<div class="col-md-7">
332710 - Machine Shops
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Business Activity:
</strong>
</div>
<div class="col-md-7">
Manufacturer / Processor / Producer
</div>
</div>
</section>
<!-- Products / Services / Licensing -->
<h3 class="page-header">
Product / Service / Licensing
</h3>
<section class="container-fluid">
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
Product Name:
</strong>
</div>
<div class="col-md-9">
USINAGE <br>
</div>
</div>
</section>
<p class="mrgn-tp-lg text-right small hidden-print">
<a href="#wb-cont">top of page</a>
</p>
<!-- Technology Profile -->
<!-- Market Profile -->
<!-- Sector Information -->
<details class="mrgn-tp-md mrgn-bttm-md">
<summary>
Third-Party Information Liability Disclaimer
</summary>
<p>
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
</p>
</details>
</details>
<details id="details-panel2">
<summary>
Contacts
</summary>
<h2 class="wb-invisible">
Contact information
</h2>
<!-- Contact Information -->
<section class="container-fluid">
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
DENIS
LAROUCHE
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
<!--if client gender is not null or empty we use gender based job title-->
Director
</div>
</div>
</section>
</details>
<details id="details-panel3">
<summary>
Description
</summary>
<h2 class="wb-invisible">
Company description
</h2>
<section class="container-fluid">
<div class="row">
<div class="col-md-5">
<strong>
Country of Ownership:
</strong>
</div>
<div class="col-md-7">
Canada
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Exporting:
</strong>
</div>
<div class="col-md-7">
No
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Industry (NAICS):
</strong>
</div>
<div class="col-md-7">
332710 - Machine Shops
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Business Activity:
</strong>
</div>
<div class="col-md-7">
Manufacturer / Processor / Producer
</div>
</div>
</section>
</details>
<details id="details-panel4">
<summary>
Products, services and licensing
</summary>
<h2 class="wb-invisible">
Product / Service / Licensing
</h2>
<section class="container-fluid">
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
Product Name:
</strong>
</div>
<div class="col-md-9">
USINAGE <br>
</div>
</div>
</section>
</details>
</div>
</div>
<div class="row">
<div class="col-md-12 text-right">
Last Update Date 2016-03-10
</div>
</div>
<!--
- Artifact ID: CBW - IMBS - CCC Search WAR
- Group ID: ca.gc.ic.strategis.imbs.ccc.search
- Version: 3.26
- Built-By: bamboo
- Build Timestamp: 2017-03-02T21:29:28Z
-->
<!-- End Body Content -->
<!-- Begin Body Foot -->
<!-- End Body Foot -->
<!-- END MAIN TABLE -->
<!-- End body -->
<!-- Begin footer -->
<div class="row pagedetails">
<div class="col-sm-5 col-xs-12 datemod">
<dl id="wb-dtmd">
<dt class=" hidden-print">Date Modified:</dt>
<dd class=" hidden-print">
<span><time>2017-03-02</time></span>
</dd>
</dl>
</div>
<div class="clear visible-xs"></div>
<div class="col-sm-4 col-xs-6">
</div>
<div class="col-sm-3 col-xs-6 text-right">
</div>
<div class="clear visible-xs"></div>
</div>
</main>
<footer role="contentinfo" id="wb-info">
<nav role="navigation" class="container wb-navcurr">
<h2 class="wb-inv">About government</h2>
<!-- EPIC FOOTER BEGIN -->
<!-- EPI-11638 Contact us -->
<ul class="list-unstyled colcount-sm-2 colcount-md-3">
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&from=Industries">Contact us</a></li>
<li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li>
<li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li>
<li><a href="https://www.canada.ca/en/news.html">News</a></li>
<li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li>
<li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li>
<li><a href="http://pm.gc.ca/eng">Prime Minister</a></li>
<li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li>
<li><a href="http://open.canada.ca/en/">Open government</a></li>
</ul>
</nav>
<div class="brand">
<div class="container">
<div class="row">
<nav class="col-md-10 ftr-urlt-lnk">
<h2 class="wb-inv">About this site</h2>
<ul>
<li><a href="https://www.canada.ca/en/social.html">Social media</a></li>
<li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li>
<li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li>
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li>
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li>
</ul>
</nav>
<div class="col-xs-6 visible-sm visible-xs tofpg">
<a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a>
</div>
<div class="col-xs-6 col-md-2 text-right">
<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>
</div>
</div>
</div>
</div>
</footer>
<!--[if gte IE 9 | !IE ]><!-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script>
<!--<![endif]-->
<!--[if lt IE 9]>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script>
<![endif]-->
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script>
<!-- EPI-10519 -->
<span class="wb-sessto"
data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span>
<script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script>
<!-- EPI-11190 - Webtrends -->
<script src="/eic/home.nsf/js/webtrends.js"></script>
<script>var endTime = new Date();</script>
<noscript>
<div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=9.4.0&dcssip=www.ic.gc.ca"/></div>
</noscript>
<!-- /Webtrends -->
<!-- JS deps -->
<script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script>
<!-- EPI-11262 - Util JS -->
<script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script>
<!-- EPI-11383 -->
<script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script>
<span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span>
</body></html>
<!-- End Footer -->
<!--
- Artifact ID: CBW - IMBS - CCC Search WAR
- Group ID: ca.gc.ic.strategis.imbs.ccc.search
- Version: 3.26
- Built-By: bamboo
- Build Timestamp: 2017-03-02T21:29:28Z
-->
| GoC-Spending/data-corporations | html/234567032346.html | HTML | mit | 30,653 | 14.208437 | 450 | 0.45394 | false |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>paco: 3 m 36 s 🏆</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.9.0 / paco - 2.0.3</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
paco
<small>
2.0.3
<span class="label label-success">3 m 36 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-10 01:57:47 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-10 01:57:47 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.9.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.04.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.04.2 Official 4.04.2 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "paco@sf.snu.ac.kr"
version: "2.0.3"
homepage: "https://github.com/snu-sf/paco/"
dev-repo: "git+https://github.com/snu-sf/paco.git"
bug-reports: "https://github.com/snu-sf/paco/issues/"
authors: [
"Chung-Kil Hur <gil.hur@sf.snu.ac.kr>"
"Georg Neis <neis@mpi-sws.org>"
"Derek Dreyer <dreyer@mpi-sws.org>"
"Viktor Vafeiadis <viktor@mpi-sws.org>"
]
license: "BSD-3"
build: [
[make "-C" "src" "all" "-j%{jobs}%"]
]
install: [
[make "-C" "src" "-f" "Makefile.coq" "install"]
]
remove: ["rm" "-r" "-f" "%{lib}%/coq/user-contrib/Paco"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.10"}
]
synopsis: "Coq library implementing parameterized coinduction"
tags: [
"date:2018-02-11"
"category:Computer Science/Programming Languages/Formal Definitions and Theory"
"category:Mathematics/Logic"
"keyword:co-induction"
"keyword:simulation"
"keyword:parameterized greatest fixed point"
]
flags: light-uninstall
url {
src: "https://github.com/snu-sf/paco/archive/v2.0.3.tar.gz"
checksum: "md5=30705f61294a229215149a024060f06d"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-paco.2.0.3 coq.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-paco.2.0.3 coq.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>11 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-paco.2.0.3 coq.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>3 m 36 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 13 M</p>
<ul>
<li>1 M <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco18_upto.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco17_upto.vo</code></li>
<li>964 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco16_upto.vo</code></li>
<li>817 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco15_upto.vo</code></li>
<li>710 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco14_upto.vo</code></li>
<li>611 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco13_upto.vo</code></li>
<li>527 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco12_upto.vo</code></li>
<li>457 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco11_upto.vo</code></li>
<li>392 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco10_upto.vo</code></li>
<li>334 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco9_upto.vo</code></li>
<li>318 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacotac.vo</code></li>
<li>281 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco8_upto.vo</code></li>
<li>233 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco7_upto.vo</code></li>
<li>228 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco18.vo</code></li>
<li>213 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paconotation_internal.vo</code></li>
<li>209 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco17.vo</code></li>
<li>191 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco16.vo</code></li>
<li>191 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco6_upto.vo</code></li>
<li>174 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco15.vo</code></li>
<li>158 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco14.vo</code></li>
<li>154 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco5_upto.vo</code></li>
<li>142 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco13.vo</code></li>
<li>128 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco12.vo</code></li>
<li>123 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco4_upto.vo</code></li>
<li>115 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco11.vo</code></li>
<li>114 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paconotation.vo</code></li>
<li>113 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/examples.vo</code></li>
<li>105 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paconotation.glob</code></li>
<li>102 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco10.vo</code></li>
<li>96 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco3_upto.vo</code></li>
<li>92 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco18.glob</code></li>
<li>90 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco9.vo</code></li>
<li>84 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco17.glob</code></li>
<li>80 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco18_upto.glob</code></li>
<li>79 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco8.vo</code></li>
<li>77 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco16.glob</code></li>
<li>72 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco17_upto.glob</code></li>
<li>72 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco2_upto.vo</code></li>
<li>71 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/tutorial.vo</code></li>
<li>70 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco15.glob</code></li>
<li>69 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco7.vo</code></li>
<li>66 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco16_upto.glob</code></li>
<li>64 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco14.glob</code></li>
<li>61 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paconotation_internal.glob</code></li>
<li>60 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco15_upto.glob</code></li>
<li>60 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco6.vo</code></li>
<li>59 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco13.glob</code></li>
<li>57 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacotac.v</code></li>
<li>55 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco14_upto.glob</code></li>
<li>54 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco12.glob</code></li>
<li>54 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco1_upto.vo</code></li>
<li>51 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco5.vo</code></li>
<li>50 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco13_upto.glob</code></li>
<li>50 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco11.glob</code></li>
<li>46 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco12_upto.glob</code></li>
<li>46 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco10.glob</code></li>
<li>43 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco4.vo</code></li>
<li>42 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco11_upto.glob</code></li>
<li>41 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacotac.glob</code></li>
<li>40 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco9.glob</code></li>
<li>39 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco10_upto.glob</code></li>
<li>38 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco0_upto.vo</code></li>
<li>37 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco8.glob</code></li>
<li>36 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco3.vo</code></li>
<li>35 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco9_upto.glob</code></li>
<li>35 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco7.glob</code></li>
<li>32 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco8_upto.glob</code></li>
<li>32 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco6.glob</code></li>
<li>30 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco7_upto.glob</code></li>
<li>30 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco2.vo</code></li>
<li>30 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco5.glob</code></li>
<li>28 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco6_upto.glob</code></li>
<li>28 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco4.glob</code></li>
<li>27 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco5_upto.glob</code></li>
<li>26 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco3.glob</code></li>
<li>26 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/tutorial.glob</code></li>
<li>25 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco4_upto.glob</code></li>
<li>24 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco1.vo</code></li>
<li>24 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/tutorial.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco3_upto.glob</code></li>
<li>24 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco2.glob</code></li>
<li>23 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco2_upto.glob</code></li>
<li>22 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco1.glob</code></li>
<li>22 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco1_upto.glob</code></li>
<li>21 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco0_upto.glob</code></li>
<li>21 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco0.glob</code></li>
<li>19 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/examples.glob</code></li>
<li>19 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paconotation.v</code></li>
<li>19 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco0.vo</code></li>
<li>18 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacon.vo</code></li>
<li>17 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco18_upto.v</code></li>
<li>16 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco18.v</code></li>
<li>16 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco17_upto.v</code></li>
<li>15 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco16_upto.v</code></li>
<li>15 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco17.v</code></li>
<li>15 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco15_upto.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco16.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacotacuser.vo</code></li>
<li>14 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco14_upto.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco13_upto.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/hpattern.vo</code></li>
<li>13 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco15.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paconotation_internal.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco12_upto.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco14.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco11_upto.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco10_upto.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco13.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco9_upto.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco8_upto.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco12.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco7_upto.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco6_upto.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacon.glob</code></li>
<li>11 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco11.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco5_upto.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco4_upto.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco3_upto.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco10.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco2_upto.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco1_upto.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco0_upto.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco9.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco8.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/examples.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco7.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco6.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco5.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco4.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco3.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco2.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco1.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco0.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco.vo</code></li>
<li>4 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/hpattern.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacon.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacotacuser.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/pacotacuser.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/paco.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Paco/hpattern.glob</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-paco.2.0.3</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| coq-bench/coq-bench.github.io | clean/Linux-x86_64-4.04.2-2.0.5/released/8.9.0/paco/2.0.3.html | HTML | mit | 22,489 | 70.314286 | 159 | 0.588987 | false |
package com.swfarm.biz.product.dao.impl;
import com.swfarm.biz.product.bo.SkuSaleMapping;
import com.swfarm.biz.product.dao.SkuSaleMappingDao;
import com.swfarm.pub.framework.dao.GenericDaoHibernateImpl;
public class SkuSaleMappingDaoImpl extends GenericDaoHibernateImpl<SkuSaleMapping, Long> implements SkuSaleMappingDao {
public SkuSaleMappingDaoImpl(Class<SkuSaleMapping> type) {
super(type);
}
} | zhangqiang110/my4j | pms/src/main/java/com/swfarm/biz/product/dao/impl/SkuSaleMappingDaoImpl.java | Java | mit | 419 | 30.384615 | 119 | 0.806683 | false |
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class ProfileFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('name');
}
public function getParent()
{
return 'FOS\UserBundle\Form\Type\ProfileFormType';
}
public function getBlockPrefix()
{
return 'app_user_profile';
}
// For Symfony 2.x
public function getName()
{
return $this->getBlockPrefix();
}
} | efalder413/PKMNBreeder | src/AppBundle/Form/ProfileFormType.php | PHP | mit | 586 | 18.566667 | 76 | 0.662116 | false |
using Nethereum.Generators.Model;
using Nethereum.Generators.Net;
namespace Nethereum.Generator.Console.Models
{
public class ContractDefinition
{
public string ContractName { get; set; }
public ContractABI Abi { get; set; }
public string Bytecode { get; set; }
public ContractDefinition(string abi)
{
Abi = new GeneratorModelABIDeserialiser().DeserialiseABI(abi);
}
}
}
| Nethereum/Nethereum | generators/Nethereum.Generator.Console/Models/ContractDefinition.cs | C# | mit | 450 | 22.578947 | 74 | 0.651786 | false |
'use strict';
module.exports = require('./toPairsIn');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2NsaWVudC9saWIvbG9kYXNoL2VudHJpZXNJbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE9BQU8sT0FBUCxHQUFpQixRQUFRLGFBQVIsQ0FBakIiLCJmaWxlIjoiZW50cmllc0luLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL3RvUGFpcnNJbicpO1xuIl19 | justin-lai/hackd.in | compiled/client/lib/lodash/entriesIn.js | JavaScript | mit | 394 | 97.75 | 338 | 0.931472 | false |
""" -*- coding: utf-8 -*- """
from python2awscli import bin_aws
from python2awscli.error import AWSNotFound, ParseError, AWSDuplicate
from python2awscli import must
class BaseSecurityGroup(object):
def __init__(self, name, region, vpc, description, inbound=None, outbound=None):
"""
:param name: String, name of SG
:param region: String, AWS region
:param vpc: String, IP of the VPC this SG belongs to
:param description: String
:param inbound: List of dicts, IP Permissions that should exist
:param outbound: List of dicts, IP Permissions that should exist
"""
self.id = None
self.name = name
self.region = region
self.vpc = vpc
self.description = description
self.IpPermissions = []
self.IpPermissionsEgress = []
self.owner = None
self.changed = False
try:
self._get()
except AWSNotFound:
self._create()
self._merge_rules(must.be_list(inbound), self.IpPermissions)
self._merge_rules(must.be_list(outbound), self.IpPermissionsEgress, egress=True)
if self.changed:
self._get()
def _break_out(self, existing):
"""
Undo AWS's rule flattening so we can do simple 'if rule in existing' logic later.
:param existing: List of SG rules as dicts.
:return: List of SG rules as dicts.
"""
spool = list()
for rule in existing:
for ip in rule['IpRanges']:
copy_of_rule = rule.copy()
copy_of_rule['IpRanges'] = [ip]
copy_of_rule['UserIdGroupPairs'] = []
spool.append(copy_of_rule)
for group in rule['UserIdGroupPairs']:
copy_of_rule = rule.copy()
copy_of_rule['IpRanges'] = []
copy_of_rule['UserIdGroupPairs'] = [group]
spool.append(copy_of_rule)
return spool
def _merge_rules(self, requested, active, egress=False):
"""
:param requested: List of dicts, IP Permissions that should exist
:param active: List of dicts, IP Permissions that already exist
:param egress: Bool, addressing outbound rules or not?
:return: Bool
"""
if not isinstance(requested, list):
raise ParseError(
'SecurityGroup {0}, need a list of dicts, instead got "{1}"'.format(self.name, requested))
for rule in requested:
if rule not in active:
self._add_rule(rule, egress)
for active_rule in active:
if active_rule not in requested:
self._rm_rule(active_rule, egress)
return True
def _add_rule(self, ip_permissions, egress):
"""
:param ip_permissions: Dict of IP Permissions
:param egress: Bool
:return: Bool
"""
direction = 'authorize-security-group-ingress'
if egress:
direction = 'authorize-security-group-egress'
command = ['ec2', direction,
'--region', self.region,
'--group-id', self.id,
'--ip-permissions', str(ip_permissions).replace("'", '"')
]
bin_aws(command)
print('Authorized: {0}'.format(ip_permissions)) # TODO: Log(...)
self.changed = True
return True
def _rm_rule(self, ip_permissions, egress):
"""
:param ip_permissions: Dict of IP Permissions
:param egress: Bool
:return: Bool
"""
direction = 'revoke-security-group-ingress'
if egress:
direction = 'revoke-security-group-egress'
command = ['ec2', direction,
'--region', self.region,
'--group-id', self.id,
'--ip-permissions', str(ip_permissions).replace("'", '"')
]
bin_aws(command)
print('Revoked: {0}'.format(ip_permissions)) # TODO: Log(...)
self.changed = True
return True
def _create(self):
"""
Create a Security Group
:return:
"""
# AWS grants all new SGs this default outbound rule "This is pro-human & anti-machine behavior."
default_egress = {
'Ipv6Ranges': [],
'PrefixListIds': [],
'IpRanges': [{'CidrIp': '0.0.0.0/0'}],
'UserIdGroupPairs': [], 'IpProtocol': '-1'
}
command = [
'ec2', 'create-security-group',
'--region', self.region,
'--group-name', self.name,
'--description', self.description,
'--vpc-id', self.vpc
]
try:
self.id = bin_aws(command, key='GroupId')
except AWSDuplicate:
return False # OK if it already exists.
print('Created {0}'.format(command)) # TODO: Log(...)
self.IpPermissions = []
self.IpPermissionsEgress = [default_egress]
self.changed = True
return True
def _get(self):
"""
Get information about Security Group from AWS and update self
:return: Bool
"""
command = ['ec2', 'describe-security-groups', '--region', self.region, '--group-names', self.name]
result = bin_aws(command, key='SecurityGroups', max=1) # will raise NotFound if empty
me = result[0]
self.id = me['GroupId']
self.owner = me['OwnerId']
self.IpPermissions = self._break_out(me['IpPermissions'])
self.IpPermissionsEgress = self._break_out(me['IpPermissionsEgress'])
print('Got {0}'.format(command)) # TODO: Log(...)
return True
def _delete(self):
"""
Delete myself by my own id.
As of 20170114 no other methods call me. You must do `foo._delete()`
:return:
"""
command = ['ec2', 'delete-security-group', '--region', self.region,
# '--dry-run',
'--group-id', self.id
]
bin_aws(command, decode_output=False)
print('Deleted {0}'.format(command)) # TODO: Log(...)
return True
| jhazelwo/python-awscli | python2awscli/model/securitygroup.py | Python | mit | 6,235 | 36.113095 | 106 | 0.538733 | false |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>18 --> 19</title>
<link href="./../../assets/style.css" rel="stylesheet">
</head>
<body>
<h2>You have to be fast</h2>
<a href="./533b52ee4ec32c5f9daf62ace85296f6775b00542726cad61b6612cd9767a7a6.html">Teleport</a>
<hr>
<a href="./../../about.md">About</a> (Spoilers! )
<script src="./../../assets/md5.js"></script>
<script>
window.currentLevel = 7;
</script>
<script src="./../../assets/script.js"></script>
</body>
</html> | simonmysun/praxis | TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/5be570b311dc13765fe469225bb34b19f7f076e3512ac2141933a657720fd9b3.html | HTML | mit | 550 | 28 | 98 | 0.581818 | false |
#
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
configuration Sample_PSModule
{
param
(
#Target nodes to apply the configuration
[string[]]$NodeName = 'localhost',
#The name of the module
[Parameter(Mandatory)]
[string]$Name,
#The required version of the module
[string]$RequiredVersion,
#Repository name
[string]$Repository,
#Whether you trust the repository
[string]$InstallationPolicy
)
Import-DscResource -Module PackageManagementProviderResource
Node $NodeName
{
#Install a package from the Powershell gallery
PSModule MyPSModule
{
Ensure = "present"
Name = $Name
RequiredVersion = "0.2.16.3"
Repository = "PSGallery"
InstallationPolicy="trusted"
}
}
}
#Compile it
Sample_PSModule -Name "xjea"
#Run it
Start-DscConfiguration -path .\Sample_PSModule -wait -Verbose -force
| devrandorfer/ScorchDev | PowerShellModules/PackageManagementProviderResource/1.0.2/Examples/Sample_PSModule.ps1 | PowerShell | mit | 1,551 | 27.2 | 79 | 0.625403 | false |
/*
The MIT License (MIT)
Copyright (c) 2014 Manni Wood
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package com.manniwood.cl4pg.v1.test.types;
import com.manniwood.cl4pg.v1.datasourceadapters.DataSourceAdapter;
import com.manniwood.cl4pg.v1.PgSession;
import com.manniwood.cl4pg.v1.datasourceadapters.PgSimpleDataSourceAdapter;
import com.manniwood.cl4pg.v1.commands.DDL;
import com.manniwood.cl4pg.v1.commands.Insert;
import com.manniwood.cl4pg.v1.commands.Select;
import com.manniwood.cl4pg.v1.resultsethandlers.GuessScalarListHandler;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* Please note that these tests must be run serially, and not all at once.
* Although they depend as little as possible on state in the database, it is
* very convenient to have them all use the same db session; so they are all run
* one after the other so that they don't all trip over each other.
*
* @author mwood
*
*/
public class IntegerSmallIntTest {
private PgSession pgSession;
private DataSourceAdapter adapter;
@BeforeClass
public void init() {
adapter = PgSimpleDataSourceAdapter.buildFromDefaultConfFile();
pgSession = adapter.getSession();
pgSession.run(DDL.config().sql("create temporary table test(col smallint)").done());
pgSession.commit();
}
@AfterClass
public void tearDown() {
pgSession.close();
adapter.close();
}
/**
* Truncate the users table before each test.
*/
@BeforeMethod
public void truncateTable() {
pgSession.run(DDL.config().sql("truncate table test").done());
pgSession.commit();
}
@Test(priority = 1)
public void testValue() {
Integer expected = 3;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
@Test(priority = 2)
public void testNull() {
Integer expected = null;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
@Test(priority = 3)
public void testSpecialValue1() {
Integer expected = 32767;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
@Test(priority = 4)
public void testSpecialValu21() {
Integer expected = -32768;
pgSession.run(Insert.usingVariadicArgs()
.sql("insert into test (col) values (#{java.lang.Integer})")
.args(expected)
.done());
pgSession.commit();
GuessScalarListHandler<Integer> handler = new GuessScalarListHandler<Integer>();
pgSession.run(Select.<Integer> usingVariadicArgs()
.sql("select col from test limit 1")
.resultSetHandler(handler)
.done());
pgSession.rollback();
Integer actual = handler.getList().get(0);
Assert.assertEquals(actual, expected, "scalars must match");
}
}
| manniwood/cl4pg | src/test/java/com/manniwood/cl4pg/v1/test/types/IntegerSmallIntTest.java | Java | mit | 5,707 | 33.587879 | 92 | 0.661819 | false |
package com.fqc.jdk8;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
public class test06 {
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 5};
ArrayList<Integer> list = Arrays.stream(arr).collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
Set<Integer> set = list.stream().collect(Collectors.toSet());
System.out.println(set.contains(33));
ArrayList<User> users = new ArrayList<>();
for (int i = 0; i < 10; i++) {
users.add(new User("name:" + i));
}
Map<String, User> map = users.stream().collect(Collectors.toMap(u -> u.username, u -> u));
map.forEach((s, user) -> System.out.println(user.username));
}
}
class User {
String username;
public User(String username) {
this.username = username;
}
}
| fqc/Java_Basic | src/main/java/com/fqc/jdk8/test06.java | Java | mit | 927 | 27.96875 | 112 | 0.614887 | false |
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
package mafmt
import (
nmafmt "github.com/multiformats/go-multiaddr-fmt"
)
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var IP = nmafmt.IP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var TCP = nmafmt.TCP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var UDP = nmafmt.UDP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var UTP = nmafmt.UTP
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var QUIC = nmafmt.QUIC
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var Unreliable = nmafmt.Unreliable
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var Reliable = nmafmt.Reliable
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var IPFS = nmafmt.IPFS
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var And = nmafmt.And
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
var Or = nmafmt.Or
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
type Pattern = nmafmt.Pattern
// Deprecated: use github.com/multiformats/go-multiaddr-fmt instead.
type Base = nmafmt.Base
| whyrusleeping/mafmt | patterns.go | GO | mit | 1,274 | 29.333333 | 68 | 0.77708 | false |
# gofmt package
An [Atom](http://atom.io) package for running `gofmt` on your buffer.
Hit Ctrl-Alt-G to run it on the current file,
or use command `gofmt:gofmt`,
or remap to whatever keybinding you like.
TODO:
* Error highlighting
* Flexible configuration
## Licensing and Copyright
Copyright 2014 Christopher Swenson.
Licensed under the MIT License (see [LICENSE.md](LICENSE.md)).
| swenson/atom-gofmt | README.md | Markdown | mit | 390 | 19.526316 | 69 | 0.751282 | false |
USE [ANTERO]
GO
/****** Object: View [dw].[v_koski_lukio_opiskelijat_netto] Script Date: 1.2.2021 14:00:39 ******/
DROP VIEW IF EXISTS [dw].[v_koski_lukio_opiskelijat_netto]
GO
/****** Object: View [dw].[v_koski_lukio_opiskelijat_netto] Script Date: 1.2.2021 14:00:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dw].[v_koski_lukio_opiskelijat_netto] AS
SELECT
-- AIKAMUUTTUJAT
[Tilastovuosi]
,[Tilastokuukausi] = d14.kuukausi_fi
,[pv_kk] = DAY(EOMONTH(d14.paivays))
-- LUKUMÄÄRÄMUUTTUJAT
,opiskelijat_netto = opiskelijat
-- HENKILÖMUUTTUJAT
,[Sukupuoli] = d1.sukupuoli_fi
,[Äidinkieli] = d2.kieliryhma1_fi
,[Ikä] =
CASE
WHEN d3.ika_avain < 15 THEN 'alle 15 vuotta'
WHEN d3.ika_avain > 70 THEN 'yli 70 vuotta'
ELSE d3.ika_fi END
,[Ikäryhmä] = d3.ikaryhma3_fi
,[Kansalaisuus] = CASE WHEN d22.maatjavaltiot2_koodi = '246' THEN d22.maatjavaltiot2_fi WHEN d22.maatjavaltiot2_koodi != '-1' THEN 'Muu' ELSE 'Tieto puuttuu' END
,[Kansalaisuus (maanosa)] = d22.maanosa0_fi
-- KOULUTUSMUUTTUJAT
,[Suorituskieli] = d23.kieli_fi
,[Majoitus] = d15.majoitus_nimi_fi
,oppimaara AS Oppimäärä
,tavoitetutkinto AS Tavoitetutkinto
,koulutus AS Koulutus
-- ORGANISAATIOMUUTTUJAT
,[Oppilaitos] = d5.organisaatio_fi
,[Koulutuksen järjestäjä] = d11.organisaatio_fi
,[Toimipiste] = d21.organisaatio_fi
,[Oppilaitoksen kunta] = d10.kunta_fi
,[Oppilaitoksen maakunta] = d10.maakunta_fi
,d10.seutukunta_fi AS [Oppilaitoksen seutukunta]
,d10.kuntaryhma_fi AS [Oppilaitoksen kuntaryhmä]
,d10.kielisuhde_fi AS [Oppilaitoksen kunnan kielisuhde]
,[Oppilaitoksen AVI] = d10.avi_fi
,[Oppilaitoksen ELY] = d10.ely_fi
,[Oppilaitoksen opetuskieli] = d5.oppilaitoksenopetuskieli_fi
,[Oppilaitostyyppi] = d5.oppilaitostyyppi_fi
,[Koul. järj. kunta] = d12.kunta_fi
,[Koul. järj. maakunta] = d12.maakunta_fi
,[Koul. järj. ELY] = d12.ely_fi
,[Koul. järj. AVI] = d12.avi_fi
,d11.koulutuksen_jarjestajan_yritysmuoto AS [Koul. järj. omistajatyyppi]
,d12.seutukunta_fi AS [Koul. järj. seutukunta]
,d12.kuntaryhma_fi AS [Koul. järj. kuntaryhmä]
,d12.kielisuhde_fi AS [Koul. jarj. kunnan kielisuhde]
-- KOODIT
,[Koodit Koulutuksen järjestäjä] = d11.organisaatio_koodi
,[Koodit Oppilaitos] = d5.organisaatio_koodi
,d12.kunta_koodi AS [Koodi Koul. järj. kunta]
,d12.seutukunta_koodi AS [Koodi Koul. järj. seutukunta]
,d10.kunta_koodi AS [Koodi Oppilaitoksen kunta]
,d10.seutukunta_koodi AS [Koodi Oppilaitoksen seutukunta]
-- JÄRJESTYSMUUTTUJAT
,jarj_ika =
CASE
WHEN d3.ika_avain = -1 THEN 99
WHEN d3.ika_avain < 15 THEN 1
WHEN d3.ika_avain > 70 THEN 71
ELSE d3.jarjestys_ika END
,d14.kuukausi AS jarj_tilastokuukausi
,d1.jarjestys_sukupuoli_koodi AS jarj_sukupuoli
,d3.jarjestys_ikaryhma3 AS jarj_ikaryhma
,d2.jarjestys_kieliryhma1 AS jarj_aidinkieli
,CASE d22.maatjavaltiot2_fi WHEN 'Suomi' THEN 1 ELSE 2 END AS jarj_kansalaisuus
,jarj_koulutus
,jarj_oppimaara
,jarj_tavoitetutkinto
,d12.jarjestys_maakunta_koodi AS jarj_koul_jarj_maakunta
,d12.jarjestys_avi_koodi AS jarj_koul_jarj_avi
,d12.jarjestys_ely_koodi AS jarj_koul_jarj_ely
,d10.jarjestys_maakunta_koodi AS jarj_oppilaitoksen_maakunta
,d10.jarjestys_ely_koodi AS jarj_oppilaitoksen_ely
,d10.jarjestys_avi_koodi AS jarj_oppilaitoksen_avi
,d5.jarjestys_oppilaitoksenopetuskieli_koodi AS jarj_oppilaitoksen_opetuskieli
,d5.jarjestys_oppilaitostyyppi_koodi AS jarj_oppilaitostyyppi
,d15.jarjestys_majoitus_koodi as jarj_majoitus
FROM dw.f_koski_lukio_opiskelijat_netto f
LEFT JOIN dw.d_sukupuoli d1 ON d1.id= f.d_sukupuoli_id
LEFT JOIN dw.d_kieli d2 ON d2.id = f.d_kieli_aidinkieli_id
LEFT JOIN dw.d_ika d3 ON d3.id = f.d_ika_id
LEFT JOIN dw.d_organisaatioluokitus d5 ON d5.id = f.d_organisaatioluokitus_oppilaitos_id
LEFT JOIN dw.d_alueluokitus d10 ON d10.kunta_koodi = d5.kunta_koodi
LEFT JOIN dw.d_organisaatioluokitus d11 ON d11.id = f.d_organisaatioluokitus_jarj_id
LEFT JOIN dw.d_alueluokitus d12 ON d12.kunta_koodi = d11.kunta_koodi
LEFT JOIN dw.d_kalenteri d14 ON d14.id = f.d_kalenteri_id
LEFT JOIN dw.d_majoitus d15 ON d15.id = f.d_majoitus_id
LEFT JOIN dw.d_organisaatioluokitus d21 ON d21.id = f.d_organisaatioluokitus_toimipiste_id
LEFT JOIN dw.d_maatjavaltiot2 d22 ON d22.id = f.d_maatjavaltiot2_kansalaisuus_id
LEFT JOIN dw.d_kieli d23 ON d23.id = f.d_kieli_suorituskieli_id
GO
USE ANTERO | CSCfi/antero | db/sql/4384__create_view_v_koski_lukio_opiskelijat_netto.sql | SQL | mit | 4,414 | 29.041096 | 163 | 0.742303 | false |
var chalk = require('chalk');
var safeStringify = require('fast-safe-stringify')
function handleErrorObject(key, value) {
if (value instanceof Error) {
return Object.getOwnPropertyNames(value).reduce(function(error, key) {
error[key] = value[key]
return error
}, {})
}
return value
}
function stringify(o) { return safeStringify(o, handleErrorObject, ' '); }
function debug() {
if (!process.env.WINSTON_CLOUDWATCH_DEBUG) return;
var args = [].slice.call(arguments);
var lastParam = args.pop();
var color = chalk.red;
if (lastParam !== true) {
args.push(lastParam);
color = chalk.green;
}
args[0] = color(args[0]);
args.unshift(chalk.blue('DEBUG:'));
console.log.apply(console, args);
}
module.exports = {
stringify: stringify,
debug: debug
};
| lazywithclass/winston-cloudwatch | lib/utils.js | JavaScript | mit | 806 | 22.028571 | 75 | 0.66129 | false |
#pragma once
#include "toolscollector.h"
#include "widgetsettings.h"
#include "toolbase.h"
namespace Engine {
namespace Tools {
struct GuiEditor : public Tool<GuiEditor> {
SERIALIZABLEUNIT(GuiEditor);
GuiEditor(ImRoot &root);
virtual Threading::Task<bool> init() override;
virtual void render() override;
virtual void renderMenu() override;
virtual void update() override;
std::string_view key() const override;
private:
void renderSelection(Widgets::WidgetBase *hoveredWidget = nullptr);
void renderHierarchy(Widgets::WidgetBase **hoveredWidget = nullptr);
bool drawWidget(Widgets::WidgetBase *w, Widgets::WidgetBase **hoveredWidget = nullptr);
private:
Widgets::WidgetManager *mWidgetManager = nullptr;
WidgetSettings *mSelected = nullptr;
std::list<WidgetSettings> mSettings;
bool mMouseDown = false;
bool mDragging = false;
bool mDraggingLeft = false, mDraggingTop = false, mDraggingRight = false, mDraggingBottom = false;
};
}
}
RegisterType(Engine::Tools::GuiEditor); | MadManRises/Madgine | plugins/core/widgets/tools/Madgine_Tools/guieditor/guieditor.h | C | mit | 1,140 | 24.931818 | 106 | 0.670175 | false |
<?php if (isset($consumers) && is_array($consumers)){ ?>
<?php $this->load->helper('security'); ?>
<tbody>
<?php foreach($consumers as $consumer){ ?>
<tr>
<td>
<a data-toggle="modal" data-target="#dynamicModal" href="<?php echo site_url("consumers/edit/$consumer->id");?>"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<td>
<?php echo $consumer->id; ?>
</td>
<td>
<?php echo xss_clean($consumer->name); ?>
</td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr class="pagination-tr">
<td colspan="3" class="pagination-tr">
<div class="text-center">
<?php echo $this->pagination->create_links(); ?>
</div>
</td>
</tr>
</tfoot>
<?php }?>
| weslleih/almoxarifado | application/views/tbodys/consumers.php | PHP | mit | 848 | 28.241379 | 181 | 0.465802 | false |
package rholang.parsing.delimc.Absyn; // Java Package generated by the BNF Converter.
public class TType2 extends TType {
public final Type type_1, type_2;
public TType2(Type p1, Type p2) { type_1 = p1; type_2 = p2; }
public <R,A> R accept(rholang.parsing.delimc.Absyn.TType.Visitor<R,A> v, A arg) { return v.visit(this, arg); }
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof rholang.parsing.delimc.Absyn.TType2) {
rholang.parsing.delimc.Absyn.TType2 x = (rholang.parsing.delimc.Absyn.TType2)o;
return this.type_1.equals(x.type_1) && this.type_2.equals(x.type_2);
}
return false;
}
public int hashCode() {
return 37*(this.type_1.hashCode())+this.type_2.hashCode();
}
}
| rchain/Rholang | src/main/java/rholang/parsing/delimc/Absyn/TType2.java | Java | mit | 753 | 31.73913 | 112 | 0.674635 | false |
require 'rubygems'
require 'test/unit'
require 'shoulda'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'sinatra'
require 'sinatra/path'
class Test::Unit::TestCase
end
| JunKikuchi/sinatra-path | test/helper.rb | Ruby | mit | 241 | 20.909091 | 66 | 0.709544 | false |
"use strict"
const createTileGridConverter = require(`./createTileGridConverter`)
const colorDepth = require(`./colorDepth`)
module.exports = ({palette, images}) => {
const converter = createTileGridConverter({
tileWidth: 7,
tileHeight: 9,
columns: 19,
tileCount: 95,
raw32bitData: colorDepth.convert8to32({palette, raw8bitData: images}),
})
return {
convertToPng: converter.convertToPng
}
} | chuckrector/mappo | src/converter/createVerge1SmallFntConverter.js | JavaScript | mit | 426 | 22.722222 | 74 | 0.704225 | false |
import * as EventLogger from './'
const log = new EventLogger()
log.info('Basic information')
log.information('Basic information')
log.warning('Watch out!')
log.warn('Watch out!')
log.error('Something went wrong.')
log.auditFailure('Audit Failure')
log.auditSuccess('Audit Success')
// Configurations
new EventLogger('FooApplication')
new EventLogger({
source: 'FooApplication',
logPath: '/var/usr/local/log',
eventLog: 'APPLICATION'
})
| DenisCarriere/eventlogger | types.ts | TypeScript | mit | 446 | 22.473684 | 36 | 0.733184 | false |
# cactuscon2015
Badge design for CactusCon 2015
| erikwilson/cactuscon2015 | README.md | Markdown | mit | 48 | 23 | 31 | 0.833333 | false |
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_imdbc_session'
| chi-bobolinks-2015/imdbc | config/initializers/session_store.rb | Ruby | mit | 137 | 44.666667 | 75 | 0.773723 | false |
<?xml version="1.0" encoding="iso-8859-1"?>
<!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">
<head>
<title>Class: HTML::Sanitizer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">HTML::Sanitizer</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/usr/lib/ruby/gems/1_8/gems/actionpack-3_0_0_beta4/lib/action_controller/vendor/html-scanner/html/sanitizer_rb.html">
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
<a href="../Object.html">
Object
</a>
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000941">process_node</a>
<a href="#M000938">sanitize</a>
<a href="#M000939">sanitizeable?</a>
<a href="#M000940">tokenize</a>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000938" class="method-detail">
<a name="M000938"></a>
<div class="method-heading">
<a href="#M000938" class="method-signature">
<span class="method-name">sanitize</span><span class="method-args">(text, options = {})</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000938-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000938-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 6</span>
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span> = {})
7: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">sanitizeable?</span>(<span class="ruby-identifier">text</span>)
8: <span class="ruby-identifier">tokenize</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span>).<span class="ruby-identifier">join</span>
9: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000939" class="method-detail">
<a name="M000939"></a>
<div class="method-heading">
<a href="#M000939" class="method-signature">
<span class="method-name">sanitizeable?</span><span class="method-args">(text)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000939-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000939-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 11</span>
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitizeable?</span>(<span class="ruby-identifier">text</span>)
12: <span class="ruby-operator">!</span>(<span class="ruby-identifier">text</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">"<"</span>))
13: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Protected Instance methods</h3>
<div id="method-M000941" class="method-detail">
<a name="M000941"></a>
<div class="method-heading">
<a href="#M000941" class="method-signature">
<span class="method-name">process_node</span><span class="method-args">(node, result, options)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000941-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000941-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 26</span>
26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_node</span>(<span class="ruby-identifier">node</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">options</span>)
27: <span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">to_s</span>
28: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000940" class="method-detail">
<a name="M000940"></a>
<div class="method-heading">
<a href="#M000940" class="method-signature">
<span class="method-name">tokenize</span><span class="method-args">(text, options)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000940-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000940-source">
<pre>
<span class="ruby-comment cmt"># File /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 16</span>
16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tokenize</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span>)
17: <span class="ruby-identifier">tokenizer</span> = <span class="ruby-constant">HTML</span><span class="ruby-operator">::</span><span class="ruby-constant">Tokenizer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">text</span>)
18: <span class="ruby-identifier">result</span> = []
19: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">token</span> = <span class="ruby-identifier">tokenizer</span>.<span class="ruby-identifier">next</span>
20: <span class="ruby-identifier">node</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-identifier">token</span>, <span class="ruby-keyword kw">false</span>)
21: <span class="ruby-identifier">process_node</span> <span class="ruby-identifier">node</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">options</span>
22: <span class="ruby-keyword kw">end</span>
23: <span class="ruby-identifier">result</span>
24: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html> | ecoulthard/summitsearch | doc/api/classes/HTML/Sanitizer.html | HTML | mit | 9,325 | 39.724891 | 468 | 0.609866 | false |
# -*- coding: utf-8 -*-
"""urls.py: messages extends"""
from django.conf.urls import url
from messages_extends.views import message_mark_all_read, message_mark_read
urlpatterns = [
url(r'^mark_read/(?P<message_id>\d+)/$', message_mark_read, name='message_mark_read'),
url(r'^mark_read/all/$', message_mark_all_read, name='message_mark_all_read'),
]
| AliLozano/django-messages-extends | messages_extends/urls.py | Python | mit | 358 | 38.777778 | 90 | 0.681564 | false |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$(document).ready(function(){
var oldAction = $('#comment-form').attr("action");
hljs.initHighlightingOnLoad();
$('#coolness div').hover(function(){
$('#coolness .second').fadeOut(500);
}, function(){
$('#coolness .second').fadeIn(1000).stop(false, true);
});
$(".reply a").click(function() {
var add = this.className;
var action = oldAction + '/' + add;
$("#comment-form").attr("action", action);
console.log($('#comment-form').attr("action"));
});
});
| mzj/yabb | src/MZJ/YabBundle/Resources/public/js/bootstrap.js | JavaScript | mit | 683 | 23.392857 | 63 | 0.525622 | false |
#include "Sound.h"
#include <Windows.h>
#include "DigitalGraffiti.h"
Sound::Sound(void)
{
// Find music and sound files
std::string exeDir = DigitalGraffiti::getExeDirectory();
DigitalGraffiti::getFileList(exeDir + "\\sound\\instructions\\*", instructionsMusicList);
DigitalGraffiti::getFileList(exeDir + "\\sound\\cleanup\\*", cleanupMusicList);
DigitalGraffiti::getFileList(exeDir + "\\sound\\splat\\*", splatSoundList);
instructionsCounter = 0;
cleanupCounter = 0;
splatCounter = 0;
numInstructions= instructionsMusicList.size();
numCleanup = cleanupMusicList.size();
numSplat = splatSoundList.size();
if(DigitalGraffiti::DEBUG)
{
printf("Sound directory is: %s\n", exeDir.c_str());
printf("\tnumInstructions = %u\n", numInstructions);
printf("\tnumCleanup = %u\n", numCleanup);
printf("\tnumSplat = %u\n", numSplat);
}
}
void Sound::playInstructionsMusic(void)
{
if(numInstructions > 0)
{
if(DigitalGraffiti::DEBUG)
{
printf("Play %s\n", instructionsMusicList[instructionsCounter].c_str());
}
PlaySound(TEXT(instructionsMusicList[instructionsCounter].c_str()), NULL, SND_FILENAME | SND_ASYNC| SND_NOWAIT);
instructionsCounter = (instructionsCounter + 1) % numInstructions;
}
}
void Sound::playCleanupMusic(void)
{
if(numCleanup > 0)
{
if(DigitalGraffiti::DEBUG)
{
printf("Play %s\n", cleanupMusicList[cleanupCounter].c_str());
}
PlaySound(TEXT(cleanupMusicList[cleanupCounter].c_str()), NULL, SND_FILENAME | SND_ASYNC| SND_NOWAIT);
cleanupCounter = (cleanupCounter + 1) % numCleanup;
}
}
void Sound::playSplatSound(void)
{
if(numSplat > 0)
{
if(DigitalGraffiti::DEBUG)
{
printf("Play %s\n", splatSoundList[splatCounter].c_str());
}
PlaySound(TEXT(splatSoundList[splatCounter].c_str()), NULL, SND_FILENAME | SND_ASYNC| SND_NOWAIT);
splatCounter = (splatCounter + 1) % numSplat;
}
} | nbbrooks/digital-graffiti | DigitalGraffiti/Sound.cpp | C++ | mit | 1,924 | 28.09375 | 114 | 0.68711 | false |
using System.Collections.ObjectModel;
using AppStudio.Common;
using AppStudio.Common.Navigation;
using Windows.UI.Xaml;
namespace WindowsAppStudio.Navigation
{
public abstract class NavigationNode : ObservableBase
{
private bool _isSelected;
public string Title { get; set; }
public string Label { get; set; }
public abstract bool IsContainer { get; }
public bool IsSelected
{
get
{
return _isSelected;
}
set
{
SetProperty(ref _isSelected, value);
}
}
public abstract void Selected();
}
public class ItemNavigationNode : NavigationNode, INavigable
{
public override bool IsContainer
{
get
{
return false;
}
}
public NavigationInfo NavigationInfo { get; set; }
public override void Selected()
{
NavigationService.NavigateTo(this);
}
}
public class GroupNavigationNode : NavigationNode
{
private Visibility _visibility;
public GroupNavigationNode()
{
Nodes = new ObservableCollection<NavigationNode>();
}
public override bool IsContainer
{
get
{
return true;
}
}
public ObservableCollection<NavigationNode> Nodes { get; set; }
public Visibility Visibility
{
get { return _visibility; }
set { SetProperty(ref _visibility, value); }
}
public override void Selected()
{
if (Visibility == Visibility.Collapsed)
{
Visibility = Visibility.Visible;
}
else
{
Visibility = Visibility.Collapsed;
}
}
}
}
| wasteam/WindowsAppStudioApp | WindowsAppStudio.W10/Navigation/NavigationNode.cs | C# | mit | 2,027 | 22.130952 | 71 | 0.49186 | false |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>canon-bdds: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.10.0 / canon-bdds - 8.5.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
canon-bdds
<small>
8.5.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-07 06:33:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-07 06:33:16 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.10.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "matej.kosik@inria.fr"
homepage: "https://github.com/coq-contribs/canon-bdds"
license: "Proprietary"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/CanonBDDs"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [
"keyword:BDT"
"keyword:finite sets"
"keyword:model checking"
"keyword:binary decision diagrams"
"category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
"category:Miscellaneous/Extracted Programs/Decision procedures"
]
authors: [ "Emmanuel Ledinot <>" ]
bug-reports: "https://github.com/coq-contribs/canon-bdds/issues"
dev-repo: "git+https://github.com/coq-contribs/canon-bdds.git"
synopsis: "Canonicity of Binary Decision Dags"
description: """
A proof of unicity and canonicity of Binary Decision Trees and
Binary Decision Dags. This contrib contains also a development on finite sets."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/canon-bdds/archive/v8.5.0.tar.gz"
checksum: "md5=1e2bdec36357609a6a0498d59a2e68ba"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-canon-bdds.8.5.0 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0).
The following dependencies couldn't be met:
- coq-canon-bdds -> coq < 8.6~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-canon-bdds.8.5.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| coq-bench/coq-bench.github.io | clean/Linux-x86_64-4.07.1-2.0.6/released/8.10.0/canon-bdds/8.5.0.html | HTML | mit | 6,962 | 40.047337 | 159 | 0.546634 | false |
# AndSpecification(*T*) Constructor
Additional header content
Initializes a new instance of the <a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">AndSpecification(T)</a> class
**Namespace:** <a href="N_iTin_Export_ComponentModel_Patterns">iTin.Export.ComponentModel.Patterns</a><br />**Assembly:** iTin.Export.Core (in iTin.Export.Core.dll) Version: 2.0.0.0 (2.0.0.0)
## Syntax
**C#**<br />
``` C#
public AndSpecification(
ISpecification<T> left,
ISpecification<T> right
)
```
**VB**<br />
``` VB
Public Sub New (
left As ISpecification(Of T),
right As ISpecification(Of T)
)
```
#### Parameters
<dl><dt>left</dt><dd>Type: <a href="T_iTin_Export_ComponentModel_Patterns_ISpecification_1">iTin.Export.ComponentModel.Patterns.ISpecification</a>(<a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">*T*</a>)<br />\[Missing <param name="left"/> documentation for "M:iTin.Export.ComponentModel.Patterns.AndSpecification`1.#ctor(iTin.Export.ComponentModel.Patterns.ISpecification{`0},iTin.Export.ComponentModel.Patterns.ISpecification{`0})"\]</dd><dt>right</dt><dd>Type: <a href="T_iTin_Export_ComponentModel_Patterns_ISpecification_1">iTin.Export.ComponentModel.Patterns.ISpecification</a>(<a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">*T*</a>)<br />\[Missing <param name="right"/> documentation for "M:iTin.Export.ComponentModel.Patterns.AndSpecification`1.#ctor(iTin.Export.ComponentModel.Patterns.ISpecification{`0},iTin.Export.ComponentModel.Patterns.ISpecification{`0})"\]</dd></dl>
## Remarks
\[Missing <remarks> documentation for "M:iTin.Export.ComponentModel.Patterns.AndSpecification`1.#ctor(iTin.Export.ComponentModel.Patterns.ISpecification{`0},iTin.Export.ComponentModel.Patterns.ISpecification{`0})"\]
## See Also
#### Reference
<a href="T_iTin_Export_ComponentModel_Patterns_AndSpecification_1">AndSpecification(T) Class</a><br /><a href="N_iTin_Export_ComponentModel_Patterns">iTin.Export.ComponentModel.Patterns Namespace</a><br /> | iAJTin/iExportEngine | source/documentation/iTin.Export.Documentation/Documentation/M_iTin_Export_ComponentModel_Patterns_AndSpecification_1__ctor.md | Markdown | mit | 2,028 | 53.837838 | 927 | 0.759369 | false |
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
#include <CRecallRequest.hpp>
START_ATF_NAMESPACE
namespace Info
{
using CRecallRequestctor_CRecallRequest2_ptr = void (WINAPIV*)(struct CRecallRequest*, uint16_t);
using CRecallRequestctor_CRecallRequest2_clbk = void (WINAPIV*)(struct CRecallRequest*, uint16_t, CRecallRequestctor_CRecallRequest2_ptr);
using CRecallRequestClear4_ptr = void (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestClear4_clbk = void (WINAPIV*)(struct CRecallRequest*, CRecallRequestClear4_ptr);
using CRecallRequestClose6_ptr = void (WINAPIV*)(struct CRecallRequest*, bool);
using CRecallRequestClose6_clbk = void (WINAPIV*)(struct CRecallRequest*, bool, CRecallRequestClose6_ptr);
using CRecallRequestGetID8_ptr = uint16_t (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestGetID8_clbk = uint16_t (WINAPIV*)(struct CRecallRequest*, CRecallRequestGetID8_ptr);
using CRecallRequestGetOwner10_ptr = struct CPlayer* (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestGetOwner10_clbk = struct CPlayer* (WINAPIV*)(struct CRecallRequest*, CRecallRequestGetOwner10_ptr);
using CRecallRequestIsBattleModeUse12_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsBattleModeUse12_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsBattleModeUse12_ptr);
using CRecallRequestIsClose14_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsClose14_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsClose14_ptr);
using CRecallRequestIsRecallAfterStoneState16_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsRecallAfterStoneState16_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsRecallAfterStoneState16_ptr);
using CRecallRequestIsRecallParty18_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsRecallParty18_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsRecallParty18_ptr);
using CRecallRequestIsTimeOut20_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsTimeOut20_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsTimeOut20_ptr);
using CRecallRequestIsWait22_ptr = bool (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestIsWait22_clbk = bool (WINAPIV*)(struct CRecallRequest*, CRecallRequestIsWait22_ptr);
using CRecallRequestRecall24_ptr = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, bool);
using CRecallRequestRecall24_clbk = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, bool, CRecallRequestRecall24_ptr);
using CRecallRequestRegist26_ptr = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, struct CCharacter*, bool, bool, bool);
using CRecallRequestRegist26_clbk = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, struct CCharacter*, bool, bool, bool, CRecallRequestRegist26_ptr);
using CRecallRequestdtor_CRecallRequest30_ptr = void (WINAPIV*)(struct CRecallRequest*);
using CRecallRequestdtor_CRecallRequest30_clbk = void (WINAPIV*)(struct CRecallRequest*, CRecallRequestdtor_CRecallRequest30_ptr);
}; // end namespace Info
END_ATF_NAMESPACE
| goodwinxp/Yorozuya | library/ATF/CRecallRequestInfo.hpp | C++ | mit | 3,442 | 80.952381 | 167 | 0.755956 | false |
class DiscountTechnicalTypesController < ApplicationController
before_action :set_discount_technical_type, only: [:show, :edit, :update, :destroy]
# GET /discount_technical_types
# GET /discount_technical_types.json
def index
@discount_technical_types = DiscountTechnicalType.all
end
# GET /discount_technical_types/1
# GET /discount_technical_types/1.json
def show
end
# GET /discount_technical_types/new
def new
@discount_technical_type = DiscountTechnicalType.new
end
# GET /discount_technical_types/1/edit
def edit
end
# POST /discount_technical_types
# POST /discount_technical_types.json
def create
@discount_technical_type = DiscountTechnicalType.new(discount_technical_type_params)
respond_to do |format|
if @discount_technical_type.save
format.html { redirect_to @discount_technical_type, notice: 'Discount technical type was successfully created.' }
format.json { render :show, status: :created, location: @discount_technical_type }
else
format.html { render :new }
format.json { render json: @discount_technical_type.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /discount_technical_types/1
# PATCH/PUT /discount_technical_types/1.json
def update
respond_to do |format|
if @discount_technical_type.update(discount_technical_type_params)
format.html { redirect_to @discount_technical_type, notice: 'Discount technical type was successfully updated.' }
format.json { render :show, status: :ok, location: @discount_technical_type }
else
format.html { render :edit }
format.json { render json: @discount_technical_type.errors, status: :unprocessable_entity }
end
end
end
# DELETE /discount_technical_types/1
# DELETE /discount_technical_types/1.json
def destroy
@discount_technical_type.destroy
respond_to do |format|
format.html { redirect_to discount_technical_types_url, notice: 'Discount technical type was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_discount_technical_type
@discount_technical_type = DiscountTechnicalType.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def discount_technical_type_params
params.require(:discount_technical_type).permit(:value)
end
end
| maxjuniorbr/mobSeg | app/controllers/discount_technical_types_controller.rb | Ruby | mit | 2,523 | 33.094595 | 125 | 0.711058 | false |
using System.Net.Sockets;
namespace VidereLib.EventArgs
{
/// <summary>
/// EventArgs for the OnClientConnected event.
/// </summary>
public class OnClientConnectedEventArgs : System.EventArgs
{
/// <summary>
/// The connected client.
/// </summary>
public TcpClient Client { private set; get; }
/// <summary>
/// Constructor.
/// </summary>
/// <param name="client">The connected client.</param>
public OnClientConnectedEventArgs( TcpClient client )
{
this.Client = client;
}
}
}
| Wolf-Code/Videre | Videre/VidereLib/EventArgs/OnClientConnectedEventArgs.cs | C# | mit | 610 | 24.333333 | 62 | 0.564145 | false |
require 'rubygems'
require 'net/dns'
module Reedland
module Command
class Host
def self.run(address)
regular = Net::DNS::Resolver.start address.join(" ")
mx = Net::DNS::Resolver.new.search(address.join(" "), Net::DNS::MX)
return "#{regular}\n#{mx}"
end
end
end
end | reedphish/discord-reedland | commands/host.rb | Ruby | mit | 291 | 18.466667 | 71 | 0.652921 | false |
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>onSupportNavigateUp</title>
</head><body><link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../../";</script>
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async></script><link href="../../../styles/style.css" rel="Stylesheet"><link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../../../styles/main.css" rel="Stylesheet"><link href="../../../styles/prism.css" rel="Stylesheet"><link href="../../../styles/logo-styles.css" rel="Stylesheet"><script type="text/javascript" src="../../../scripts/clipboard.js" async></script><script type="text/javascript" src="../../../scripts/navigation-loader.js" async></script><script type="text/javascript" src="../../../scripts/platform-content-handler.js" async></script><script type="text/javascript" src="../../../scripts/main.js" defer></script><script type="text/javascript" src="../../../scripts/prism.js" async></script><script>const storage = localStorage.getItem("dokka-dark-mode")
const savedDarkMode = storage ? JSON.parse(storage) : false
if(savedDarkMode === true){
document.getElementsByTagName("html")[0].classList.add("theme-dark")
}</script>
<div class="navigation-wrapper" id="navigation-wrapper">
<div id="leftToggler"><span class="icon-toggler"></span></div>
<div class="library-name"><a href="../../../index.html"><span>stripe-android</span></a></div>
<div></div>
<div class="pull-right d-flex"><button id="theme-toggle-button"><span id="theme-toggle"></span></button>
<div id="searchBar"></div>
</div>
</div>
<div id="container">
<div id="leftColumn">
<div id="sideMenu"></div>
</div>
<div id="main">
<div class="main-content" id="content" pageids="payments-core::com.stripe.android.view/PaymentMethodsActivity/onSupportNavigateUp/#/PointingToDeclaration//-1622557690">
<div class="breadcrumbs"><a href="../../index.html">payments-core</a>/<a href="../index.html">com.stripe.android.view</a>/<a href="index.html">PaymentMethodsActivity</a>/<a href="on-support-navigate-up.html">onSupportNavigateUp</a></div>
<div class="cover ">
<h1 class="cover"><span>on</span><wbr><span>Support</span><wbr><span>Navigate</span><wbr><span><span>Up</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":payments-core:dokkaHtmlPartial/release"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">override </span><span class="token keyword">fun </span><a href="on-support-navigate-up.html"><span class="token function">onSupportNavigateUp</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
</div>
<div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2022 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div>
</div>
</div>
</body></html>
| stripe/stripe-android | docs/payments-core/com.stripe.android.view/-payment-methods-activity/on-support-navigate-up.html | HTML | mit | 3,722 | 94.410256 | 883 | 0.664875 | false |
# Set up gems listed in the Gemfile.
# See: http://gembundler.com/bundler_setup.html
# http://stackoverflow.com/questions/7243486/why-do-you-need-require-bundler-setup
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
# Require gems we care about
require 'rubygems'
require 'uri'
require 'pathname'
require 'pg'
require 'active_record'
require 'logger'
require 'sinatra'
require "sinatra/reloader" if development?
require 'erb'
require 'bcrypt'
# Some helper constants for path-centric logic
APP_ROOT = Pathname.new(File.expand_path('../../', __FILE__))
APP_NAME = APP_ROOT.basename.to_s
configure do
# By default, Sinatra assumes that the root is the file that calls the configure block.
# Since this is not the case for us, we set it manually.
set :root, APP_ROOT.to_path
# See: http://www.sinatrarb.com/faq.html#sessions
enable :sessions
set :session_secret, ENV['SESSION_SECRET'] || 'this is a secret shhhhhhhhh'
# Set the views to
set :views, File.join(Sinatra::Application.root, "app", "views")
end
# Set up the controllers and helpers
Dir[APP_ROOT.join('app', 'controllers', '*.rb')].each { |file| require file }
Dir[APP_ROOT.join('app', 'helpers', '*.rb')].each { |file| require file }
# Set up the database and models
require APP_ROOT.join('config', 'database')
| ckammerl/LilTwitter | config/environment.rb | Ruby | mit | 1,387 | 29.152174 | 89 | 0.707282 | false |
#!/bin/bash
STEP=$1
TEST=$2
case "$STEP" in
install)
echo "Installing..."
if [ -d vendor ]; then
chmod 777 -R vendor
rm -r vendor
fi
COMPOSER=dev.json composer install
;;
script)
echo "Run tests...";
if [ ! -d vendor ]; then
echo "Application not installed. Tests stopped. Exit with code 1"
exit 1
fi
case "$TEST" in
unit)
echo "Run phpunit --verbose --testsuite=unit...";
php vendor/bin/phpunit --verbose --testsuite=unit
;;
phpcs)
echo "Run phpcs --encoding=utf-8 --extensions=php --standard=psr2 Okvpn/ -p...";
php vendor/bin/phpcs --encoding=utf-8 --standard=psr2 -p src
;;
esac
;;
esac
| vtsykun/redis-message-queue | .builds/travis.sh | Shell | mit | 845 | 23.142857 | 96 | 0.481657 | false |
(function(Object) {
Object.Model.Background = Object.Model.PresentationObject.extend({
"initialize" : function() {
Object.Model.PresentationObject.prototype.initialize.call(this);
}
},{
"type" : "Background",
"attributes" : _.defaults({
"skybox" : {
"type" : "res-texture",
"name" : "skybox",
"_default" : ""
},
"name" : {
"type" : "string",
"_default" : "new Background",
"name" : "name"
}
}, Object.Model.PresentationObject.attributes)
});
}(sp.module("object"))); | larsrohwedder/scenepoint | client_src/modules/object/model/Background.js | JavaScript | mit | 532 | 18.740741 | 67 | 0.578947 | false |
<div class="mini-graph clearfix">
<div class="nav"><nav><a class="breadcrumb" href="/">Offices</a> > <span>{{office}}</span></nav></div>
<h3>NYC Campaign Contributions: {{office}}</h3>
<hr>
<ul>
<li ng-click="byTotal($event)" class="chart-option active-option">Total Funds</li>
<li ng-click="byContributions($event)" class="chart-option">Contributions</li>
<li ng-click="byMatch($event)" class="chart-option">Matching Funds</li>
<li ng-click="byContributors($event)" class="chart-option">Number of Contributors</li>
</ul>
<hr>
<ul class="selected-candidates">
<li ng-repeat="candidate in selectedCandidates" id="{{candidate.id}}" class="candidate-button-selected" ng-class="addActive(candidate.id)" ng-click="removeActive($event, candidate.id, $index)">
{{candidate.name}}
</li>
</ul>
<hr>
<ul class="candidate-list">
<li ng-repeat="candidate in candidates" id="can_{{candidate.id}}" class="candidate-button" ng-click="toggleSelected($event, $index)">
{{candidate.name}}
</li>
</ul>
<div class="candidates graph-wrapper">
<svg d3="" d3-data="selectedCandidates" d3-renderer="barGraphRenderer" class="candidate-bar-graph"></svg>
</div>
<!--<hr>-->
<!--<div class="candidate-info-box" style="display: none;">-->
<!--<p class="candidate-name">{{name}}</p>-->
<!--<p class="total-contributors">{{count_contributors}} Contributors</p><a href="{{detail_link}}" title="{{name}} Details">Details</a>-->
<!--<table class="funds">-->
<!--<tr class="match-amount">-->
<!--<td>Matching Funds:</td>-->
<!--<td>{{candidate_match | currency}}</td>-->
<!--</tr>-->
<!--<tr class="contribution-amount">-->
<!--<td>Contributions Funds:</td>-->
<!--<td>{{candidate_contributions | currency}}</td>-->
<!--</tr>-->
<!--<tr class="total-amount">-->
<!--<td>Total Funds:</td>-->
<!--<td>{{candidate_total | currency}}</td>-->
<!--</tr>-->
<!--</table>-->
<!--</div>-->
<div id="candidate_info" class="candidate-info tooltip">
{{candidate_name}}<br>
{{candidate_value}}
</div>
</div> | akilism/nyc-campaign-finance | site_code/views/partials/candidate_list.html | HTML | mit | 2,346 | 44.134615 | 201 | 0.542199 | false |
<?php
namespace HsBundle;
use HsBundle\DependencyInjection\Compiler\ReportsCompilerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class HsBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new ReportsCompilerPass());
}
}
| deregenboog/ecd | src/HsBundle/HsBundle.php | PHP | mit | 401 | 22.588235 | 63 | 0.76808 | false |
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link href="../style/campfire.css" rel="stylesheet">
<link href="../style/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="chart" id="wall"></div>
</body>
<script src="../script/campfire-wall.js" charset="utf-8"></script>
</html>
| mpoegel/SemNExT-Visualizations | public/campfire/wall.html | HTML | mit | 315 | 14.75 | 71 | 0.647619 | false |
import './Modal.scss'
import pugTpl from './Modal.pug'
import mixin from '../../mixin'
import alert from '@vue2do/component/module/Modal/alert'
import confirm from '@vue2do/component/module/Modal/confirm'
export default {
name: 'PageCompModal',
template: pugTpl(),
mixins: [mixin],
data() {
return {
testName: 'test'
}
},
methods: {
simple() {
this.$refs.simple.show()
},
alert() {
alert({
message: '这是一个警告弹窗',
theme: this.typeTheme,
ui: this.typeUI
})
},
confirm() {
confirm({
message: '这是一个确认弹窗',
title: '测试确认弹出',
theme: 'danger',
ui: 'bootstrap'
})
},
showFullPop() {
this.$refs.fullPop.show()
},
hideFullPop() {
this.$refs.fullPop.hide()
},
showPureModal() {
this.$refs.pureModal.show()
},
hidePureModal() {
this.$refs.pureModal.hide()
}
}
}
| zen0822/vue2do | app/doc/client/component/page/Component/message/Modal/Modal.js | JavaScript | mit | 995 | 15.396552 | 60 | 0.534175 | false |
package com.igonics.transformers.simple;
import java.io.PrintStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.relique.jdbc.csv.CsvDriver;
import com.igonics.transformers.simple.helpers.CSVDirWalker;
import com.igonics.transformers.simple.helpers.CSVLogger;
/**
* @author gggordon <https://github.com/gggordon>
* @version 1.0.0
* @description Transforms sub-directories of similar CSV files into one database file
* @created 1.11.2015
*
* */
public class JavaCSVTransform {
/**
* @param baseDir Base Directory to Check for CSV Files
* @param dbFile Database File Name or Path
* @param subDirectoryDepth Recursive Depth to check for CSV Files. -1 will recurse indefinitely
* @param keepTemporaryFile Keep Temporary Buffer File or Delete
* */
public void createCSVDatabase(String baseDir, String dbFile,int subDirectoryDepth,boolean keepTemporaryFile){
final String BASE_DIR =baseDir==null? System.getProperty("user.dir") + "\\dataFiles" : baseDir;
final String DB_FILE = dbFile==null?"DB-" + System.currentTimeMillis() + ".csv":dbFile;
long startTime = System.currentTimeMillis();
CSVLogger.info("Base Dir : " + BASE_DIR);
try {
CSVDirWalker dirWalker = new CSVDirWalker(BASE_DIR, subDirectoryDepth);
//Process Directories
dirWalker.start();
CSVLogger.debug("Column Names : " + dirWalker.getHeader());
CSVLogger.info("Temporary Buffer File Complete. Starting Database Queries");
// Writing to database
// Load the driver.
Class.forName("org.relique.jdbc.csv.CsvDriver");
// Create a connection. The first command line parameter is the directory containing the .csv files.
Connection conn = DriverManager.getConnection("jdbc:relique:csv:"
+ System.getProperty("user.dir"));
// Create a Statement object to execute the query with.
Statement stmt = conn.createStatement();
ResultSet results = stmt.executeQuery("SELECT * FROM "
+ dirWalker.getTempBufferPath().replaceAll(".csv", ""));
CSVLogger.info("Retrieved Records From Temporary File");
// Dump out the results to a CSV file with the same format
// using CsvJdbc helper function
CSVLogger.info("Writing Records to database file");
long databaseSaveStartTime = System.currentTimeMillis();
//Create redirect stream to database file
PrintStream printStream = new PrintStream(DB_FILE);
//print column headings
printStream.print(dirWalker.getHeader()+System.lineSeparator());
CsvDriver.writeToCsv(results, printStream, false);
CSVLogger.info("Time taken to save records to database (ms): "+(System.currentTimeMillis() - databaseSaveStartTime));
//delete temporary file
if(!keepTemporaryFile){
CSVLogger.info("Removing Temporary File");
dirWalker.removeTemporaryFile();
}
//Output Program Execution Completed
CSVLogger.info("Total execution time (ms) : "
+ (System.currentTimeMillis() - startTime)
+ " | Approx Size (bytes) : "
+ dirWalker.getTotalBytesRead());
} catch (Exception ioe) {
CSVLogger.error(ioe.getMessage(), ioe);
}
}
// TODO: Modularize Concepts
public static void main(String args[]) {
//Parse Command Line Options
Options opts = new Options();
HelpFormatter formatter = new HelpFormatter();
opts.addOption("d", "dir", false, "Base Directory of CSV files. Default : Current Directory");
opts.addOption("db", "database", false, "Database File Name. Default DB-{timestamp}.csv");
opts.addOption("depth", "depth", false, "Recursive Depth. Set -1 to recurse indefintely. Default : -1");
opts.addOption("keepTemp",false,"Keeps Temporary file. Default : false");
opts.addOption("h", "help", false, "Display Help");
try {
CommandLine cmd = new DefaultParser().parse(opts,args);
if(cmd.hasOption("h") || cmd.hasOption("help")){
formatter.printHelp( "javacsvtransform", opts );
return;
}
//Create CSV Database With Command Line Options or Defaults
new JavaCSVTransform().createCSVDatabase(cmd.getOptionValue("d"), cmd.getOptionValue("db"),Integer.parseInt(cmd.getOptionValue("depth", "-1")), cmd.hasOption("keepTemp"));
} catch (ParseException e) {
formatter.printHelp( "javacsvtransform", opts );
}
}
}
| gggordon/JavaCSVTransform | src/com/igonics/transformers/simple/JavaCSVTransform.java | Java | mit | 4,527 | 38.025862 | 174 | 0.721449 | false |
require 'test_helper'
module ContentControl
class UploadsHelperTest < ActionView::TestCase
end
end
| mikedhart/ContentControl | test/unit/helpers/simple_cms/uploads_helper_test.rb | Ruby | mit | 104 | 16.333333 | 48 | 0.798077 | false |
/*
* JDIVisitor
* Copyright (C) 2014 Adrian Herrera
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jdivisitor.debugger.launcher;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.Validate;
import com.sun.jdi.Bootstrap;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.AttachingConnector;
import com.sun.jdi.connect.Connector;
/**
* Attach (via a socket) to a listening virtual machine in debug mode.
*
* @author Adrian Herrera
*
*/
public class RemoteVMConnector extends VMConnector {
/**
* Socket connection details.
*/
private final InetSocketAddress socketAddress;
/**
* Constructor.
*
* @param hostname Name of the host to connect to
* @param port Port number the virtual machine is listening on
*/
public RemoteVMConnector(String hostname, int port) {
this(new InetSocketAddress(hostname, port));
}
/**
* Constructor.
*
* @param sockAddr Socket address structure to connect to.
*/
public RemoteVMConnector(InetSocketAddress sockAddr) {
socketAddress = Validate.notNull(sockAddr);
}
@Override
public VirtualMachine connect() throws Exception {
List<AttachingConnector> connectors = Bootstrap.virtualMachineManager()
.attachingConnectors();
AttachingConnector connector = findConnector(
"com.sun.jdi.SocketAttach", connectors);
Map<String, Connector.Argument> arguments = connectorArguments(connector);
VirtualMachine vm = connector.attach(arguments);
// TODO - redirect stdout and stderr?
return vm;
}
/**
* Set the socket-attaching connector's arguments.
*
* @param connector A socket-attaching connector
* @return The socket-attaching connector's arguments
*/
private Map<String, Connector.Argument> connectorArguments(
AttachingConnector connector) {
Map<String, Connector.Argument> arguments = connector
.defaultArguments();
arguments.get("hostname").setValue(socketAddress.getHostName());
arguments.get("port").setValue(
Integer.toString(socketAddress.getPort()));
return arguments;
}
}
| adrianherrera/jdivisitor | src/main/java/org/jdivisitor/debugger/launcher/RemoteVMConnector.java | Java | mit | 2,991 | 29.835052 | 82 | 0.690739 | false |
# The MIT License (MIT)
#
# Copyright (c) 2016 Frederic Guillot
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from cliff import app
from cliff import commandmanager
from pbr import version as app_version
import sys
from kanboard_cli.commands import application
from kanboard_cli.commands import project
from kanboard_cli.commands import task
from kanboard_cli import client
class KanboardShell(app.App):
def __init__(self):
super(KanboardShell, self).__init__(
description='Kanboard Command Line Client',
version=app_version.VersionInfo('kanboard_cli').version_string(),
command_manager=commandmanager.CommandManager('kanboard.cli'),
deferred_help=True)
self.client = None
self.is_super_user = True
def build_option_parser(self, description, version, argparse_kwargs=None):
parser = super(KanboardShell, self).build_option_parser(
description, version, argparse_kwargs=argparse_kwargs)
parser.add_argument(
'--url',
metavar='<api url>',
help='Kanboard API URL',
)
parser.add_argument(
'--username',
metavar='<api username>',
help='API username',
)
parser.add_argument(
'--password',
metavar='<api password>',
help='API password/token',
)
parser.add_argument(
'--auth-header',
metavar='<authentication header>',
help='API authentication header',
)
return parser
def initialize_app(self, argv):
client_manager = client.ClientManager(self.options)
self.client = client_manager.get_client()
self.is_super_user = client_manager.is_super_user()
self.command_manager.add_command('app version', application.ShowVersion)
self.command_manager.add_command('app timezone', application.ShowTimezone)
self.command_manager.add_command('project show', project.ShowProject)
self.command_manager.add_command('project list', project.ListProjects)
self.command_manager.add_command('task create', task.CreateTask)
self.command_manager.add_command('task list', task.ListTasks)
def main(argv=sys.argv[1:]):
return KanboardShell().run(argv)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
| kanboard/kanboard-cli | kanboard_cli/shell.py | Python | mit | 3,401 | 35.569892 | 82 | 0.6798 | false |
<div>
<h1 class="page-header">项目详情</h1>
<form class="form-horizontal" name="project" role="form">
<div class="form-group">
<label for="projectName" class="col-sm-2 control-label">选择项目</label>
<div class="col-sm-5">
<select class="form-control" ng-model="projectName" name="projectName" id="projectName">
<option ng-repeat="project in projects | filter: filterKey">{{project.name}}</option>
</select>
</div>
<div class="col-sm-3">
<input type="text" class="form-control" name="filterKey" ng-model="filterKey" id="filterKey" placeholder="项目过滤关键词">
</div>
</div>
<div class="form-group">
<label for="id" class="col-sm-2 control-label">项目编号</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="id" ng-model="tmpProject.id" id="id">
</div>
</div>
<div class="form-group">
<label for="description" class="col-sm-2 control-label">项目概要</label>
<div class="col-sm-8">
<textarea class="form-control" name="description" rows="5" cols="100" id="description" ng-model="tmpProject.description"></textarea>
</div>
</div>
<div class="form-group">
<label for="parent" class="col-sm-2 control-label">隶属父项目</label>
<div class="col-sm-5">
<select class="form-control" ng-disabled="parentReadonly" ng-model="tmpProject.parent" name="parent" id="parent">
<option value="">无</option>
<option ng-repeat="project in parentProjects">{{project.name}}</option>
</select>
</div>
<div class="col-sm-3" ng-show="parentReadonly">
<button class="btn btn-default btn-block" ng-click="editParent()">修改父项目</button>
</div>
<div class="col-sm-3" ng-hide="parentReadonly">
<input type="text" class="form-control" name="filterParentKey" ng-model="filterParentKey" id="filterParentKey" placeholder="项目过滤关键词">
</div>
</div>
<div class="form-group">
<label for="children" class="col-sm-2 control-label">包含子项目</label>
<div class="col-sm-5">
<textarea class="form-control" readonly name="children" rows="5" cols="100" id="children">{{tmpProject.children.join('\n')}}</textarea>
</div>
<div class="col-sm-3">
<!-- 用于打开模式对话框 -->
<button type="button" class="btn btn-default btn-block" data-toggle="modal" data-target="#projectList">
修改子项目
<span class="caret"></span>
</button>
</div>
</div>
<!-- 选择子项目模式对话框 -->
<div class="modal fade" id="projectList" tabindex="-1" role="dialog" aria-labelledby="projectListLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" ng-click="cancelSelection()" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<div class="col-sm-6 col-sm-offset-2 text-center" id="projectListLabel">
<h4><strong>项目列表</strong></h4>
</div>
<div class="col-sm-3">
<input type="text" class="form-control" ng-model="childrenFilterKey" placeholder="项目过滤关键词">
</div>
<div><br></div>
</div>
<div class="modal-body">
<div class="col-sm-4" ng-repeat="project in projectsRaw | filter: childrenFilterKey">
<label><input type="checkbox" ng-model="childrenProject[project.name]"> {{project.name}}</label>
</div>
</div>
<div class="modal-footer">
<div class="col-sm-2 col-sm-offset-8">
<button type="button" class="btn btn-success btn-block" data-dismiss="modal" ng-click="selectChildren()">确 定</button>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary btn-block" data-dismiss="modal" ng-click="cancelSelection()">取 消</button>
</div>
</div>
</div>
</div>
</div>
<!-- 子项目模式对话框结束 -->
<!--
<div class="form-group">
<label class="col-sm-2 control-label">项目合同</label>
<div class="col-sm-9">
<div class="panel panel-default">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>序号</th>
<th>合同名称</th>
<th>原件存放位置</th>
<th>编辑</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="contract in currentProject().contract">
<td>{{$index}}</td>
<td>{{tmpProject.contract.name}}</td>
<td>{{tmpProject.contract.store}}</td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
<tr>
<td> --</td>
<td></td>
<td></td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">项目文件</label>
<div class="col-sm-9">
<div class="panel panel-default">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>序号</th>
<th>文件名称</th>
<th>原件存放位置</th>
<th>编辑</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="file in currentProject().file">
<td>{{$index}}</td>
<td>{{tmpProject.file.name}}</td>
<td>{{tmpProject.file.store}}</td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
<tr>
<td> --</td>
<td></td>
<td></td>
<td>
<span ng-click="modify($event)" class="glyphicon glyphicon-pencil"></span>
<span ng-click="confirm($event)" class="glyphicon glyphicon-ok"></span>
<span ng-click="remove($event)" class="glyphicon glyphicon-remove"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
-->
</form>
<div class="col-sm-12">
<div class="col-sm-3 col-sm-offset-3">
<button type="button" class="btn btn-success btn-block" data-dismiss="modal" ng-click="confirmModify()">确认修改</button>
</div>
<div class="col-sm-3">
<button type="button" class="btn btn-primary btn-block" data-dismiss="modal" ng-click="cancelModify()">取消修改</button>
</div>
</div>
<div class="col-md-8 col-md-offset-2" ng-show="message">
<div ng-class="msgClass" class="alert text-center" role="alert">
<strong >{{message}}</strong>
</div>
</div>
<div><br></div>
</div> | lszhu/dataManager | app/partials/search/queryProjectDetail.html | HTML | mit | 7,951 | 39.389474 | 180 | 0.536817 | false |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cShART
{
public class ARTFlystick : ARTObject
{
private bool visible;
private int numberOfButtons;
private int numberOfControllers;
private int buttonStates;
private float[] controllerStates;
public static ARTFlystick Empty()
{
return new ARTFlystick(-1, false, 0, 0, 0, new float[0], ARTPoint.Empty(), ARTMatrix.Empty());
}
public ARTFlystick(int id, bool visible, int numberOfButtons, int buttonStates, int numberOfControllers, float[] controllerStates, ARTPoint position, ARTMatrix matrix) : base(id, position, matrix)
{
this.visible = visible;
this.numberOfButtons = numberOfButtons;
this.numberOfControllers = numberOfControllers;
this.buttonStates = buttonStates;
this.controllerStates = controllerStates;
}
public bool isVisible()
{
return this.visible;
}
public int getNumberOfButtons()
{
return this.numberOfButtons;
}
public int getNumberOfControllers()
{
return this.numberOfControllers;
}
public int getButtonStates()
{
return this.buttonStates;
}
/// <summary>
/// This Method translates the button states integer into actual english for better handling.
/// (aka tells you which button is currently pushed.) Useful for debugging.
/// </summary>
/// <returns>Returns a string containing names of pushed buttons</returns>
public String getPushedButtonsByName()
{
//Byte binBStates = Convert.ToByte(buttonStates);
// BitArray BA = new BitArray(binBStates);
//int[] StatesArray = new int[]{buttonStates};
//Array.Reverse(StatesArray);
BitArray binBStates = new BitArray(new int[]{buttonStates});
String output = "";
//byte[] binBStates = BitConverter.GetBytes(buttonStates);
if (binBStates[3])
{
output = output + "LeftButton";
}
if (binBStates[2])
{
if (!output.Equals(""))
{
output = output + "/";
}
output = output + "MiddleButton";
}
if (binBStates[1])
{
if (!output.Equals(""))
{
output = output + "/";
}
output = output + "RightButton";
}
if (binBStates[0])
{
if (!output.Equals(""))
{
output = output + "/";
}
output = output + "Trigger";
}
if (output == "")
{
output = "NothingPressed";
}
return output + " Byte: " + binBStates.ToString();
}
/// <summary>
/// This method is for further button handling of the flystick. You will receive a bit array which represents the currently pushed buttons.
/// Array value and corresponding buttons are:
/// [0] = Trigger
/// [1] = Right button
/// [2] = Middle button
/// [3] = Left button
/// </summary>
/// <returns>Returns a bit array represting currently pushed buttons</returns>
public BitArray GetStateArrayOfButtons()
{
return new BitArray(new int[]{buttonStates});
}
public float[] GetStickXYPos()
{
return this.controllerStates;
}
override protected String nameToString()
{
return "ARTFlystick";
}
protected String controllerStatesToString()
{
String res = "";
for (int i = 0; i < this.controllerStates.Length; i++)
{
res = res + this.controllerStates[i];
if (i + 1 < this.controllerStates.Length)
{
res = res + ", ";
}
}
return res;
}
override protected String extensionsToString()
{
return "isVisible: " + isVisible() + Environment.NewLine + "numberOfButtons: " + getNumberOfButtons() + ", buttonStates: " + getButtonStates() + Environment.NewLine + "numberOfControllers: " + getNumberOfControllers() + ", controllerStates: " + controllerStatesToString() + Environment.NewLine;
}
}
}
| schMarXman/cShART | ARTFlystick.cs | C# | mit | 4,744 | 31.930556 | 306 | 0.52636 | false |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>PruneCluster - Realworld 50k</title>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2.rc.2/leaflet.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2.rc.2/leaflet.js"></script>
<script src="../dist/PruneCluster.js"></script>
<link rel="stylesheet" href="examples.css"/>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map("map", {
attributionControl: false,
zoomControl: false
}).setView(new L.LatLng(59.911111, 10.752778), 15);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
detectRetina: true,
maxNativeZoom: 17
}).addTo(map);
var leafletView = new PruneClusterForLeaflet();
var size = 1000;
var markers = [];
for (var i = 0; i < size; ++i) {
var marker = new PruneCluster.Marker(59.91111 + (Math.random() - 0.5) * Math.random() * 0.00001 * size, 10.752778 + (Math.random() - 0.5) * Math.random() * 0.00002 * size);
markers.push(marker);
leafletView.RegisterMarker(marker);
}
window.setInterval(function () {
for (i = 0; i < size / 2; ++i) {
var coef = i < size / 8 ? 10 : 1;
var ll = markers[i].position;
ll.lat += (Math.random() - 0.5) * 0.00001 * coef;
ll.lng += (Math.random() - 0.5) * 0.00002 * coef;
}
leafletView.ProcessView();
}, 500);
map.addLayer(leafletView);
</script>
</body>
</html>
| SINTEF-9012/PruneCluster | examples/random.1000.html | HTML | mit | 1,726 | 29.785714 | 180 | 0.586427 | false |
using System;
using System.Text.RegularExpressions;
namespace _07_Hideout
{
class Hideout
{
static void Main()
{
string input = Console.ReadLine();
while (true)
{
string[] parameters = Console.ReadLine().Split();
string key = Regex.Escape(parameters[0]);
string pattern = @"(" + key + "{" + parameters[1] + ",})";
Regex r = new Regex(pattern);
Match match = r.Match(input);
if (match.Success)
{
Console.WriteLine("Hideout found at index {0} and it is with size {1}!", match.Index, match.Groups[0].Length);
break;
}
}
}
}
}
| nellypeneva/SoftUniProjects | 01_ProgrFundamentalsMay/32_Strings-and-Regular-Expressions-More-Exercises/07_Hideout/Hideout.cs | C# | mit | 795 | 29.5 | 130 | 0.45145 | false |
using System.ComponentModel.DataAnnotations;
namespace JezekT.AspNetCore.IdentityServer4.WebApp.Models.AccountSettingsViewModels
{
public class ConfirmEmailViewModel
{
[Display(Name = "Email", ResourceType = typeof(Resources.Models.AccountSettingsViewModels.ConfirmEmailViewModel))]
public string Email { get; set; }
}
}
| jezekt/AspNetCore | JezekT.AspNetCore.IdentityServer4.WebApp/Models/AccountSettingsViewModels/ConfirmEmailViewModel.cs | C# | mit | 354 | 31 | 122 | 0.758523 | false |
require "rails_helper"
describe "announcements/_public_announcement" do
it "renders nothing when announcements are not visible" do
allow(view).to receive(:announcement_visible?).and_return(false)
render
expect(rendered).to eq ""
end
it "renders the announcement when announcements are visible" do
announcement = create :announcement, body: "Test"
allow(view).to receive(:announcement_visible?).and_return(true)
render
expect(rendered).to match /Test/
expect(rendered).to match /#{announcement.to_cookie_key}/
expect(rendered).to match /hideAnnouncement/
end
end
| thoughtbot/paul_revere | spec/views/announcements/_public_announcement.html.erb_spec.rb | Ruby | mit | 610 | 29.5 | 68 | 0.727869 | false |
"use strict";
var i = 180; //3分固定
function count(){
if(i <= 0){
document.getElementById("output").innerHTML = "完成!";
}else{
document.getElementById("output").innerHTML = i + "s";
}
i -= 1;
}
window.onload = function(){
setInterval("count()", 1000);
}; | Shin-nosukeSaito/elctron_app | ramen.js | JavaScript | mit | 280 | 18.357143 | 58 | 0.596296 | false |
class IE
@private
def ie_config
@client = Selenium::WebDriver::Remote::Http::Default.new
@client.read_timeout = 120
@caps = Selenium::WebDriver::Remote::Capabilities.ie('ie.ensureCleanSession' => true,
:javascript_enabled => true,
:http_client => @client,
:native_events => false,
:acceptSslCerts => true)
end
@private
def set_ie_config(driver)
driver.manage.timeouts.implicit_wait = 90
driver.manage.timeouts.page_load = 120
if ENV['RESOLUTION'].nil?
driver.manage.window.size = Selenium::WebDriver::Dimension.new(1366,768)
elsif ENV['RESOLUTION'].downcase == "max"
driver.manage.window.maximize
else
res = ENV['RESOLUTION'].split('x')
driver.manage.window.size = Selenium::WebDriver::Dimension.new(res.first.to_i, res.last.to_i)
end
end
def launch_driver_ie
self.ie_config
driver = Selenium::WebDriver.for(:ie,
:desired_capabilities => @caps,
:http_client => @client)
self.set_ie_config(driver)
return driver
end
def launch_watir_ie
self.ie_config
browser = Watir::Browser.new(:ie,
:desired_capabilities => @caps,
:http_client => @client)
self.set_ie_config(browser.driver)
return browser
end
end | krupani/testnow | lib/testnow/ie.rb | Ruby | mit | 1,583 | 33.434783 | 99 | 0.521162 | false |
#include <fstream>
#include <iostream>
#include <vector>
int main(int argc, char **argv) {
std::vector<std::string> args(argv, argv + argc);
std::ofstream tty;
tty.open("/dev/tty");
if (args.size() <= 1 || (args.size() & 2) == 1) {
std::cerr << "usage: maplabel [devlocal remote]... remotedir\n";
return 1;
}
std::string curdir = args[args.size() - 1];
for (size_t i = 1; i + 1 < args.size(); i += 2) {
if (curdir.find(args[i + 1]) == 0) {
if ((curdir.size() > args[i + 1].size() &&
curdir[args[i + 1].size()] == '/') ||
curdir.size() == args[i + 1].size()) {
tty << "\033];" << args[i] + curdir.substr(args[i + 1].size())
<< "\007\n";
return 0;
}
}
}
tty << "\033];" << curdir << "\007\n";
return 0;
}
| uluyol/tools | maplabel/main.cc | C++ | mit | 804 | 25.8 | 70 | 0.486318 | false |
package com.catsprogrammer.catsfourthv;
/**
* Created by C on 2016-09-14.
*/
public class MatrixCalculator {
public static float[] getRotationMatrixFromOrientation(float[] o) {
float[] xM = new float[9];
float[] yM = new float[9];
float[] zM = new float[9];
float sinX = (float) Math.sin(o[1]);
float cosX = (float) Math.cos(o[1]);
float sinY = (float) Math.sin(o[2]);
float cosY = (float) Math.cos(o[2]);
float sinZ = (float) Math.sin(o[0]);
float cosZ = (float) Math.cos(o[0]);
// rotation about x-axis (pitch)
xM[0] = 1.0f;
xM[1] = 0.0f;
xM[2] = 0.0f;
xM[3] = 0.0f;
xM[4] = cosX;
xM[5] = sinX;
xM[6] = 0.0f;
xM[7] = -sinX;
xM[8] = cosX;
// rotation about y-axis (roll)
yM[0] = cosY;
yM[1] = 0.0f;
yM[2] = sinY;
yM[3] = 0.0f;
yM[4] = 1.0f;
yM[5] = 0.0f;
yM[6] = -sinY;
yM[7] = 0.0f;
yM[8] = cosY;
// rotation about z-axis (azimuth)
zM[0] = cosZ;
zM[1] = sinZ;
zM[2] = 0.0f;
zM[3] = -sinZ;
zM[4] = cosZ;
zM[5] = 0.0f;
zM[6] = 0.0f;
zM[7] = 0.0f;
zM[8] = 1.0f;
// rotation order is y, x, z (roll, pitch, azimuth)
float[] resultMatrix = matrixMultiplication(xM, yM);
resultMatrix = matrixMultiplication(zM, resultMatrix); //????????????????왜?????????????
return resultMatrix;
}
public static float[] matrixMultiplication(float[] A, float[] B) {
float[] result = new float[9];
result[0] = A[0] * B[0] + A[1] * B[3] + A[2] * B[6];
result[1] = A[0] * B[1] + A[1] * B[4] + A[2] * B[7];
result[2] = A[0] * B[2] + A[1] * B[5] + A[2] * B[8];
result[3] = A[3] * B[0] + A[4] * B[3] + A[5] * B[6];
result[4] = A[3] * B[1] + A[4] * B[4] + A[5] * B[7];
result[5] = A[3] * B[2] + A[4] * B[5] + A[5] * B[8];
result[6] = A[6] * B[0] + A[7] * B[3] + A[8] * B[6];
result[7] = A[6] * B[1] + A[7] * B[4] + A[8] * B[7];
result[8] = A[6] * B[2] + A[7] * B[5] + A[8] * B[8];
return result;
}
}
| CatsProject/CycleAssistantTools | mobile/src/main/java/com/catsprogrammer/catsfourthv/MatrixCalculator.java | Java | mit | 2,238 | 27.303797 | 95 | 0.428891 | false |
default_app_config = "gallery.apps.GalleryConfig"
| cdriehuys/chmvh-website | chmvh_website/gallery/__init__.py | Python | mit | 50 | 49 | 49 | 0.8 | false |
import { browser, by, element } from 'protractor';
export class Angular2Page {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
| deepak1725/django-angular4 | users/static/ngApp/angular2/e2e/app.po.ts | TypeScript | mit | 213 | 18.363636 | 52 | 0.633803 | false |
<!-- START LEFT SIDEBAR NAV-->
<?php
$role = "";
switch($this->session->userdata('ROLE_ID')){
case 1:
$role = "Administrator";
break;
case 2:
$role = "Adopting Parent";
break;
case 3:
$role = "Biological Parent/Guardian";
break;
}
?>
<aside id="left-sidebar-nav">
<ul id="slide-out" class="side-nav fixed leftside-navigation">
<li class="user-details cyan darken-2">
<div class="row">
<div class="col col s4 m4 l4">
<img src="<?=base_url();?>assets/images/profile.png" alt="" class="circle responsive-img valign profile-image">
</div>
<div class="col col s8 m8 l8">
<a class="btn-flat dropdown-button waves-effect waves-light white-text profile-btn" href="#" data-activates="profile-dropdown"><?=$this->session->userdata('NAME');?></a>
<p class="user-roal"><?=$role;?></p>
</div>
</div>
</li>
<li class="bold"><a href="<?=base_url();?>front/adopting_parent" class="waves-effect waves-cyan"><i class="mdi-action-dashboard"></i> Dashboard</a>
</li>
<li class="bold"><a href="<?=base_url();?>front/personal_details" class="waves-effect waves-cyan"><i class="mdi-content-content-paste"></i> Personal Details</a>
</li>
<li class="bold"><a href="<?=base_url();?>front/search_child" class="waves-effect waves-cyan"><i class="mdi-action-search"></i> Search Child</a>
</li>
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold"><a class="collapsible-header waves-effect waves-cyan"><i class="mdi-communication-chat"></i> Meetings</a>
<div class="collapsible-body">
<ul>
<li><a href="<?=base_url();?>front/search_child">Setup a Meeting</a>
</li>
<li><a href="<?=base_url();?>front/past_meetings">Past Meetings</a>
</li>
</ul>
</div>
</li>
<li class="bold"><a class="collapsible-header waves-effect waves-cyan"><i class="mdi-editor-vertical-align-bottom"></i> Adoption</a>
<div class="collapsible-body">
<ul>
<li><a href="<?=base_url();?>front/adoption">Create Request</a>
</li>
<li><a href="<?=base_url();?>front/past_adoptions">Past Requests</a>
</li>
</ul>
</div>
</li>
</ul>
</li>
</ul>
</aside>
<!-- END LEFT SIDEBAR NAV--> | ushangt/FosterCare | application/views/front/adopting_parent/menu.php | PHP | mit | 2,980 | 47.868852 | 189 | 0.458389 | false |
package es.sandbox.ui.messages.argument;
import es.sandbox.ui.messages.resolver.MessageResolver;
import es.sandbox.ui.messages.resolver.Resolvable;
import java.util.ArrayList;
import java.util.List;
class LinkArgument implements Link, Resolvable {
private static final String LINK_FORMAT = "<a href=\"%s\" title=\"%s\" class=\"%s\">%s</a>";
private static final String LINK_FORMAT_WITHOUT_CSS_CLASS = "<a href=\"%s\" title=\"%s\">%s</a>";
private String url;
private Text text;
private String cssClass;
public LinkArgument(String url) {
url(url);
}
private void assertThatUrlIsValid(String url) {
if (url == null) {
throw new NullPointerException("Link url can't be null");
}
if (url.trim().isEmpty()) {
throw new IllegalArgumentException("Link url can't be empty");
}
}
@Override
public LinkArgument url(String url) {
assertThatUrlIsValid(url);
this.url = url;
return this;
}
@Override
public LinkArgument title(Text text) {
this.text = text;
return this;
}
@Override
public LinkArgument title(String code, Object... arguments) {
this.text = new TextArgument(code, arguments);
return this;
}
@Override
public LinkArgument cssClass(String cssClass) {
this.cssClass = trimToNull(cssClass);
return this;
}
private static final String trimToNull(final String theString) {
if (theString == null) {
return null;
}
final String trimmed = theString.trim();
return trimmed.isEmpty() ? null : trimmed;
}
@Override
public String resolve(MessageResolver messageResolver) {
MessageResolver.assertThatIsNotNull(messageResolver);
return String.format(linkFormat(), arguments(messageResolver));
}
private String linkFormat() {
return this.cssClass == null ? LINK_FORMAT_WITHOUT_CSS_CLASS : LINK_FORMAT;
}
private Object[] arguments(MessageResolver messageResolver) {
final List<Object> arguments = new ArrayList<Object>();
final String title = resolveTitle(messageResolver);
arguments.add(this.url);
arguments.add(title == null ? this.url : title);
if (this.cssClass != null) {
arguments.add(this.cssClass);
}
arguments.add(title == null ? this.url : title);
return arguments.toArray(new Object[0]);
}
private String resolveTitle(MessageResolver messageResolver) {
return trimToNull(this.text == null ? null : ((Resolvable) this.text).resolve(messageResolver));
}
@Override
public String toString() {
return String.format("link{%s, %s, %s}", this.url, this.text, this.cssClass);
}
}
| jeslopalo/flash-messages | flash-messages-core/src/main/java/es/sandbox/ui/messages/argument/LinkArgument.java | Java | mit | 2,828 | 27 | 104 | 0.630481 | false |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, sys
import tempfile
from winsys._compat import unittest
import uuid
import win32file
from winsys.tests.test_fs import utils
from winsys import fs
class TestFS (unittest.TestCase):
filenames = ["%d" % i for i in range (5)]
def setUp (self):
utils.mktemp ()
for filename in self.filenames:
with open (os.path.join (utils.TEST_ROOT, filename), "w"):
pass
def tearDown (self):
utils.rmtemp ()
def test_glob (self):
import glob
pattern = os.path.join (utils.TEST_ROOT, "*")
self.assertEquals (list (fs.glob (pattern)), glob.glob (pattern))
def test_listdir (self):
import os
fs_version = list (fs.listdir (utils.TEST_ROOT))
os_version = os.listdir (utils.TEST_ROOT)
self.assertEquals (fs_version, os_version, "%s differs from %s" % (fs_version, os_version))
#
# All the other module-level functions are hand-offs
# to the corresponding Entry methods.
#
if __name__ == "__main__":
unittest.main ()
if sys.stdout.isatty (): raw_input ("Press enter...")
| operepo/ope | laptop_credential/winsys/tests/test_fs/test_fs.py | Python | mit | 1,100 | 23.444444 | 95 | 0.662727 | false |
/*
Copyright 2011 Google Inc.
Modifications Copyright (c) 2014 Simon Zimmermann
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 blob
import (
"io"
)
// Fetcher is the minimal interface for retrieving a blob from storage.
// The full storage interface is blobserver.Storage.
type Fetcher interface {
// Fetch returns a blob. If the blob is not found then
// os.ErrNotExist should be returned for the error (not a wrapped
// error with a ErrNotExist inside)
//
// The caller should close blob.
Fetch(Ref) (blob io.ReadCloser, size uint32, err error)
}
| simonz05/blobserver | blob/fetcher.go | GO | mit | 1,050 | 30.818182 | 72 | 0.76381 | false |
module HTMLValidationHelpers
def bad_html
'<html><title>the title<title></head><body><p>blah blah</body></html>'
end
def good_html
html_5_doctype + '<html><title>the title</title></head><body><p>a paragraph</p></body></html>'
end
def dtd
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
end
def html_5_doctype
'<!DOCTYPE html>'
end
def warning_html
html_5_doctype + '<html><title proprietary="1">h</title></head><body><p>a para</p></body></html>'
end
end
| ericbeland/html_validation | spec/helpers/html_validation_helpers.rb | Ruby | mit | 576 | 24.043478 | 127 | 0.644097 | false |
using System.Xml.Serialization;
namespace ImgLab
{
[XmlRoot("source")]
public sealed class Source
{
[XmlElement("database")]
public string Database
{
get;
set;
}
}
} | takuya-takeuchi/DlibDotNet | tools/ImgLab/Source.cs | C# | mit | 263 | 11.842105 | 32 | 0.467433 | false |
package fr.adrienbrault.idea.symfony2plugin.tests;
import fr.adrienbrault.idea.symfony2plugin.ServiceMap;
import fr.adrienbrault.idea.symfony2plugin.ServiceMapParser;
import org.junit.Test;
import org.junit.Assert;
import java.io.ByteArrayInputStream;
import java.util.Map;
/**
* @author Adrien Brault <adrien.brault@gmail.com>
*/
public class ServiceMapParserTest extends Assert {
@Test
public void testParse() throws Exception {
ServiceMapParser serviceMapParser = new ServiceMapParser();
String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<container>" +
"<service id=\"adrienbrault\" class=\"AdrienBrault\\Awesome\"/>" +
"<service id=\"secret\" class=\"AdrienBrault\\Secret\" public=\"false\"/>" +
"</container>";
ServiceMap serviceMap = serviceMapParser.parse(new ByteArrayInputStream(xmlString.getBytes()));
assertTrue(serviceMap instanceof ServiceMap);
assertEquals("\\AdrienBrault\\Awesome", serviceMap.getMap().get("adrienbrault"));
assertEquals("\\AdrienBrault\\Awesome", serviceMap.getPublicMap().get("adrienbrault"));
assertEquals("\\AdrienBrault\\Secret", serviceMap.getMap().get("secret"));
assertNull(serviceMap.getPublicMap().get("secret"));
assertEquals("\\Symfony\\Component\\HttpFoundation\\Request", serviceMap.getMap().get("request"));
assertEquals("\\Symfony\\Component\\HttpFoundation\\Request", serviceMap.getPublicMap().get("request"));
assertEquals("\\Symfony\\Component\\DependencyInjection\\ContainerInterface", serviceMap.getMap().get("service_container"));
assertEquals("\\Symfony\\Component\\DependencyInjection\\ContainerInterface", serviceMap.getPublicMap().get("service_container"));
assertEquals("\\Symfony\\Component\\HttpKernel\\KernelInterface", serviceMap.getMap().get("kernel"));
assertEquals("\\Symfony\\Component\\HttpKernel\\KernelInterface", serviceMap.getPublicMap().get("kernel"));
}
}
| Ocramius/idea-php-symfony2-plugin | tests/fr/adrienbrault/idea/symfony2plugin/tests/ServiceMapParserTest.java | Java | mit | 2,039 | 46.418605 | 138 | 0.699362 | false |
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/reporters'
Minitest::Reporters.use!
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
include ApplicationHelper
# Add more helper methods to be used by all tests here...
# Returns true, if user is logged in.
def is_logged_in?
!session[:user_id].nil?
end
# Logs in test user.
def log_in_as(user, options={})
password = options[:password] || 'password'
remember_me = options[:remember_me] || '1'
if integration_test?
post login_path, session: { email: user.email, password: password, remember_me: remember_me }
else
session[:user_id] = user.id
end
end
# Returns true, if integration test is used.
def integration_test?
# post_via_redirect is accessible only in integration test.
defined?(post_via_redirect)
end
end
| stepnivlk/stepnivlk | test/test_helper.rb | Ruby | mit | 999 | 26.75 | 99 | 0.684685 | false |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int main () {
int n;
while(scanf("%d", &n) && n) {
bitset<32> bs,a,b;
bs = n;
int cont = 0;
for(int i = 0; i < 32; i++) {
if(bs.test(i)) {
if(cont%2) b.set(i);
else a.set(i);
cont++;
}
}
//int x = a;
printf("%u %u\n", a.to_ulong(), b.to_ulong());
}
return 0;
}
| matheuscarius/competitive-programming | uva/11933-2.cpp | C++ | mit | 491 | 15.366667 | 50 | 0.478615 | false |
#ifndef BARBERPOLE_H
#define BARBERPOLE_H
#include "iLampAnimation.h"
#include "Lamp.h"
class BarberPole : public iLampAnimation
{
public:
BarberPole(Lamp* lamp);
int itterate();
void reset();
protected:
int cur_led = 0;
int offset = 0;
uint8_t hue = 0;
uint8_t fps = 60;
private:
};
#endif // BarberPole_H
| lienmeat/arduino-lamp | BarberPole.h | C | mit | 344 | 15.380952 | 40 | 0.639535 | false |
describe Certificate do
it { is_expected.to have_property :id }
it { is_expected.to have_property :identifier }
it { is_expected.to have_property :image_key }
it { is_expected.to have_property :certificate_key }
it { is_expected.to have_property :created_at }
it { is_expected.to belong_to :delivery }
it { is_expected.to belong_to :student }
describe 'Creating a Certificate' do
before do
course = Course.create(title: 'Learn To Code 101', description: 'Introduction to programming')
delivery = course.deliveries.create(start_date: '2015-01-01')
student = delivery.students.create(full_name: 'Thomas Ochman', email: 'thomas@random.com')
@certificate = student.certificates.create(created_at: DateTime.now, delivery: delivery)
end
after { FileUtils.rm_rf Dir['pdf/test/**/*.pdf'] }
it 'adds an identifier after create' do
expect(@certificate.identifier.size).to eq 64
end
it 'has a Student name' do
expect(@certificate.student.full_name).to eq 'Thomas Ochman'
end
it 'has a Course name' do
expect(@certificate.delivery.course.title).to eq 'Learn To Code 101'
end
it 'has a Course delivery date' do
expect(@certificate.delivery.start_date.to_s).to eq '2015-01-01'
end
describe 'S3' do
before { CertificateGenerator.generate(@certificate) }
it 'can be fetched by #image_url' do
binding.pry
expect(@certificate.image_url).to eq 'https://certz.s3.amazonaws.com/pdf/test/thomas_ochman_2015-01-01.jpg'
end
it 'can be fetched by #certificate_url' do
expect(@certificate.certificate_url).to eq 'https://certz.s3.amazonaws.com/pdf/test/thomas_ochman_2015-01-01.pdf'
end
it 'returns #bitly_lookup' do
expect(@certificate.bitly_lookup).to eq "http://localhost:9292/verify/#{@certificate.identifier}"
end
it 'returns #stats' do
expect(@certificate.stats).to eq 0
end
end
end
end
| CraftAcademy/workshop | spec/certificate_spec.rb | Ruby | mit | 1,999 | 29.287879 | 121 | 0.669835 | false |
<?php
namespace OpenRailData\NetworkRail\Services\Stomp\Topics\Rtppm\Entities\Performance;
/**
* Class Performance
*
* @package OpenRailData\NetworkRail\Services\Stomp\Topics\Rtppm\Entities\Performance
*/
class Performance
{
/**
* @var int
*/
private $totalCount;
/**
* @var int
*/
private $onTimeCount;
/**
* @var int
*/
private $lateCount;
/**
* @var int
*/
private $cancelledOrVeryLateCount;
/**
* @var Ppm
*/
private $ppm;
/**
* @var RollingPpm
*/
private $rollingPpm;
public function __construct($data)
{
if (property_exists($data, "Total"))
$this->setTotalCount($data->Total);
if (property_exists($data, "OnTime"))
$this->setOnTimeCount($data->OnTime);
if (property_exists($data, "Late"))
$this->setLateCount($data->Late);
if (property_exists($data, "CancelVeryLate"))
$this->setCancelledOrVeryLateCount($data->CancelVeryLate);
if (property_exists($data, "PPM"))
$this->setPpm(new Ppm($data->PPM));
if (property_exists($data, "RollingPPM"))
$this->setRollingPpm(new RollingPpm($data->RollingPPM));
}
/**
* @return int
*/
public function getTotalCount()
{
return $this->totalCount;
}
/**
* @param int $totalCount
*
* @return $this;
*/
public function setTotalCount($totalCount)
{
$this->totalCount = (int)$totalCount;
return $this;
}
/**
* @return int
*/
public function getOnTimeCount()
{
return $this->onTimeCount;
}
/**
* @param int $onTimeCount
*
* @return $this;
*/
public function setOnTimeCount($onTimeCount)
{
$this->onTimeCount = (int)$onTimeCount;
return $this;
}
/**
* @return int
*/
public function getLateCount()
{
return $this->lateCount;
}
/**
* @param int $lateCount
*
* @return $this;
*/
public function setLateCount($lateCount)
{
$this->lateCount = (int)$lateCount;
return $this;
}
/**
* @return int
*/
public function getCancelledOrVeryLateCount()
{
return $this->cancelledOrVeryLateCount;
}
/**
* @param int $cancelledOrVeryLateCount
*
* @return $this;
*/
public function setCancelledOrVeryLateCount($cancelledOrVeryLateCount)
{
$this->cancelledOrVeryLateCount = (int)$cancelledOrVeryLateCount;
return $this;
}
/**
* @return Ppm
*/
public function getPpm()
{
return $this->ppm;
}
/**
* @param Ppm $ppm
*
* @return $this
*/
public function setPpm(Ppm $ppm)
{
$this->ppm = $ppm;
return $this;
}
/**
* @return RollingPpm
*/
public function getRollingPpm()
{
return $this->rollingPpm;
}
/**
* @param RollingPpm $rollingPpm
*
* @return $this
*/
public function setRollingPpm(RollingPpm $rollingPpm)
{
$this->rollingPpm = $rollingPpm;
return $this;
}
} | neilmcgibbon/php-open-rail-data | src/NetworkRail/Services/Stomp/Topics/Rtppm/Entities/Performance/Performance.php | PHP | mit | 3,258 | 17.308989 | 85 | 0.532842 | false |
package gitnotify
import (
"errors"
"fmt"
"html/template"
"net/http"
"os"
"sort"
"github.com/gorilla/mux"
"github.com/markbates/goth"
"github.com/markbates/goth/gothic"
"github.com/markbates/goth/providers/github"
"github.com/markbates/goth/providers/gitlab"
"github.com/sairam/kinli"
)
// Authentication data/$provider/$user/$settingsFile
type Authentication struct {
Provider string `yaml:"provider"` // github/gitlab
Name string `yaml:"name"` // name of the person addressing to
Email string `yaml:"email"` // email that we will send to
UserName string `yaml:"username"` // username for identification
Token string `yaml:"token"` // used to query the provider
}
// UserInfo provides provider/username
func (userInfo *Authentication) UserInfo() string {
return fmt.Sprintf("%s/%s", userInfo.Provider, userInfo.UserName)
}
func (userInfo *Authentication) save() {
conf := new(Setting)
os.MkdirAll(userInfo.getConfigDir(), 0700)
conf.load(userInfo.getConfigFile())
conf.Auth = userInfo
conf.save(userInfo.getConfigFile())
}
func (userInfo *Authentication) getConfigDir() string {
if userInfo.Provider == "" {
return ""
}
return fmt.Sprintf("data/%s/%s", userInfo.Provider, userInfo.UserName)
}
func (userInfo *Authentication) getConfigFile() string {
if userInfo.Provider == "" {
return ""
}
return fmt.Sprintf("%s/%s", userInfo.getConfigDir(), config.SettingsFile)
}
func preInitAuth() {
// ProviderNames is the map of key/value providers configured
config.Providers = make(map[string]string)
var providers []goth.Provider
if provider := configureGithub(); provider != nil {
providers = append(providers, provider)
}
if provider := configureGitlab(); provider != nil {
providers = append(providers, provider)
}
goth.UseProviders(providers...)
}
func initAuth(p *mux.Router) {
p.HandleFunc("/{provider}/callback", authProviderCallbackHandler).Methods("GET")
p.HandleFunc("/{provider}", authProviderHandler).Methods("GET")
p.HandleFunc("/", authListHandler).Methods("GET")
}
func configureGithub() goth.Provider {
if config.GithubURLEndPoint != "" && config.GithubAPIEndPoint != "" {
if os.Getenv("GITHUB_KEY") == "" || os.Getenv("GITHUB_SECRET") == "" {
panic("Missing Configuration: Github Authentication is not set!")
}
github.AuthURL = config.GithubURLEndPoint + "login/oauth/authorize"
github.TokenURL = config.GithubURLEndPoint + "login/oauth/access_token"
github.ProfileURL = config.GithubAPIEndPoint + "user"
config.Providers[GithubProvider] = "Github"
// for github, add scope: "repo:status" to access private repositories
return github.New(os.Getenv("GITHUB_KEY"), os.Getenv("GITHUB_SECRET"), config.websiteURL()+"/auth/github/callback", "user:email")
}
return nil
}
func configureGitlab() goth.Provider {
if config.GitlabURLEndPoint != "" && config.GitlabAPIEndPoint != "" {
if os.Getenv("GITLAB_KEY") == "" || os.Getenv("GITLAB_SECRET") == "" {
panic("Missing Configuration: Github Authentication is not set!")
}
gitlab.AuthURL = config.GitlabURLEndPoint + "oauth/authorize"
gitlab.TokenURL = config.GitlabURLEndPoint + "oauth/token"
gitlab.ProfileURL = config.GitlabAPIEndPoint + "user"
config.Providers[GitlabProvider] = "Gitlab"
// gitlab does not have any scopes, you get full access to the user's account
return gitlab.New(os.Getenv("GITLAB_KEY"), os.Getenv("GITLAB_SECRET"), config.websiteURL()+"/auth/gitlab/callback")
}
return nil
}
func authListHandler(res http.ResponseWriter, req *http.Request) {
var keys []string
for k := range config.Providers {
keys = append(keys, k)
}
sort.Strings(keys)
providerIndex := &ProviderIndex{Providers: keys, ProvidersMap: config.Providers}
t, _ := template.New("foo").Parse(indexTemplate)
t.Execute(res, providerIndex)
}
func authProviderHandler(res http.ResponseWriter, req *http.Request) {
hc := &kinli.HttpContext{W: res, R: req}
if isAuthed(hc) {
text := "User is already logged in"
kinli.DisplayText(hc, res, text)
} else {
statCount("auth.start")
gothic.BeginAuthHandler(res, req)
}
}
func authProviderCallbackHandler(res http.ResponseWriter, req *http.Request) {
statCount("auth.complete")
user, err := gothic.CompleteUserAuth(res, req)
if err != nil {
fmt.Fprintln(res, err)
return
}
authType, _ := getProviderName(req)
auth := &Authentication{
Provider: authType,
UserName: user.NickName,
Name: user.Name,
Email: user.Email,
Token: user.AccessToken,
}
auth.save()
hc := &kinli.HttpContext{W: res, R: req}
loginTheUser(hc, auth, authType)
http.Redirect(res, req, kinli.HomePathAuthed, 302)
}
// ProviderIndex is used for setting up the providers
type ProviderIndex struct {
Providers []string
ProvidersMap map[string]string
}
// See gothic/gothic.go: GetProviderName function
// Overridden since we use mux
func getProviderName(req *http.Request) (string, error) {
vars := mux.Vars(req)
provider := vars["provider"]
if provider == "" {
return provider, errors.New("you must select a provider")
}
return provider, nil
}
var indexTemplate = `{{range $key,$value:=.Providers}}
<p><a href="/auth/{{$value}}">Log in with {{index $.ProvidersMap $value}}</a></p>
{{end}}`
| sairam/gitnotify | gitnotify/auth.go | GO | mit | 5,241 | 28.610169 | 131 | 0.710933 | false |
import numpy as np
import matplotlib.pylab as plt
from numba import cuda, uint8, int32, uint32, jit
from timeit import default_timer as timer
@cuda.jit('void(uint8[:], int32, int32[:], int32[:])')
def lbp_kernel(input, neighborhood, powers, h):
i = cuda.grid(1)
r = 0
if i < input.shape[0] - 2 * neighborhood:
i += neighborhood
for j in range(i - neighborhood, i):
if input[j] >= input[i]:
r += powers[j - i + neighborhood]
for j in range(i + 1, i + neighborhood + 1):
if input[j] >= input[i]:
r += powers[j - i + neighborhood - 1]
cuda.atomic.add(h, r, 1)
def extract_1dlbp_gpu(input, neighborhood, d_powers):
maxThread = 512
blockDim = maxThread
d_input = cuda.to_device(input)
hist = np.zeros(2 ** (2 * neighborhood), dtype='int32')
gridDim = (len(input) - 2 * neighborhood + blockDim) / blockDim
d_hist = cuda.to_device(hist)
lbp_kernel[gridDim, blockDim](d_input, neighborhood, d_powers, d_hist)
d_hist.to_host()
return hist
def extract_1dlbp_gpu_debug(input, neighborhood, powers, res):
maxThread = 512
blockDim = maxThread
gridDim = (len(input) - 2 * neighborhood + blockDim) / blockDim
for block in range(0, gridDim):
for thread in range(0, blockDim):
r = 0
i = blockDim * block + thread
if i < input.shape[0] - 2 * neighborhood:
i += neighborhood
for j in range(i - neighborhood, i):
if input[j] >= input[i]:
r += powers[j - i + neighborhood]
for j in range(i + 1, i + neighborhood + 1):
if input[j] >= input[i]:
r += powers[j - i + neighborhood - 1]
res[r] += 1
return res
@jit("int32[:](uint8[:], int64, int32[:], int32[:])", nopython=True)
def extract_1dlbp_cpu_jit(input, neighborhood, powers, res):
maxThread = 512
blockDim = maxThread
gridDim = (len(input) - 2 * neighborhood + blockDim) / blockDim
for block in range(0, gridDim):
for thread in range(0, blockDim):
r = 0
i = blockDim * block + thread
if i < input.shape[0] - 2 * neighborhood:
i += neighborhood
for j in range(i - neighborhood, i):
if input[j] >= input[i]:
r += powers[j - i + neighborhood]
for j in range(i + 1, i + neighborhood + 1):
if input[j] >= input[i]:
r += powers[j - i + neighborhood - 1]
res[r] += 1
return res
def extract_1dlbp_cpu(input, neighborhood, p):
"""
Extract the 1d lbp pattern on CPU
"""
res = np.zeros(1 << (2 * neighborhood))
for i in range(neighborhood, len(input) - neighborhood):
left = input[i - neighborhood : i]
right = input[i + 1 : i + neighborhood + 1]
both = np.r_[left, right]
res[np.sum(p [both >= input[i]])] += 1
return res
X = np.arange(3, 7)
X = 10 ** X
neighborhood = 4
cpu_times = np.zeros(X.shape[0])
cpu_times_simple = cpu_times.copy()
cpu_times_jit = cpu_times.copy()
gpu_times = np.zeros(X.shape[0])
p = 1 << np.array(range(0, 2 * neighborhood), dtype='int32')
d_powers = cuda.to_device(p)
for i, x in enumerate(X):
input = np.random.randint(0, 256, size = x).astype(np.uint8)
print "Length: {0}".format(x)
print "--------------"
start = timer()
h_cpu = extract_1dlbp_cpu(input, neighborhood, p)
cpu_times[i] = timer() - start
print "Finished on CPU: time: {0:3.5f}s".format(cpu_times[i])
res = np.zeros(1 << (2 * neighborhood), dtype='int32')
start = timer()
h_cpu_simple = extract_1dlbp_gpu_debug(input, neighborhood, p, res)
cpu_times_simple[i] = timer() - start
print "Finished on CPU (simple): time: {0:3.5f}s".format(cpu_times_simple[i])
res = np.zeros(1 << (2 * neighborhood), dtype='int32')
start = timer()
h_cpu_jit = extract_1dlbp_cpu_jit(input, neighborhood, p, res)
cpu_times_jit[i] = timer() - start
print "Finished on CPU (numba: jit): time: {0:3.5f}s".format(cpu_times_jit[i])
start = timer()
h_gpu = extract_1dlbp_gpu(input, neighborhood, d_powers)
gpu_times[i] = timer() - start
print "Finished on GPU: time: {0:3.5f}s".format(gpu_times[i])
print "All h_cpu == h_gpu: ", (h_cpu_jit == h_gpu).all() and (h_cpu_simple == h_cpu_jit).all() and (h_cpu == h_cpu_jit).all()
print ''
f = plt.figure(figsize=(10, 5))
plt.plot(X, cpu_times, label = "CPU")
plt.plot(X, cpu_times_simple, label = "CPU non-vectorized")
plt.plot(X, cpu_times_jit, label = "CPU jit")
plt.plot(X, gpu_times, label = "GPU")
plt.yscale('log')
plt.xscale('log')
plt.xlabel('input length')
plt.ylabel('time, sec')
plt.legend()
plt.show()
| fierval/KaggleMalware | Learning/1dlbp_tests.py | Python | mit | 4,911 | 32.182432 | 129 | 0.561189 | false |
package me.F_o_F_1092.WeatherVote.PluginManager.Spigot;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import me.F_o_F_1092.WeatherVote.Options;
import me.F_o_F_1092.WeatherVote.PluginManager.Command;
import me.F_o_F_1092.WeatherVote.PluginManager.CommandListener;
import me.F_o_F_1092.WeatherVote.PluginManager.HelpMessage;
public class HelpPageListener extends me.F_o_F_1092.WeatherVote.PluginManager.HelpPageListener {
public static void sendMessage(Player p, int page) {
List<HelpMessage> personalHelpMessages = getAllPersonalHelpMessages(p);
List<HelpMessage> personalHelpPageMessages = getHelpPageMessages(p, personalHelpMessages, page);
p.sendMessage("");
JSONMessageListener.send(p, getNavBar(personalHelpMessages, personalHelpPageMessages, page));
p.sendMessage("");
for (HelpMessage hm : personalHelpPageMessages) {
JSONMessageListener.send(p, hm.getJsonString());
}
p.sendMessage("");
if (getMaxPlayerPages(personalHelpMessages) != 1) {
p.sendMessage(Options.msg.get("helpTextGui.4").replace("[PAGE]", (page + 1) + ""));
}
JSONMessageListener.send(p, getNavBar(personalHelpMessages, personalHelpPageMessages, page));
p.sendMessage("");
}
public static void sendNormalMessage(CommandSender cs) {
cs.sendMessage(Options.msg.get("color.1") + "§m----------------§r " + pluginNametag + Options.msg.get("color.1") + "§m----------------");
cs.sendMessage("");
for (Command command : CommandListener.getAllCommands()) {
cs.sendMessage(command.getHelpMessage().getNormalString());
}
cs.sendMessage("");
cs.sendMessage(Options.msg.get("color.1") + "§m----------------§r " + pluginNametag + Options.msg.get("color.1") + "§m----------------");
}
private static List<HelpMessage> getHelpPageMessages(Player p, List<HelpMessage> personalHelpMessages, int page) {
List<HelpMessage> personalHelpPageMessages = new ArrayList<HelpMessage>();
for (int i = 0; i < maxHelpMessages; i++) {
if (personalHelpMessages.size() >= (page * maxHelpMessages + i + 1)) {
personalHelpPageMessages.add(personalHelpMessages.get(page * maxHelpMessages + i));
}
}
return personalHelpPageMessages;
}
public static int getMaxPlayerPages(Player p) {
return (int) java.lang.Math.ceil(((double)getAllPersonalHelpMessages(p).size() / (double)maxHelpMessages));
}
private static List<HelpMessage> getAllPersonalHelpMessages(Player p) {
List<HelpMessage> personalHelpMessages = new ArrayList<HelpMessage>();
for (Command command : CommandListener.getAllCommands()) {
if (command.getPermission()== null || p.hasPermission(command.getPermission())) {
personalHelpMessages.add(command.getHelpMessage());
}
}
return personalHelpMessages;
}
} | fof1092/WeatherVote | src/me/F_o_F_1092/WeatherVote/PluginManager/Spigot/HelpPageListener.java | Java | mit | 2,808 | 37.479452 | 139 | 0.724003 | false |
namespace _05_SlicingFile
{
using System;
using System.Collections.Generic;
using System.IO;
class StartUp
{
static void Main()
{
var sourceFile = @"D:\SoftUni\05-Csharp Advanced\08-EXERCISE STREAMS\Resources\sliceMe.mp4";
var destinationDirectory = @"D:\SoftUni\05-Csharp Advanced\08-EXERCISE STREAMS\HomeWorkResults\";
int parts = 5;
Slice(sourceFile, destinationDirectory, parts);
var files = new List<string>
{
"05-SlicingFile-Part-01.mp4",
"05-SlicingFile-Part-02.mp4",
"05-SlicingFile-Part-03.mp4",
"05-SlicingFile-Part-04.mp4",
"05-SlicingFile-Part-05.mp4",
};
Assemble(files, destinationDirectory);
}
static void Slice(string sourceFile, string destinationDirectory, int parts)
{
using (var reader = new FileStream(sourceFile, FileMode.Open))
{
long partSize = (long)Math.Ceiling((double)reader.Length / parts);
for (int i = 1; i <= parts; i++)
{
long currentPartSize = 0;
var fileName = $"{destinationDirectory}05-SlicingFile-Part-0{i}.mp4";
using (var writer = new FileStream(fileName, FileMode.Create))
{
var buffer = new byte[4096];
while (reader.Read(buffer, 0, buffer.Length) == 4096)
{
writer.Write(buffer, 0, buffer.Length);
currentPartSize += 4096;
if (currentPartSize >= partSize)
{
break;
}
}
}
}
}
}
static void Assemble(List<string> files, string destinationDirectory)
{
var assembledFilePath = $"{destinationDirectory}05-SlicingFile-Assembled.mp4";
using (var writer = new FileStream(assembledFilePath, FileMode.Create))
{
var buffer = new byte[4096];
for (int i = 0; i < files.Count; i++)
{
var filePath = $"{destinationDirectory}{files[i]}";
using (var reader = new FileStream(filePath, FileMode.Open))
{
while (reader.Read(buffer,0,buffer.Length) != 0)
{
writer.Write(buffer, 0, buffer.Length);
}
}
}
}
}
}
} | MrPIvanov/SoftUni | 04-Csharp Advanced/08-EXERCISE STREAMS/08-StreamsExercises/05-SlicingFile/StartUp.cs | C# | mit | 2,788 | 30.314607 | 109 | 0.457645 | false |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BeastApplication")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BeastApplication")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)] | mpenchev86/WindowsApplicationsTeamwork | WindowsPhoneApplication/BeastApplication/Properties/AssemblyInfo.cs | C# | mit | 1,052 | 35.206897 | 84 | 0.743565 | false |
#pragma once
#include "SYCL/detail/common.h"
namespace cl {
namespace sycl {
namespace detail {
using counter_t = unsigned int;
template <class T, counter_t start = 0>
class counter {
private:
static counter_t internal_count;
counter_t counter_id;
public:
counter() : counter_id(internal_count++) {}
counter(const counter& copy) : counter() {}
counter(counter&& move) noexcept : counter_id(move.counter_id) {}
counter& operator=(const counter& copy) {
counter_id = copy.counter_id;
return *this;
}
counter& operator=(counter&& move) noexcept {
return *this;
}
~counter() = default;
static counter_t get_total_count() {
return internal_count;
}
counter_t get_count_id() const {
return counter_id;
}
};
template <class T, counter_t start>
counter_t counter<T, start>::internal_count = start;
} // namespace detail
} // namespace sycl
} // namespace cl
| ProGTX/sycl-gtx | sycl-gtx/include/SYCL/detail/counter.h | C | mit | 913 | 19.288889 | 67 | 0.669222 | false |
pub const MEMORY_REGIONS_MAX: usize = 8;
| ababo/arwen | src/kernel/config.rs | Rust | mit | 41 | 40 | 40 | 0.731707 | false |
<!-- INCLUDE ucp_header.html -->
<!-- IF not PROMPT -->
<!-- INCLUDE ucp_pm_message_header.html -->
<!-- ENDIF -->
<!-- IF PROMPT -->
<h2>{L_EXPORT_AS_CSV}</h2>
<form id="viewfolder" method="post" action="{S_PM_ACTION}">
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h3>{L_OPTIONS}</h3>
<fieldset>
<dl>
<dt><label for="delimiter">{L_DELIMITER}:</label></dt>
<dd><input class="inputbox" type="text" id="delimiter" name="delimiter" value="," /></dd>
</dl>
<dl>
<dt><label for="enclosure">{L_ENCLOSURE}:</label></dt>
<dd><input class="inputbox" type="text" id="enclosure" name="enclosure" value=""" /></dd>
</dl>
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
</form>
<!-- ELSE -->
<!-- IF NUM_REMOVED -->
<div class="notice">
<p>{RULE_REMOVED_MESSAGES}</p>
</div>
<!-- ENDIF -->
<!-- IF NUM_NOT_MOVED -->
<div class="notice">
<p>{NOT_MOVED_MESSAGES}<br />{RELEASE_MESSAGE_INFO}</p>
</div>
<!-- ENDIF -->
<!-- IF .messagerow -->
<ul class="topiclist">
<li class="header">
<dl>
<dt>{L_MESSAGE}</dt>
<dd class="mark">{L_MARK}</dd>
</dl>
</li>
</ul>
<ul class="topiclist cplist pmlist">
<!-- BEGIN messagerow -->
<li class="row<!-- IF messagerow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF messagerow.PM_CLASS --> {messagerow.PM_CLASS}<!-- ENDIF -->">
<dl class="icon" style="background-image: url({messagerow.FOLDER_IMG_SRC}); background-repeat: no-repeat;">
<dt<!-- IF messagerow.PM_ICON_URL and S_PM_ICONS --> style="background-image: url({messagerow.PM_ICON_URL}); background-repeat: no-repeat;"<!-- ENDIF -->>
<!-- IF messagerow.S_PM_DELETED -->
<a href="{messagerow.U_REMOVE_PM}" class="topictitle">{L_DELETE_MESSAGE}</a><br />
<span class="error">{L_MESSAGE_REMOVED_FROM_OUTBOX}</span>
<!-- ELSE -->
<a href="{messagerow.U_VIEW_PM}" class="topictitle">{messagerow.SUBJECT}</a>
<!-- ENDIF -->
<!-- IF messagerow.S_AUTHOR_DELETED -->
<br /><em class="small">{L_PM_FROM_REMOVED_AUTHOR}</em>
<!-- ENDIF -->
<!-- IF messagerow.S_PM_REPORTED --><a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --> {messagerow.ATTACH_ICON_IMG}<br />
<!-- IF S_SHOW_RECIPIENTS -->{L_MESSAGE_TO} {messagerow.RECIPIENTS}<!-- ELSE -->{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} » {messagerow.SENT_TIME}<!-- ENDIF -->
</dt>
<!-- IF S_SHOW_RECIPIENTS --><dd class="info"><span>{L_SENT_AT}: {messagerow.SENT_TIME}</span></dd><!-- ENDIF -->
<!-- IF S_UNREAD --><dd class="info"><!-- IF messagerow.FOLDER --><a href="{messagerow.U_FOLDER}">{messagerow.FOLDER}</a><!-- ELSE -->{L_UNKNOWN_FOLDER}<!-- ENDIF --></dd><!-- ENDIF -->
<dd class="mark"><input type="checkbox" name="marked_msg_id[]" value="{messagerow.MESSAGE_ID}" /></dd>
</dl>
</li>
<!-- END messagerow -->
</ul>
<!-- ELSE -->
<p><strong>
<!-- IF S_COMPOSE_PM_VIEW and S_NO_AUTH_SEND_MESSAGE -->
<!-- IF S_USER_NEW -->{L_USER_NEW_PERMISSION_DISALLOWED}<!-- ELSE -->{L_NO_AUTH_SEND_MESSAGE}<!-- ENDIF -->
<!-- ELSE -->
{L_NO_MESSAGES}
<!-- ENDIF -->
</strong></p>
<!-- ENDIF -->
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
<fieldset class="display-actions">
<a href="#" onclick="marklist('viewfolder', 'marked_msg', true); return false;">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('viewfolder', 'marked_msg', false); return false;">{L_UNMARK_ALL}</a>
<select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" />
</fieldset>
<hr />
<ul class="linklist">
<!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
<li class="rightside pagination">
<!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES}<!-- ENDIF -->
<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
</li>
<!-- ENDIF -->
</ul>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
<fieldset class="display-options">
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
<label>{L_DISPLAY}: {S_SELECT_SORT_DAYS}</label>
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
<label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
<input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" />
</fieldset>
<!-- ENDIF -->
<!-- INCLUDE ucp_pm_message_footer.html -->
<!-- ENDIF -->
<!-- INCLUDE ucp_footer.html --> | UnliCrea/CPT | ContentPlatformsTriangle/Index/community/styles/prosilver/template/ucp_pm_viewfolder.html | HTML | mit | 4,962 | 39.680328 | 239 | 0.581419 | false |
define(['omega/entity', 'omega/core'], function (e, o) {
'use strict';
var triggerKey = function (action, e) {
o.trigger(action, {
keyCode: e.keyCode,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
altKey: e.altKey
});
};
window.onkeydown = function (e) {
triggerKey('KeyDown', e);
};
window.onkeyup = function (e) {
triggerKey('KeyUp', e);
};
// ---
return e.extend({
keyboard: {keys: {}},
init: function () {
o.bind('KeyDown', function (e) {
this.keyboard.keys[e.keyCode] = true;
this.trigger('KeyDown', e);
}, this);
o.bind('KeyUp', function (e) {
this.keyboard.keys[e.keyCode] = false;
this.trigger('KeyUp', e);
}, this);
},
isKeyDown: function (keyCode) {
return (this.keyboard.keys[keyCode]);
}
});
});
| alecsammon/OmegaJS | omega/behaviour/keyboard.js | JavaScript | mit | 897 | 19.860465 | 56 | 0.510591 | false |
package zeonClient.mods;
import java.util.Iterator;
import org.lwjgl.input.Keyboard;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.play.client.CPacketPlayerDigging;
import net.minecraft.network.play.client.CPacketPlayerDigging.Action;
import net.minecraft.network.play.client.CPacketUseEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import zeonClient.main.Category;
public class KillAura extends Mod {
private int ticks = 0;
public KillAura() {
super("KillAura", "KillAura", Keyboard.KEY_R, Category.COMBAT);
}
public void onUpdate() {
if(this.isToggled()) {
ticks++;
if(ticks >= 20 - speed()) {
ticks = 0;
mc.player.rotationYaw +=0.2F;
for(Iterator<Entity> entities = mc.world.loadedEntityList.iterator(); entities.hasNext();) {
Object object = entities.next();
if(object instanceof EntityLivingBase) {
EntityLivingBase e = (EntityLivingBase) object;
if(e instanceof EntityPlayerSP) continue;
if(mc.player.getDistanceToEntity(e) <= 7F) {
if(e.isInvisible()) {
break;
}
if(e.isEntityAlive()) {
if(mc.player.getHeldItemMainhand() != null) {
mc.player.attackTargetEntityWithCurrentItem(e);
}
if(mc.player.isActiveItemStackBlocking()) {
mc.player.connection.sendPacket(new CPacketPlayerDigging(Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), EnumFacing.UP));
}
mc.player.connection.sendPacket(new CPacketUseEntity(e));
mc.player.swingArm(EnumHand.MAIN_HAND);
break;
}
}
}
}
}
}
}
private int speed() {
return 18;
}
}
| A-D-I-T-Y-A/Zeon-Client | src/minecraft/zeonClient/mods/KillAura.java | Java | mit | 2,021 | 29.092308 | 130 | 0.662543 | false |
package com.github.lunatrius.schematica.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
class GuiSchematicMaterialsSlot extends GuiSlot {
private final Minecraft minecraft = Minecraft.getMinecraft();
private final GuiSchematicMaterials guiSchematicMaterials;
protected int selectedIndex = -1;
private final String strUnknownBlock = I18n.format("schematica.gui.unknownblock");
public GuiSchematicMaterialsSlot(GuiSchematicMaterials par1) {
super(Minecraft.getMinecraft(), par1.width, par1.height, 16, par1.height - 34, 24);
this.guiSchematicMaterials = par1;
this.selectedIndex = -1;
}
@Override
protected int getSize() {
return this.guiSchematicMaterials.blockList.size();
}
@Override
protected void elementClicked(int index, boolean par2, int par3, int par4) {
this.selectedIndex = index;
}
@Override
protected boolean isSelected(int index) {
return index == this.selectedIndex;
}
@Override
protected void drawBackground() {
}
@Override
protected void drawContainerBackground(Tessellator tessellator) {
}
@Override
protected void drawSlot(int index, int x, int y, int par4, Tessellator tessellator, int par6, int par7) {
ItemStack itemStack = this.guiSchematicMaterials.blockList.get(index);
String itemName;
String amount = Integer.toString(itemStack.stackSize);
if (itemStack.getItem() != null) {
itemName = itemStack.getItem().getItemStackDisplayName(itemStack);
} else {
itemName = this.strUnknownBlock;
}
GuiHelper.drawItemStack(this.minecraft.renderEngine, this.minecraft.fontRenderer, x, y, itemStack);
this.guiSchematicMaterials.drawString(this.minecraft.fontRenderer, itemName, x + 24, y + 6, 0xFFFFFF);
this.guiSchematicMaterials.drawString(this.minecraft.fontRenderer, amount, x + 215 - this.minecraft.fontRenderer.getStringWidth(amount), y + 6, 0xFFFFFF);
}
}
| CannibalVox/Schematica | src/main/java/com/github/lunatrius/schematica/client/gui/GuiSchematicMaterialsSlot.java | Java | mit | 2,204 | 32.907692 | 162 | 0.710526 | false |
package li.cryx.minecraft.death;
import java.util.logging.Logger;
import li.cryx.minecraft.death.i18n.ITranslator;
import li.cryx.minecraft.death.persist.AbstractPersistManager;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
public interface ISpiritHealer {
void addAltarLocation(Location loc);
Material getAltarBaseMaterial();
Material getAltarMaterial();
// FileConfiguration getConfig();
Logger getLogger();
AbstractPersistManager getPersist();
ITranslator getTranslator();
boolean isAltar(Location loc);
void restoreItems(Player player);
}
| cryxli/SpiritHealer | src/main/java/li/cryx/minecraft/death/ISpiritHealer.java | Java | mit | 609 | 18.03125 | 62 | 0.794745 | false |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* A CodeIgniter library that wraps \Firebase\JWT\JWT methods.
*/
class Jwt {
function __construct()
{
// TODO: Is this the best way to do this? (Issue #4 at psignoret/aad-sso-codeigniter.)
require_once(APPPATH . 'libraries/JWT/JWT.php');
require_once(APPPATH . 'libraries/JWT/BeforeValidException.php');
require_once(APPPATH . 'libraries/JWT/ExpiredException.php');
require_once(APPPATH . 'libraries/JWT/SignatureInvalidException.php');
}
/**
* Wrapper function for JWT::decode.
*/
public function decode($jwt, $key, $allowed_algs = array())
{
return \Firebase\JWT\JWT::decode($jwt, $key, $allowed_algs);
}
}
| psignoret/aad-sso-codeigniter | application/libraries/Jwt.php | PHP | mit | 774 | 29.96 | 94 | 0.639535 | false |
---
layout: post
title: 100 Plus
date: 2013-07-13 20:23
author: admin
comments: true
---
Hey, I just noticed that this is my 102nd entry here on Tidy Husband. I've written over 100 articles here - An anniversary of sorts and when you think about it, it only took me about a year. I've written 55,000 words here. That's a novel's length.
Meanwhile, in the USA...
The Dog and I have been busy: First up, we weeded the garden. Not the best job I know, but better than <a href="http://tidyhusband.com/i-a-door-you/">before</a> and there's lots of time to make another attempt. I took the shovel, dug everyting up and then took the rake and raked out all the weeds. Our weed puller was useless as the weeds were many, but not big to grab with the weed puller. Regardless, BW is in Argentina and I'm pulling weeds. Heh, if you'd have told me 3 years ago my condo living self would be living in the US pulling weeds with a dog by your side, I'd tell you were crazy.. never say never.
<a href="http://tidyhusband.com/images/2013/07/JIM_2148.jpg"><img class="alignnone size-full wp-image-1795" alt="JIM_2148" src="http://tidyhusband.com/images/2013/07/JIM_2148.jpg" width="2144" height="1424" /></a>
And if that wasn't enough outdoor activity we also did this;
<strong>Before: </strong>
<a href="http://tidyhusband.com/images/2013/07/JIM_2147.jpg"><img class="alignnone size-full wp-image-1797" alt="JIM_2147" src="http://tidyhusband.com/images/2013/07/JIM_2147.jpg" width="2144" height="1424" /></a>
<strong>After</strong>
<a href="http://tidyhusband.com/images/2013/07/JIM_2149.jpg"><img class="alignnone size-full wp-image-1796" alt="JIM_2149" src="http://tidyhusband.com/images/2013/07/JIM_2149.jpg" width="2144" height="1424" /></a>
Can you tell the difference?
That's right -<strong> I got rid of the dog!</strong> :)
Okay, Okay, the dog is still here and fine but we did cut that little tree/hedge/stump down to a more reasonable size. It was due for it's annual haircut. Now, by 'we' I mean I cut the tree down and thedog sat in the shade and directed.
Other news...
BW, I watered your plants today but I think it's going to rain on us later if the black clouds in the sky are any indicator.
I went to stain the deck chairs but two problems arose: One, we don't have enough stain left in the can we have and when I went to home depot they don't have any stain either they don't sell the stuff we have any more. So screw it, you can help me go to the home depot with me when you get back BW, and we can pick out a color for these things when you get back. I have to save some fun for you...
But, I did buy a tube of caulking and I'm going to make my very first attempt at this tomorrow. Pictures to follow.
Othewise, a trip to the grocery store (I love blueberry season) and a lap of the house with vacuum and a mop with a dog walk added in there for good measure and it's 8:30pm and here's post 102 wrapped up.
Until next time,
TH & co.
| ramseeker/newjims | _posts/2013-07-13-100-plus.md | Markdown | mit | 3,037 | 61.1875 | 614 | 0.724695 | false |
$(window).on('load', function() {//main
const dom = {//define inputs
tswitch: $("#wave-switch input"),
aSlider: $("input#angle"),//angle slider
nSlider: $("input#refractive-index-ratio"),
};
let layout = {//define layout of pot
showlegend: false,
scene: {
aspectmode: "cube",
xaxis: {range: [-2, 2]},
yaxis: {range: [-2, 2]},
zaxis: {range: [-2, 2]},
camera: {
eye: {x: 0, y: 0, z: -2}//adjust camera starting view
}
},
};
//define constants
let size = 100;
let t = 0;
let isPlay = false;
let E_0 = 0.5;
let w_r = 2e9;
let c = 3e8; // Speed of light
let n1 = 1;
let k_1 = (n1*w_r)/c;
let k_2,theta_i,theta_t;
let x_data = numeric.linspace(2, 0, size);//x and y data is always the same and just change z
let x_data_t = math.add(-2,x_data);
let y_data = numeric.linspace(-2, 2, size);
//constants based of of inputs
let condition = $("input[name = wave-switch]:checked").val();
let angle_of_incidence = parseFloat($("input#angle").val());
let n2 = parseFloat($("input#refractive-index-ratio").val());
function snell(theta_i){//snells law
console.log(Math.sin(theta_i));
console.log((n1 / n2))
return Math.asin((n1 / n2) * Math.sin(theta_i));
};
function getData_wave_incident(){//produces data for the incident wave on the boundry
let z,z_square = [];
let k_x = Math.cos(theta_i)*k_1;
let k_y = Math.sin(theta_i)*k_1;
for (let v=0;v < y_data.length ;v++) {
let z_row = [];
for (let i = 0; i < x_data.length ; i++) {
z = E_0* Math.sin(k_x* x_data[i]+k_y*y_data[v]+w_r*t);
z_row.push(z);
}
z_square.push(z_row);
}
return z_square
}
function getData_wave_reflected(){//produces data for the reflected wave on the boundry
let z,z_square = [];
let k_x = Math.cos(-theta_i)*k_1;
let k_y = Math.sin(-theta_i)*k_1;
let E_0_r = reflect();
for (let v=0;v < y_data.length ;v++) {
let z_row = [];
for (let i = 0; i < x_data.length ; i++) {
z = E_0_r* Math.sin(k_x* x_data[i]+k_y*y_data[v]-w_r*t);
z_row.push(z);
}
z_square.push(z_row);
}
return z_square
}
function getData_wave_transmitted(){//produces data for the incident wave on the boundry
let z,z_square = [];
let E_0_t = transmit();
let k_y = Math.sin(theta_i)*k_1;
let k_x = Math.cos(theta_t)*k_2;
for (let v=0;v < y_data.length ;v++) {
let z_row = [];
for (let i = 0; i < x_data_t.length ; i++) {
z = E_0_t*Math.sin(k_x*x_data_t[i]+k_y*y_data[v]+w_r*t);
z_row.push(z);
}
z_square.push(z_row);//Not entirelly sure the physics is correct need to review
}
return z_square
}
function transmit(){//gives the new amplitude of the transmitted wave
let E_t0;
if (isNaN(theta_t) === true){//if snells law return not a number this means total internal refection is occurring hence no transmitted wave(no attenuation accounted for)
return 0
}
else {
E_t0 = E_0 * (2. * n1 * Math.cos(theta_i)) / (n1 * Math.cos(theta_i) + n2 * Math.cos(theta_t))
return E_t0
}
};
function reflect() {//gives the amplitude of the refected wave
if (n1 === n2) {//if both materials have same refractive index then there is no reflection
return 0
}
else {
let E_r0;
if (isNaN(theta_t) === true){
E_r0 = E_0;
}
else {
E_r0 = E_0 * (n1 * Math.cos(theta_i) - n2 * Math.cos(theta_t)) / (n1 * Math.cos(theta_i) + n2 * Math.cos(theta_t))
}
return E_r0
}
};
function plot_data() {//produces the traces of the plot
$("#angle-display").html($("input#angle").val().toString()+"°");//update display
$("#refractive-index-ratio-display").html($("input#refractive-index-ratio").val().toString());
condition = $("input[name = wave-switch]:checked").val();//update value of constants
angle_of_incidence = parseFloat($("input#angle").val());
n2 = parseFloat($("input#refractive-index-ratio").val());
k_2 = (n2*w_r)/c;
theta_i = Math.PI * (angle_of_incidence / 180);
theta_t = snell(theta_i);
if (isNaN(Math.asin(n2))=== true){//update value of citical angle
$("#critical_angle-display").html("No Total Internal Reflection possible");
}else{
$("#critical_angle-display").html(((180*Math.asin(n2))/Math.PI).toFixed(2).toString()+"°");
}
let data = [];
if (condition === "incident") {//creates trace dependent of the conditions of the system
let incident_wave = {
opacity: 1,
x: x_data,
y: y_data,
z: getData_wave_incident(),
type: 'surface',
name: "Incident"
};
data.push(incident_wave);
}
else if(condition === "reflected") {
let reflected_wave = {
opacity: 1,
x: x_data,
y: y_data,
z: getData_wave_reflected(),
type: 'surface',
name: "Reflected"
};
data.push(reflected_wave);
}
else{
let incident_plus_reflected_wave = {
opacity: 1,
x: x_data,
y: y_data,
z: math.add(getData_wave_incident(),getData_wave_reflected()),
type: 'surface',
name:"Reflected and Incident combined"
};
data.push(incident_plus_reflected_wave);
}
let transmitted_wave = {
opacity: 1,
x: x_data_t,
y: y_data,
z: getData_wave_transmitted(),
type: 'surface',
name:"Transmitted"
};
let opacity_1;//opacity gives qualitative representation of refractive index
let opacity_2;
if((1 < n2) && (n2 <= 15)){//decide opacity dependant on refractive index
opacity_1 = 0;
opacity_2 = n2/10
}
else if((0.1 <= n2) && (n2< 1)){
opacity_1 = 0.1/n2;
opacity_2 = 0;
}
else{
opacity_1 = 0;
opacity_2 = 0;
}
let material_1 =//dielectric one
{
opacity: opacity_1,
color: '#379F9F',
type: "mesh3d",
name: "material 1",
z: [-2, -2, 2, 2, -2, -2, 2, 2],
y: [-2, 2, 2, -2, -2, 2, 2, -2],
x: [2, 2, 2, 2, 0, 0, 0, 0],
i: [7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
j: [3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
k: [0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
};
let material_2 =//dielectric two
{
opacity: opacity_2,
color: '#379F9F',
type: "mesh3d",
name: "material 2",
z: [-2, -2, 2, 2, -2, -2, 2, 2],
y: [-2, 2, 2, -2, -2, 2, 2, -2],
x: [0, 0, 0, 0, -2, -2, -2, -2],
i: [7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
j: [3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
k: [0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
};
data.push(transmitted_wave,material_1,material_2);
if (data.length < 5) {//animate function requires data sets of the same length hence those unused in situation must be filled with empty traces
let extensionSize = data.length;
for (let i = 0; i < (5 - extensionSize); ++i){
data.push(
{
type: "scatter3d",
mode: "lines",
x: [0],
y: [0],
z: [0]
}
);
}
}
return data
}
function update_graph(){//update animation
Plotly.animate("graph",
{data: plot_data()},//updated data
{
fromcurrent: true,
transition: {duration: 0,},
frame: {duration: 0, redraw: false,},
mode: "afterall"
}
);
};
function play_loop(){//handles the play button
if(isPlay === true) {
t++;//keeps time ticking
Plotly.animate("graph",
{data: plot_data()},
{
fromcurrent: true,
transition: {duration: 0,},
frame: {duration: 0, redraw: false,},
mode: "afterall"
});
requestAnimationFrame(play_loop);//prepares next frame
}
return 0;
};
function initial() {
Plotly.purge("graph");
Plotly.newPlot('graph', plot_data(),layout);//create plot
dom.tswitch.on("change", update_graph);//change of input produces reaction
dom.aSlider.on("input", update_graph);
dom.nSlider.on("input", update_graph);
$('#playButton').on('click', function() {
document.getElementById("playButton").value = (isPlay) ? "Play" : "Stop";//change button label
isPlay = !isPlay;
w_t = 0;//reset time to 0
requestAnimationFrame(play_loop);
});
};
initial();
}); | cydcowley/Imperial-Visualizations | visuals_EM/Waves and Dielectrics/scripts/2D_Dielectric_Dielectric.js | JavaScript | mit | 10,284 | 32.626263 | 177 | 0.441646 | false |
// EX.1 - READ A TEXT FILE CHAR BY CHAR
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
FILE *bin; //declare a file pointer variable
FILE *numfile;
char s[20] = "1234";
int ch;
int i;
char line[50];
numfile = fopen("numbers.txt","r");
bin = fopen("numbers.txt","wb");
//open the file, text reading mode
if (numfile == NULL)
{ //test if everything was ok
printf("Cannot open file.\n");
exit(1);
} // Error checking
while(fgets(line,50,numfile) != NULL)
{
i = atoi(s);
fwrite(&i,sizeof(int),1,bin);
}
getchar();
fclose(bin);
fclose(numfile); //close the files
return 0;
} // end main()
| RobertEviston/CollegeWork | C Programming/PersisTest.c | C | mit | 747 | 20.342857 | 50 | 0.535475 | false |
<html>
<head>
<title>主页</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="imagetoolbar" content="no"/>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<link rel="apple-touch-icon" href="data/apple-touch-icon.png" />
<link rel="apple-touch-startup-image" href="data/startup-iphone.png" media="screen and (max-device-width: 320px)"/>
<link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet">
<link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet">
<link href="主页_1_files/axurerp_pagespecificstyles.css" type="text/css" rel="stylesheet">
<!--[if IE 6]>
<link href="主页_1_files/axurerp_pagespecificstyles_ie6.css" type="text/css" rel="stylesheet">
<![endif]-->
<script src="data/sitemap.js"></script>
<script src="resources/scripts/jquery-1.7.1.min.js"></script>
<script src="resources/scripts/axutils.js"></script>
<script src="resources/scripts/jquery-ui-1.8.10.custom.min.js"></script>
<script src="resources/scripts/axurerp_beforepagescript.js"></script>
<script src="resources/scripts/messagecenter.js"></script>
<script src='主页_1_files/data.js'></script>
</head>
<body>
<div id="main_container">
<div id="u0" class="u0_container" >
<div id="u0_img" class="u0_normal detectCanvas"></div>
<div id="u1" class="u1" style="visibility:hidden;" >
<div id="u1_rtf"></div>
</div>
</div>
<div id="u2" class="u2_container" >
<div id="u2_img" class="u2_normal detectCanvas"></div>
<div id="u3" class="u3" style="visibility:hidden;" >
<div id="u3_rtf"></div>
</div>
</div>
<div id="u4" class="u4_container" >
<div id="u4_img" class="u4_normal detectCanvas"></div>
<div id="u5" class="u5" >
<div id="u5_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">用户管理</span></p></div>
</div>
</div>
<div id="u6" class="u6_container" >
<div id="u6_img" class="u6_normal detectCanvas"></div>
<div id="u7" class="u7" style="visibility:hidden;" >
<div id="u7_rtf"></div>
</div>
</div>
<div id="u8" class="u8_container" >
<div id="u8_img" class="u8_normal detectCanvas"></div>
<div id="u9" class="u9" >
<div id="u9_rtf"><p style="text-align:center;"><span style="font-family:Arial;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">enter text...</span></p></div>
</div>
</div><div id="u10" class="u10" >
<DIV id="u10_line" class="u10_line" ></DIV>
</div>
<div id="u11" class="u11_container" >
<div id="u11_img" class="u11_normal detectCanvas"></div>
<div id="u12" class="u12" style="visibility:hidden;" >
<div id="u12_rtf"></div>
</div>
</div>
<div id="u13" class="u13_container" >
<div id="u13_img" class="u13_normal detectCanvas"></div>
<div id="u14" class="u14" style="visibility:hidden;" >
<div id="u14_rtf"></div>
</div>
</div>
<DIV id="u15container" style="position:absolute; left:219px; top:84px; width:100px; height:13px; ; ; ;" >
<LABEL for="u15">
<div id="u16" class="u16" >
<div id="u16_rtf"><p style="text-align:left;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">全选</span></p></div>
</div>
</LABEL>
<INPUT id="u15" style="position:absolute; left:-3px; top:-2px;" type="checkbox" value="checkbox" >
</DIV>
<div id="u17" class="u17_container" >
<div id="u17_img" class="u17_normal detectCanvas"></div>
<div id="u18" class="u18" >
<div id="u18_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">用户名</span></p></div>
</div>
</div>
<div id="u19" class="u19_container" >
<div id="u19_img" class="u19_normal detectCanvas"></div>
<div id="u20" class="u20" >
<div id="u20_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">注册时间</span></p></div>
</div>
</div>
<div id="u21" class="u21_container" >
<div id="u21_img" class="u21_normal detectCanvas"></div>
<div id="u22" class="u22" >
<div id="u22_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">学员数量</span></p></div>
</div>
</div>
<div id="u23" class="u23_container" >
<div id="u23_img" class="u23_normal detectCanvas"></div>
<div id="u24" class="u24" >
<div id="u24_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">学员管理</span></p></div>
</div>
</div>
<div id="u25" class="u25_container" >
<div id="u25_img" class="u25_normal detectCanvas"></div>
<div id="u26" class="u26" >
<div id="u26_rtf"><p style="text-align:center;"><span style="font-family:Heiti SC;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;">学员数量</span></p></div>
</div>
</div>
</div>
<div class="preload"><img src="主页_1_files/u0_normal.png" width="1" height="1"/><img src="主页_1_files/u2_normal.png" width="1" height="1"/><img src="主页_1_files/u4_normal.png" width="1" height="1"/><img src="主页_1_files/u6_normal.png" width="1" height="1"/><img src="主页_1_files/u10_line.png" width="1" height="1"/><img src="主页_1_files/u11_normal.png" width="1" height="1"/><img src="主页_1_files/u13_normal.png" width="1" height="1"/><img src="主页_1_files/u17_normal.png" width="1" height="1"/><img src="主页_1_files/u19_normal.png" width="1" height="1"/></div>
</body>
<script src="resources/scripts/axurerp_pagescript.js"></script>
<script src="主页_1_files/axurerp_pagespecificscript.js" charset="utf-8"></script> | tiansiyuan/SQA | projects/dd/prototype/主页_1.html | HTML | mit | 6,083 | 51.184211 | 552 | 0.671464 | false |
/*****************************************************************
* syscall.c
* adapted from MIT xv6 by Zhiyi Huang, hzy@cs.otago.ac.nz
* University of Otago
*
********************************************************************/
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "arm.h"
#include "syscall.h"
// User code makes a system call with INT T_SYSCALL.
// System call number in %eax.
// Arguments on the stack, from the user call to the C
// library system call function. The saved user %esp points
// to a saved program counter, and then the first argument.
// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
if(addr >= curr_proc->sz || addr+4 > curr_proc->sz)
return -1;
*ip = *(int*)(addr);
return 0;
}
// Fetch the nul-terminated string at addr from the current process.
// Doesn't actually copy the string - just sets *pp to point at it.
// Returns length of string, not including nul.
int
fetchstr(uint addr, char **pp)
{
char *s, *ep;
if(addr >= curr_proc->sz)
return -1;
*pp = (char*)addr;
ep = (char*)curr_proc->sz;
for(s = *pp; s < ep; s++)
if(*s == 0)
return s - *pp;
return -1;
}
// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
return fetchint(curr_proc->tf->sp + 4*n, ip);
}
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size n bytes. Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
int i;
if(argint(n, &i) < 0)
return -1;
if((uint)i >= curr_proc->sz || (uint)i+size > curr_proc->sz)
return -1;
*pp = (char*)i;
return 0;
}
// Fetch the nth word-sized system call argument as a string pointer.
// Check that the pointer is valid and the string is nul-terminated.
// (There is no shared writable memory, so the string can't change
// between this check and being used by the kernel.)
int
argstr(int n, char **pp)
{
int addr;
if(argint(n, &addr) < 0)
return -1;
return fetchstr(addr, pp);
}
extern int sys_chdir(void);
extern int sys_close(void);
extern int sys_dup(void);
extern int sys_exec(void);
extern int sys_exit(void);
extern int sys_fork(void);
extern int sys_fstat(void);
extern int sys_getpid(void);
extern int sys_kill(void);
extern int sys_link(void);
extern int sys_mkdir(void);
extern int sys_mknod(void);
extern int sys_open(void);
extern int sys_pipe(void);
extern int sys_read(void);
extern int sys_sbrk(void);
extern int sys_sleep(void);
extern int sys_unlink(void);
extern int sys_wait(void);
extern int sys_write(void);
extern int sys_uptime(void);
static int (*syscalls[])(void) = {
[SYS_fork] sys_fork,
[SYS_exit] sys_exit,
[SYS_wait] sys_wait,
[SYS_pipe] sys_pipe,
[SYS_read] sys_read,
[SYS_kill] sys_kill,
[SYS_exec] sys_exec,
[SYS_fstat] sys_fstat,
[SYS_chdir] sys_chdir,
[SYS_dup] sys_dup,
[SYS_getpid] sys_getpid,
[SYS_sbrk] sys_sbrk,
[SYS_sleep] sys_sleep,
[SYS_uptime] sys_uptime,
[SYS_open] sys_open,
[SYS_write] sys_write,
[SYS_mknod] sys_mknod,
[SYS_unlink] sys_unlink,
[SYS_link] sys_link,
[SYS_mkdir] sys_mkdir,
[SYS_close] sys_close,
};
void
syscall(void)
{
int num;
num = curr_proc->tf->r0;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
// cprintf("\n%d %s: sys call %d syscall address %x\n",
// curr_proc->pid, curr_proc->name, num, syscalls[num]);
if(num == SYS_exec) {
if(syscalls[num]() == -1) curr_proc->tf->r0 = -1;
} else curr_proc->tf->r0 = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
curr_proc->pid, curr_proc->name, num);
curr_proc->tf->r0 = -1;
}
}
| fosler/xv6-rpi-port | source/syscall.c | C | mit | 3,791 | 23.940789 | 69 | 0.619889 | false |
// Package machinelearningservices implements the Azure ARM Machinelearningservices service API version 2019-06-01.
//
// These APIs allow end users to operate on Azure Machine Learning Workspace resources.
package machinelearningservices
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
)
const (
// DefaultBaseURI is the default URI used for the service Machinelearningservices
DefaultBaseURI = "https://management.azure.com"
)
// BaseClient is the base client for Machinelearningservices.
type BaseClient struct {
autorest.Client
BaseURI string
SubscriptionID string
}
// New creates an instance of the BaseClient client.
func New(subscriptionID string) BaseClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
return BaseClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
SubscriptionID: subscriptionID,
}
}
| Azure/azure-sdk-for-go | services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/client.go | GO | mit | 1,478 | 35.04878 | 119 | 0.781461 | false |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base data-ice="baseUrl" href="../../../">
<title data-ice="title">CondaExecutable | API Document</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
<script src="script/prettify/prettify.js"></script>
<script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">
<header>
<a href="./">Home</a>
<a href="identifiers.html">Reference</a>
<a href="source.html">Source</a>
<a data-ice="repoURL" href="https://github.com/jsoma/mcpyver" class="repo-url-github">Repository</a>
<div class="search-box">
<span>
<img src="./image/search.png">
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
</span>
<ul class="search-result"></ul>
</div>
</header>
<nav class="navigation" data-ice="nav"><div>
<ul>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-clear">clear</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-exec">exec</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getConda">getConda</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getJupyter">getJupyter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getJupyterList">getJupyterList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPipList">getPipList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPythonList">getPythonList</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getVirtualEnv">getVirtualEnv</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">environments</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/environments/condaenv.js~CondaEnv.html">CondaEnv</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/environments/environment.js~Environment.html">Environment</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/environments/virtualenv.js~VirtualEnv.html">VirtualEnv</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">executables</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html">CondaExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/jupyter.js~JupyterExecutable.html">JupyterExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/pip.js~PipExecutable.html">PipExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/python.js~PythonExecutable.html">PythonExecutable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/executables/virtualenv.js~VirtualEnvExecutable.html">VirtualEnvExecutable</a></span></span></li>
</ul>
</div>
</nav>
<div class="content" data-ice="content"><div class="header-notice">
<div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import CondaExecutable from '<span><a href="file/src/executables/conda.js.html#lineNumber5">mcpyver/src/executables/conda.js</a></span>'</code></pre></div>
<span data-ice="access">public</span>
<span data-ice="kind">class</span>
<span data-ice="source">| <span><a href="file/src/executables/conda.js.html#lineNumber5">source</a></span></span>
</div>
<div class="self-detail detail">
<h1 data-ice="name">CondaExecutable</h1>
<div class="flat-list" data-ice="extendsChain"><h4>Extends:</h4><div><span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span> → CondaExecutable</div></div>
</div>
<div data-ice="memberSummary"><h2>Member Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3">Public Members</td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-member-details">details</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-member-environments">environments</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-member-version">version</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-cleanVersion">cleanVersion</a></span></span><span data-ice="signature">()</span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-getDetails">getDetails</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-populateEnvironments">populateEnvironments</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-setDetails">setDetails</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-setEnvironments">setEnvironments</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/conda.js~CondaExecutable.html#instance-method-setExtras">setExtras</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div class="inherited-summary" data-ice="inheritedSummary"><h2>Inherited Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3"><span class="toggle closed"></span> From class <span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span></td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-get-searchPaths">searchPaths</a></span></span><span data-ice="signature">: <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Paths to manually search in for executables</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findAll">findAll</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span> | <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a command name or list of commands, returns an ExecutableCollection
of all the executables with that name your computer might know about
Looks in the path as well as looking in common paths.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findAllWithoutMerge">findAllWithoutMerge</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a command name or list of commands, returns an ExecutableCollection
of all the executables with that name your computer might know about
Looks in the path as well as looking in common paths.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findByPaths">findByPaths</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Manually searches paths to find executables with a given name</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findByWhich">findByWhich</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable_collection.js~ExecutableCollection.html">ExecutableCollection</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Uses which to find all of the paths for a given command</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#static-method-findOne">findOne</a></span></span><span data-ice="signature">(command: <span>*</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="class/src/executables/executable.js~Executable.html">Executable</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a command name, creates an Executable from the executable
file that would have been run had you typed the command in (e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-get-mergeField">mergeField</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>When merging an ExecutableCollection, this is what you group
the executables by.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-get-path">path</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>When you're looking for a path, but don't necessarily care
if it's the symlinked one or the non-symlinked on?</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">get</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-get-realpath">realpath</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>: <span>*</span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The path of the executable, or the target of a symlinked executable</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="kind" data-ice="kind">set</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-set-realpath">realpath</a></span></span><span data-ice="signature">(the: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>): <span>*</span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Set the realpath</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-atime">atime</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-ctime">ctime</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-defaultCommands">defaultCommands</a></span></span><span data-ice="signature">: <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The commands for which this executable is first in line to run
e.g., running which returns it</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-errors">errors</a></span></span><span data-ice="signature">: <span><span>*</span><span>[]</span></span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-isDefault">isDefault</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Is this executable the default for any commands?</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-mtime">mtime</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-paths">paths</a></span></span><span data-ice="signature">: <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span><span>[]</span></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Any paths that you can find this executable at (symlinked or otherwise)</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-rawVersion">rawVersion</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The raw output from stdout/stderr of --version</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-member-version">version</a></span></span><span data-ice="signature">: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>The version number of the program, typically cleaned up in
a subclass</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-addCommand">addCommand</a></span></span><span data-ice="signature">(command: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Add a command that this executable is first in line for,
e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-addError">addError</a></span></span><span data-ice="signature">(error: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Take any rescued error and attach it to the object, e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-addPath">addPath</a></span></span><span data-ice="signature">(path: <span>*</span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Adds a known path to this executable (e.g.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-cleanVersion">cleanVersion</a></span></span><span data-ice="signature">()</span>
</p>
</div>
<div>
<div data-ice="description"><p>Clean up the rawVersion, pulling out the actual version number</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-populate">populate</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Fills in all of the details of the executable</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-requestVersion">requestVersion</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span><<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>></span>
</p>
</div>
<div>
<div data-ice="description"><p>Gets the version of the executable by shelling out and
running --version</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="abstract" data-ice="abstract">abstract</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setExtras">setExtras</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Subclasses that need extra details (lists of packages, etc)
override this method</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setRawVersion">setRawVersion</a></span></span><span data-ice="signature">(version: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Given a version-y string, do slight cleanup and set the
executable's rawVersion. Typically comes from stdout/stderr.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setStats">setStats</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Query for the executable file's creation/modification/access time
and save it to the object</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setVersion">setVersion</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Query for and set the rawVersion and version</p>
</div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/executables/executable.js~Executable.html#instance-method-toJSON">toJSON</a></span></span><span data-ice="signature">(): <span>*</span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Converts the executable's data to a JSON-friendly object
it's mostly so we can rename _realpath to realpath</p>
</div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div data-ice="memberDetails"><h2 data-ice="title">Public Members</h2>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-member-details">
<span class="access" data-ice="access">public</span>
<span data-ice="name">details</span><span data-ice="signature">: <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber41">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-member-environments">
<span class="access" data-ice="access">public</span>
<span data-ice="name">environments</span><span data-ice="signature">: <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber16">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-member-version">
<span class="access" data-ice="access">public</span>
<span data-ice="name">version</span><span data-ice="signature">: <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber47">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>The version number of the program, typically cleaned up in
a subclass</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/executables/executable.js~Executable.html#instance-member-version">Executable#version</a></span></div>
<div data-ice="properties">
</div>
</div>
</div>
<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-cleanVersion">
<span class="access" data-ice="access">public</span>
<span data-ice="name">cleanVersion</span><span data-ice="signature">()</span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber46">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>Clean up the rawVersion, pulling out the actual version number</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/executables/executable.js~Executable.html#instance-method-cleanVersion">Executable#cleanVersion</a></span></div>
<div data-ice="properties">
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-getDetails">
<span class="access" data-ice="access">public</span>
<span data-ice="name">getDetails</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber26">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-populateEnvironments">
<span class="access" data-ice="access">public</span>
<span data-ice="name">populateEnvironments</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber21">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-setDetails">
<span class="access" data-ice="access">public</span>
<span data-ice="name">setDetails</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber38">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-setEnvironments">
<span class="access" data-ice="access">public</span>
<span data-ice="name">setEnvironments</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber14">source</a></span></span>
</span>
</h3>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-setExtras">
<span class="access" data-ice="access">public</span>
<span data-ice="name">setExtras</span><span data-ice="signature">(): <span>*</span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/executables/conda.js.html#lineNumber7">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>Subclasses that need extra details (lists of packages, etc)
override this method</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/executables/executable.js~Executable.html#instance-method-setExtras">Executable#setExtras</a></span></div>
<div data-ice="properties">
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span>*</span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.5.2)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>
<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
| jsoma/mcpyver | dist/esdoc/class/src/executables/conda.js~CondaExecutable.html | HTML | mit | 44,514 | 25.324069 | 718 | 0.56553 | false |
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class AdminLoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login / registration.
*
* @var string
*/
protected $redirectTo = '/admin/home';
protected $username;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest:web', ['except' => 'logout']);
}
/**
* 重写登录视图页面
* @author 晚黎
* @date 2016-09-05T23:06:16+0800
* @return [type] [description]
*/
public function showLoginForm()
{
return view('auth.admin-login');
}
/**
* 自定义认证驱动
* @author 晚黎
* @date 2016-09-05T23:53:07+0800
* @return [type] [description]
*/
public function username(){
return 'name';
}
protected function guard()
{
return auth()->guard('web');
}
}
| mobyan/thc-platform | src/app/Http/Controllers/AdminLoginController.php | PHP | mit | 1,582 | 22.753846 | 79 | 0.524611 | false |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>XPEDYTOR</title>
<meta name="author" content="lajmahal"/>
<meta name="description" content="The Xpedytor App"/>
<meta name="keywords" content="xpedytor"/>
<link rel="stylesheet" href="../../js/lib/bootstrap/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="../../js/lib/bootstrap/dist/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="css/app.css"/>
</head>
<body>
<div class="container">
<div>
<!-- Header goes here -->
<xpd-common-header header-title="Xpedytor"/>
</div>
<div ui-view>
<!-- Main body goes here -->
<h2>
Main Menu
</h2>
<ul>
<li>New Order</li>
<li>View Orders</li>
<li>Settings</li>
</ul>
</div>
<div>
<xpd-common-footer/>
</div>
</div>
<script src="../../js/lib/requirejs/require.js" data-main="js/require-main"></script>
</body>
</html> | lajmahal/xpedytor | xpedytor-site/src/index.html | HTML | mit | 1,018 | 23.261905 | 91 | 0.549116 | false |
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class LogoutBox
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(LogoutBox))
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
Me.OK_Button = New System.Windows.Forms.Button()
Me.Cancel_Button = New System.Windows.Forms.Button()
Me.lblLogout = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.TableLayoutPanel1.SuspendLayout()
Me.SuspendLayout()
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TableLayoutPanel1.ColumnCount = 2
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0)
Me.TableLayoutPanel1.Location = New System.Drawing.Point(115, 158)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 1
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(221, 50)
Me.TableLayoutPanel1.TabIndex = 0
'
'OK_Button
'
Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None
Me.OK_Button.BackColor = System.Drawing.Color.White
Me.OK_Button.DialogResult = System.Windows.Forms.DialogResult.OK
Me.OK_Button.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.OK_Button.Font = New System.Drawing.Font("Arial", 11.0!)
Me.OK_Button.Location = New System.Drawing.Point(3, 3)
Me.OK_Button.Name = "OK_Button"
Me.OK_Button.Size = New System.Drawing.Size(104, 44)
Me.OK_Button.TabIndex = 0
Me.OK_Button.Text = "Log out"
Me.OK_Button.UseVisualStyleBackColor = False
'
'Cancel_Button
'
Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None
Me.Cancel_Button.BackColor = System.Drawing.Color.White
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Cancel_Button.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Cancel_Button.Font = New System.Drawing.Font("Arial", 11.0!)
Me.Cancel_Button.Location = New System.Drawing.Point(113, 3)
Me.Cancel_Button.Name = "Cancel_Button"
Me.Cancel_Button.Size = New System.Drawing.Size(105, 44)
Me.Cancel_Button.TabIndex = 1
Me.Cancel_Button.Text = "Cancel"
Me.Cancel_Button.UseVisualStyleBackColor = False
'
'lblLogout
'
Me.lblLogout.AutoSize = True
Me.lblLogout.Font = New System.Drawing.Font("Arial", 18.0!)
Me.lblLogout.Location = New System.Drawing.Point(39, 36)
Me.lblLogout.Name = "lblLogout"
Me.lblLogout.Size = New System.Drawing.Size(373, 27)
Me.lblLogout.TabIndex = 1
Me.lblLogout.Text = "Are you sure you want to log out?"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Arial", 11.0!)
Me.Label1.Location = New System.Drawing.Point(86, 103)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(278, 17)
Me.Label1.TabIndex = 2
Me.Label1.Text = "(You will be redirected to the login screen)"
'
'LogoutBox
'
Me.AcceptButton = Me.OK_Button
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None
Me.BackColor = System.Drawing.Color.Silver
Me.CancelButton = Me.Cancel_Button
Me.ClientSize = New System.Drawing.Size(450, 220)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.lblLogout)
Me.Controls.Add(Me.TableLayoutPanel1)
Me.Font = New System.Drawing.Font("Arial", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "LogoutBox"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Logout?"
Me.TableLayoutPanel1.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
Friend WithEvents OK_Button As System.Windows.Forms.Button
Friend WithEvents Cancel_Button As System.Windows.Forms.Button
Friend WithEvents lblLogout As Label
Friend WithEvents Label1 As Label
End Class
| KameQuazi/Software-Major-Assignment-2k18 | LampClient/DialogBoxes/LogoutBox.Designer.vb | Visual Basic | mit | 6,027 | 46.81746 | 165 | 0.678672 | false |
---
tags: post
title: The utility module antipattern
description:
Why naming a module or file utils is a bad idea and how to fix that problem.
date: 2020-05-20
published: true
featuredImage: "./www/posts/utils-antipattern/banner.jpg"
featuredImageAlt: Messy toolbox
thumbnailImage: "./thumbnail.jpg"
thumbnailImageAlt: Messy toolbox
---
# The Problem
Today, I want to talk about a problem that I think pervades a lot of codebases
that's relatively easy to fix. Chances are you've come across it in one form or
another. I'm talking about the catch-all, kitchen sink module that contains all
the reusable functions for a project. They are usually named `utils.py`,
`helpers.js`, or `common.rb` depending on the language.
While the intention of pulling commonly used logic into a helper/utility module
makes sense on paper, I will contend that having a `utils` module is generally a
bad idea.
## Growing without bounds
What I've personally observed is that the module starts off on the right track
with just a couple of functions. But given moderate amount of time and number of
engineers working on the codebase, you'll find that the `utils` module will
grows seemingly without bounds. It becomes a mish-mash of all sorts of one-off
functions. You start to get an uneasy feeling about adding any new functions to
the pile because you begin to lose sense and judgement of whether your new
function should even belong there. In its worst form, it may start to resemble
an software equivalent of an episode of hoarders.
I think the reason why the contents of these `utils` module grows out of bounds
is because of the name itself. `util` is just too loose of a name; it gives no
guidance about what should or should not belong in it.
We all know that naming is a difficult but vitally important aspect of
programming. It conveys our intentions to other programmers or our future
selves. If we look at utility modules from that lens, we can see that the naming
of `utils` does not really communicate _anything_ useful about what it should
contain.
Names should be narrow. It needs to give us programmers a sense of its domain
and communicate about things that it can and can't represent.
# Solutions
Fortunately, if you do happen to have this growing pile of `utils` module in
your project, we can apply some relatively easy and incrementally adoptable
fixes.
### Solution 1: Split the `utils` module up and give each submodule a good name.
If the problem is one of naming being too loose, the obvious solution is to come
up with a better names.
Chances are, if you have a large `utils` module, they can be separated into
logical groupings. For example, in a hypothetical web application codebase,
There may be a set of functions that deals with array manipulations, some that
handles structuring logging data, and some functions that handle input
validation. In this cases, the easy way out would be to just create sub-modules
within `util` with a name about its logical domain.
```js
// Before
import { flatten, getLogger, validateAddress } from "./utils.js";
// After
import { flatten } from "./utils/array.js";
import { getLogger } from "./utils/logging.js";
import { validateAddress } from "./utils/validation.js";
```
Seems simple and obvious enough, but I think just giving it a good name does
help everyone who works on the project implicitly understand what should or
shouldn't be in these sub-modules.
### Solution 2: Create a `unstable_temporary_utils` module.
As a supplement to solution 1, something that I've found helpful is to create a
`utils`-like module but a bit more verbosely named `unstable_temporary_utils`,
with the expectation that it is only a transient home for functions until we can
find a better module to place it in.
If I reflect on some of my own temptations to add a `utils` like catch-all
module, it happens when I'm exploring a new feature or domain and I just don't
know _where_ something belongs yet. Being able to come up with a good, narrow
name can very much be a chicken and egg problem of having to spend enough time
fleshing out code and fixed some corner case bugs for a new domain/feature.
Placing a strict policy of never have a kitchen sink modules and always needing
to properly name things may be setting ourselves up for failure. It may lead to
premature/wrong abstraction early on in the process. I've found that having a
given module designated as a "lost and found" of sorts can be a good mechanism
for the team to temporarily put logic and defer actually coming up with a good
name, as long as it's understood that we'll have to revisit and find a proper
home for it.
```js
// unstableTemporaryUtils.js
function parseAuthToken(request) {
// ...
}
```
Given a contrived example above of a `parseAuthToken` function, we can give it
some time to settle into the codebase and realize that `utils/auth.js` maybe a
more suitable module for it.
```js
// utils/auth.js
function parseAuthToken(request) {
// ...
}
```
## The unwieldy name is on purpose
I want to note that that long and awkward naming of `unstable_temporary_utils`
is very much intentional here. It lets us easily track its usage via `git grep`.
More importantly, it also subtly applies a certain sense of pressure and shame
whenever you import from `unstable_temporary_utils`. We want it to be a module
of a last resort, and give you a little bit of pause and thought on whether you
really want to put a new function in there.
Sometimes that pause may give you the opportunity to actually come up with a
good name. Or perhaps you realize that not creating an abstraction and living
with the duplication is perfectly ok.
## Prevent unchecked growth
If you do happen to adopt this approach, I also recommend adding a linting step
in CI that will fail the build if the `unstable_temporary_utils` module exceeds
a certain size. This will help us draws a line in the sand and prevent the
module from exceeding a certain size and avoid the same fate as an ever
expanding `utils` module.
# It's all about alignment
At the end of the day, programming is really just about communication to other
fellow humans. I really encourage you to look at how you name
function/modules/services and approach it from the lens of if your teammates or
future self can reasonably articulate if something should or shouldn't belong in
it.
And if you find that you've fallen into the `utils` module trap, you can fix it
but giving it better names/boundaries, which has the invaluable side-effect of
realigning your teammates on the purposes of certain module, which I've found to
be invaluable for the longevity of a project.
| yanglinz/personal-site | www/posts/utils-antipattern/index.md | Markdown | mit | 6,647 | 41.883871 | 80 | 0.780051 | false |
# ETL
We are going to do the `Transform` step of an Extract-Transform-Load.
### ETL
Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
we're going to migrate this."
(Typically, this is followed by, "We're only going to need to run this
once." That's then typically followed by much forehead slapping and
moaning about how stupid we could possibly be.)
### The goal
We're going to extract some scrabble scores from a legacy system.
The old system stored a list of letters per score:
- 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T",
- 2 points: "D", "G",
- 3 points: "B", "C", "M", "P",
- 4 points: "F", "H", "V", "W", "Y",
- 5 points: "K",
- 8 points: "J", "X",
- 10 points: "Q", "Z",
The shiny new scrabble system instead stores the score per letter, which
makes it much faster and easier to calculate the score for a word. It
also stores the letters in lower-case regardless of the case of the
input letters:
- "a" is worth 1 point.
- "b" is worth 3 points.
- "c" is worth 3 points.
- "d" is worth 2 points.
- Etc.
Your mission, should you choose to accept it, is to transform the legacy data
format to the shiny new format.
### Notes
A final note about scoring, Scrabble is played around the world in a
variety of languages, each with its own unique scoring table. For
example, an "E" is scored at 2 in the Māori-language version of the
game while being scored at 4 in the Hawaiian-language version.
## Rust Installation
Refer to the [exercism help page][help-page] for Rust installation and learning
resources.
## Writing the Code
Execute the tests with:
```bash
$ cargo test
```
All but the first test have been ignored. After you get the first test to
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
to pass again. The test file is located in the `tests` directory. You can
also remove the ignore flag from all the tests to get them to run all at once
if you wish.
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
haven't already, it will help you with organizing your files.
## Feedback, Issues, Pull Requests
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
[help-page]: http://exercism.io/languages/rust
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
## Source
The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com)
## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
| attilahorvath/exercism-rust | etl/README.md | Markdown | mit | 3,133 | 36.73494 | 332 | 0.731801 | false |
package pixlepix.auracascade.data;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Created by localmacaccount on 5/31/15.
*/
public class Quest {
//TODO QUEST
public static int nextId;
public final ItemStack target;
public final ItemStack result;
public final int id;
public String string;
public Quest(String string, ItemStack target, ItemStack result) {
this.target = target;
this.result = result;
this.string = string;
this.id = nextId;
nextId++;
}
public boolean hasCompleted(EntityPlayer player) {
// QuestData questData = (QuestData) player.getExtendedProperties(QuestData.EXT_PROP_NAME);
// return questData.completedQuests.contains(this);
return false;
}
public void complete(EntityPlayer player) {
//QuestData questData = (QuestData) player.getExtendedProperties(QuestData.EXT_PROP_NAME);
// questData.completedQuests.add(this);
// AuraCascade.analytics.eventDesign("questComplete", id);
}
}
| pixlepix/Aura-Cascade | src/main/java/pixlepix/auracascade/data/Quest.java | Java | mit | 1,082 | 28.243243 | 98 | 0.685767 | false |
<?php
/*
* This file is part of the Itkg\Core package.
*
* (c) Interakting - Business & Decision
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Itkg\Core\Cache\Adapter;
use Itkg\Core\Cache\AdapterInterface;
use Itkg\Core\CacheableInterface;
/**
* Class Persistent
*
* Store cache in specific adapter & keep in memory (with array storage)
*
* @package Itkg\Core\Cache\Adapter
*/
class Persistent extends Registry
{
/**
* @var \Itkg\Core\Cache\AdapterInterface
*/
protected $adapter;
/**
* @param AdapterInterface $adapter
*/
public function __construct(AdapterInterface $adapter)
{
$this->adapter = $adapter;
}
/**
* Get value from cache
*
* @param \Itkg\Core\CacheableInterface $item
*
* @return string
*/
public function get(CacheableInterface $item)
{
if (false !== $result = parent::get($item)) {
return $result;
}
return $this->adapter->get($item);
}
/**
* Set a value into the cache
*
* @param \Itkg\Core\CacheableInterface $item
*
* @return void
*/
public function set(CacheableInterface $item)
{
parent::set($item);
$this->adapter->set($item);
}
/**
* Remove a value from cache
*
* @param \Itkg\Core\CacheableInterface $item
* @return void
*/
public function remove(CacheableInterface $item)
{
parent::remove($item);
$this->adapter->remove($item);
}
/**
* Remove cache
*
* @return void
*/
public function removeAll()
{
parent::removeAll();
$this->adapter->removeAll();
}
/**
* @return AdapterInterface
*/
public function getAdapter()
{
return $this->adapter;
}
/**
* @param AdapterInterface $adapter
*
* @return $this
*/
public function setAdapter(AdapterInterface $adapter)
{
$this->adapter = $adapter;
return $this;
}
}
| itkg/core | src/Itkg/Core/Cache/Adapter/Persistent.php | PHP | mit | 2,140 | 18.279279 | 74 | 0.571495 | false |