hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7a1dd4dc49b8a2a44bd8764fe9790ed63cdaab70 | 265 | rs | Rust | src/scoring.rs | mateka/rscuboids | b5685339a5a2e0bce0240ddb11946851734b2951 | [
"MIT"
] | null | null | null | src/scoring.rs | mateka/rscuboids | b5685339a5a2e0bce0240ddb11946851734b2951 | [
"MIT"
] | 10 | 2021-01-03T01:17:51.000Z | 2022-03-25T22:17:03.000Z | src/scoring.rs | mateka/rscuboids | b5685339a5a2e0bce0240ddb11946851734b2951 | [
"MIT"
] | null | null | null | use bevy::prelude::*;
#[derive(Debug, Clone)]
pub struct Score {
pub score: u32,
}
#[derive(Default)]
pub struct ScoringPlugin;
impl Plugin for ScoringPlugin {
fn build(&self, app: &mut AppBuilder) {
app.add_resource(Score { score: 0 });
}
}
| 16.5625 | 45 | 0.637736 |
0bee86659e0bc3c6d26a80fcf722418b2b8bfa12 | 3,855 | js | JavaScript | webpack.config.js | maxchernin/books-library | 8b50b6574a2bc424fd379f29cf1adb236ef011e5 | [
"MIT"
] | 1 | 2020-05-26T11:16:49.000Z | 2020-05-26T11:16:49.000Z | webpack.config.js | maxchernin/books-library | 8b50b6574a2bc424fd379f29cf1adb236ef011e5 | [
"MIT"
] | null | null | null | webpack.config.js | maxchernin/books-library | 8b50b6574a2bc424fd379f29cf1adb236ef011e5 | [
"MIT"
] | null | null | null | /**
* Created by Max on 3/8/2017.
*/
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var ChunkManifestPlugin = require("chunk-manifest-webpack-plugin");
var WebpackChunkHash = require("webpack-chunk-hash");
var OpenBrowserPlugin = require("open-browser-webpack-plugin");
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
main: './index.js',
vendors: './vendors.js'
},
output: {
filename: '[name].js',
chunkFilename: "[name].[chunkhash].js",
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.scss$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader" // compiles Sass to CSS
}]
},
{
test: /\.sass$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader" // compiles Sass to CSS
}]
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: 'css-loader'
})
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
{loader: 'file-loader'}
]
},
{
test: /\.json$/,
use: 'json-loader',
exclude: /(\/node_modules)/
},
{
test: /\.html/,
use: 'raw-loader',
exclude: /(\/node_modules)/
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
'file-loader'
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'index.html',
filename: 'index.html',
inject: 'body'
}),
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest'],
minChunks: function (module) {
return module.context && module.context.indexOf('node_modules') !== -1;
}
}),
new ChunkManifestPlugin({
filename: "chunk-manifest.json",
manifestVariable: "webpackManifest"
}),
new webpack.HashedModuleIdsPlugin(),
new WebpackChunkHash(),
new ExtractTextPlugin('app/assets/booklib.scss'),
new OpenBrowserPlugin({url: 'http://localhost:4200'}),
new webpack.ProvidePlugin({
moment: 'moment'
}),
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery'
}),
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery'
}),
new webpack.ProvidePlugin({
toastr: 'toastr'
}),
new webpack.ProvidePlugin({
_: 'lodash'
}),
new CopyWebpackPlugin([
{from: 'app/assets', to: 'app/assets'},
{from: 'app/lib', to: 'app/lib'}
])
],
devtool: "inline-source-map",
devServer: {
contentBase: path.join(__dirname, "app"),
watchContentBase: true,
watchOptions: {
poll: true
},
compress: true,
port: 4200,
clientLogLevel: 'error'
}
}; | 30.117188 | 87 | 0.449287 |
0ef09aabf832abeae4020b86bf154436cfcb156f | 187 | tsx | TypeScript | lib/index.tsx | yangdepp/webpack4-demo | 558dcd89399c8565d6d2a044b275d2be92515dab | [
"MIT"
] | 11 | 2019-03-18T07:14:14.000Z | 2020-07-29T01:04:32.000Z | lib/index.tsx | yangdepp/react-golu-ui | 558dcd89399c8565d6d2a044b275d2be92515dab | [
"MIT"
] | null | null | null | lib/index.tsx | yangdepp/react-golu-ui | 558dcd89399c8565d6d2a044b275d2be92515dab | [
"MIT"
] | null | null | null | import './index.scss';
import Icon from './icon/icon';
import Button from './button/button';
import Dialog from './dialog/dialog';
export { Icon };
export { Button };
export { Dialog };
| 20.777778 | 37 | 0.679144 |
435d15be582ab898799829462a7898f01687476e | 84 | lua | Lua | src/LanguageModel.Tests/CorrectSampleLuaFiles/ComplexTableConstructor.lua | Bhaskers-Blu-Org2/VSLua | 37d87e08930e7f4c182bd43078c68644186854fa | [
"MIT"
] | 186 | 2015-09-28T16:50:16.000Z | 2019-05-03T07:30:23.000Z | src/LanguageModel.Tests/CorrectSampleLuaFiles/ComplexTableConstructor.lua | Strongc/VSLua | ac315984f92dd0301e068c8664d80099194f3ee6 | [
"MIT"
] | 19 | 2015-09-30T22:36:36.000Z | 2019-04-16T20:28:35.000Z | src/LanguageModel.Tests/CorrectSampleLuaFiles/ComplexTableConstructor.lua | Strongc/VSLua | ac315984f92dd0301e068c8664d80099194f3ee6 | [
"MIT"
] | 52 | 2015-09-28T18:35:23.000Z | 2019-05-02T07:08:13.000Z | y = {x=10, ["x"]=0, y=45; "one", print("hello world"), [3] = {x=10}, "two", "three"} | 84 | 84 | 0.464286 |
a9b05bd5351b7b01363b8fffa6ce94a88abbafac | 8,985 | html | HTML | public/themes/admin_simpleboot3/shop/admin_shop/base.html | hcwincom/zzicyun | 856cd97cbbb4bb741c121f34b5b1b2703ad0d61b | [
"Apache-2.0"
] | null | null | null | public/themes/admin_simpleboot3/shop/admin_shop/base.html | hcwincom/zzicyun | 856cd97cbbb4bb741c121f34b5b1b2703ad0d61b | [
"Apache-2.0"
] | null | null | null | public/themes/admin_simpleboot3/shop/admin_shop/base.html | hcwincom/zzicyun | 856cd97cbbb4bb741c121f34b5b1b2703ad0d61b | [
"Apache-2.0"
] | 1 | 2019-08-30T03:05:25.000Z | 2019-08-30T03:05:25.000Z |
<div class="form-group">
<label for="" class="col-sm-2 control-label">{$flag}名称</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="name" value="{$info.name}" />
<present name='change.name'>
<input type="text" class="red form-control" value="{$change.name}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">公司全称</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="company_name" value="{$info.company_name}" />
<present name='change.company_name'>
<input type="text" class="red form-control" value="{$change.company_name}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">名称首字母</label>
<div class="col-md-6 col-sm-10">
<select class=" form-control" name="char">
<foreach name="chars" item="vchar" key="kchar">
<option value="{$vchar}" <if condition="$vchar eq $info.char">selected</if>>{$vchar}</option>
</foreach>
</select>
<present name="change.char">
<input type="text" class="form-control red" value="{$change.char}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">{$flag}编号</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="code" value="{$info.code}" />
<present name='change.code'>
<input type="text" class="red form-control" value="{$change.code}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">加盟类型</label>
<div class="col-md-6 col-sm-10">
<select name="type" class="form-control">
<foreach name="shop_types" item="vo">
<option value="{$key}" <if condition="$key eq $info.type">selected</if>>{$vo}</option>
</foreach>
</select>
<present name='change.name'>
<input type="text" class="red form-control" value="{$shop_types[$change.type]|default=$change.type}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label"><eq name="info.id" value="1">人民币对美元汇率<else/>抽成比例</eq></label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="rate" value="{$info.rate}" />
<present name='change.rate'>
<input type="text" class="red form-control" value="{$change.rate}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">加盟时间</label>
<div class="col-md-6 col-sm-10">
<empty name="info.show_time">
<input type="text" class="form-control js-date" name="show_time" value="" />
<else/>
<input type="text" class="form-control js-date" name="show_time" value="{$info.show_time|date='Y-m-d',###}" />
</empty>
<span class="notice">时间为空默认为当前时间</span>
<present name='change.show_time'>
<input type="text" class="red form-control" value="{$change.show_time|date='Y-m-d',###}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">产品线</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="pros" value="{$info.pros}" />
<present name='change.pros'>
<input type="text" class="red form-control" value="{$change.pros}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">主营产品</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="brands" value="{$info.brands}" />
<present name='change.brands'>
<input type="text" class="red form-control" value="{$change.brands}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">申请人</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="tel_name" value="{$info.uname|default=''}" />
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">联系人</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="tel_name" value="{$info.tel_name}" />
<present name='change.tel_name'>
<input type="text" class="red form-control" value="{$change.tel_name}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">联系电话</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="tel" value="{$info.tel}" />
<present name='change.tel'>
<input type="text" class="red form-control" value="{$change.tel}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">联系邮箱</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="email" value="{$info.email}" />
<present name='change.email'>
<input type="text" class="red form-control" value="{$change.email}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">联系地址</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="address" value="{$info.address}" />
<present name='change.address'>
<input type="text" class="red form-control" value="{$change.address}" />
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">文件下载</label>
<div class="col-md-6 col-sm-10">
<notempty name="info.file1">
<a href="{:url('shop/Public/file_load',['id'=>$info.id,'file'=>'file1'])}">营业执照</a>
</notempty>
<notempty name="info.file2">
<a href="{:url('shop/Public/file_load',['id'=>$info.id,'file'=>'file2'])}">代理证书</a>
</notempty>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">店铺logo</label>
<div class="col-md-6 col-sm-10">
<input type="hidden" class="form-control" id="logo" name="logo" value="{$info.logo}">
<a href="javascript:uploadOneImage('图片上传','#logo');">上传图片</a>
<notempty name="pic_conf"><span class="notice">建议尺寸{$pic_conf.width}*{$pic_conf.height}</span></notempty>
<img id="logo-preview" src="{:cmf_get_image_url($info.logo)}" width="{$pic_conf.width}" height="{$pic_conf.height}">
<present name='change.logo'>
更改图片 <img src="{:cmf_get_image_url($change.logo)}" width="{$pic_conf.width}" height="{$pic_conf.height}">
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">店铺产品图标</label>
<div class="col-md-6 col-sm-10">
<input type="hidden" class="form-control" id="icon" name="icon" value="{$info.icon}">
<a href="javascript:uploadOneImage('图片上传','#icon');">上传图片</a>
<notempty name="pic_conf_icon"><span class="notice">建议尺寸{$pic_conf_icon.width}*{$pic_conf_icon.height}</span></notempty>
<img id="icon-preview" src="{:cmf_get_image_url($info.icon)}" width="{$pic_conf_icon.width}" height="{$pic_conf_icon.height}">
<present name='change.icon'>
更改图片 <img src="{:cmf_get_image_url($change.icon)}" width="{$pic_conf_icon.width}" height="{$pic_conf_icon.height}">
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">审核模式</label>
<div class="col-md-6 col-sm-10">
<foreach name="is_review" item="vo">
<label class="radio-inline">
<input type="radio" name="is_review" value="{$key}" <if condition="$key eq $info.is_review">checked</if>/>{$vo}
</label>
</foreach>
<present name='change.is_review'>
<span class="red">{$is_review[$info.is_review]|default=$info.is_review}</span>
</present>
<p class="notice">审核模式由商家在我的店铺修改</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">简介</label>
<div class="col-md-6 col-sm-10">
<textarea class="form-control" name="dsc" rows="5" >{$info.dsc}</textarea>
<present name='change.dsc'>
<textarea class="red form-control" rows="5" >{$change.dsc}</textarea>
</present>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">排序</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" name="sort" value="{$info.sort|default=1000}" />
<present name='change.sort'>
<input type="text" class="red form-control" value="{$change.sort}" />
</present>
</div>
</div>
<include file="public@adsc" /> | 39.756637 | 134 | 0.585977 |
22d8743c7f923a9bc8b526ab8d20a2dcb0371a8d | 341 | kt | Kotlin | android/testData/lint/missingPermissionKotlin.kt | phpc0de/idea-android | 79e20f027ca1d047b91aa7acd92fb71fa2968a09 | [
"Apache-2.0"
] | 831 | 2016-06-09T06:55:34.000Z | 2022-03-30T11:17:10.000Z | android/testData/lint/missingPermissionKotlin.kt | phpc0de/idea-android | 79e20f027ca1d047b91aa7acd92fb71fa2968a09 | [
"Apache-2.0"
] | 19 | 2017-10-27T00:36:35.000Z | 2021-02-04T13:59:45.000Z | android/testData/lint/missingPermissionKotlin.kt | phpc0de/idea-android | 79e20f027ca1d047b91aa7acd92fb71fa2968a09 | [
"Apache-2.0"
] | 210 | 2016-07-05T12:22:36.000Z | 2022-03-19T09:07:15.000Z | package p1.p2
import android.annotation.SuppressLint
import android.app.Activity
import android.location.LocationManager
@Suppress("unused")
@SuppressLint("Registered")
class LocationTest : Activity() {
fun test(manager: LocationManager, provider: String) {
<error>manager.get<caret>LastKnownLocation(provider)</error>
}
}
| 24.357143 | 68 | 0.762463 |
21d6d42102da21b292510422ece6930d0e92a02c | 2,785 | html | HTML | rite_of_maturity/25.html | Vadskye/personal-website | a9f239ad6658ea300a5ba821ab4a907014492502 | [
"MIT"
] | null | null | null | rite_of_maturity/25.html | Vadskye/personal-website | a9f239ad6658ea300a5ba821ab4a907014492502 | [
"MIT"
] | null | null | null | rite_of_maturity/25.html | Vadskye/personal-website | a9f239ad6658ea300a5ba821ab4a907014492502 | [
"MIT"
] | null | null | null | <h2>Adventuring By Committee</h2>
<p>
Last week, the party noticed that Theodolus had gone missing<sup>1</sup>. They abandoned the corpses they were looting and raced after him. They chased his tracks back to the room with the tieflings, but there were too many exits to know which direction he went<sup>2</sup>, so they split up the gang to search for clues. The found a number of clues. Or more accurately, they found a number of large and potentially deadly monsters: giant dinosaur skeletons, a horde of zombies, snake people with human heads, minotaurs, a huge black dragon, an immense, animated pile of corpses, and a spider thing that shot webs at them behind a poisonous cloud. None of these things were Thedolus.
</p>
<p>
The party reluctantly gave up searching and stayed in the tiefling room to rest. At this point, Theodolus wandered in. He explained that he had been kidnapped by Astrius, who had just wanted to have a private conversation with him. Astrius claimed to be willing to kill Zedar, but unable to directly act against him until the party dealt with the cult. As proof of this, he gave information about the cult, revealing that it was run by a powerful iron golem named Makor. Makor has the Spark - the ability to craft animated golems out of raw materials, without any complex rituals. If Makor is defeated without being destroyed, the Spark could be harvested from him, granting its power to someone else - such as the party. In response, Silk claimed that Astrius was actually still working with Zedar, and could not be trusted. According to Silk, Zedar uses the dungeon to store monsters so he can selectively release them against towns to lure Rite of Maturity questers to their doom.
</p>
<p>
The party wrestled with the complexities of this information for a long time. Led by Clockwork, they organized a voting process, and after two rounds of voting, they all agreed to give up on figuring out what was going on and instead just go kill stuff. So they attacked the giant snakes with human heads, which went fairly well, and ended with a deal to get extra food for the tieflings. Show up this week to vote in a committee meeting about what to kill next!
</p>
<ol>
<li>The fact that he screamed loudly after being harpooned was helpful.</li>
<li>The fact that he was no longer screaming or struggling was unhelpful.</li>
</ol>
<h3>Stupid Awards</h3>
Everyone
<ul>
<li>Adventuring By Committee</li>
<li>Snake Charmer</li>
</ul>
Clockwork
<ul>
<li>Wandering Fangirl</li>
<li>Secretly Hates Minotaurs</li>
</ul>
Rucks
<ul>
<li>Dragon Thirsty</li>
<li>Gentleman Caller</li>
</ul>
Sir Patty Cakes
<ul>
<li>Sense No Motives</li>
</ul>
Theodolus
<ul>
<li>Oh, Hey Guys, What's Up?</li>
</ul>
Atana
<ul>
<li>Vaguely Racist Glare</li>
</ul>
| 47.20339 | 985 | 0.764452 |
61d8e14f781eb54be3fcbf6d4fb6b6ad2de5d92f | 52,677 | pls | SQL | svn_pod/hw/trunk/eagle/VET6_POD.pls | GliderWinchItems/embed | cc72aa7d8208db3871a15e38185e1e125fa7de47 | [
"MIT"
] | 1 | 2019-07-18T07:22:19.000Z | 2019-07-18T07:22:19.000Z | svn_pod/hw/trunk/eagle/VET6_POD.pls | GliderWinchItems/embed | cc72aa7d8208db3871a15e38185e1e125fa7de47 | [
"MIT"
] | null | null | null | svn_pod/hw/trunk/eagle/VET6_POD.pls | GliderWinchItems/embed | cc72aa7d8208db3871a15e38185e1e125fa7de47 | [
"MIT"
] | 2 | 2019-04-03T01:44:46.000Z | 2020-04-01T07:41:41.000Z | G75*
G70*
%OFA0B0*%
%FSLAX24Y24*%
%IPPOS*%
%LPD*%
%AMOC8*
5,1,8,0,0,1.08239X$1,22.5*
%
%ADD10C,0.0080*%
%ADD11C,0.0040*%
%ADD12C,0.0000*%
%ADD13C,0.0050*%
D10*
X001381Y000917D02*
X001381Y030838D01*
X036263Y030838D01*
X036263Y000917D01*
X036341Y000917D01*
X036263Y000917D02*
X001381Y000917D01*
D11*
X013403Y012425D02*
X013710Y012425D01*
X013403Y012732D01*
X013403Y012809D01*
X013480Y012885D01*
X013633Y012885D01*
X013710Y012809D01*
X013863Y012809D02*
X014170Y012502D01*
X014094Y012425D01*
X013940Y012425D01*
X013863Y012502D01*
X013863Y012809D01*
X013940Y012885D01*
X014094Y012885D01*
X014170Y012809D01*
X014170Y012502D01*
X014324Y012425D02*
X014631Y012425D01*
X014784Y012425D02*
X014937Y012578D01*
X014861Y012578D02*
X015091Y012578D01*
X015091Y012425D02*
X015091Y012885D01*
X014861Y012885D01*
X014784Y012809D01*
X014784Y012655D01*
X014861Y012578D01*
X014631Y012732D02*
X014477Y012885D01*
X014477Y012425D01*
X013945Y014054D02*
X013639Y014054D01*
X013562Y014130D01*
X013562Y014284D01*
X013639Y014360D01*
X013562Y014514D02*
X013562Y014821D01*
X013562Y014667D02*
X014022Y014667D01*
X013869Y014514D01*
X013945Y014360D02*
X014022Y014284D01*
X014022Y014130D01*
X013945Y014054D01*
X013945Y014974D02*
X013639Y014974D01*
X013945Y015281D01*
X013639Y015281D01*
X013562Y015204D01*
X013562Y015051D01*
X013639Y014974D01*
X013945Y014974D02*
X014022Y015051D01*
X014022Y015204D01*
X013945Y015281D01*
X013945Y015435D02*
X013639Y015435D01*
X013945Y015741D01*
X013639Y015741D01*
X013562Y015665D01*
X013562Y015511D01*
X013639Y015435D01*
X013945Y015435D02*
X014022Y015511D01*
X014022Y015665D01*
X013945Y015741D01*
X011499Y017086D02*
X011499Y017547D01*
X011268Y017547D01*
X011192Y017470D01*
X011192Y017317D01*
X011268Y017240D01*
X011499Y017240D01*
X011345Y017240D02*
X011192Y017086D01*
X011038Y017086D02*
X010731Y017086D01*
X010885Y017086D02*
X010885Y017547D01*
X011038Y017393D01*
X010578Y017470D02*
X010578Y017163D01*
X010271Y017470D01*
X010271Y017163D01*
X010348Y017086D01*
X010501Y017086D01*
X010578Y017163D01*
X010578Y017470D02*
X010501Y017547D01*
X010348Y017547D01*
X010271Y017470D01*
X010118Y017393D02*
X009964Y017547D01*
X009964Y017086D01*
X009811Y017086D02*
X010118Y017086D01*
X015952Y019917D02*
X016259Y019917D01*
X016106Y019917D02*
X016106Y020378D01*
X016259Y020224D01*
X016413Y020301D02*
X016413Y019994D01*
X016489Y019917D01*
X016643Y019917D01*
X016720Y019994D01*
X016413Y020301D01*
X016489Y020378D01*
X016643Y020378D01*
X016720Y020301D01*
X016720Y019994D01*
X016873Y019917D02*
X017180Y019917D01*
X017027Y019917D02*
X017027Y020378D01*
X017180Y020224D01*
X017333Y020301D02*
X017410Y020378D01*
X017564Y020378D01*
X017640Y020301D01*
X017640Y019994D01*
X017564Y019917D01*
X017410Y019917D01*
X017333Y019994D01*
X017439Y020819D02*
X016978Y020819D01*
X017132Y020819D02*
X017132Y021049D01*
X017209Y021126D01*
X017362Y021126D01*
X017439Y021049D01*
X017439Y020819D01*
X017132Y020972D02*
X016978Y021126D01*
X016978Y021279D02*
X016978Y021586D01*
X016978Y021433D02*
X017439Y021433D01*
X017285Y021279D01*
X017362Y021740D02*
X017055Y021740D01*
X017362Y022047D01*
X017055Y022047D01*
X016978Y021970D01*
X016978Y021816D01*
X017055Y021740D01*
X017362Y021740D02*
X017439Y021816D01*
X017439Y021970D01*
X017362Y022047D01*
X017362Y022200D02*
X017439Y022277D01*
X017439Y022430D01*
X017362Y022507D01*
X017285Y022507D01*
X017209Y022430D01*
X017132Y022507D01*
X017055Y022507D01*
X016978Y022430D01*
X016978Y022277D01*
X017055Y022200D01*
X017209Y022354D02*
X017209Y022430D01*
X015931Y022605D02*
X015777Y022605D01*
X015854Y022605D02*
X015854Y023065D01*
X015931Y023065D02*
X015777Y023065D01*
X015624Y022989D02*
X015624Y022682D01*
X015547Y022605D01*
X015393Y022605D01*
X015317Y022682D01*
X015163Y022605D02*
X014856Y022605D01*
X015010Y022605D02*
X015010Y023065D01*
X015163Y022912D01*
X015317Y022989D02*
X015393Y023065D01*
X015547Y023065D01*
X015624Y022989D01*
X014703Y022989D02*
X014703Y022682D01*
X014396Y022989D01*
X014396Y022682D01*
X014473Y022605D01*
X014626Y022605D01*
X014703Y022682D01*
X014703Y022989D02*
X014626Y023065D01*
X014473Y023065D01*
X014396Y022989D01*
X014243Y022989D02*
X014166Y023065D01*
X014012Y023065D01*
X013936Y022989D01*
X013936Y022912D01*
X014243Y022605D01*
X013936Y022605D01*
X017494Y025841D02*
X017494Y025994D01*
X017494Y025917D02*
X017954Y025917D01*
X017954Y025841D02*
X017954Y025994D01*
X017878Y026148D02*
X017571Y026148D01*
X017494Y026224D01*
X017494Y026378D01*
X017571Y026454D01*
X017494Y026608D02*
X017494Y026915D01*
X017494Y026761D02*
X017954Y026761D01*
X017801Y026608D01*
X017878Y026454D02*
X017954Y026378D01*
X017954Y026224D01*
X017878Y026148D01*
X017878Y027068D02*
X017571Y027068D01*
X017878Y027375D01*
X017571Y027375D01*
X017494Y027298D01*
X017494Y027145D01*
X017571Y027068D01*
X017878Y027068D02*
X017954Y027145D01*
X017954Y027298D01*
X017878Y027375D01*
X017878Y027529D02*
X017954Y027605D01*
X017954Y027759D01*
X017878Y027836D01*
X017801Y027836D01*
X017724Y027759D01*
X017648Y027836D01*
X017571Y027836D01*
X017494Y027759D01*
X017494Y027605D01*
X017571Y027529D01*
X017724Y027682D02*
X017724Y027759D01*
X024108Y022207D02*
X024108Y022053D01*
X024185Y021977D01*
X024491Y022284D01*
X024185Y022284D01*
X024108Y022207D01*
X024185Y021977D02*
X024491Y021977D01*
X024568Y022053D01*
X024568Y022207D01*
X024491Y022284D01*
X024108Y021823D02*
X024108Y021516D01*
X024108Y021363D02*
X024108Y021056D01*
X024108Y021209D02*
X024568Y021209D01*
X024415Y021056D01*
X024491Y020903D02*
X024568Y020826D01*
X024568Y020672D01*
X024491Y020596D01*
X024185Y020596D01*
X024108Y020672D01*
X024108Y020826D01*
X024185Y020903D01*
X024415Y021516D02*
X024568Y021670D01*
X024108Y021670D01*
X027190Y023446D02*
X027190Y023906D01*
X027420Y023676D01*
X027113Y023676D01*
X027573Y023523D02*
X027650Y023446D01*
X027803Y023446D01*
X027880Y023523D01*
X027573Y023829D01*
X027573Y023523D01*
X027573Y023829D02*
X027650Y023906D01*
X027803Y023906D01*
X027880Y023829D01*
X027880Y023523D01*
X028034Y023446D02*
X028340Y023446D01*
X028187Y023446D02*
X028187Y023906D01*
X028340Y023753D01*
X028494Y023829D02*
X028571Y023906D01*
X028724Y023906D01*
X028801Y023829D01*
X028801Y023523D01*
X028724Y023446D01*
X028571Y023446D01*
X028494Y023523D01*
X028954Y023446D02*
X029108Y023446D01*
X029031Y023446D02*
X029031Y023906D01*
X029108Y023906D02*
X028954Y023906D01*
X029634Y023827D02*
X029634Y023751D01*
X029941Y023444D01*
X029634Y023444D01*
X029591Y023047D02*
X029437Y023047D01*
X029361Y022970D01*
X029668Y022663D01*
X029591Y022587D01*
X029437Y022587D01*
X029361Y022663D01*
X029361Y022970D01*
X029207Y022970D02*
X029207Y022663D01*
X028900Y022970D01*
X028900Y022663D01*
X028977Y022587D01*
X029130Y022587D01*
X029207Y022663D01*
X029207Y022970D02*
X029130Y023047D01*
X028977Y023047D01*
X028900Y022970D01*
X029591Y023047D02*
X029668Y022970D01*
X029668Y022663D01*
X029821Y022587D02*
X030128Y022587D01*
X030281Y022587D02*
X030281Y022894D01*
X030435Y023047D01*
X030588Y022894D01*
X030588Y022587D01*
X030742Y022587D02*
X030895Y022740D01*
X030818Y022740D02*
X031049Y022740D01*
X031049Y022587D02*
X031049Y023047D01*
X030818Y023047D01*
X030742Y022970D01*
X030742Y022817D01*
X030818Y022740D01*
X030588Y022817D02*
X030281Y022817D01*
X030128Y022894D02*
X029974Y023047D01*
X029974Y022587D01*
X030248Y023444D02*
X030248Y023904D01*
X030401Y023904D02*
X030094Y023904D01*
X029941Y023827D02*
X029864Y023904D01*
X029711Y023904D01*
X029634Y023827D01*
X028407Y024585D02*
X028330Y024508D01*
X028024Y024508D01*
X027947Y024585D01*
X027947Y024739D01*
X028024Y024815D01*
X027947Y024969D02*
X027947Y025276D01*
X027947Y025429D02*
X027947Y025736D01*
X027947Y025583D02*
X028407Y025583D01*
X028254Y025429D01*
X028407Y025122D02*
X027947Y025122D01*
X028254Y024969D02*
X028407Y025122D01*
X028330Y024815D02*
X028407Y024739D01*
X028407Y024585D01*
X028177Y025889D02*
X028024Y025889D01*
X027947Y025966D01*
X027947Y026120D01*
X028024Y026196D01*
X028100Y026196D01*
X028177Y026120D01*
X028177Y025889D01*
X028330Y026043D01*
X028407Y026196D01*
X031164Y025070D02*
X031471Y025070D01*
X031471Y024840D01*
X031318Y024916D01*
X031241Y024916D01*
X031164Y024840D01*
X031164Y024686D01*
X031241Y024610D01*
X031394Y024610D01*
X031471Y024686D01*
X031625Y024610D02*
X031931Y024610D01*
X031778Y024610D02*
X031778Y025070D01*
X031931Y024916D01*
X032085Y024610D02*
X032392Y024610D01*
X032545Y024610D02*
X032699Y024763D01*
X032622Y024763D02*
X032852Y024763D01*
X032852Y024610D02*
X032852Y025070D01*
X032622Y025070D01*
X032545Y024993D01*
X032545Y024840D01*
X032622Y024763D01*
X032392Y024916D02*
X032238Y025070D01*
X032238Y024610D01*
X032390Y023640D02*
X032313Y023564D01*
X032313Y023487D01*
X032390Y023410D01*
X032313Y023334D01*
X032313Y023257D01*
X032390Y023180D01*
X032543Y023180D01*
X032620Y023257D01*
X032773Y023180D02*
X033080Y023180D01*
X032773Y023487D01*
X032773Y023564D01*
X032850Y023640D01*
X033003Y023640D01*
X033080Y023564D01*
X033387Y023640D02*
X033387Y023180D01*
X033540Y023180D02*
X033234Y023180D01*
X033540Y023487D02*
X033387Y023640D01*
X033694Y023564D02*
X033771Y023640D01*
X033924Y023640D01*
X034001Y023564D01*
X034001Y023257D01*
X033924Y023180D01*
X033771Y023180D01*
X033694Y023257D01*
X032620Y023564D02*
X032543Y023640D01*
X032390Y023640D01*
X032390Y023410D02*
X032466Y023410D01*
X032500Y021435D02*
X032654Y021435D01*
X032730Y021358D01*
X032500Y021435D02*
X032423Y021358D01*
X032423Y021281D01*
X032730Y020974D01*
X032423Y020974D01*
X032270Y021051D02*
X032193Y020974D01*
X032040Y020974D01*
X031963Y021051D01*
X031963Y021204D01*
X032040Y021281D01*
X032116Y021281D01*
X032270Y021204D01*
X032270Y021435D01*
X031963Y021435D01*
X032884Y020974D02*
X033191Y020974D01*
X033037Y020974D02*
X033037Y021435D01*
X033191Y021281D01*
X033344Y021358D02*
X033421Y021435D01*
X033574Y021435D01*
X033651Y021358D01*
X033651Y021051D01*
X033574Y020974D01*
X033421Y020974D01*
X033344Y021051D01*
X033430Y019888D02*
X033353Y019811D01*
X033353Y019657D01*
X033430Y019581D01*
X033660Y019581D01*
X033507Y019581D02*
X033353Y019427D01*
X033200Y019427D02*
X032893Y019427D01*
X033046Y019427D02*
X033046Y019888D01*
X033200Y019734D01*
X033430Y019888D02*
X033660Y019888D01*
X033660Y019427D01*
X033602Y018801D02*
X033602Y018340D01*
X033755Y018340D02*
X033448Y018340D01*
X033295Y018340D02*
X032988Y018340D01*
X033141Y018340D02*
X033141Y018801D01*
X033295Y018647D01*
X033602Y018801D02*
X033755Y018647D01*
X033908Y018570D02*
X033985Y018494D01*
X034215Y018494D01*
X034062Y018494D02*
X033908Y018340D01*
X033908Y018570D02*
X033908Y018724D01*
X033985Y018801D01*
X034215Y018801D01*
X034215Y018340D01*
X035443Y018404D02*
X035904Y018404D01*
X035750Y018251D01*
X035673Y018097D02*
X035597Y018020D01*
X035597Y017790D01*
X035443Y017790D02*
X035904Y017790D01*
X035904Y018020D01*
X035827Y018097D01*
X035673Y018097D01*
X035597Y017944D02*
X035443Y018097D01*
X035443Y018251D02*
X035443Y018558D01*
X035443Y018711D02*
X035750Y019018D01*
X035827Y019018D01*
X035904Y018941D01*
X035904Y018788D01*
X035827Y018711D01*
X035443Y018711D02*
X035443Y019018D01*
X035673Y019171D02*
X035673Y019478D01*
X035443Y019402D02*
X035904Y019402D01*
X035673Y019171D01*
X035600Y019929D02*
X035140Y019929D01*
X035293Y019929D02*
X035293Y020159D01*
X035370Y020235D01*
X035523Y020235D01*
X035600Y020159D01*
X035600Y019929D01*
X035293Y020082D02*
X035140Y020235D01*
X035140Y020389D02*
X035140Y020696D01*
X035140Y020849D02*
X035447Y021156D01*
X035523Y021156D01*
X035600Y021079D01*
X035600Y020926D01*
X035523Y020849D01*
X035600Y020542D02*
X035140Y020542D01*
X035140Y020849D02*
X035140Y021156D01*
X035140Y021310D02*
X035447Y021616D01*
X035523Y021616D01*
X035600Y021540D01*
X035600Y021386D01*
X035523Y021310D01*
X035140Y021310D02*
X035140Y021616D01*
X035346Y021849D02*
X035270Y021926D01*
X035270Y022080D01*
X035346Y022156D01*
X035270Y022310D02*
X035270Y022617D01*
X035270Y022770D02*
X035577Y023077D01*
X035653Y023077D01*
X035730Y023000D01*
X035730Y022847D01*
X035653Y022770D01*
X035730Y022463D02*
X035270Y022463D01*
X035270Y022770D02*
X035270Y023077D01*
X035346Y023230D02*
X035270Y023307D01*
X035270Y023461D01*
X035346Y023537D01*
X035423Y023537D01*
X035500Y023461D01*
X035500Y023307D01*
X035577Y023230D01*
X035653Y023230D01*
X035730Y023307D01*
X035730Y023461D01*
X035653Y023537D01*
X035577Y023537D01*
X035500Y023461D01*
X035500Y023307D02*
X035423Y023230D01*
X035346Y023230D01*
X035193Y023907D02*
X035193Y024138D01*
X035270Y024214D01*
X035423Y024214D01*
X035500Y024138D01*
X035500Y023907D01*
X035040Y023907D01*
X035193Y024061D02*
X035040Y024214D01*
X035040Y024368D02*
X035040Y024675D01*
X035040Y024828D02*
X035347Y025135D01*
X035423Y025135D01*
X035500Y025058D01*
X035500Y024905D01*
X035423Y024828D01*
X035500Y024521D02*
X035040Y024521D01*
X035040Y024828D02*
X035040Y025135D01*
X035040Y025289D02*
X035040Y025595D01*
X035040Y025442D02*
X035500Y025442D01*
X035347Y025289D01*
X035500Y024521D02*
X035347Y024368D01*
X035730Y022463D02*
X035577Y022310D01*
X035653Y022156D02*
X035730Y022080D01*
X035730Y021926D01*
X035653Y021849D01*
X035346Y021849D01*
X035600Y020542D02*
X035447Y020389D01*
X032739Y019734D02*
X032586Y019888D01*
X032586Y019427D01*
X032739Y019427D02*
X032432Y019427D01*
X032279Y019504D02*
X032202Y019427D01*
X032049Y019427D01*
X031972Y019504D01*
X031972Y019581D01*
X032049Y019657D01*
X032279Y019657D01*
X032279Y019504D01*
X032279Y019657D02*
X032126Y019811D01*
X031972Y019888D01*
X030916Y020253D02*
X030839Y020177D01*
X030686Y020177D01*
X030609Y020253D01*
X030456Y020177D02*
X030149Y020177D01*
X030302Y020177D02*
X030302Y020637D01*
X030456Y020483D01*
X030609Y020560D02*
X030686Y020637D01*
X030839Y020637D01*
X030916Y020560D01*
X030916Y020253D01*
X029995Y020177D02*
X029688Y020483D01*
X029688Y020560D01*
X029765Y020637D01*
X029919Y020637D01*
X029995Y020560D01*
X029995Y020177D02*
X029688Y020177D01*
X029535Y020177D02*
X029228Y020177D01*
X029381Y020177D02*
X029381Y020637D01*
X029535Y020483D01*
X028807Y020568D02*
X028500Y020568D01*
X028654Y020568D02*
X028654Y020108D01*
X028347Y020108D02*
X028040Y020108D01*
X028193Y020108D02*
X028193Y020568D01*
X028347Y020415D01*
X028729Y019224D02*
X028652Y019147D01*
X028652Y019070D01*
X028729Y018994D01*
X028882Y018994D01*
X028959Y019070D01*
X028959Y019147D01*
X028882Y019224D01*
X028729Y019224D01*
X028729Y018994D02*
X028652Y018917D01*
X028652Y018840D01*
X028729Y018764D01*
X028882Y018764D01*
X028959Y018840D01*
X028959Y018917D01*
X028882Y018994D01*
X029112Y019147D02*
X029419Y018840D01*
X029342Y018764D01*
X029189Y018764D01*
X029112Y018840D01*
X029112Y019147D01*
X029189Y019224D01*
X029342Y019224D01*
X029419Y019147D01*
X029419Y018840D01*
X029572Y018764D02*
X029879Y018764D01*
X029726Y018764D02*
X029726Y019224D01*
X029879Y019070D01*
X030033Y018994D02*
X030110Y018917D01*
X030340Y018917D01*
X030340Y018764D02*
X030340Y019224D01*
X030110Y019224D01*
X030033Y019147D01*
X030033Y018994D01*
X030186Y018917D02*
X030033Y018764D01*
X029975Y018192D02*
X030205Y017962D01*
X029898Y017962D01*
X029975Y017732D02*
X029975Y018192D01*
X030359Y018116D02*
X030436Y018192D01*
X030589Y018192D01*
X030666Y018116D01*
X030359Y018116D02*
X030359Y018039D01*
X030666Y017732D01*
X030359Y017732D01*
X030819Y017732D02*
X031126Y017732D01*
X030973Y017732D02*
X030973Y018192D01*
X031126Y018039D01*
X031279Y018116D02*
X031356Y018192D01*
X031510Y018192D01*
X031586Y018116D01*
X031586Y017809D01*
X031510Y017732D01*
X031356Y017732D01*
X031279Y017809D01*
X032604Y018340D02*
X032604Y018801D01*
X032834Y018570D01*
X032527Y018570D01*
X035534Y015992D02*
X035534Y015838D01*
X035611Y015762D01*
X035764Y015762D02*
X035841Y015915D01*
X035841Y015992D01*
X035764Y016068D01*
X035611Y016068D01*
X035534Y015992D01*
X035764Y015762D02*
X035995Y015762D01*
X035995Y016068D01*
X035918Y015608D02*
X035995Y015531D01*
X035995Y015378D01*
X035918Y015301D01*
X035918Y015608D02*
X035841Y015608D01*
X035534Y015301D01*
X035534Y015608D01*
X035534Y015148D02*
X035534Y014841D01*
X035534Y014994D02*
X035995Y014994D01*
X035841Y014841D01*
X035764Y014687D02*
X035688Y014611D01*
X035688Y014380D01*
X035534Y014380D02*
X035995Y014380D01*
X035995Y014611D01*
X035918Y014687D01*
X035764Y014687D01*
X035688Y014534D02*
X035534Y014687D01*
X034350Y014506D02*
X034350Y014045D01*
X034350Y014199D02*
X034120Y014199D01*
X034043Y014276D01*
X034043Y014429D01*
X034120Y014506D01*
X034350Y014506D01*
X034196Y014199D02*
X034043Y014045D01*
X033889Y014045D02*
X033583Y014045D01*
X033736Y014045D02*
X033736Y014506D01*
X033889Y014352D01*
X033429Y014429D02*
X033352Y014506D01*
X033199Y014506D01*
X033122Y014429D01*
X033122Y014352D01*
X033429Y014045D01*
X033122Y014045D01*
X032969Y014122D02*
X032892Y014045D01*
X032739Y014045D01*
X032662Y014122D01*
X032662Y014199D01*
X032739Y014276D01*
X032815Y014276D01*
X032739Y014276D02*
X032662Y014352D01*
X032662Y014429D01*
X032739Y014506D01*
X032892Y014506D01*
X032969Y014429D01*
X032003Y014104D02*
X031542Y014104D01*
X031542Y013951D02*
X031542Y014258D01*
X031849Y013951D02*
X032003Y014104D01*
X031542Y013797D02*
X031542Y013490D01*
X031542Y013337D02*
X031542Y013030D01*
X031542Y013183D02*
X032003Y013183D01*
X031849Y013030D01*
X031773Y012876D02*
X031696Y012800D01*
X031696Y012570D01*
X031696Y012723D02*
X031542Y012876D01*
X031773Y012876D02*
X031926Y012876D01*
X032003Y012800D01*
X032003Y012570D01*
X031542Y012570D01*
X031501Y011994D02*
X031425Y011917D01*
X031501Y011994D02*
X031655Y011994D01*
X031731Y011917D01*
X031731Y011610D01*
X031655Y011534D01*
X031501Y011534D01*
X031425Y011610D01*
X031271Y011534D02*
X030964Y011534D01*
X030811Y011534D02*
X030504Y011534D01*
X030657Y011534D02*
X030657Y011994D01*
X030811Y011841D01*
X031118Y011994D02*
X031118Y011534D01*
X031271Y011841D02*
X031118Y011994D01*
X030350Y011917D02*
X030350Y011841D01*
X030274Y011764D01*
X030120Y011764D01*
X030044Y011687D01*
X030044Y011610D01*
X030120Y011534D01*
X030274Y011534D01*
X030350Y011610D01*
X030350Y011687D01*
X030274Y011764D01*
X030120Y011764D02*
X030044Y011841D01*
X030044Y011917D01*
X030120Y011994D01*
X030274Y011994D01*
X030350Y011917D01*
X030483Y010738D02*
X030637Y010738D01*
X030713Y010661D01*
X030713Y010585D01*
X030637Y010508D01*
X030406Y010508D01*
X030406Y010661D02*
X030483Y010738D01*
X030406Y010661D02*
X030406Y010354D01*
X030483Y010278D01*
X030637Y010278D01*
X030713Y010354D01*
X030658Y010311D02*
X030658Y010004D01*
X030965Y010311D01*
X031041Y010311D01*
X031118Y010235D01*
X031118Y010081D01*
X031041Y010004D01*
X031041Y009851D02*
X031118Y009774D01*
X031118Y009621D01*
X031041Y009544D01*
X031041Y009851D02*
X030965Y009851D01*
X030658Y009544D01*
X030658Y009851D01*
X030867Y010278D02*
X031174Y010278D01*
X031327Y010278D02*
X031634Y010278D01*
X031481Y010278D02*
X031481Y010738D01*
X031634Y010585D01*
X031788Y010661D02*
X031864Y010738D01*
X032018Y010738D01*
X032094Y010661D01*
X032094Y010354D01*
X032018Y010278D01*
X031864Y010278D01*
X031788Y010354D01*
X031174Y010585D02*
X031020Y010738D01*
X031020Y010278D01*
X030658Y009391D02*
X030658Y009084D01*
X030658Y009237D02*
X031118Y009237D01*
X030965Y009084D01*
X031041Y008930D02*
X031118Y008854D01*
X031118Y008700D01*
X031041Y008623D01*
X030735Y008623D01*
X030658Y008700D01*
X030658Y008854D01*
X030735Y008930D01*
X030561Y008502D02*
X030408Y008502D01*
X030331Y008425D01*
X030638Y008118D01*
X030561Y008041D01*
X030408Y008041D01*
X030331Y008118D01*
X030331Y008425D01*
X030178Y008425D02*
X030178Y008348D01*
X030101Y008272D01*
X029871Y008272D01*
X029871Y008425D02*
X029947Y008502D01*
X030101Y008502D01*
X030178Y008425D01*
X030178Y008118D02*
X030101Y008041D01*
X029947Y008041D01*
X029871Y008118D01*
X029871Y008425D01*
X030561Y008502D02*
X030638Y008425D01*
X030638Y008118D01*
X030791Y008041D02*
X031098Y008041D01*
X030945Y008041D02*
X030945Y008502D01*
X031098Y008348D01*
X031252Y008272D02*
X031328Y008195D01*
X031559Y008195D01*
X031559Y008041D02*
X031559Y008502D01*
X031328Y008502D01*
X031252Y008425D01*
X031252Y008272D01*
X031405Y008195D02*
X031252Y008041D01*
X030707Y007487D02*
X030477Y007487D01*
X030400Y007411D01*
X030400Y007257D01*
X030477Y007180D01*
X030707Y007180D01*
X030707Y007027D02*
X030707Y007487D01*
X030553Y007180D02*
X030400Y007027D01*
X030246Y007027D02*
X029940Y007027D01*
X030093Y007027D02*
X030093Y007487D01*
X030246Y007334D01*
X029786Y007334D02*
X029633Y007487D01*
X029633Y007027D01*
X029786Y007027D02*
X029479Y007027D01*
X029326Y007104D02*
X029019Y007411D01*
X029019Y007104D01*
X029096Y007027D01*
X029249Y007027D01*
X029326Y007104D01*
X029326Y007411D01*
X029249Y007487D01*
X029096Y007487D01*
X029019Y007411D01*
X029226Y006225D02*
X029149Y006148D01*
X029456Y005841D01*
X029379Y005765D01*
X029226Y005765D01*
X029149Y005841D01*
X029149Y006148D01*
X029226Y006225D02*
X029379Y006225D01*
X029456Y006148D01*
X029456Y005841D01*
X029610Y005765D02*
X029916Y005765D01*
X029610Y006072D01*
X029610Y006148D01*
X029686Y006225D01*
X029840Y006225D01*
X029916Y006148D01*
X030223Y006225D02*
X030223Y005765D01*
X030186Y005622D02*
X029879Y005315D01*
X029802Y005315D01*
X029802Y005161D02*
X029802Y004854D01*
X029802Y004701D02*
X029802Y004394D01*
X029802Y004547D02*
X030263Y004547D01*
X030109Y004394D01*
X030186Y004241D02*
X030263Y004164D01*
X030263Y004010D01*
X030186Y003934D01*
X029879Y003934D01*
X029802Y004010D01*
X029802Y004164D01*
X029879Y004241D01*
X030109Y004854D02*
X030263Y005008D01*
X029802Y005008D01*
X030263Y005315D02*
X030263Y005622D01*
X030186Y005622D01*
X030070Y005765D02*
X030377Y005765D01*
X030530Y005841D02*
X030607Y005765D01*
X030760Y005765D01*
X030837Y005841D01*
X030837Y006148D01*
X030760Y006225D01*
X030607Y006225D01*
X030530Y006148D01*
X030377Y006072D02*
X030223Y006225D01*
X032134Y006773D02*
X032441Y006773D01*
X032134Y007080D01*
X032134Y007157D01*
X032211Y007234D01*
X032365Y007234D01*
X032441Y007157D01*
X032748Y007234D02*
X032748Y006773D01*
X032595Y006773D02*
X032902Y006773D01*
X033055Y006773D02*
X033362Y006773D01*
X033209Y006773D02*
X033209Y007234D01*
X033362Y007080D01*
X033516Y007004D02*
X033592Y006927D01*
X033822Y006927D01*
X033669Y006927D02*
X033516Y006773D01*
X033516Y007004D02*
X033516Y007157D01*
X033592Y007234D01*
X033822Y007234D01*
X033822Y006773D01*
X032902Y007080D02*
X032748Y007234D01*
X033371Y007901D02*
X033524Y007901D01*
X033601Y007978D01*
X033294Y008285D01*
X033294Y007978D01*
X033371Y007901D01*
X033601Y007978D02*
X033601Y008285D01*
X033524Y008362D01*
X033371Y008362D01*
X033294Y008285D01*
X033755Y008285D02*
X033831Y008362D01*
X033985Y008362D01*
X034062Y008285D01*
X033755Y008285D02*
X033755Y008208D01*
X034062Y007901D01*
X033755Y007901D01*
X034215Y007901D02*
X034522Y007901D01*
X034675Y007901D02*
X034829Y008055D01*
X034752Y008055D02*
X034982Y008055D01*
X034982Y007901D02*
X034982Y008362D01*
X034752Y008362D01*
X034675Y008285D01*
X034675Y008131D01*
X034752Y008055D01*
X034522Y008208D02*
X034368Y008362D01*
X034368Y007901D01*
X035440Y007915D02*
X035440Y007609D01*
X035440Y007762D02*
X035901Y007762D01*
X035747Y007609D01*
X035824Y007455D02*
X035901Y007378D01*
X035901Y007225D01*
X035824Y007148D01*
X035517Y007148D01*
X035440Y007225D01*
X035440Y007378D01*
X035517Y007455D01*
X035440Y008069D02*
X035747Y008376D01*
X035824Y008376D01*
X035901Y008299D01*
X035901Y008146D01*
X035824Y008069D01*
X035440Y008069D02*
X035440Y008376D01*
X035517Y008529D02*
X035440Y008606D01*
X035440Y008759D01*
X035517Y008836D01*
X035594Y008836D01*
X035670Y008759D01*
X035670Y008529D01*
X035517Y008529D01*
X035670Y008529D02*
X035824Y008683D01*
X035901Y008836D01*
X035653Y004741D02*
X035730Y004664D01*
X035730Y004358D01*
X035653Y004281D01*
X035500Y004281D01*
X035423Y004358D01*
X035270Y004281D02*
X034963Y004281D01*
X035116Y004281D02*
X035116Y004741D01*
X035270Y004588D01*
X035423Y004664D02*
X035500Y004741D01*
X035653Y004741D01*
X034809Y004664D02*
X034732Y004741D01*
X034579Y004741D01*
X034502Y004664D01*
X034502Y004588D01*
X034809Y004281D01*
X034502Y004281D01*
X034349Y004281D02*
X034349Y004358D01*
X034042Y004664D01*
X034042Y004741D01*
X034349Y004741D01*
X032678Y001906D02*
X032448Y001906D01*
X032371Y001829D01*
X032371Y001676D01*
X032448Y001599D01*
X032678Y001599D01*
X032525Y001599D02*
X032371Y001445D01*
X032218Y001445D02*
X031911Y001445D01*
X031758Y001445D02*
X031451Y001445D01*
X031604Y001445D02*
X031604Y001906D01*
X031758Y001752D01*
X032065Y001906D02*
X032065Y001445D01*
X032218Y001752D02*
X032065Y001906D01*
X032678Y001906D02*
X032678Y001445D01*
X031297Y001522D02*
X031221Y001445D01*
X031067Y001445D01*
X030990Y001522D01*
X030990Y001599D01*
X031067Y001676D01*
X031144Y001676D01*
X031067Y001676D02*
X030990Y001752D01*
X030990Y001829D01*
X031067Y001906D01*
X031221Y001906D01*
X031297Y001829D01*
X027780Y004339D02*
X027703Y004263D01*
X027396Y004263D01*
X027320Y004339D01*
X027320Y004493D01*
X027396Y004570D01*
X027320Y004723D02*
X027320Y005030D01*
X027320Y005183D02*
X027320Y005490D01*
X027320Y005337D02*
X027780Y005337D01*
X027627Y005183D01*
X027780Y004877D02*
X027320Y004877D01*
X027627Y004723D02*
X027780Y004877D01*
X027703Y004570D02*
X027780Y004493D01*
X027780Y004339D01*
X027780Y005644D02*
X027550Y005644D01*
X027627Y005797D01*
X027627Y005874D01*
X027550Y005951D01*
X027396Y005951D01*
X027320Y005874D01*
X027320Y005721D01*
X027396Y005644D01*
X027780Y005644D02*
X027780Y005951D01*
X025569Y006484D02*
X025492Y006407D01*
X025339Y006407D01*
X025262Y006484D01*
X025108Y006407D02*
X024801Y006407D01*
X024955Y006407D02*
X024955Y006868D01*
X025108Y006714D01*
X025262Y006791D02*
X025339Y006868D01*
X025492Y006868D01*
X025569Y006791D01*
X025569Y006484D01*
X024648Y006484D02*
X024341Y006791D01*
X024341Y006484D01*
X024418Y006407D01*
X024571Y006407D01*
X024648Y006484D01*
X024648Y006791D01*
X024571Y006868D01*
X024418Y006868D01*
X024341Y006791D01*
X024188Y006638D02*
X024188Y006484D01*
X024111Y006407D01*
X023957Y006407D01*
X023881Y006484D01*
X023881Y006561D01*
X023957Y006638D01*
X024188Y006638D01*
X024034Y006791D01*
X023881Y006868D01*
X024341Y007346D02*
X024802Y007346D01*
X024802Y007576D01*
X024725Y007653D01*
X024571Y007653D01*
X024495Y007576D01*
X024495Y007346D01*
X024495Y007499D02*
X024341Y007653D01*
X024341Y007806D02*
X024341Y008113D01*
X024341Y007959D02*
X024802Y007959D01*
X024648Y007806D01*
X024725Y008266D02*
X024418Y008266D01*
X024725Y008573D01*
X024418Y008573D01*
X024341Y008496D01*
X024341Y008343D01*
X024418Y008266D01*
X024725Y008266D02*
X024802Y008343D01*
X024802Y008496D01*
X024725Y008573D01*
X024802Y008727D02*
X024802Y009034D01*
X024725Y009034D01*
X024418Y008727D01*
X024341Y008727D01*
X023330Y009765D02*
X023176Y009765D01*
X023100Y009842D01*
X022946Y009765D02*
X022639Y009765D01*
X022793Y009765D02*
X022793Y010225D01*
X022946Y010072D01*
X023100Y010149D02*
X023176Y010225D01*
X023330Y010225D01*
X023406Y010149D01*
X023406Y009842D01*
X023330Y009765D01*
X022486Y009842D02*
X022486Y010149D01*
X022409Y010225D01*
X022256Y010225D01*
X022179Y010149D01*
X022486Y009842D01*
X022409Y009765D01*
X022256Y009765D01*
X022179Y009842D01*
X022179Y010149D01*
X022025Y010225D02*
X022025Y009995D01*
X021872Y010072D01*
X021795Y010072D01*
X021719Y009995D01*
X021719Y009842D01*
X021795Y009765D01*
X021949Y009765D01*
X022025Y009842D01*
X022025Y010225D02*
X021719Y010225D01*
X020939Y011066D02*
X020632Y011066D01*
X020555Y011143D01*
X020555Y011296D01*
X020632Y011373D01*
X020555Y011526D02*
X020555Y011833D01*
X020555Y011680D02*
X021015Y011680D01*
X020862Y011526D01*
X020939Y011373D02*
X021015Y011296D01*
X021015Y011143D01*
X020939Y011066D01*
X020939Y011987D02*
X020632Y011987D01*
X020939Y012294D01*
X020632Y012294D01*
X020555Y012217D01*
X020555Y012063D01*
X020632Y011987D01*
X020939Y011987D02*
X021015Y012063D01*
X021015Y012217D01*
X020939Y012294D01*
X020939Y012447D02*
X021015Y012524D01*
X021015Y012677D01*
X020939Y012754D01*
X020862Y012754D01*
X020555Y012447D01*
X020555Y012754D01*
X020549Y013754D02*
X020243Y013754D01*
X020396Y013754D02*
X020396Y014214D01*
X020549Y014061D01*
X020703Y013754D02*
X021010Y013754D01*
X020856Y013754D02*
X020856Y014214D01*
X021010Y014061D01*
X021163Y014138D02*
X021470Y013831D01*
X021394Y013754D01*
X021240Y013754D01*
X021163Y013831D01*
X021163Y014138D01*
X021240Y014214D01*
X021394Y014214D01*
X021470Y014138D01*
X021470Y013831D01*
X021624Y013754D02*
X021931Y013754D01*
X021624Y014061D01*
X021624Y014138D01*
X021700Y014214D01*
X021854Y014214D01*
X021931Y014138D01*
X022084Y014214D02*
X022391Y013754D01*
X022328Y013629D02*
X022175Y013629D01*
X022098Y013552D01*
X022405Y013245D01*
X022328Y013169D01*
X022175Y013169D01*
X022098Y013245D01*
X022098Y013552D01*
X022328Y013629D02*
X022405Y013552D01*
X022405Y013245D01*
X022558Y013092D02*
X022865Y013092D01*
X022832Y012801D02*
X022832Y012341D01*
X022985Y012341D02*
X022679Y012341D01*
X022525Y012417D02*
X022448Y012341D01*
X022295Y012341D01*
X022218Y012417D01*
X022218Y012724D01*
X022525Y012417D01*
X022525Y012724D01*
X022448Y012801D01*
X022295Y012801D01*
X022218Y012724D01*
X022065Y012724D02*
X022065Y012648D01*
X021988Y012571D01*
X021758Y012571D01*
X021758Y012724D02*
X021758Y012417D01*
X021835Y012341D01*
X021988Y012341D01*
X022065Y012417D01*
X022065Y012724D02*
X021988Y012801D01*
X021835Y012801D01*
X021758Y012724D01*
X022832Y012801D02*
X022985Y012648D01*
X023139Y012724D02*
X023216Y012801D01*
X023369Y012801D01*
X023446Y012724D01*
X023446Y012417D01*
X023369Y012341D01*
X023216Y012341D01*
X023139Y012417D01*
X023172Y013169D02*
X023019Y013476D01*
X023005Y013754D02*
X023312Y013754D01*
X023005Y014061D01*
X023005Y014138D01*
X023081Y014214D01*
X023235Y014214D01*
X023312Y014138D01*
X023465Y014214D02*
X023772Y013754D01*
X023925Y013831D02*
X024002Y013754D01*
X024156Y013754D01*
X024232Y013831D01*
X024232Y013984D02*
X024079Y014061D01*
X024002Y014061D01*
X023925Y013984D01*
X023925Y013831D01*
X024016Y013629D02*
X023939Y013552D01*
X023939Y013399D01*
X024016Y013322D01*
X024246Y013322D01*
X024093Y013322D02*
X023939Y013169D01*
X023786Y013245D02*
X023786Y013399D01*
X023709Y013476D01*
X023556Y013476D01*
X023479Y013399D01*
X023479Y013322D01*
X023786Y013322D01*
X023786Y013245D02*
X023709Y013169D01*
X023556Y013169D01*
X023326Y013476D02*
X023172Y013169D01*
X022851Y013754D02*
X022544Y013754D01*
X022698Y013754D02*
X022698Y014214D01*
X022851Y014061D01*
X023094Y014441D02*
X023094Y014901D01*
X022864Y014901D01*
X022787Y014825D01*
X022787Y014671D01*
X022864Y014595D01*
X023094Y014595D01*
X023247Y014364D02*
X023554Y014364D01*
X023707Y014518D02*
X023707Y014595D01*
X023784Y014671D01*
X024014Y014671D01*
X024014Y014518D01*
X023938Y014441D01*
X023784Y014441D01*
X023707Y014518D01*
X023861Y014825D02*
X024014Y014671D01*
X023861Y014825D02*
X023707Y014901D01*
X024168Y014901D02*
X024475Y014901D01*
X024628Y014901D02*
X024935Y014901D01*
X024935Y014441D01*
X024628Y014441D01*
X024616Y014214D02*
X024463Y014214D01*
X024386Y014138D01*
X024693Y013831D01*
X024616Y013754D01*
X024463Y013754D01*
X024386Y013831D01*
X024386Y014138D01*
X024232Y014214D02*
X024232Y013984D01*
X024232Y014214D02*
X023925Y014214D01*
X024321Y014441D02*
X024321Y014901D01*
X024782Y014671D02*
X024935Y014671D01*
X025089Y014595D02*
X025089Y014901D01*
X025395Y014901D02*
X025395Y014595D01*
X025242Y014441D01*
X025089Y014595D01*
X024693Y014138D02*
X024616Y014214D01*
X024693Y014138D02*
X024693Y013831D01*
X024246Y013629D02*
X024246Y013169D01*
X024246Y013629D02*
X024016Y013629D01*
X022633Y014518D02*
X022633Y014825D01*
X022557Y014901D01*
X022403Y014901D01*
X022326Y014825D01*
X022326Y014518D01*
X022403Y014441D01*
X022557Y014441D01*
X022633Y014518D01*
X022173Y014441D02*
X022173Y014901D01*
X021943Y014901D01*
X021866Y014825D01*
X021866Y014518D01*
X021943Y014441D01*
X022173Y014441D01*
X021713Y014364D02*
X021406Y014364D01*
X021252Y014441D02*
X021252Y014748D01*
X021176Y014748D01*
X021099Y014671D01*
X021022Y014748D01*
X020945Y014671D01*
X020945Y014441D01*
X020792Y014441D02*
X020792Y014748D01*
X020715Y014748D01*
X020638Y014671D01*
X020562Y014748D01*
X020485Y014671D01*
X020485Y014441D01*
X020638Y014441D02*
X020638Y014671D01*
X021099Y014671D02*
X021099Y014441D01*
X021153Y015914D02*
X021307Y015914D01*
X021384Y015991D01*
X021077Y016298D01*
X021077Y015991D01*
X021153Y015914D01*
X021384Y015991D02*
X021384Y016298D01*
X021307Y016375D01*
X021153Y016375D01*
X021077Y016298D01*
X020923Y016144D02*
X020616Y016144D01*
X020693Y015914D02*
X020693Y016375D01*
X020923Y016144D01*
X021537Y015914D02*
X021844Y015914D01*
X021691Y015914D02*
X021691Y016375D01*
X021844Y016221D01*
X021997Y016298D02*
X022074Y016375D01*
X022228Y016375D01*
X022304Y016298D01*
X022304Y015991D01*
X022228Y015914D01*
X022074Y015914D01*
X021997Y015991D01*
X019506Y019726D02*
X019046Y019726D01*
X019199Y019726D02*
X019199Y019956D01*
X019276Y020033D01*
X019430Y020033D01*
X019506Y019956D01*
X019506Y019726D01*
X019199Y019879D02*
X019046Y020033D01*
X019046Y020186D02*
X019046Y020493D01*
X019046Y020340D02*
X019506Y020340D01*
X019353Y020186D01*
X019430Y020646D02*
X019123Y020646D01*
X019430Y020953D01*
X019123Y020953D01*
X019046Y020877D01*
X019046Y020723D01*
X019123Y020646D01*
X019430Y020646D02*
X019506Y020723D01*
X019506Y020877D01*
X019430Y020953D01*
X019276Y021107D02*
X019276Y021414D01*
X019046Y021337D02*
X019506Y021337D01*
X019276Y021107D01*
X024853Y026716D02*
X024776Y026793D01*
X024776Y026946D01*
X024853Y027023D01*
X024776Y027176D02*
X024776Y027483D01*
X024776Y027330D02*
X025236Y027330D01*
X025083Y027176D01*
X025160Y027023D02*
X025236Y026946D01*
X025236Y026793D01*
X025160Y026716D01*
X024853Y026716D01*
X024853Y027637D02*
X025160Y027944D01*
X024853Y027944D01*
X024776Y027867D01*
X024776Y027713D01*
X024853Y027637D01*
X025160Y027637D01*
X025236Y027713D01*
X025236Y027867D01*
X025160Y027944D01*
X025160Y028097D02*
X025083Y028097D01*
X025006Y028174D01*
X025006Y028327D01*
X024929Y028404D01*
X024853Y028404D01*
X024776Y028327D01*
X024776Y028174D01*
X024853Y028097D01*
X024929Y028097D01*
X025006Y028174D01*
X025006Y028327D02*
X025083Y028404D01*
X025160Y028404D01*
X025236Y028327D01*
X025236Y028174D01*
X025160Y028097D01*
X025813Y029194D02*
X025813Y029655D01*
X026043Y029424D01*
X025736Y029424D01*
X026196Y029194D02*
X026503Y029194D01*
X026350Y029194D02*
X026350Y029655D01*
X026503Y029501D01*
X026657Y029194D02*
X026963Y029194D01*
X026810Y029194D02*
X026810Y029655D01*
X026963Y029501D01*
X027117Y029578D02*
X027194Y029655D01*
X027347Y029655D01*
X027424Y029578D01*
X027424Y029271D01*
X027347Y029194D01*
X027194Y029194D01*
X027117Y029271D01*
X027208Y015537D02*
X027208Y015230D01*
X027515Y015537D01*
X027592Y015537D01*
X027669Y015460D01*
X027669Y015307D01*
X027592Y015230D01*
X027669Y014923D02*
X027208Y014923D01*
X027208Y014770D02*
X027208Y015077D01*
X027515Y014770D02*
X027669Y014923D01*
X027669Y014463D02*
X027208Y014463D01*
X027208Y014310D02*
X027208Y014616D01*
X027013Y014323D02*
X026936Y014323D01*
X026860Y014246D01*
X026783Y014323D01*
X026706Y014323D01*
X026630Y014246D01*
X026630Y014093D01*
X026706Y014016D01*
X026630Y013863D02*
X026630Y013556D01*
X026630Y013709D02*
X027090Y013709D01*
X026936Y013556D01*
X026630Y013402D02*
X026630Y013096D01*
X026630Y013249D02*
X027090Y013249D01*
X026936Y013096D01*
X027013Y012942D02*
X027090Y012865D01*
X027090Y012712D01*
X027013Y012635D01*
X026706Y012635D01*
X026630Y012712D01*
X026630Y012865D01*
X026706Y012942D01*
X027285Y013849D02*
X027208Y013926D01*
X027208Y014079D01*
X027285Y014156D01*
X027090Y014093D02*
X027090Y014246D01*
X027013Y014323D01*
X026860Y014246D02*
X026860Y014170D01*
X027013Y014016D02*
X027090Y014093D01*
X027285Y013849D02*
X027592Y013849D01*
X027669Y013926D01*
X027669Y014079D01*
X027592Y014156D01*
X027515Y014310D02*
X027669Y014463D01*
X031542Y013644D02*
X032003Y013644D01*
X031849Y013490D01*
X026457Y009932D02*
X025997Y009932D01*
X025997Y009779D02*
X025997Y010086D01*
X026304Y009779D02*
X026457Y009932D01*
X026457Y009472D02*
X025997Y009472D01*
X025997Y009319D02*
X025997Y009626D01*
X026304Y009319D02*
X026457Y009472D01*
X025997Y009165D02*
X025997Y008858D01*
X025997Y009012D02*
X026457Y009012D01*
X026304Y008858D01*
X026380Y008705D02*
X026457Y008628D01*
X026457Y008475D01*
X026380Y008398D01*
X026074Y008398D01*
X025997Y008475D01*
X025997Y008628D01*
X026074Y008705D01*
X024119Y005612D02*
X024196Y005535D01*
X024196Y005228D01*
X024119Y005151D01*
X023966Y005151D01*
X023889Y005228D01*
X023735Y005151D02*
X023429Y005151D01*
X023582Y005151D02*
X023582Y005612D01*
X023735Y005458D01*
X023889Y005535D02*
X023966Y005612D01*
X024119Y005612D01*
X023275Y005535D02*
X023198Y005612D01*
X023045Y005612D01*
X022968Y005535D01*
X023275Y005228D01*
X023198Y005151D01*
X023045Y005151D01*
X022968Y005228D01*
X022968Y005535D01*
X022815Y005612D02*
X022508Y005612D01*
X022508Y005535D01*
X022815Y005228D01*
X022815Y005151D01*
X023275Y005228D02*
X023275Y005535D01*
X023216Y004615D02*
X023140Y004538D01*
X023140Y004385D01*
X023216Y004308D01*
X023523Y004615D01*
X023216Y004615D01*
X023216Y004308D02*
X023523Y004308D01*
X023600Y004385D01*
X023600Y004538D01*
X023523Y004615D01*
X023523Y004155D02*
X023216Y004155D01*
X023140Y004078D01*
X023140Y003924D01*
X023216Y003848D01*
X023523Y004155D01*
X023600Y004078D01*
X023600Y003924D01*
X023523Y003848D01*
X023216Y003848D01*
X023140Y003694D02*
X023140Y003387D01*
X023140Y003234D02*
X023600Y003234D01*
X023447Y003080D01*
X023600Y002927D01*
X023140Y002927D01*
X023140Y002774D02*
X023293Y002620D01*
X023293Y002697D02*
X023293Y002467D01*
X023140Y002467D02*
X023600Y002467D01*
X023600Y002697D01*
X023523Y002774D01*
X023370Y002774D01*
X023293Y002697D01*
X023370Y002313D02*
X023370Y002006D01*
X023140Y002006D02*
X023600Y002006D01*
X023600Y001853D02*
X023600Y001546D01*
X023600Y001699D02*
X023140Y001699D01*
X023140Y002313D02*
X023600Y002313D01*
X023447Y003387D02*
X023600Y003541D01*
X023140Y003541D01*
X022217Y002970D02*
X022217Y002510D01*
X022217Y002663D02*
X021987Y002663D01*
X021910Y002740D01*
X021910Y002894D01*
X021987Y002970D01*
X022217Y002970D01*
X022063Y002663D02*
X021910Y002510D01*
X021756Y002510D02*
X021449Y002510D01*
X021603Y002510D02*
X021603Y002970D01*
X021756Y002817D01*
X021296Y002894D02*
X021296Y002587D01*
X020989Y002894D01*
X020989Y002587D01*
X021066Y002510D01*
X021219Y002510D01*
X021296Y002587D01*
X021296Y002894D02*
X021219Y002970D01*
X021066Y002970D01*
X020989Y002894D01*
X020836Y002740D02*
X020836Y002587D01*
X020759Y002510D01*
X020605Y002510D01*
X020529Y002587D01*
X020529Y002663D01*
X020605Y002740D01*
X020836Y002740D01*
X020682Y002894D01*
X020529Y002970D01*
X018645Y007044D02*
X018645Y007505D01*
X018415Y007505D01*
X018339Y007428D01*
X018339Y007274D01*
X018415Y007198D01*
X018645Y007198D01*
X018492Y007198D02*
X018339Y007044D01*
X018185Y007044D02*
X017878Y007044D01*
X018032Y007044D02*
X018032Y007505D01*
X018185Y007351D01*
X017725Y007428D02*
X017725Y007121D01*
X017418Y007428D01*
X017418Y007121D01*
X017495Y007044D01*
X017648Y007044D01*
X017725Y007121D01*
X017725Y007428D02*
X017648Y007505D01*
X017495Y007505D01*
X017418Y007428D01*
X017264Y007505D02*
X017264Y007274D01*
X017111Y007351D01*
X017034Y007351D01*
X016957Y007274D01*
X016957Y007121D01*
X017034Y007044D01*
X017188Y007044D01*
X017264Y007121D01*
X017264Y007505D02*
X016957Y007505D01*
X019155Y007624D02*
X019232Y007548D01*
X019385Y007548D01*
X019462Y007624D01*
X019615Y007624D02*
X019692Y007548D01*
X019846Y007548D01*
X019922Y007624D01*
X019615Y007931D01*
X019615Y007624D01*
X019615Y007931D02*
X019692Y008008D01*
X019846Y008008D01*
X019922Y007931D01*
X019922Y007624D01*
X020076Y007548D02*
X020383Y007548D01*
X020229Y007548D02*
X020229Y008008D01*
X020383Y007855D01*
X020536Y007931D02*
X020613Y008008D01*
X020766Y008008D01*
X020843Y007931D01*
X020843Y007624D01*
X020766Y007548D01*
X020613Y007548D01*
X020536Y007624D01*
X019462Y007931D02*
X019385Y008008D01*
X019232Y008008D01*
X019155Y007931D01*
X019155Y007855D01*
X019232Y007778D01*
X019155Y007701D01*
X019155Y007624D01*
X019232Y007778D02*
X019309Y007778D01*
X008624Y026994D02*
X008164Y026994D01*
X008317Y026994D02*
X008317Y027224D01*
X008394Y027301D01*
X008547Y027301D01*
X008624Y027224D01*
X008624Y026994D01*
X008317Y027147D02*
X008164Y027301D01*
X008164Y027454D02*
X008164Y027761D01*
X008164Y027608D02*
X008624Y027608D01*
X008471Y027454D01*
X008547Y027915D02*
X008240Y027915D01*
X008547Y028221D01*
X008240Y028221D01*
X008164Y028145D01*
X008164Y027991D01*
X008240Y027915D01*
X008547Y027915D02*
X008624Y027991D01*
X008624Y028145D01*
X008547Y028221D01*
X008547Y028375D02*
X008240Y028375D01*
X008547Y028682D01*
X008240Y028682D01*
X008164Y028605D01*
X008164Y028452D01*
X008240Y028375D01*
X008547Y028375D02*
X008624Y028452D01*
X008624Y028605D01*
X008547Y028682D01*
D12*
X003063Y016473D02*
X003065Y016515D01*
X003071Y016556D01*
X003081Y016597D01*
X003095Y016636D01*
X003113Y016674D01*
X003134Y016710D01*
X003158Y016744D01*
X003186Y016775D01*
X003217Y016804D01*
X003250Y016829D01*
X003286Y016851D01*
X003323Y016870D01*
X003362Y016885D01*
X003403Y016896D01*
X003444Y016903D01*
X003486Y016906D01*
X003527Y016905D01*
X003569Y016900D01*
X003610Y016891D01*
X003650Y016878D01*
X003688Y016861D01*
X003724Y016841D01*
X003759Y016817D01*
X003791Y016790D01*
X003820Y016760D01*
X003846Y016728D01*
X003869Y016693D01*
X003889Y016655D01*
X003904Y016617D01*
X003916Y016577D01*
X003924Y016536D01*
X003928Y016494D01*
X003928Y016452D01*
X003924Y016410D01*
X003916Y016369D01*
X003904Y016329D01*
X003889Y016291D01*
X003869Y016253D01*
X003846Y016218D01*
X003820Y016186D01*
X003791Y016156D01*
X003759Y016129D01*
X003724Y016105D01*
X003688Y016085D01*
X003650Y016068D01*
X003610Y016055D01*
X003569Y016046D01*
X003527Y016041D01*
X003486Y016040D01*
X003444Y016043D01*
X003403Y016050D01*
X003362Y016061D01*
X003323Y016076D01*
X003286Y016095D01*
X003250Y016117D01*
X003217Y016142D01*
X003186Y016171D01*
X003158Y016202D01*
X003134Y016236D01*
X003113Y016272D01*
X003095Y016310D01*
X003081Y016349D01*
X003071Y016390D01*
X003065Y016431D01*
X003063Y016473D01*
X003063Y010528D02*
X003065Y010570D01*
X003071Y010611D01*
X003081Y010652D01*
X003095Y010691D01*
X003113Y010729D01*
X003134Y010765D01*
X003158Y010799D01*
X003186Y010830D01*
X003217Y010859D01*
X003250Y010884D01*
X003286Y010906D01*
X003323Y010925D01*
X003362Y010940D01*
X003403Y010951D01*
X003444Y010958D01*
X003486Y010961D01*
X003527Y010960D01*
X003569Y010955D01*
X003610Y010946D01*
X003650Y010933D01*
X003688Y010916D01*
X003724Y010896D01*
X003759Y010872D01*
X003791Y010845D01*
X003820Y010815D01*
X003846Y010783D01*
X003869Y010748D01*
X003889Y010710D01*
X003904Y010672D01*
X003916Y010632D01*
X003924Y010591D01*
X003928Y010549D01*
X003928Y010507D01*
X003924Y010465D01*
X003916Y010424D01*
X003904Y010384D01*
X003889Y010346D01*
X003869Y010308D01*
X003846Y010273D01*
X003820Y010241D01*
X003791Y010211D01*
X003759Y010184D01*
X003724Y010160D01*
X003688Y010140D01*
X003650Y010123D01*
X003610Y010110D01*
X003569Y010101D01*
X003527Y010096D01*
X003486Y010095D01*
X003444Y010098D01*
X003403Y010105D01*
X003362Y010116D01*
X003323Y010131D01*
X003286Y010150D01*
X003250Y010172D01*
X003217Y010197D01*
X003186Y010226D01*
X003158Y010257D01*
X003134Y010291D01*
X003113Y010327D01*
X003095Y010365D01*
X003081Y010404D01*
X003071Y010445D01*
X003065Y010486D01*
X003063Y010528D01*
D13*
X006151Y009133D02*
X006151Y008833D01*
X006226Y008757D01*
X006376Y008757D01*
X006451Y008833D01*
X006151Y009133D01*
X006226Y009208D01*
X006376Y009208D01*
X006451Y009133D01*
X006451Y008833D01*
X006611Y008833D02*
X006686Y008757D01*
X006836Y008757D01*
X006912Y008833D01*
X006611Y009133D01*
X006611Y008833D01*
X006611Y009133D02*
X006686Y009208D01*
X006836Y009208D01*
X006912Y009133D01*
X006912Y008833D01*
X007072Y008757D02*
X007372Y008757D01*
X007222Y008757D02*
X007222Y009208D01*
X007372Y009058D01*
X007532Y009208D02*
X007532Y008757D01*
X007682Y008908D01*
X007832Y008757D01*
X007832Y009208D01*
X007992Y009133D02*
X008067Y009208D01*
X008218Y009208D01*
X008293Y009133D01*
X008293Y009058D01*
X008218Y008983D01*
X008067Y008983D01*
X007992Y008908D01*
X007992Y008833D01*
X008067Y008757D01*
X008218Y008757D01*
X008293Y008833D01*
X010091Y011464D02*
X010016Y011539D01*
X010016Y011689D01*
X010091Y011764D01*
X010392Y011764D01*
X010467Y011689D01*
X010467Y011539D01*
X010392Y011464D01*
X010091Y011464D01*
X010167Y011614D02*
X010016Y011764D01*
X010091Y011925D02*
X010016Y012000D01*
X010016Y012150D01*
X010091Y012225D01*
X010392Y012225D01*
X010467Y012150D01*
X010467Y012000D01*
X010392Y011925D01*
X010091Y011925D01*
X010167Y012075D02*
X010016Y012225D01*
X010016Y012385D02*
X010016Y012685D01*
X010016Y012535D02*
X010467Y012535D01*
X010317Y012385D01*
X010392Y012845D02*
X010091Y012845D01*
X010392Y013146D01*
X010091Y013146D01*
X010016Y013070D01*
X010016Y012920D01*
X010091Y012845D01*
X010392Y012845D02*
X010467Y012920D01*
X010467Y013070D01*
X010392Y013146D01*
X010392Y013306D02*
X010467Y013381D01*
X010467Y013531D01*
X010392Y013606D01*
X010091Y013306D01*
X010016Y013381D01*
X010016Y013531D01*
X010091Y013606D01*
X010392Y013606D01*
X010392Y013306D02*
X010091Y013306D01*
X012261Y015479D02*
X012186Y015554D01*
X012186Y015704D01*
X012261Y015779D01*
X012561Y015779D01*
X012636Y015704D01*
X012636Y015554D01*
X012561Y015479D01*
X012261Y015479D01*
X012336Y015629D02*
X012186Y015779D01*
X012186Y015940D02*
X012186Y016240D01*
X012186Y016090D02*
X012636Y016090D01*
X012486Y015940D01*
X012561Y016400D02*
X012261Y016400D01*
X012561Y016700D01*
X012261Y016700D01*
X012186Y016625D01*
X012186Y016475D01*
X012261Y016400D01*
X012561Y016400D02*
X012636Y016475D01*
X012636Y016625D01*
X012561Y016700D01*
X012561Y016860D02*
X012636Y016935D01*
X012636Y017085D01*
X012561Y017160D01*
X012261Y016860D01*
X012186Y016935D01*
X012186Y017085D01*
X012261Y017160D01*
X012561Y017160D01*
X012500Y017200D02*
X012650Y017200D01*
X012725Y017275D01*
X012425Y017575D01*
X012425Y017275D01*
X012500Y017200D01*
X012725Y017275D02*
X012725Y017575D01*
X012650Y017650D01*
X012500Y017650D01*
X012425Y017575D01*
X012885Y017575D02*
X013185Y017275D01*
X013110Y017200D01*
X012960Y017200D01*
X012885Y017275D01*
X012885Y017575D01*
X012960Y017650D01*
X013110Y017650D01*
X013185Y017575D01*
X013185Y017275D01*
X013345Y017200D02*
X013646Y017200D01*
X013496Y017200D02*
X013496Y017650D01*
X013646Y017500D01*
X013806Y017650D02*
X014106Y017200D01*
X013806Y017200D02*
X014106Y017650D01*
X012561Y016860D02*
X012261Y016860D01*
X014998Y014652D02*
X014998Y014351D01*
X014998Y014501D02*
X015448Y014501D01*
X015298Y014351D01*
X015373Y014191D02*
X015073Y014191D01*
X014998Y014116D01*
X014998Y013966D01*
X015073Y013891D01*
X015373Y014191D01*
X015448Y014116D01*
X015448Y013966D01*
X015373Y013891D01*
X015073Y013891D01*
X014998Y013731D02*
X014998Y013431D01*
X014998Y013581D02*
X015448Y013581D01*
X015298Y013431D01*
X015373Y013271D02*
X015073Y013271D01*
X014998Y013195D01*
X014998Y013045D01*
X015073Y012970D01*
X015373Y012970D01*
X015448Y013045D01*
X015448Y013195D01*
X015373Y013271D01*
X015148Y013120D02*
X014998Y013271D01*
X019179Y013719D02*
X019254Y013644D01*
X019404Y013644D01*
X019479Y013719D01*
X019479Y013869D02*
X019329Y013944D01*
X019254Y013944D01*
X019179Y013869D01*
X019179Y013719D01*
X019479Y013869D02*
X019479Y014094D01*
X019179Y014094D01*
X019639Y014019D02*
X019639Y013944D01*
X019714Y013869D01*
X019639Y013794D01*
X019639Y013719D01*
X019714Y013644D01*
X019864Y013644D01*
X019939Y013719D01*
X019789Y013869D02*
X019714Y013869D01*
X019639Y014019D02*
X019714Y014094D01*
X019864Y014094D01*
X019939Y014019D01*
X020099Y014019D02*
X020099Y013869D01*
X020174Y013794D01*
X020399Y013794D01*
X020399Y013644D02*
X020399Y014094D01*
X020174Y014094D01*
X020099Y014019D01*
X020200Y013211D02*
X020125Y013136D01*
X020125Y012985D01*
X020200Y012910D01*
X020425Y012910D01*
X020425Y012760D02*
X020425Y013211D01*
X020200Y013211D01*
X019965Y013136D02*
X019890Y013211D01*
X019740Y013211D01*
X019665Y013136D01*
X019665Y013061D01*
X019740Y012985D01*
X019665Y012910D01*
X019665Y012835D01*
X019740Y012760D01*
X019890Y012760D01*
X019965Y012835D01*
X019815Y012985D02*
X019740Y012985D01*
X019505Y012985D02*
X019205Y012985D01*
X019280Y012760D02*
X019280Y013211D01*
X019505Y012985D01*
X022436Y015279D02*
X022436Y015354D01*
X022511Y015429D01*
X022587Y015429D01*
X022511Y015429D02*
X022436Y015504D01*
X022436Y015579D01*
X022511Y015654D01*
X022662Y015654D01*
X022737Y015579D01*
X022897Y015579D02*
X022972Y015654D01*
X023122Y015654D01*
X023197Y015579D01*
X023357Y015579D02*
X023357Y015429D01*
X023432Y015354D01*
X023657Y015354D01*
X023657Y015204D02*
X023657Y015654D01*
X023432Y015654D01*
X023357Y015579D01*
X023197Y015279D02*
X023122Y015204D01*
X022972Y015204D01*
X022897Y015279D01*
X022897Y015354D01*
X022972Y015429D01*
X023047Y015429D01*
X022972Y015429D02*
X022897Y015504D01*
X022897Y015579D01*
X022737Y015279D02*
X022662Y015204D01*
X022511Y015204D01*
X022436Y015279D01*
X026005Y019745D02*
X026155Y019745D01*
X026230Y019820D01*
X026390Y019820D02*
X026465Y019745D01*
X026615Y019745D01*
X026690Y019820D01*
X026390Y020121D01*
X026390Y019820D01*
X026690Y019820D02*
X026690Y020121D01*
X026615Y020196D01*
X026465Y020196D01*
X026390Y020121D01*
X026230Y020121D02*
X026155Y020196D01*
X026005Y020196D01*
X025930Y020121D01*
X025930Y020046D01*
X026005Y019970D01*
X025930Y019895D01*
X025930Y019820D01*
X026005Y019745D01*
X026005Y019970D02*
X026080Y019970D01*
X026851Y019745D02*
X027151Y019745D01*
X027001Y019745D02*
X027001Y020196D01*
X027151Y020046D01*
X027311Y020121D02*
X027311Y019820D01*
X027386Y019745D01*
X027536Y019745D01*
X027611Y019820D01*
X027611Y020121D01*
X027536Y020196D01*
X027386Y020196D01*
X027311Y020121D01*
X027461Y019895D02*
X027311Y019745D01*
X031420Y015058D02*
X031420Y014983D01*
X031720Y014683D01*
X031720Y014608D01*
X031880Y014608D02*
X032180Y014608D01*
X032030Y014608D02*
X032030Y015058D01*
X032180Y014908D01*
X032340Y014608D02*
X032641Y014608D01*
X032491Y014608D02*
X032491Y015058D01*
X032641Y014908D01*
X032801Y014983D02*
X032801Y014833D01*
X032876Y014758D01*
X033101Y014758D01*
X032951Y014758D02*
X032801Y014608D01*
X033101Y014608D02*
X033101Y015058D01*
X032876Y015058D01*
X032801Y014983D01*
X031720Y015058D02*
X031420Y015058D01*
X032641Y011941D02*
X032566Y011866D01*
X032566Y011791D01*
X032641Y011716D01*
X032791Y011716D01*
X032866Y011791D01*
X032866Y011866D01*
X032791Y011941D01*
X032641Y011941D01*
X032641Y011716D02*
X032566Y011641D01*
X032566Y011566D01*
X032641Y011491D01*
X032791Y011491D01*
X032866Y011566D01*
X032866Y011641D01*
X032791Y011716D01*
X033026Y011491D02*
X033326Y011491D01*
X033176Y011491D02*
X033176Y011941D01*
X033326Y011791D01*
X033486Y011491D02*
X033787Y011491D01*
X033636Y011491D02*
X033636Y011941D01*
X033787Y011791D01*
X033947Y011866D02*
X033947Y011716D01*
X034022Y011641D01*
X034247Y011641D01*
X034097Y011641D02*
X033947Y011491D01*
X034247Y011491D02*
X034247Y011941D01*
X034022Y011941D01*
X033947Y011866D01*
X033565Y009387D02*
X033340Y009387D01*
X033265Y009312D01*
X033265Y009161D01*
X033340Y009086D01*
X033565Y009086D01*
X033565Y008936D02*
X033565Y009387D01*
X033415Y009086D02*
X033265Y008936D01*
X033105Y008936D02*
X032805Y008936D01*
X032955Y008936D02*
X032955Y009387D01*
X033105Y009236D01*
X032645Y009236D02*
X032494Y009387D01*
X032494Y008936D01*
X032344Y008936D02*
X032645Y008936D01*
X032184Y009011D02*
X032109Y008936D01*
X031959Y008936D01*
X031884Y009011D01*
X031884Y009312D01*
X031959Y009387D01*
X032109Y009387D01*
X032184Y009312D01*
X032184Y009236D01*
X032109Y009161D01*
X031884Y009161D01*
X021102Y005748D02*
X020652Y005748D01*
X020652Y005598D02*
X020652Y005898D01*
X020952Y005598D02*
X021102Y005748D01*
X021027Y005438D02*
X020727Y005438D01*
X020652Y005363D01*
X020652Y005213D01*
X020727Y005138D01*
X021027Y005438D01*
X021102Y005363D01*
X021102Y005213D01*
X021027Y005138D01*
X020727Y005138D01*
X020652Y004978D02*
X020652Y004677D01*
X020652Y004828D02*
X021102Y004828D01*
X020952Y004677D01*
X021102Y004517D02*
X020652Y004217D01*
X020652Y004517D02*
X021102Y004217D01*
X020042Y008221D02*
X020117Y008296D01*
X020117Y008446D01*
X020042Y008521D01*
X019741Y008521D01*
X019666Y008446D01*
X019666Y008296D01*
X019741Y008221D01*
X020042Y008221D01*
X019817Y008371D02*
X019666Y008521D01*
X019666Y008681D02*
X019666Y008981D01*
X019666Y008831D02*
X020117Y008831D01*
X019967Y008681D01*
X020042Y009141D02*
X020117Y009216D01*
X020117Y009367D01*
X020042Y009442D01*
X019741Y009141D01*
X019666Y009216D01*
X019666Y009367D01*
X019741Y009442D01*
X020042Y009442D01*
X020042Y009602D02*
X020117Y009677D01*
X020117Y009827D01*
X020042Y009902D01*
X019967Y009902D01*
X019666Y009602D01*
X019666Y009902D01*
X019741Y009141D02*
X020042Y009141D01*
X014569Y019496D02*
X014418Y019496D01*
X014494Y019496D02*
X014494Y019946D01*
X014569Y019946D02*
X014418Y019946D01*
X014262Y019871D02*
X014262Y019571D01*
X014187Y019496D01*
X014036Y019496D01*
X013961Y019571D01*
X013801Y019496D02*
X013501Y019496D01*
X013651Y019496D02*
X013651Y019946D01*
X013801Y019796D01*
X013961Y019871D02*
X014036Y019946D01*
X014187Y019946D01*
X014262Y019871D01*
X013341Y019871D02*
X013341Y019571D01*
X013041Y019871D01*
X013041Y019571D01*
X013116Y019496D01*
X013266Y019496D01*
X013341Y019571D01*
X013341Y019871D02*
X013266Y019946D01*
X013116Y019946D01*
X013041Y019871D01*
X012881Y019796D02*
X012730Y019946D01*
X012730Y019496D01*
X012580Y019496D02*
X012881Y019496D01*
X007675Y026310D02*
X007675Y026460D01*
X007675Y026385D02*
X007225Y026385D01*
X007225Y026310D02*
X007225Y026460D01*
X007300Y026617D02*
X007225Y026692D01*
X007225Y026842D01*
X007300Y026917D01*
X007225Y027078D02*
X007225Y027378D01*
X007225Y027228D02*
X007675Y027228D01*
X007525Y027078D01*
X007600Y026917D02*
X007675Y026842D01*
X007675Y026692D01*
X007600Y026617D01*
X007300Y026617D01*
X007300Y027538D02*
X007600Y027838D01*
X007300Y027838D01*
X007225Y027763D01*
X007225Y027613D01*
X007300Y027538D01*
X007600Y027538D01*
X007675Y027613D01*
X007675Y027763D01*
X007600Y027838D01*
X007600Y027998D02*
X007675Y028073D01*
X007675Y028223D01*
X007600Y028298D01*
X007300Y027998D01*
X007225Y028073D01*
X007225Y028223D01*
X007300Y028298D01*
X007600Y028298D01*
X007600Y027998D02*
X007300Y027998D01*
M02*
| 18.934939 | 26 | 0.893768 |
d705a44d939961f595a9cbed5580b17ae7dcc890 | 281 | swift | Swift | BitsWallet/Model/CardDetails.swift | danesh-23/bitswallet | 7d5c87d8863ec46a148da4a714533deba544b542 | [
"MIT"
] | null | null | null | BitsWallet/Model/CardDetails.swift | danesh-23/bitswallet | 7d5c87d8863ec46a148da4a714533deba544b542 | [
"MIT"
] | null | null | null | BitsWallet/Model/CardDetails.swift | danesh-23/bitswallet | 7d5c87d8863ec46a148da4a714533deba544b542 | [
"MIT"
] | null | null | null | //
// CardDetails.swift
// BitsWallet
//
// Created by Danesh Rajasolan on 2021-05-25.
//
import Foundation
struct CardDetails: Codable, Equatable {
let number: String
let firstName: String
let lastName: String
let expiryDate: String
let cvvCode: String
}
| 16.529412 | 46 | 0.690391 |
5db70eb71a5c6e0c82e61e08b78dc2e796f50924 | 267 | go | Go | example_format_u2577_test.go | reiver/go-font8x8 | d7d13a60ce2700e4de5802c5f11c363f4eec54bd | [
"MIT"
] | 1 | 2020-01-26T21:51:57.000Z | 2020-01-26T21:51:57.000Z | example_format_u2577_test.go | reiver/go-font8x8 | d7d13a60ce2700e4de5802c5f11c363f4eec54bd | [
"MIT"
] | null | null | null | example_format_u2577_test.go | reiver/go-font8x8 | d7d13a60ce2700e4de5802c5f11c363f4eec54bd | [
"MIT"
] | null | null | null | package font8x8_test
import (
"github.com/reiver/go-font8x8"
"fmt"
)
func ExampleType_Format_u2577() {
fmt.Printf("%z\n", font8x8.U2577)
// Output:
//
// ░░░░░░░░
// ░░░░░░░░
// ░░░░░░░░
// ░░░░░░░░
// ░░░█░░░░
// ░░░█░░░░
// ░░░█░░░░
// ░░░█░░░░
}
| 11.125 | 34 | 0.40824 |
8bae8641e8b2bc7fa794537cd23b6f528d259cb0 | 314 | kt | Kotlin | app/app/src/main/java/com/nikolaykul/android/mvp/comparison/presentation/base/BasePresenter.kt | NikolayKul/Android-mvp-comarison | eef06d295d7f9d0b7514cfeef13c12d38c5f714b | [
"Apache-2.0"
] | null | null | null | app/app/src/main/java/com/nikolaykul/android/mvp/comparison/presentation/base/BasePresenter.kt | NikolayKul/Android-mvp-comarison | eef06d295d7f9d0b7514cfeef13c12d38c5f714b | [
"Apache-2.0"
] | null | null | null | app/app/src/main/java/com/nikolaykul/android/mvp/comparison/presentation/base/BasePresenter.kt | NikolayKul/Android-mvp-comarison | eef06d295d7f9d0b7514cfeef13c12d38c5f714b | [
"Apache-2.0"
] | null | null | null | package com.nikolaykul.android.mvp.comparison.presentation.base
/**
* Created by nikolay
*/
abstract class BasePresenter<TView : BaseMvpView> {
protected var view: TView? = null
open fun attachView(view: TView) {
this.view = view
}
open fun detachView() {
view = null
}
} | 17.444444 | 63 | 0.643312 |
aa27095979c379b76b1938637f89978c181de3a6 | 30,445 | sql | SQL | pealip_trip.sql | wawanneutron/dnmerapi | 4722d92c9b97291a282e3b9432ac4d5a2b5f2498 | [
"MIT"
] | null | null | null | pealip_trip.sql | wawanneutron/dnmerapi | 4722d92c9b97291a282e3b9432ac4d5a2b5f2498 | [
"MIT"
] | null | null | null | pealip_trip.sql | wawanneutron/dnmerapi | 4722d92c9b97291a282e3b9432ac4d5a2b5f2498 | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 23, 2020 at 05:01 PM
-- Server version: 10.3.15-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `pealip_trip`
--
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `galleries`
--
CREATE TABLE `galleries` (
`id` bigint(20) UNSIGNED NOT NULL,
`travel_packages_id` int(11) NOT NULL,
`image` text COLLATE utf8mb4_unicode_ci NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `galleries`
--
INSERT INTO `galleries` (`id`, `travel_packages_id`, `image`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 8, 'assets/gallery/gXLpiXIfvgIY5eKM9xiyC3PKEbe9IVTTXUTdowIl.jpeg', NULL, '2020-09-16 02:40:29', '2020-09-19 07:58:32'),
(2, 3, 'assets/gallery/U5QYukEibOCk7T15ajJeWWJJ3sS74DcZmIwocoEG.jpeg', NULL, '2020-09-16 02:40:47', '2020-09-18 10:55:51'),
(9, 1, 'assets/gallery/LTHQAcH6re0of0zDX8ngQAakX9qxEyJUdlS1u3aG.jpeg', NULL, '2020-09-17 10:12:19', '2020-09-18 10:54:58'),
(10, 2, 'assets/gallery/XvdxDmkAA50R8PGHNYhAvJeXudBdsQOjdfH9zYNe.jpeg', NULL, '2020-09-18 10:56:56', '2020-09-18 10:56:56'),
(11, 9, 'assets/gallery/h9gR3BlBlEzaPG67FbwEPV8Bo82syUVst140oesQ.jpeg', NULL, '2020-09-18 10:57:12', '2020-09-18 10:57:12'),
(12, 8, 'assets/gallery/66NjsQhu5xsmIbXmdKUPkxDyW0JyvUMrPCFT3Utc.jpeg', NULL, '2020-09-19 07:57:58', '2020-09-19 07:57:58'),
(13, 8, 'assets/gallery/Z0kvzMVj0o75ZwnZp6Zh0KuASL5RiXzbzBq2HNyU.jpeg', NULL, '2020-09-19 07:58:13', '2020-09-19 07:58:13'),
(14, 1, 'assets/gallery/oCk8vjIFQu0cdv4Wpo7RE7oNCvMNxvvWlkv9Re8r.jpeg', NULL, '2020-09-19 08:00:21', '2020-09-19 08:00:21');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2020_09_13_140937_creat_travel_packages_table', 1),
(5, '2020_09_13_143748_create_galleries_table', 2),
(8, '2020_09_14_061233_add_roles_field_to_users_table', 5),
(15, '2020_09_13_145506_create_transaction_detail_table', 6),
(16, '2020_09_14_152331_add_username_field_to_users_table', 6),
(17, '2020_09_17_065929_create_transactions_table', 6);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `transactions`
--
CREATE TABLE `transactions` (
`id` bigint(20) UNSIGNED NOT NULL,
`travel_packages_id` int(11) NOT NULL,
`users_id` int(11) DEFAULT NULL,
`additional_visa` int(11) NOT NULL,
`transaction_total` int(11) NOT NULL,
`transaction_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `transactions`
--
INSERT INTO `transactions` (`id`, `travel_packages_id`, `users_id`, `additional_visa`, `transaction_total`, `transaction_status`, `deleted_at`, `created_at`, `updated_at`) VALUES
(72, 8, 8, 0, 2000000, 'PENDING', NULL, '2020-09-23 01:16:01', '2020-09-23 01:28:36'),
(73, 2, 2, 0, 0, 'IN_CART', NULL, '2020-09-23 05:01:34', '2020-09-23 05:21:48');
-- --------------------------------------------------------
--
-- Table structure for table `transaction_details`
--
CREATE TABLE `transaction_details` (
`id` bigint(20) UNSIGNED NOT NULL,
`transactions_id` int(11) NOT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`nationality` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`is_visa` tinyint(1) NOT NULL,
`doe_passport` date NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `transaction_details`
--
INSERT INTO `transaction_details` (`id`, `transactions_id`, `username`, `nationality`, `is_visa`, `doe_passport`, `deleted_at`, `created_at`, `updated_at`) VALUES
(5, 8, 'Neutron', 'ID', 0, '2020-09-26', NULL, '2020-09-10 17:00:00', '2020-09-24 17:00:00'),
(8, 8, 'lim yulia', 'ID', 1, '0000-00-00', NULL, '2020-09-17 17:00:00', '2020-09-18 17:00:00'),
(10, 9, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:01:57', '2020-09-20 01:01:57'),
(11, 10, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:02:05', '2020-09-20 01:02:05'),
(12, 11, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:06:18', '2020-09-20 01:06:18'),
(13, 12, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:16:38', '2020-09-20 01:16:38'),
(14, 13, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:18:34', '2020-09-20 01:18:34'),
(15, 14, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:42:16', '2020-09-20 01:42:16'),
(16, 15, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:47:13', '2020-09-20 01:47:13'),
(17, 16, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 01:57:21', '2020-09-20 01:57:21'),
(18, 17, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:01:42', '2020-09-20 02:01:42'),
(19, 18, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:05:31', '2020-09-20 02:05:31'),
(20, 19, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:13:58', '2020-09-20 02:13:58'),
(21, 20, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:17:22', '2020-09-20 02:17:22'),
(22, 21, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:21:45', '2020-09-20 02:21:45'),
(23, 22, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:24:56', '2020-09-20 02:24:56'),
(24, 23, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:25:34', '2020-09-20 02:25:34'),
(25, 24, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:29:46', '2020-09-20 02:29:46'),
(26, 25, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:30:22', '2020-09-20 02:30:22'),
(27, 26, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:36:18', '2020-09-20 02:36:18'),
(28, 27, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:36:23', '2020-09-20 02:36:23'),
(29, 28, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 02:37:42', '2020-09-20 02:37:42'),
(30, 29, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 04:24:16', '2020-09-20 04:24:16'),
(31, 30, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 04:41:05', '2020-09-20 04:41:05'),
(32, 31, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 04:42:51', '2020-09-20 04:42:51'),
(33, 32, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 04:44:16', '2020-09-20 04:44:16'),
(34, 33, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 04:45:12', '2020-09-20 04:45:12'),
(35, 34, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 04:48:46', '2020-09-20 04:48:46'),
(36, 35, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 04:57:55', '2020-09-20 04:57:55'),
(37, 36, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:08:57', '2020-09-20 05:08:57'),
(38, 37, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:09:11', '2020-09-20 05:09:11'),
(39, 38, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:09:55', '2020-09-20 05:09:55'),
(40, 39, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:11:25', '2020-09-20 05:11:25'),
(41, 40, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:14:20', '2020-09-20 05:14:20'),
(42, 41, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:14:44', '2020-09-20 05:14:44'),
(43, 42, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:15:50', '2020-09-20 05:15:50'),
(44, 43, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:18:27', '2020-09-20 05:18:27'),
(45, 44, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:20:53', '2020-09-20 05:20:53'),
(46, 45, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:22:08', '2020-09-20 05:22:08'),
(47, 46, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:27:49', '2020-09-20 05:27:49'),
(48, 47, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:33:22', '2020-09-20 05:33:22'),
(49, 48, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:38:39', '2020-09-20 05:38:39'),
(50, 49, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:41:21', '2020-09-20 05:41:21'),
(51, 50, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:41:36', '2020-09-20 05:41:36'),
(52, 51, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:42:50', '2020-09-20 05:42:50'),
(53, 52, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:42:58', '2020-09-20 05:42:58'),
(54, 53, 'lim yulia', 'ID', 0, '2025-09-20', NULL, '2020-09-20 05:58:19', '2020-09-20 05:58:19'),
(55, 54, 'lim yulia', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:01:02', '2020-09-20 06:01:02'),
(56, 55, 'lim yulia', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:01:34', '2020-09-20 06:01:34'),
(57, 56, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:03:05', '2020-09-20 06:03:05'),
(58, 57, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:14:22', '2020-09-20 06:14:22'),
(59, 58, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:22:48', '2020-09-20 06:22:48'),
(60, 59, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:33:12', '2020-09-20 06:33:12'),
(61, 60, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:34:38', '2020-09-20 06:34:38'),
(62, 61, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:40:15', '2020-09-20 06:40:15'),
(63, 62, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:45:51', '2020-09-20 06:45:51'),
(64, 63, 'Neutron', 'ID', 0, '2025-09-20', NULL, '2020-09-20 06:49:05', '2020-09-20 06:49:05'),
(65, 64, 'Neutron', 'ID', 0, '2025-09-23', '2020-09-23 01:03:13', '2020-09-23 00:01:03', '2020-09-23 01:03:13'),
(66, 65, 'lim yulia', 'ID', 0, '2025-09-23', '2020-09-23 01:01:49', '2020-09-23 00:01:54', '2020-09-23 01:01:49'),
(67, 66, 'lim yulia', 'ID', 0, '2025-09-23', '2020-09-23 01:05:16', '2020-09-23 00:13:52', '2020-09-23 01:05:16'),
(68, 66, 'Kiwil', 'Lampung', 1, '2020-09-22', '2020-09-23 01:06:31', '2020-09-23 00:44:28', '2020-09-23 01:06:31'),
(69, 65, 'lim yulia', 'ID', 0, '2020-09-24', '2020-09-23 01:07:42', '2020-09-23 01:02:23', '2020-09-23 01:07:42'),
(70, 65, 'Neutron', 'ID', 0, '2020-09-16', '2020-09-23 01:09:37', '2020-09-23 01:02:37', '2020-09-23 01:09:37'),
(71, 65, 'Kiwil', 'Malaysia', 1, '2020-09-30', '2020-09-23 01:11:50', '2020-09-23 01:03:08', '2020-09-23 01:11:50'),
(72, 67, 'lim yulia', 'ID', 0, '2025-09-23', NULL, '2020-09-23 01:03:55', '2020-09-23 01:03:55'),
(73, 67, 'Neutron', 'Id', 0, '2020-09-22', NULL, '2020-09-23 01:05:12', '2020-09-23 01:05:12'),
(74, 68, 'lim yulia', 'ID', 0, '2025-09-23', NULL, '2020-09-23 01:05:39', '2020-09-23 01:05:39'),
(75, 68, 'Neutron', 'Id', 0, '2020-09-22', NULL, '2020-09-23 01:05:52', '2020-09-23 01:05:52'),
(76, 68, 'Kiwil', 'Malaysia', 1, '2020-09-30', NULL, '2020-09-23 01:06:22', '2020-09-23 01:06:22'),
(77, 69, 'Neutron', 'ID', 0, '2025-09-23', NULL, '2020-09-23 01:07:23', '2020-09-23 01:07:23'),
(78, 69, 'lim yulia', 'Id', 0, '2020-09-01', NULL, '2020-09-23 01:07:35', '2020-09-23 01:07:35'),
(79, 70, 'Neutron', 'ID', 0, '2025-09-23', NULL, '2020-09-23 01:08:22', '2020-09-23 01:08:22'),
(80, 70, 'Kiwil', 'ID', 0, '2020-09-30', NULL, '2020-09-23 01:08:45', '2020-09-23 01:08:45'),
(81, 70, 'lim yulia', 'Malaysia', 1, '2020-09-28', NULL, '2020-09-23 01:08:56', '2020-09-23 01:08:56'),
(82, 65, 'lim yulia', 'Id', 0, '2020-10-15', NULL, '2020-09-23 01:10:23', '2020-09-23 01:10:23'),
(83, 65, 'Neutron', 'Id', 1, '2020-09-27', NULL, '2020-09-23 01:10:52', '2020-09-23 01:10:52'),
(84, 71, 'Neutron', 'ID', 0, '2025-09-23', NULL, '2020-09-23 01:11:19', '2020-09-23 01:11:19'),
(85, 71, 'lim yulia', 'Malaysia', 1, '2020-11-25', NULL, '2020-09-23 01:11:35', '2020-09-23 01:11:35'),
(86, 72, 'lim yulia', 'ID', 0, '2025-09-23', NULL, '2020-09-23 01:16:01', '2020-09-23 01:16:01'),
(87, 72, 'Cebong', 'ID', 0, '2020-09-30', '2020-09-23 01:21:53', '2020-09-23 01:16:30', '2020-09-23 01:21:53'),
(88, 72, 'fazrin', 'ID', 0, '2020-09-29', '2020-09-23 01:21:59', '2020-09-23 01:16:45', '2020-09-23 01:21:59'),
(89, 72, 'Kiwil', 'CN', 1, '2020-12-30', '2020-09-23 01:21:56', '2020-09-23 01:17:05', '2020-09-23 01:21:56'),
(90, 72, 'Neutron', 'ID', 0, '2020-08-31', NULL, '2020-09-23 01:18:44', '2020-09-23 01:18:44'),
(91, 73, 'Neutron', 'ID', 0, '2025-09-23', '2020-09-23 05:01:38', '2020-09-23 05:01:34', '2020-09-23 05:01:38'),
(92, 73, 'lim yulia', 'ID', 1, '2020-09-22', '2020-09-23 05:01:52', '2020-09-23 05:01:49', '2020-09-23 05:01:52'),
(93, 73, 'lim yulia', 'ID', 0, '2020-09-21', '2020-09-23 05:04:39', '2020-09-23 05:04:36', '2020-09-23 05:04:39'),
(94, 73, 'lim yulia', 'ID', 1, '2020-09-22', '2020-09-23 05:05:52', '2020-09-23 05:05:23', '2020-09-23 05:05:52'),
(95, 73, 'lim yulia', 'ID', 1, '2020-09-22', '2020-09-23 05:18:44', '2020-09-23 05:14:10', '2020-09-23 05:18:44'),
(96, 73, 'Kiwil', 'Malaysia', 0, '2020-09-28', '2020-09-23 05:14:45', '2020-09-23 05:14:33', '2020-09-23 05:14:45'),
(97, 73, 'lim yulia', 'ID', 0, '2020-09-22', '2020-09-23 05:21:48', '2020-09-23 05:18:55', '2020-09-23 05:21:48');
-- --------------------------------------------------------
--
-- Table structure for table `travel_packages`
--
CREATE TABLE `travel_packages` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`about` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`culture` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`canton` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`deperture_date` date NOT NULL,
`duration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`price` int(11) NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `travel_packages`
--
INSERT INTO `travel_packages` (`id`, `title`, `slug`, `location`, `about`, `culture`, `canton`, `deperture_date`, `duration`, `type`, `price`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'Trip Mountain Semeru', 'trip-mountain-semeru', 'Semeru, East Java, Indonesian', 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aspernatur non, nemo illum impedit laborum nesciunt cum eum? Vero, ipsum voluptate nihil perferendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libero, voluptatum nisi hic iusto quisquam aliquid harum eligendi laborum illum.', 'Suku sakask', 'House ntraditional', '2020-09-25', '2D/1N', 'Open Trip', 500000, NULL, NULL, '2020-09-19 08:55:55'),
(2, 'Trip Mountain Guntur', 'trip-mountain-guntur', 'West Java', 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aspernatur non, nemo illum impedit laborum nesciunt cum eum? Vero, ipsum voluptate nihil perferendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libero, voluptatum nisi hic iusto quisquam aliquid harum eligendi laborum illum.\r\n\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe', 'Tari Kecak', 'Sunda', '2020-09-10', '2D 1N', 'Open Trip', 500000, NULL, '2020-09-15 08:02:41', '2020-09-19 08:56:09'),
(3, 'Trip Mount Cikurai', 'trip-mount-cikurai', 'West Java Indonesian', 'rendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe', 'Sunda', 'Budaya', '2020-10-02', '2D', 'Trip', 200002, NULL, '2020-09-15 08:56:24', '2020-09-19 08:56:20'),
(5, 'sfg', 'sfg', 'fdf', 'fgddg', 'dfdfdf', 'fdfd', '2020-09-04', '2D', 'dfdf', 55, '2020-09-18 10:47:13', '2020-09-15 09:01:29', '2020-09-18 10:47:13'),
(8, 'Trip Mount Gede Pangrango', 'trip-mount-gede-pangrango', 'West Java', 'rendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam liberendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe\r\n\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe\r\n\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe', 'Candi Dieng', 'Adat Jawa', '2020-09-03', '4D 3N', 'Trip', 1000000, NULL, '2020-09-15 08:59:25', '2020-09-19 08:56:30'),
(9, 'Trip Lawu', 'trip-lawu', 'Central Java', 'rendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam liberendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam liberendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe\r\n\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe\r\n\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe\r\n\r\nrendis a nostrum? Expedita repellat aliquid commodi? Tempore, eius nobis possimus alias rem, dolorem officia magnam explicabo, vel cum eveniet harum nulla cumque expedita nisi ipsam distinctio architecto suscipit impedit veniam beatae fuga? Veritatis eius ipsa sint a aliquid, aspernatur assumenda totam voluptatem possimus vel error ab repudiandae est veniam quaerat blanditiis harum minus placeat, odit dolorum? At voluptatibus qui unde cupiditate soluta? Quis odio corporis officiis magnam libe', 'Traditional Culture', 'Candi Sukuh, Cetho, Kethek', '2020-10-15', '5 days', 'Open Trip', 2000000, NULL, '2020-09-17 09:57:03', '2020-09-19 08:56:48');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`roles` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USER',
`username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `roles`, `username`) VALUES
(2, 'wawan setiawan', 'wawanneutron1331@gmail.com', '2020-09-20 06:02:55', '$2y$10$C1kh9HQggMKR1qdV/.2slOvuskZHrfG2N4kBUnFAoGcJ6.KnA.VZe', 'NWqDwbBoSErwn3BOMpaOY3giYeS5kq5ebzxOdVOTy2f0HYTAG5SuUGdlsMDT', '2020-09-14 00:19:28', '2020-09-20 06:02:55', 'ADMIN', 'Neutron'),
(3, 'Muhammad Fahmi', 'muhammda@gmail.com', NULL, '$2y$10$phj7kptqrOi1eq/mrcNv2uCpi7c/Yxtue69gq1B4g4U84ZuwekB4S', NULL, '2020-09-14 00:35:38', '2020-09-14 00:35:38', 'USER', 'Cebong'),
(4, 'Muhammad Akbar', 'muhammadakbar@gmail.com', NULL, '$2y$10$GWptUP0oM45pgGFpxe5A0elG.wgW63Auplkc7SB2RbmiB/1XLSttu', NULL, '2020-09-14 02:30:37', '2020-09-14 02:30:37', 'USER', ''),
(5, 'Neutron', 'neutron@gmail.com', '2020-09-14 07:45:29', '$2y$10$kLYe2u2pjNTHzT4sLB7g2ukIaZVtX/foiv9wX8LQS98A3nh2szf1W', NULL, '2020-09-14 07:43:34', '2020-09-14 07:45:29', 'USER', 'Neutron'),
(6, 'Arif Kurniawan', 'arif@gmail.com', NULL, '$2y$10$tjysG1.iEmcmjNWmdih4P.RyR/skDoMg8xZrU2nD5EGAy1RZvbBnG', NULL, '2020-09-14 09:05:27', '2020-09-14 09:05:27', 'USER', ''),
(7, 'Agus Mauludin', 'kiwilaja@gmail.com', '2020-09-14 09:17:32', '$2y$10$H5bpbTN8MkLAm557tpiwoOi185LWy3Lozqnrowz8cLoA/eE/p.b4u', NULL, '2020-09-14 09:16:58', '2020-09-14 09:17:32', 'USER', 'Kiwil'),
(8, 'Yulia', 'yulia@gmail.com', '2020-09-17 00:07:50', '$2y$10$Nw/5XyPCxjhBp37M4sbYneAZ5zCMkZ.k9jw3yScYpU3wsF/2jpVtq', '1dyKiluOxmdPppAg90DGL4H7y4JEyFktSIfwAPQVpsioqX50eVJcI4GrjVy2', '2020-09-17 00:07:00', '2020-09-20 05:58:03', 'USER', 'lim yulia'),
(9, 'Fazrin Tri Setiawati', 'fazrin@gmail.com', NULL, '$2y$10$Kwwi3oioHul6T5omKmlH0uJqxSnb0K36zo3blChHGT2Qfyr24NkH2', NULL, '2020-09-19 09:29:13', '2020-09-19 09:29:13', 'USER', 'fazrin');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `galleries`
--
ALTER TABLE `galleries`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `transaction_details`
--
ALTER TABLE `transaction_details`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `travel_packages`
--
ALTER TABLE `travel_packages`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `galleries`
--
ALTER TABLE `galleries`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=74;
--
-- AUTO_INCREMENT for table `transaction_details`
--
ALTER TABLE `transaction_details`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=98;
--
-- AUTO_INCREMENT for table `travel_packages`
--
ALTER TABLE `travel_packages`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 72.661098 | 3,207 | 0.698867 |
c7819002f1c0af9de0fcbe6cafcb8f16a7df76e9 | 9,711 | sql | SQL | realestate scenario/full dynamap output/profiler_output/insertSQLfile.sql | MLacra/mapping_generation_experiments | d44266499c588958745ebf339a2cba62fe0e5409 | [
"Apache-2.0"
] | 1 | 2021-08-25T10:39:01.000Z | 2021-08-25T10:39:01.000Z | realestate scenario/full dynamap output/profiler_output/insertSQLfile.sql | MLacra/mapping_generation_experiments | d44266499c588958745ebf339a2cba62fe0e5409 | [
"Apache-2.0"
] | null | null | null | realestate scenario/full dynamap output/profiler_output/insertSQLfile.sql | MLacra/mapping_generation_experiments | d44266499c588958745ebf339a2cba62fe0e5409 | [
"Apache-2.0"
] | null | null | null | CREATE TABLE cotswold(
prov text,
price text,
url text,
postcode text,
description text,
property_type text,
bedroom_number text,
street_name text,
image text,
period_unit text,
origin_url text,
location_raw text);
COPY cotswold(prov,price,url,postcode,description,property_type,bedroom_number,street_name,image,period_unit,origin_url,location_raw)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/cotswold.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE deprivation_data_pc_man(
postcode text,
postcodestatus text,
lsoacode text,
lsoaname text,
indexofmultipledeprivationrank text,
indexofmultipledeprivationdecile text,
incomerank text,
incomedecile text,
incomescore text,
employmentrank text,
employmentdecile text,
employmentscore text,
educationandskillsrank text,
educationandskillsdecile text,
healthanddisabilityrank text,
healthanddisabilitydecile text,
crimerank text,
crimedecile text,
barrierstohousingandservicesrank text,
barrierstohousingandservicesdecile text,
livingenvironmentrank text,
livingenvironmentdecile text,
idacirank text,
idacidecile text,
idaciscore text,
idaopirank text,
idaopidecile text,
idaopiscore text);
COPY deprivation_data_pc_man(postcode,postcodestatus,lsoacode,lsoaname,indexofmultipledeprivationrank,indexofmultipledeprivationdecile,incomerank,incomedecile,incomescore,employmentrank,employmentdecile,employmentscore,educationandskillsrank,educationandskillsdecile,healthanddisabilityrank,healthanddisabilitydecile,crimerank,crimedecile,barrierstohousingandservicesrank,barrierstohousingandservicesdecile,livingenvironmentrank,livingenvironmentdecile,idacirank,idacidecile,idaciscore,idaopirank,idaopidecile,idaopiscore)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/deprivation_data_pc_man.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE jpknight(
prov text,
price text,
url text,
postcode text,
description text,
image text,
origin_url text,
street_name text,
property_status text,
bedroom_number text);
COPY jpknight(prov,price,url,postcode,description,image,origin_url,street_name,property_status,bedroom_number)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/jpknight.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE l_belvoir(
street text,
city text,
postcode text,
price text,
enquiry_address text,
description text);
COPY l_belvoir(street,city,postcode,price,enquiry_address,description)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/l_belvoir.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE l_deprivation(
postcode text,
postcodestatus text,
lsoacode text,
lsoaname text,
indexofmultipledeprivationrank text,
indexofmultipledeprivationdecile text,
incomerank text,
incomedecile text,
incomescore text,
employmentrank text,
employmentdecile text,
employmentscore text,
educationandskillsrank text,
educationandskillsdecile text,
healthanddisabilityrank text,
healthanddisabilitydecile text,
crimerank text,
crimedecile text,
barrierstohousingandservicesrank text,
barrierstohousingandservicesdecile text,
livingenvironmentrank text,
livingenvironmentdecile text,
idacirank text,
idacidecile text,
idaciscore text,
idaopirank text,
idaopidecile text,
idaopiscore text);
COPY l_deprivation(postcode,postcodestatus,lsoacode,lsoaname,indexofmultipledeprivationrank,indexofmultipledeprivationdecile,incomerank,incomedecile,incomescore,employmentrank,employmentdecile,employmentscore,educationandskillsrank,educationandskillsdecile,healthanddisabilityrank,healthanddisabilitydecile,crimerank,crimedecile,barrierstohousingandservicesrank,barrierstohousingandservicesdecile,livingenvironmentrank,livingenvironmentdecile,idacirank,idacidecile,idaciscore,idaopirank,idaopidecile,idaopiscore)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/l_deprivation.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE l_savills(
tst_addressline1 text,
property_address text,
street text,
city text,
postcode text,
price text,
pricetype text,
bedrooms text,
bullets_2 text,
bullets_3 text,
bullets_4 text,
agency text,
contact text);
COPY l_savills(tst_addressline1,property_address,street,city,postcode,price,pricetype,bedrooms,bullets_2,bullets_3,bullets_4,agency,contact)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/l_savills.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE m_agent(
street text,
city text,
postcode text,
price text,
nth_of_type_2 text,
details_box_nth_of_type_2 text,
bedroom_number text);
COPY m_agent(street,city,postcode,price,nth_of_type_2,details_box_nth_of_type_2,bedroom_number)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/m_agent.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE m_belvoir(
street text,
postcode text,
city text,
price text,
agency text,
listing_enquiry_tel text,
trcontainsstatus text,
trcontainsstyle text,
bedroom_number text);
COPY m_belvoir(street,postcode,city,price,agency,listing_enquiry_tel,trcontainsstatus,trcontainsstyle,bedroom_number)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/m_belvoir.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE m_deprivation(
"postcode" text,
"postcodestatus" text,
"lsoacode" text,
"lsoaname" text,
"indexofmultipledeprivationrank" text,
"indexofmultipledeprivationdecile" text,
"incomerank" text,
"incomedecile" text,
"incomescore" text,
"employmentrank" text,
"employmentdecile" text,
"employmentscore" text,
"educationandskillsrank" text,
"educationandskillsdecile" text,
"healthanddisabilityrank" text,
"healthanddisabilitydecile" text,
"crimerank" text,
"crimedecile" text,
"barrierstohousingandservicesrank" text,
"barrierstohousingandservicesdecile" text,
"livingenvironmentrank" text,
"livingenvironmentdecile" text,
"idacirank" text,
"idacidecile" text,
"idaciscore" text,
"idaopirank" text,
"idaopidecile" text,
"idaopiscore" text);
COPY m_deprivation("postcode","postcodestatus","lsoacode","lsoaname","indexofmultipledeprivationrank","indexofmultipledeprivationdecile","incomerank","incomedecile","incomescore","employmentrank","employmentdecile","employmentscore","educationandskillsrank","educationandskillsdecile","healthanddisabilityrank","healthanddisabilitydecile","crimerank","crimedecile","barrierstohousingandservicesrank","barrierstohousingandservicesdecile","livingenvironmentrank","livingenvironmentdecile","idacirank","idacidecile","idaciscore","idaopirank","idaopidecile","idaopiscore")
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/m_deprivation.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE m_onthemarket(
detailsheading_h1 text,
price text,
city text,
description text,
agentname text,
street text,
postcode text,
bedroom_number text,
price_raw text);
COPY m_onthemarket(detailsheading_h1,price,city,description,agentname,street,postcode,bedroom_number,price_raw)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/m_onthemarket.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE m_rightmove(
bedroom_number text,
street text,
price text,
requestdetails_p_a text,
price_raw text,
postcode text,
city text);
COPY m_rightmove(bedroom_number,street,price,requestdetails_p_a,price_raw,postcode,city)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/m_rightmove.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE m_zoopla(
street text,
city text,
postcode text,
price text,
bedroom_number text);
COPY m_zoopla(street,city,postcode,price,bedroom_number)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/m_zoopla.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE olm_openaddresses(
postcode text,
street_name text,
town text,
prov text);
COPY olm_openaddresses(postcode,street_name,town,prov)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/olm_openaddresses.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE oxlets(
prov text,
price text,
url text,
postcode text,
description text,
street_name text,
furnishing text,
image text,
period_unit text,
origin_url text,
location text,
property_type text,
property_status text,
bedroom_number_raw text);
COPY oxlets(prov,price,url,postcode,description,street_name,furnishing,image,period_unit,origin_url,location,property_type,property_status,bedroom_number_raw)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/oxlets.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE trinity(
prov text,
price text,
url text,
postcode text,
description text,
bedroom_number text,
street_name text,
image text,
period_unit text,
origin_url text,
location text);
COPY trinity(prov,price,url,postcode,description,bedroom_number,street_name,image,period_unit,origin_url,location)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/trinity.csv' DELIMITER ',' CSV HEADER;
CREATE TABLE unique_openaddresses(
postcode text,
street_name text,
town text,
prov text);
COPY unique_openaddresses(postcode,street_name,town,prov)
FROM '/Users/lara/git/vada/app/src/main/resources/lara_tests/vldb_extended_realestate/csvs/unique_openaddresses.csv' DELIMITER ',' CSV HEADER;
| 22.120729 | 569 | 0.811966 |
28515e8bc9a74cfc3a8a56d5415d5d427c0b0232 | 338 | rb | Ruby | metadata.rb | manabuishii/docker-install-cookbook | 4c2ded4de4406275b171249d39aab5371c1fbb90 | [
"MIT"
] | null | null | null | metadata.rb | manabuishii/docker-install-cookbook | 4c2ded4de4406275b171249d39aab5371c1fbb90 | [
"MIT"
] | null | null | null | metadata.rb | manabuishii/docker-install-cookbook | 4c2ded4de4406275b171249d39aab5371c1fbb90 | [
"MIT"
] | null | null | null | name 'docker-install'
maintainer 'RIKEN Bioinformatics Research Unit Released'
maintainer_email 'Manabu ISHII'
license 'MIT'
description 'Install docker'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.2.0'
depends 'apt', '= 7.0.0'
depends 'docker', '= 4.2.0'
| 30.727273 | 72 | 0.659763 |
a4ad5f2353bd5e841bcc51c4ad6e12273246250a | 372 | swift | Swift | ComposeViewController.swift | stevenpovlitz/Week4TwitterAppSteven | fb56bcbc0924dde3165567a6e77516b36f27c368 | [
"Apache-2.0"
] | null | null | null | ComposeViewController.swift | stevenpovlitz/Week4TwitterAppSteven | fb56bcbc0924dde3165567a6e77516b36f27c368 | [
"Apache-2.0"
] | 2 | 2016-02-22T04:57:40.000Z | 2016-03-01T14:50:54.000Z | ComposeViewController.swift | stevenpovlitz/Week4TwitterAppSteven | fb56bcbc0924dde3165567a6e77516b36f27c368 | [
"Apache-2.0"
] | null | null | null | //
// ComposeViewController.swift
//
//
// Created by Steven Povlitz on 2/27/16.
//
//
import UIKit
class ComposeViewController: UIViewController {
var tweet: Tweet?
override func viewDidLoad() {
super.vieDidLoad()
}
override func didRecieveMemoryWarning() {
super.didRecieveMemoryWarning()
}
}
| 13.777778 | 47 | 0.596774 |
4a2c5c1929d7ea817f8e4b54348756191f078dd8 | 1,150 | js | JavaScript | src/commons/indexCalculator.js | sheldarr/Shift | 357dcff771fdd03b23d643b73f0912f0a9916ed5 | [
"MIT"
] | 1 | 2016-04-15T18:36:13.000Z | 2016-04-15T18:36:13.000Z | src/commons/indexCalculator.js | sheldarr/Shift | 357dcff771fdd03b23d643b73f0912f0a9916ed5 | [
"MIT"
] | 8 | 2017-01-17T19:44:54.000Z | 2017-02-05T14:13:14.000Z | src/commons/indexCalculator.js | sheldarr/shift | 357dcff771fdd03b23d643b73f0912f0a9916ed5 | [
"MIT"
] | null | null | null | 'use strict';
import constants from './constants';
const indexCalculator = {
calculateBmi (weight, height) {
return weight / Math.pow(height / 100, 2);
},
calculateBmr (weight, height, age, sex) {
if (sex == constants.sex.male) {
return 66.4730 + ((13.7516 * weight) +
(5.0033 * height) -
(6.7550 * age));
}
return 655.0955 + ((9.5634 * weight) +
(1.8496 * height) -
(4.6756 * age));
},
calculateTmr (weight, height, age, sex, physicalActivityRate) {
return this.calculateBmr(weight, height, age, sex, physicalActivityRate) * physicalActivityRate;
},
calculateWhr (waistCircumference, hipCircumference) {
return waistCircumference / hipCircumference;
},
getObesityType (waistCircumference, hipCircumference, sex) {
const whr = this.calculateWhr(waistCircumference, hipCircumference);
if (sex == constants.sex.male) {
return whr >= 1 ? 'Apple' : 'Pineapple';
}
return whr >= 0.8 ? 'Apple' : 'Pineapple';
}
};
export default indexCalculator;
| 27.380952 | 104 | 0.582609 |
818e40365394dea65b44fe652d41be64aae4071e | 658 | rs | Rust | src/test/ui/impl-trait/recursive-impl-trait-type-through-non-recursive.rs | Eric-Arellano/rust | 0f6f2d681b39c5f95459cd09cb936b6ceb27cd82 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 66,762 | 2015-01-01T08:32:03.000Z | 2022-03-31T23:26:40.000Z | src/test/ui/impl-trait/recursive-impl-trait-type-through-non-recursive.rs | Eric-Arellano/rust | 0f6f2d681b39c5f95459cd09cb936b6ceb27cd82 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 76,993 | 2015-01-01T00:06:33.000Z | 2022-03-31T23:59:15.000Z | src/test/ui/impl-trait/recursive-impl-trait-type-through-non-recursive.rs | Eric-Arellano/rust | 0f6f2d681b39c5f95459cd09cb936b6ceb27cd82 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11,787 | 2015-01-01T00:01:19.000Z | 2022-03-31T19:03:42.000Z | // Test that impl trait does not allow creating recursive types that are
// otherwise forbidden. Even when there's an opaque type in another crate
// hiding this.
fn id<T>(t: T) -> impl Sized { t }
fn recursive_id() -> impl Sized { //~ ERROR cannot resolve opaque type
id(recursive_id2())
}
fn recursive_id2() -> impl Sized { //~ ERROR cannot resolve opaque type
id(recursive_id())
}
fn wrap<T>(t: T) -> impl Sized { (t,) }
fn recursive_wrap() -> impl Sized { //~ ERROR cannot resolve opaque type
wrap(recursive_wrap2())
}
fn recursive_wrap2() -> impl Sized { //~ ERROR cannot resolve opaque type
wrap(recursive_wrap())
}
fn main() {}
| 25.307692 | 73 | 0.674772 |
9305ebbb9253563c09d10eb14dca45fe2eb787c1 | 63 | kt | Kotlin | kcqrs-client-gson/src/test/kotlin/com/clouway/kcqrs/client/LearnToUseEventStoreTest.kt | clouway/kcqrs | 31dcf617cfcc36b6056d08ccfc17550e1f3de7e7 | [
"Apache-2.0"
] | 24 | 2018-01-04T19:49:42.000Z | 2021-12-31T18:41:11.000Z | kcqrs-client-gson/src/test/kotlin/com/clouway/kcqrs/client/LearnToUseEventStoreTest.kt | clouway/kcqrs | 31dcf617cfcc36b6056d08ccfc17550e1f3de7e7 | [
"Apache-2.0"
] | 39 | 2018-01-04T19:53:24.000Z | 2019-11-05T16:24:57.000Z | kcqrs-client-gson/src/test/kotlin/com/clouway/kcqrs/client/LearnToUseEventStoreTest.kt | clouway/kcqrs | 31dcf617cfcc36b6056d08ccfc17550e1f3de7e7 | [
"Apache-2.0"
] | 6 | 2018-01-09T14:36:36.000Z | 2018-08-29T12:14:16.000Z | /**
* @author Miroslav Genov (miroslav.genov@clouway.com)
*/
| 15.75 | 54 | 0.666667 |
7078c24d73c49d536150e026c4828643612b4269 | 1,035 | h | C | src/include/frmPassword.h | dpage/pgadmin3 | 6784e6281831a083fe5a0bbd49eac90e1a6ac547 | [
"Artistic-1.0"
] | 2 | 2021-07-16T21:45:41.000Z | 2021-08-14T15:54:17.000Z | src/include/frmPassword.h | dpage/pgadmin3 | 6784e6281831a083fe5a0bbd49eac90e1a6ac547 | [
"Artistic-1.0"
] | null | null | null | src/include/frmPassword.h | dpage/pgadmin3 | 6784e6281831a083fe5a0bbd49eac90e1a6ac547 | [
"Artistic-1.0"
] | 2 | 2017-11-18T15:00:24.000Z | 2021-08-14T15:54:30.000Z | //////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
// RCS-ID: $Id$
// Copyright (C) 2002 - 2010, The pgAdmin Development Team
// This software is released under the Artistic Licence
//
// frmPassword.h - Change password
//
//////////////////////////////////////////////////////////////////////////
#ifndef FRMPASSWORD_H
#define FRMPASSWORD_H
#include "dlgClasses.h"
#include "base/factory.h"
class pgServer;
// Class declarations
class frmPassword : public pgDialog
{
public:
frmPassword(wxFrame *parent, pgObject *obj);
~frmPassword();
private:
pgServer *server;
void OnHelp(wxCommandEvent& ev);
void OnOK(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
class passwordFactory : public actionFactory
{
public:
passwordFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
wxWindow *StartDialog(frmMain *form, pgObject *obj);
bool CheckEnable(pgObject *obj);
};
#endif
| 23.522727 | 76 | 0.611594 |
5c9d04810d991d11bddda922ee6dc627de18612e | 314 | lua | Lua | lua/nvim/plugins/markdown-preview/init.lua | Frankcs96/Vim-conf-Lua | 32a4cc43944f3a3c813adbad597369d9c056d3d7 | [
"MIT"
] | 1 | 2021-03-24T20:04:38.000Z | 2021-03-24T20:04:38.000Z | lua/nvim/plugins/markdown-preview/init.lua | Frankcs96/Vim-conf-Lua | 32a4cc43944f3a3c813adbad597369d9c056d3d7 | [
"MIT"
] | null | null | null | lua/nvim/plugins/markdown-preview/init.lua | Frankcs96/Vim-conf-Lua | 32a4cc43944f3a3c813adbad597369d9c056d3d7 | [
"MIT"
] | null | null | null | Variable.g({
mkdp_auto_start = true,
mkdp_auto_close = true,
mkdp_refresh_slow = false,
mkdp_command_for_global = false,
mkdp_open_to_the_world = false,
mkdp_browser = 'chromium',
mkdp_echo_preview_url = true,
mkdp_preview_options = {
sync_scroll_type = 'middle',
},
mkdp_filetypes = { 'markdown' }
})
| 22.428571 | 33 | 0.742038 |
9be812cbc9b11604750377a11f36997310cd730b | 1,905 | js | JavaScript | test/registrationTesting.js | Loaki07/BookStore_BackEnd | 7383b5afb12525b2959a91f5450b699eb6d767a1 | [
"MIT"
] | null | null | null | test/registrationTesting.js | Loaki07/BookStore_BackEnd | 7383b5afb12525b2959a91f5450b699eb6d767a1 | [
"MIT"
] | null | null | null | test/registrationTesting.js | Loaki07/BookStore_BackEnd | 7383b5afb12525b2959a91f5450b699eb6d767a1 | [
"MIT"
] | null | null | null | import chai from 'chai';
import chaiHttp from 'chai-http';
import { server } from '../app.js';
// Assertion Style
chai.should();
chai.use(chaiHttp);
describe('Registration API', () => {
/**
* @describe Testing LogIn POST request
*/
// describe('POST /registration', () => {
// it('It should register user', (done) => {
// const userDataObject = {
// fullName: 'Edogawa Conan',
// emailId: 'edogawa.conan@gmail.com',
// password: '123456',
// mobileNumber: '9876543210',
// };
// chai
// .request(server)
// .post('/registration')
// .send(userDataObject)
// .end((err, response) => {
// response.should.have.status(200);
// response.body.should.be.a('object');
// response.body.should.have.property('success').eq(true);
// response.body.should.have
// .property('message')
// .eq('Successfully Registered User!');
// done();
// });
// });
// });
describe('POST /registration', () => {
it('It should not register user if already registered', (done) => {
const userDataObject = {
fullName: 'Edogawa Conan',
emailId: 'edogawa.conan@gmail.com',
password: '123456',
mobileNumber: '9876543210',
};
chai
.request(server)
.post('/registration')
.send(userDataObject)
.end((err, response) => {
response.should.have.status(500);
response.body.should.be.a('object');
response.body.should.have.property('success').eq(false);
response.body.should.have
.property('message')
.eq(
'E11000 duplicate key error collection: book-store.users index: emailId_1 dup key: { emailId: "edogawa.conan@gmail.com" }'
);
done();
});
});
});
});
| 29.765625 | 136 | 0.532808 |
096469f1ebe2c28e4d15198cda6a4eb18351c894 | 1,675 | kt | Kotlin | dapp/src/main/kotlin/jp/co/soramitsu/dapp/config/DappContextConfiguration.kt | d3ledger/iroha-dapp | e3c0701897721030bb3faf678b197297120cc6e3 | [
"Apache-2.0"
] | 2 | 2019-06-21T07:20:37.000Z | 2019-12-07T10:34:53.000Z | dapp/src/main/kotlin/jp/co/soramitsu/dapp/config/DappContextConfiguration.kt | d3ledger/iroha-dapp | e3c0701897721030bb3faf678b197297120cc6e3 | [
"Apache-2.0"
] | 1 | 2019-05-17T07:05:40.000Z | 2019-05-17T07:05:40.000Z | dapp/src/main/kotlin/jp/co/soramitsu/dapp/config/DappContextConfiguration.kt | d3ledger/iroha-dapp | e3c0701897721030bb3faf678b197297120cc6e3 | [
"Apache-2.0"
] | 1 | 2019-06-26T15:08:02.000Z | 2019-06-26T15:08:02.000Z | /*
* Copyright D3 Ledger, Inc. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package jp.co.soramitsu.dapp.config
import com.d3.commons.config.RMQConfig
import com.d3.commons.config.loadRawLocalConfigs
import com.d3.commons.healthcheck.HealthCheckEndpoint
import com.d3.commons.sidechain.iroha.ReliableIrohaChainListener
import com.d3.commons.util.createPrettySingleThreadPool
import jp.co.soramitsu.iroha.java.IrohaAPI
import jp.co.soramitsu.iroha.java.QueryAPI
import jp.co.soramitsu.iroha.java.Utils
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import java.net.URI
@Configuration
class DappContextConfiguration {
private val dappConfig = loadRawLocalConfigs(DAPP_NAME, DappConfig::class.java, "dapp.properties")
private val rmqConfig = loadRawLocalConfigs(DAPP_NAME, RMQConfig::class.java, "rmq.properties")
@Bean
fun dappKeyPair() = Utils.parseHexKeypair(
dappConfig.pubKey,
dappConfig.privKey
)
@Bean
fun irohaApi() = IrohaAPI(URI(dappConfig.irohaUrl))
@Bean
fun dAppAccountId() = dappConfig.accountId
@Bean
fun queryApi(): QueryAPI {
return QueryAPI(irohaApi(), dAppAccountId(), dappKeyPair())
}
@Bean
fun chainListener() = ReliableIrohaChainListener(
rmqConfig,
dappConfig.queue,
createPrettySingleThreadPool(DAPP_NAME, "chain-listener")
)
@Bean
fun repositoryAccountId() = dappConfig.repository
@Bean
fun repositorySetterId() = dappConfig.repositorySetter
@Bean
fun healthCheckEndpoint()=HealthCheckEndpoint(dappConfig.healthCheckPort)
}
| 27.916667 | 102 | 0.751642 |
2a42915962b1a8efbdbe291c7caaba9d1c160985 | 614 | lua | Lua | MMOCoreORB/bin/scripts/mobile/outfits/mos_taike_mayor_outfit.lua | V-Fib/FlurryClone | 40e0ca7245ec31b3815eb6459329fd9e70f88936 | [
"Zlib",
"OpenSSL"
] | 18 | 2017-02-09T15:36:05.000Z | 2021-12-21T04:22:15.000Z | MMOCoreORB/bin/scripts/mobile/outfits/mos_taike_mayor_outfit.lua | V-Fib/FlurryClone | 40e0ca7245ec31b3815eb6459329fd9e70f88936 | [
"Zlib",
"OpenSSL"
] | 61 | 2016-12-30T21:51:10.000Z | 2021-12-10T20:25:56.000Z | MMOCoreORB/bin/scripts/mobile/outfits/mos_taike_mayor_outfit.lua | V-Fib/FlurryClone | 40e0ca7245ec31b3815eb6459329fd9e70f88936 | [
"Zlib",
"OpenSSL"
] | 71 | 2017-01-01T05:34:38.000Z | 2022-03-29T01:04:00.000Z | mos_taike_mayor_outfit = {
{
{objectTemplate = "object/tangible/wearables/shirt/shirt_s07.iff", customizationVariables = {} },
{objectTemplate = "object/tangible/wearables/pants/pants_s01.iff", customizationVariables = {} },
{objectTemplate = "object/tangible/wearables/boots/boots_s04.iff", customizationVariables = {} },
{objectTemplate = "object/tangible/wearables/jacket/jacket_s16.iff", customizationVariables = {} },
{objectTemplate = "object/tangible/hair/human/hair_human_male_s28.iff", customizationVariables = {} },
}
}
addOutfitGroup("mos_taike_mayor_outfit", mos_taike_mayor_outfit) | 47.230769 | 104 | 0.760586 |
dfcfb1f1136e233a7de1970010c60bbd9320534e | 664 | ts | TypeScript | src/server.ts | DanielSpasov/Cr46-Server | 01424750c10c6635375ce85d3abbe66ebb524263 | [
"MIT"
] | null | null | null | src/server.ts | DanielSpasov/Cr46-Server | 01424750c10c6635375ce85d3abbe66ebb524263 | [
"MIT"
] | null | null | null | src/server.ts | DanielSpasov/Cr46-Server | 01424750c10c6635375ce85d3abbe66ebb524263 | [
"MIT"
] | null | null | null | import express, { Application } from 'express';
import dotenv from 'dotenv';
import mongoose from 'mongoose';
const cors = require('cors');
import router from './routes';
dotenv.config();
const app: Application = express();
app.use(cors());
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.static('public'))
mongoose.connect(process.env.DB_URI!, {});
const db = mongoose.connection;
db.once('error', () => console.log('Connection Error'));
db.once('open', () => console.log('Database Connected'));
app.use(router);
app.listen(process.env.PORT, () => console.log(`Server is running on PORT: ${process.env.PORT}...`)); | 27.666667 | 101 | 0.691265 |
3ef2869ba1a5ee3afa9cfef8dbbea0d3f5824ff8 | 738 | h | C | watchtest/Location.h | andriitishchenko/watchtest | 51f1cb562639e91cadcf7cafaa9de814aea804fa | [
"MIT"
] | null | null | null | watchtest/Location.h | andriitishchenko/watchtest | 51f1cb562639e91cadcf7cafaa9de814aea804fa | [
"MIT"
] | null | null | null | watchtest/Location.h | andriitishchenko/watchtest | 51f1cb562639e91cadcf7cafaa9de814aea804fa | [
"MIT"
] | null | null | null | //
// Location.h
// watchtest
//
// Created by Andrii Tishchenko on 27.07.15.
// Copyright (c) 2015 Andrii Tishchenko. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class Track;
@interface Location : NSManagedObject
@property (nonatomic, retain) NSNumber * altitude;
@property (nonatomic, retain) NSNumber * direction;
@property (nonatomic, retain) NSNumber * latitude;
@property (nonatomic, retain) NSNumber * longitude;
@property (nonatomic, retain) NSNumber * speed;
@property (nonatomic, retain) NSNumber * time;
@property (nonatomic, retain) NSNumber * horizontalAccuracy;
@property (nonatomic, retain) NSNumber * verticalAccuracy;
@property (nonatomic, retain) Track *track;
@end
| 27.333333 | 62 | 0.746612 |
7f7bb7c609362d0ad71248cbc37d0d27d084db15 | 3,130 | go | Go | pkg/cmd/lookup_tables/create/create.go | SumoLogic-Labs/sumocli | 7c05ce2bcfa38163728a25199e2d5876e0bc024f | [
"Apache-2.0"
] | 1 | 2022-01-08T09:29:31.000Z | 2022-01-08T09:29:31.000Z | pkg/cmd/lookup_tables/create/create.go | SumoLogic-Labs/sumocli | 7c05ce2bcfa38163728a25199e2d5876e0bc024f | [
"Apache-2.0"
] | 4 | 2022-01-08T08:38:38.000Z | 2022-01-10T11:43:55.000Z | pkg/cmd/lookup_tables/create/create.go | SumoLogic-Labs/sumocli | 7c05ce2bcfa38163728a25199e2d5876e0bc024f | [
"Apache-2.0"
] | null | null | null | package create
import (
"github.com/SumoLogic-Labs/sumocli/pkg/cmdutils"
"github.com/SumoLogic-Labs/sumologic-go-sdk/service/cip"
"github.com/SumoLogic-Labs/sumologic-go-sdk/service/cip/types"
"github.com/spf13/cobra"
)
func NewCmdLookupTablesCreate(client *cip.APIClient) *cobra.Command {
var (
description string
fieldNames []string
fieldTypes []string
primaryKeys []string
ttl int32
sizeLimitAction string
name string
parentFolderId string
)
cmd := &cobra.Command{
Use: "create",
Short: "Create a new lookup table by providing a schema and specifying its configuration.",
Run: func(cmd *cobra.Command, args []string) {
createLookupTable(description, fieldNames, fieldTypes, primaryKeys, ttl, sizeLimitAction, name,
parentFolderId, client)
},
}
cmd.Flags().StringVar(&description, "description", "", "Specify a description for the lookup table")
cmd.Flags().StringSliceVar(&fieldNames, "fieldNames", []string{}, "List of field names (they need to be comma separated e.g. test,test1,test2")
cmd.Flags().StringSliceVar(&fieldTypes, "fieldTypes", []string{}, "List of field types that align with the fieldNames "+
"(they need to be comma separated e.g. string,boolean,int). The following fieldTypes can be specified: "+
"boolean, int, long, double, string")
cmd.Flags().StringSliceVar(&primaryKeys, "primaryKeys", []string{}, "List of field names that make up the primary key for the"+
"lookup table (they need to be comma separated e.g. name1,name2,name3). ")
cmd.Flags().Int32Var(&ttl, "ttl", 0, "A time to live for each entry in the lookup table (in minutes). "+
"365 days is the maximum ttl, leaving the ttl as 0 means that the records will not expire automatically.")
cmd.Flags().StringVar(&sizeLimitAction, "sizeLimitAction", "StopIncomingMessages", "The action that needs to be taken "+
"when the size limit is reached for the table. The possible values can be StopIncomingMessages (default) or DeleteOldData.")
cmd.Flags().StringVar(&name, "name", "", "Specify the name of the lookup table")
cmd.Flags().StringVar(&parentFolderId, "parentFolderId", "", "Specify the parent folder path identifier of the lookup table in the Library")
cmd.MarkFlagRequired("description")
cmd.MarkFlagRequired("fieldNames")
cmd.MarkFlagRequired("fieldTypes")
cmd.MarkFlagRequired("primaryKeys")
cmd.MarkFlagRequired("name")
cmd.MarkFlagRequired("parentFolderId")
return cmd
}
func createLookupTable(description string, fieldNames []string, fieldTypes []string, primaryKeys []string,
ttl int32, sizeLimitAction string, name string, parentFolderId string, client *cip.APIClient) {
data, response, err := client.CreateTable(types.LookupTableDefinition{
Description: description,
Fields: cmdutils.GenerateLookupTableFields(fieldNames, fieldTypes),
PrimaryKeys: primaryKeys,
Ttl: ttl,
SizeLimitAction: sizeLimitAction,
Name: name,
ParentFolderId: parentFolderId,
})
if err != nil {
cmdutils.OutputError(response, err)
} else {
cmdutils.Output(data, response, err, "")
}
}
| 46.029412 | 144 | 0.728435 |
42fa64dc263085410d05e3e26e21e27b17a63232 | 2,246 | swift | Swift | TFGMLive/StationServiceAdapter/StationServiceAdapter.swift | Winnie90/TFGMLive | f8cc19e1812a137c3165a893960b3d7499aca567 | [
"MIT"
] | null | null | null | TFGMLive/StationServiceAdapter/StationServiceAdapter.swift | Winnie90/TFGMLive | f8cc19e1812a137c3165a893960b3d7499aca567 | [
"MIT"
] | null | null | null | TFGMLive/StationServiceAdapter/StationServiceAdapter.swift | Winnie90/TFGMLive | f8cc19e1812a137c3165a893960b3d7499aca567 | [
"MIT"
] | null | null | null | import Foundation
import StationRequest
struct StationServiceAdapter: DataSourceChangedDelegate {
init() {
WatchSessionManager.sharedManager.addDataSourceChangedDelegate(delegate: self)
}
func getAllStationRecords(completion: @escaping ([StationRecord], Error?)->()) {
StationService.getAllStations { (resultStations, error) in
if let error = error{
completion([], error)
}
if let resultStations = resultStations {
completion(resultStations.map{StationRecord(station: $0)}, nil)
}
}
}
func getUserStations() -> [StationPresentable] {
var stations: [StationPresentable] = []
for station in StationService.getUserStations() {
stations.append(StationPresentable(station: station))
}
return stations
}
func getLatestDataForStation(station: StationPresentable, completion: @escaping (StationPresentable, Error?)->()) {
return StationService.getLatestDataForStation(identifier: station.identifier, completion: { station, error in
if let station = station {
completion(StationPresentable(station: station), nil)
} else {
completion(StationPresentable(), error)
}
})
}
func saveUsersStationRecords(stations: [StationRecord]) -> Bool {
var stationsToSave: [Station] = []
for station in stations {
stationsToSave.append(station.toStation())
}
if stationsToSave == StationService.getUserStations() {
return false
}
StationService.saveUserStations(stations: stationsToSave)
WatchSessionManager.sharedManager.updateUserStation()
return true
}
func getUsersStationRecords() -> [StationRecord] {
var stations: [StationRecord] = []
for station in StationService.getUserStations() {
stations.append(StationRecord(station: station))
}
return stations
}
func addStation(identifier: Int, completion: @escaping ()->()) {
StationService.addStation(identifier: identifier, completion: completion)
}
}
| 35.09375 | 119 | 0.627337 |
c317158792fcfdc95316695b9156d46086ea78c4 | 3,200 | rs | Rust | src/assets_cache.rs | Leinnan/doppler | 9320ed97b683f40337485ae55175643ad754d4d1 | [
"MIT"
] | 1 | 2020-11-29T02:35:53.000Z | 2020-11-29T02:35:53.000Z | src/assets_cache.rs | Leinnan/doppler | 9320ed97b683f40337485ae55175643ad754d4d1 | [
"MIT"
] | null | null | null | src/assets_cache.rs | Leinnan/doppler | 9320ed97b683f40337485ae55175643ad754d4d1 | [
"MIT"
] | null | null | null | use crate::mesh::Texture;
use crate::model::Model;
use crate::utils::load_texture_from_dir;
use log::{error, info};
use std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
#[derive(Default)]
pub struct AssetsCache {
textures: HashMap<u64, Texture>,
models: HashMap<u64, Model>,
}
impl AssetsCache {
pub fn load_all_from_file(&mut self, path: &str) {
let path = std::path::Path::new(path);
let meta = std::fs::metadata(path);
if !meta.is_ok() {
error!("There is no assets file");
return;
}
use std::fs;
use std::io::prelude::*;
use std::io::BufReader;
let buf = BufReader::new(fs::File::open(path).expect("no such file"));
let lines: Vec<String> = buf
.lines()
.map(|l| l.expect("Could not parse line"))
.collect();
for line in lines {
let mut splitted = line.split_whitespace();
let path = splitted.next();
if path.is_none() || self.has_model(&path.unwrap()) {
error!("Skip wrong line: {}", line);
continue;
}
let texture = splitted.next();
self.load_model_ext(path.unwrap(), texture);
info!("Added model from path {}", path.unwrap());
}
}
pub fn has_model(&self, path: &str) -> bool {
self.models.contains_key(&Self::path_hash(path))
}
pub fn get_model(&mut self, path: &str) -> Model {
self.get_model_ext(path, None)
}
pub fn get_model_ext(&mut self, path: &str, diff_texture: Option<&str>) -> Model {
match self.models.get(&Self::path_hash(path)) {
Some(model) => model.clone(),
None => {
self.load_model_ext(path, diff_texture);
self.get_model_ext(path, diff_texture)
}
}
}
pub fn get_model_by_hash(&mut self, hash: &u64) -> Option<Model> {
match self.models.get(hash) {
Some(model) => Some(model.clone()),
None => None,
}
}
fn load_model_ext(&mut self, path: &str, diff_texture: Option<&str>) {
let hash = Self::path_hash(path);
info!("Loading model: {}({})", path, hash);
let model = Model::new_ext(path, diff_texture, self);
self.models.insert(hash, model);
}
pub fn get_material_texture(&mut self, dir: &str, path: &str, type_name: &str) -> Texture {
match self.textures.get(&Self::path_hash(path)) {
Some(texture) => texture.clone(),
None => {
let directory: String = dir.into();
let texture = Texture {
id: unsafe { load_texture_from_dir(path, &directory) },
type_: type_name.into(),
path: path.into(),
};
self.textures.insert(Self::path_hash(path), texture.clone());
texture
}
}
}
pub fn path_hash(path: &str) -> u64 {
let mut hasher = DefaultHasher::new();
path.hash(&mut hasher);
hasher.finish()
}
}
| 32.323232 | 95 | 0.534063 |
875a6e9cf01e4dbff3791462853d42c3fd1fab82 | 171 | html | HTML | template.html | honux77/level1-js | 61a615e1984714750c0cb57b82250d822cd25e2e | [
"MIT"
] | null | null | null | template.html | honux77/level1-js | 61a615e1984714750c0cb57b82250d822cd25e2e | [
"MIT"
] | null | null | null | template.html | honux77/level1-js | 61a615e1984714750c0cb57b82250d822cd25e2e | [
"MIT"
] | 1 | 2017-11-03T06:13:47.000Z | 2017-11-03T06:13:47.000Z | <!DOCTYPE html>
<html>
<title>HTML Tutorial</title>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html> | 13.153846 | 28 | 0.631579 |
d7d0d8ac328896fae6e48e4e4efa97581abc3b66 | 1,197 | swift | Swift | Leetcode-Swift/Leetcode/1122.swift | devshiye/Leetcode-Swift | 5bf0bba0778fcf275c02f1f6c496ea5b0ddf4692 | [
"MIT"
] | null | null | null | Leetcode-Swift/Leetcode/1122.swift | devshiye/Leetcode-Swift | 5bf0bba0778fcf275c02f1f6c496ea5b0ddf4692 | [
"MIT"
] | null | null | null | Leetcode-Swift/Leetcode/1122.swift | devshiye/Leetcode-Swift | 5bf0bba0778fcf275c02f1f6c496ea5b0ddf4692 | [
"MIT"
] | null | null | null | //
// 1122.swift
// Leetcode-Swift
//
// Created by devshiye on 2022/1/2.
//
import Foundation
/*
1122. 数组的相对排序 (简单)
https://leetcode-cn.com/problems/relative-sort-array/
*/
class Solution_1122 {
func relativeSortArray(_ arr1: [Int], _ arr2: [Int]) -> [Int] {
if arr1.isEmpty {
return []
}
if arr2.isEmpty {
return arr1.sorted()
}
var map = [Int: Int]()
var k = 0
var ans = [Int](repeating: 0, count: arr1.count)
// 统计arr2中出现的数字
for i in arr2 {
map[i] = 0
}
// 统计arr2中的数字在arr1中的个数
for i in arr1 {
if let count = map[i] {
map[i] = count + 1
}
}
// 将arr2中的顺序及个数,放到结果数组中
for key in arr2 {
let count = map[key]!
for _ in 0..<count {
ans[k] = key
k += 1
}
}
// 未在arr2中的数字,按升序放入结果数组中
let sortedArr1 = arr1.sorted()
for i in sortedArr1 {
if let _ = map[i] {
continue
}
ans[k] = i
k += 1
}
return ans
}
}
| 19 | 67 | 0.429407 |
e20903ec8722eb5f701a089f1f3b368daa074940 | 3,606 | kt | Kotlin | src/app.kt | kmdinake/fuzzy-lamp | 12c5c195ae73fb78695bdcb9da8b53e6c01e7c19 | [
"MIT"
] | null | null | null | src/app.kt | kmdinake/fuzzy-lamp | 12c5c195ae73fb78695bdcb9da8b53e6c01e7c19 | [
"MIT"
] | null | null | null | src/app.kt | kmdinake/fuzzy-lamp | 12c5c195ae73fb78695bdcb9da8b53e6c01e7c19 | [
"MIT"
] | null | null | null | import ai.*
fun main(args: Array<String>){
println("=================> Boundary Constrained PSO <=================")
var userInput: String?
var selectedPSOVariant: Int
var numberOfEpochs: Int
var numberOfParticles: Int
var numberOfDimensions: Int
do {
displayPSOVariants()
print("> ")
userInput = readLine()
selectedPSOVariant = userInput.toString().toInt()
if (userInput == "" || selectedPSOVariant < 0 || selectedPSOVariant > 10){
println("Invalid option.")
} else {
println("You selected option $selectedPSOVariant.")
}
} while (selectedPSOVariant < 0 || selectedPSOVariant > 10)
do {
println("How many particles should be in the swarm?")
print("> ")
userInput = readLine()
numberOfParticles = userInput.toString().toInt()
if (userInput == "" || numberOfParticles <= 0){
println("Invalid option.")
} else {
println("Your swarm has $numberOfParticles particles.")
}
} while (numberOfParticles < 0)
do {
println("What is the dimensionality of the swarm?")
print("> ")
userInput = readLine()
numberOfDimensions = userInput.toString().toInt()
if (userInput == "" || numberOfDimensions <= 0){
println("Invalid option.")
} else {
println("Space of R^n is where n = $numberOfDimensions.")
}
} while(numberOfDimensions < 0)
do {
println("How many epochs should the swarm run over?")
print("> ")
userInput = readLine()
numberOfEpochs = userInput.toString().toInt()
if (userInput == "" || numberOfEpochs <= 0){
println("Invalid option.")
} else {
println("Swarm running over $numberOfEpochs epochs.")
}
} while (numberOfEpochs < 0)
var pso: PSO? = null
when (selectedPSOVariant) {
0 -> pso = FeasiblePSO()
1 -> pso = ClampingPSO()
2 -> pso = ElemReinitPSO()
3 -> pso = ElemReinitZeroVelPSO()
4 -> pso = InitPbestPSO()
5 -> pso = InitPbestZeroVelPSO()
6 -> pso = InitGbestPSO()
7 -> pso = InitGbestZeroVelPSO()
8 -> pso = ReverseVelPSO()
9 -> pso = ArithmeticAvgPSO()
/*10 -> pso = "10"
11 -> pso = "11"*/
}
if(pso != null){
pso.numberOfDimensions = numberOfDimensions
pso.numberOfEpochs = numberOfEpochs
pso.numberOfParticles = numberOfParticles
(0.until(50)).forEach {
println("Run[$it]:")
(0.until(11)).forEach { i ->
pso.initialize("f$i")
pso.optimize()
pso.printResults()
}
}
}
}
fun displayPSOVariants() {
val variants = listOf(
"Feasible particle position approach",
"Clamping approach",
"Per element reinitialization approach",
"Per element reinitialization and set velocity to zero approach",
"Initialize to personal best approach",
"Initialize to personal best and set velocity to zero approach",
"Initialize to global best position approach",
"Initialize to global best position and set velocity to zero approach",
"Reverse velocity approach",
"Set boundary violation decision variable to an arithmetic average approach",
"Literature approach"
)
for (index in variants.indices) {
println("[$index]: ${variants[index]}")
}
}
| 33.700935 | 89 | 0.559623 |
bf3a1f7ef273a950dad67e0fe992d641c9942eb2 | 288 | swift | Swift | SooMusic/Cell/SongCollectiveTypeTableViewCell.swift | martinolee/SooMusic | fa97a743165ae57c45644d8b08a549d987f41190 | [
"MIT"
] | null | null | null | SooMusic/Cell/SongCollectiveTypeTableViewCell.swift | martinolee/SooMusic | fa97a743165ae57c45644d8b08a549d987f41190 | [
"MIT"
] | null | null | null | SooMusic/Cell/SongCollectiveTypeTableViewCell.swift | martinolee/SooMusic | fa97a743165ae57c45644d8b08a549d987f41190 | [
"MIT"
] | null | null | null | //
// SongCollectiveTypeTableViewCell.swift
// SooMusic
//
// Created by Soohan Lee on 2019/12/10.
// Copyright © 2019 Soohan. All rights reserved.
//
import UIKit
class SongCollectiveTypeTableViewCell: UITableViewCell {
static let identifier = "SongCollectiveTypeCell"
}
| 18 | 56 | 0.732639 |
fc5006ee346248bf6ddad220681806a05206eb8a | 2,695 | kt | Kotlin | app/src/main/java/eu/yeger/koffee/ui/user/editing/UserEditingViewModel.kt | koffee-project/koffee-app | 8fd30631154ea3b9f568297152250322dd6d2f58 | [
"Apache-2.0"
] | 1 | 2021-07-20T13:09:25.000Z | 2021-07-20T13:09:25.000Z | app/src/main/java/eu/yeger/koffee/ui/user/editing/UserEditingViewModel.kt | koffee-project/koffee-app | 8fd30631154ea3b9f568297152250322dd6d2f58 | [
"Apache-2.0"
] | 1 | 2021-01-21T13:06:30.000Z | 2021-01-21T14:27:19.000Z | app/src/main/java/eu/yeger/koffee/ui/user/editing/UserEditingViewModel.kt | koffee-project/koffee-app | 8fd30631154ea3b9f568297152250322dd6d2f58 | [
"Apache-2.0"
] | null | null | null | package eu.yeger.koffee.ui.user.editing
import androidx.lifecycle.MutableLiveData
import eu.yeger.koffee.repository.AdminRepository
import eu.yeger.koffee.repository.UserRepository
import eu.yeger.koffee.ui.CoroutineViewModel
import eu.yeger.koffee.ui.DataAction
import eu.yeger.koffee.utility.nullIfBlank
import eu.yeger.koffee.utility.sourcedLiveData
/**
* [CoroutineViewModel] for updating users.
*
* @property userId The id of the user that is being edited.
* @property adminRepository [AdminRepository] for accessing authentication tokens.
* @property userRepository [UserRepository] for updating the user.
* @property userName Bidirectional [MutableLiveData](https://developer.android.com/reference/androidx/lifecycle/MutableLiveData) for binding the user name.
* @property userPassword Bidirectional [MutableLiveData](https://developer.android.com/reference/androidx/lifecycle/MutableLiveData) for binding the user password.
* @property isAdmin Bidirectional [MutableLiveData](https://developer.android.com/reference/androidx/lifecycle/MutableLiveData) for binding the admin status.
* @property canUpdateUser Indicates that updating a user is possible with the current input values.
* @property userUpdatedAction [DataAction] that is activated when the user has been updated. Contains the user's id.
*
* @author Jan Müller
*/
class UserEditingViewModel(
val userId: String,
private val adminRepository: AdminRepository,
private val userRepository: UserRepository
) : CoroutineViewModel() {
val userName = MutableLiveData("")
val userPassword = MutableLiveData("")
val isAdmin = MutableLiveData(false)
val canUpdateUser = sourcedLiveData(userName, userPassword, isAdmin) {
userName.value.isNullOrBlank().not() &&
(isAdmin.value!!.not() ||
userPassword.value.isNullOrBlank().not() && userPassword.value!!.length >= 8)
}
val userUpdatedAction = DataAction<String>()
init {
onViewModelScope {
userRepository.getUserById(userId)?.run {
userName.value = name
}
}
}
/**
* Updates the name, password and admin status of the user with the given id.
*/
fun updateUser() {
onViewModelScope {
adminRepository.getJWT()?.let {
userRepository.updateUser(
userId = userId,
userName = userName.value!!,
password = userPassword.value.nullIfBlank(),
isAdmin = isAdmin.value!!,
jwt = it
)
userUpdatedAction.activateWith(userId)
}
}
}
}
| 37.957746 | 164 | 0.686827 |
7108837efff92e55c59707968481856347aa40d7 | 3,063 | swift | Swift | Struct/StructDemo.playground/Contents.swift | dengfeng520/RPDemo | 95c283f102f4aeee9af1842eb5579b3aae71e869 | [
"MIT"
] | null | null | null | Struct/StructDemo.playground/Contents.swift | dengfeng520/RPDemo | 95c283f102f4aeee9af1842eb5579b3aae71e869 | [
"MIT"
] | null | null | null | Struct/StructDemo.playground/Contents.swift | dengfeng520/RPDemo | 95c283f102f4aeee9af1842eb5579b3aae71e869 | [
"MIT"
] | null | null | null | import UIKit
var str = "Hello, playground"
// MARK: - struct
struct Color {
var red: Double = 0
var green: Double = 0
var blue: Double = 0
var alpha: Double? = 1
init(red: Double = 0, green: Double = 0, blue: Double = 0, alpha: Double? = 1) {
self.red = red
self.green = green
self.blue = blue
self.alpha = alpha
}
mutating func modifyWith(alpha: Double) {
self.alpha = alpha
}
}
extension Color: Codable {
init?(data: Data) {
guard let model = try? JSONDecoder().decode(Color.self, from: data) else { return nil }
self = model
}
}
extension Color {
static let themeColor = Color(red: 200, green: 200, blue: 200, alpha: 1)
}
//let color = Color.themeColor
var colorA = Color(red: 200, green: 200, blue: 200) {
didSet {
print("color============\(colorA)")
}
}
let colorB = Color(red: 100, green: 100, blue: 100)
colorA = colorB
if colorA.alpha == colorB.alpha {
}
let colorC = colorA
let colorD = colorA
let colorE = colorA
var colorArray = [colorA, colorB, colorC, colorD, colorE]
let queue = DispatchQueue.global()
let count = colorArray.count
//queue.async { [colorArray] in
// for index in 0..<colorArray.count {
// print("index=========\(colorArray[index])")
// Thread.sleep(forTimeInterval: 1)
// }
//}
queue.async {
for index in 0..<count {
print("index=========\(colorArray[index])")
Thread.sleep(forTimeInterval: 1)
}
}
queue.async {
Thread.sleep(forTimeInterval: 0.5)
colorArray.removeLast()
print("-------\(colorArray.count)")
}
// MARK: - class
@objcMembers class MyColor {
var red: Double = 0.0
var green: Double = 0.0
var blue: Double = 0.0
var alpha: Double? = 1
init(_ red: Double = 0, _ green: Double = 0, _ blue: Double = 0, _ alpha: Double? = 1) {
self.red = red
self.green = green
self.blue = blue
self.alpha = alpha
}
convenience init(at: (Double, Double, Double, Double?)) {
self.init(at.0, at.1, at.2, at.3)
}
convenience init?(at: (String, String, String, String?)) {
guard let red = Double(at.0), let green = Double(at.1), let blue = Double(at.2) else {
return nil
}
self.init(red, green, blue)
}
}
let mycolorA = MyColor()
let mycolor = MyColor(100, 100, 100)
let mycolorB = mycolorA
if mycolorA === mycolor {
}
struct Stack<Element> {
lazy var stackList = Array<Element>()
// 进栈
// @available(*, unavailable, renamed: "")
mutating func push(_ data: Element?) {
guard let data = data else { return }
stackList.append(data)
print("push----------\(stackList.count)")
}
// 出栈
mutating func pop() {
guard stackList.count != 0 else { return }
stackList.removeLast()
print("pop----------\(stackList.count)")
}
}
var stack = Stack<Any>()
stack.push("1")
stack.push("2")
stack.push(3)
stack.push("test")
stack.pop()
| 22.357664 | 95 | 0.5746 |
f83cf27b6384c0eafdfe24c0bf1bfdcb69f7a970 | 33,836 | kt | Kotlin | godot-kotlin/src/nativeGen/kotlin/godot/Image.kt | m4gr3d/godot-kotlin-native | 2a8529085ccb4aec280f898dc220c8aafd6d6de4 | [
"MIT"
] | 56 | 2019-01-17T13:32:07.000Z | 2022-01-11T23:33:50.000Z | godot-kotlin/src/nativeGen/kotlin/godot/Image.kt | m4gr3d/godot-kotlin-native | 2a8529085ccb4aec280f898dc220c8aafd6d6de4 | [
"MIT"
] | 25 | 2020-01-27T15:13:06.000Z | 2020-03-17T10:25:22.000Z | godot-kotlin/src/nativeGen/kotlin/godot/Image.kt | m4gr3d/godot-kotlin-native | 2a8529085ccb4aec280f898dc220c8aafd6d6de4 | [
"MIT"
] | 5 | 2020-01-27T14:45:21.000Z | 2020-04-26T09:41:11.000Z | // DO NOT EDIT, THIS FILE IS GENERATED FROM api.json
package godot
import gdnative.godot_method_bind
import gdnative.godot_string
import godot.core.Allocator
import godot.core.Color
import godot.core.Dictionary
import godot.core.GDError
import godot.core.Godot
import godot.core.PoolByteArray
import godot.core.Rect2
import godot.core.Variant
import godot.core.VariantArray
import godot.core.Vector2
import kotlin.Boolean
import kotlin.Float
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.reflect.KCallable
import kotlinx.cinterop.BooleanVar
import kotlinx.cinterop.CFunction
import kotlinx.cinterop.COpaquePointer
import kotlinx.cinterop.COpaquePointerVar
import kotlinx.cinterop.CPointer
import kotlinx.cinterop.DoubleVar
import kotlinx.cinterop.IntVar
import kotlinx.cinterop.alloc
import kotlinx.cinterop.cstr
import kotlinx.cinterop.invoke
import kotlinx.cinterop.pointed
import kotlinx.cinterop.ptr
import kotlinx.cinterop.readValue
import kotlinx.cinterop.reinterpret
import kotlinx.cinterop.value
open class Image(
@Suppress("UNUSED_PARAMETER")
__ignore: String?
) : Resource(null) {
constructor() : this(null) {
if (Godot.shouldInitHandle()) {
_handle = __new()
}
}
open fun _get_data(): Dictionary {
TODO()
}
open fun _set_data(data: Dictionary) {
TODO()
}
fun blendRect(
src: Image,
srcRect: Rect2,
dst: Vector2
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(src)
_args.add(srcRect)
_args.add(dst)
__method_bind.blendRect.call(self._handle, _args, null)
}
}
fun blendRectMask(
src: Image,
mask: Image,
srcRect: Rect2,
dst: Vector2
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(src)
_args.add(mask)
_args.add(srcRect)
_args.add(dst)
__method_bind.blendRectMask.call(self._handle, _args, null)
}
}
fun blitRect(
src: Image,
srcRect: Rect2,
dst: Vector2
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(src)
_args.add(srcRect)
_args.add(dst)
__method_bind.blitRect.call(self._handle, _args, null)
}
}
fun blitRectMask(
src: Image,
mask: Image,
srcRect: Rect2,
dst: Vector2
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(src)
_args.add(mask)
_args.add(srcRect)
_args.add(dst)
__method_bind.blitRectMask.call(self._handle, _args, null)
}
}
fun bumpmapToNormalmap(bumpScale: Float = 1.0f) {
val self = this
return Allocator.allocationScope {
__method_bind.bumpmapToNormalmap.call(self._handle, listOf(bumpScale), null)
}
}
fun clearMipmaps() {
val self = this
return Allocator.allocationScope {
__method_bind.clearMipmaps.call(self._handle, emptyList(), null)
}
}
fun compress(
mode: Int,
source: Int,
lossyQuality: Float
): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
val _args = mutableListOf<Any?>()
_args.add(mode)
_args.add(source)
_args.add(lossyQuality)
__method_bind.compress.call(self._handle, _args, _retPtr)
GDError.from(_ret.value)
}
}
fun convert(format: Int) {
val self = this
return Allocator.allocationScope {
__method_bind.convert.call(self._handle, listOf(format), null)
}
}
fun copyFrom(src: Image) {
val self = this
return Allocator.allocationScope {
__method_bind.copyFrom.call(self._handle, listOf(src), null)
}
}
fun create(
width: Int,
height: Int,
useMipmaps: Boolean,
format: Int
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(width)
_args.add(height)
_args.add(useMipmaps)
_args.add(format)
__method_bind.create.call(self._handle, _args, null)
}
}
fun createFromData(
width: Int,
height: Int,
useMipmaps: Boolean,
format: Int,
data: PoolByteArray
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(width)
_args.add(height)
_args.add(useMipmaps)
_args.add(format)
_args.add(data)
__method_bind.createFromData.call(self._handle, _args, null)
}
}
fun crop(width: Int, height: Int) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(width)
_args.add(height)
__method_bind.crop.call(self._handle, _args, null)
}
}
fun decompress(): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.decompress.call(self._handle, emptyList(), _retPtr)
GDError.from(_ret.value)
}
}
fun detectAlpha(): AlphaMode {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.detectAlpha.call(self._handle, emptyList(), _retPtr)
Image.AlphaMode.from(_ret.value)
}
}
fun expandX2Hq2x() {
val self = this
return Allocator.allocationScope {
__method_bind.expandX2Hq2x.call(self._handle, emptyList(), null)
}
}
fun fill(color: Color) {
val self = this
return Allocator.allocationScope {
__method_bind.fill.call(self._handle, listOf(color), null)
}
}
fun fixAlphaEdges() {
val self = this
return Allocator.allocationScope {
__method_bind.fixAlphaEdges.call(self._handle, emptyList(), null)
}
}
fun flipX() {
val self = this
return Allocator.allocationScope {
__method_bind.flipX.call(self._handle, emptyList(), null)
}
}
fun flipY() {
val self = this
return Allocator.allocationScope {
__method_bind.flipY.call(self._handle, emptyList(), null)
}
}
fun generateMipmaps(renormalize: Boolean = false): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.generateMipmaps.call(self._handle, listOf(renormalize), _retPtr)
GDError.from(_ret.value)
}
}
fun getData(): PoolByteArray {
val self = this
return Allocator.allocationScope {
val _ret = PoolByteArray()
val _retPtr = _ret._value.ptr
__method_bind.getData.call(self._handle, emptyList(), _retPtr)
_ret._value = _retPtr.pointed.readValue()
_ret
}
}
fun getFormat(): Format {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.getFormat.call(self._handle, emptyList(), _retPtr)
Image.Format.from(_ret.value)
}
}
fun getHeight(): Int {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.getHeight.call(self._handle, emptyList(), _retPtr)
_ret.value
}
}
fun getMipmapOffset(mipmap: Int): Int {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.getMipmapOffset.call(self._handle, listOf(mipmap), _retPtr)
_ret.value
}
}
fun getPixel(x: Int, y: Int): Color {
val self = this
return Allocator.allocationScope {
val _ret = Color()
val _retPtr = _ret._value.ptr
val _args = mutableListOf<Any?>()
_args.add(x)
_args.add(y)
__method_bind.getPixel.call(self._handle, _args, _retPtr)
_ret._value = _retPtr.pointed.readValue()
_ret
}
}
fun getPixelv(src: Vector2): Color {
val self = this
return Allocator.allocationScope {
val _ret = Color()
val _retPtr = _ret._value.ptr
__method_bind.getPixelv.call(self._handle, listOf(src), _retPtr)
_ret._value = _retPtr.pointed.readValue()
_ret
}
}
fun getRect(rect: Rect2): Image {
val self = this
return Allocator.allocationScope {
lateinit var _ret: Image
val _tmp = alloc<COpaquePointerVar>()
val _retPtr = _tmp.ptr
__method_bind.getRect.call(self._handle, listOf(rect), _retPtr)
_ret = objectToType<Image>(_tmp.value!!)
_ret
}
}
fun getSize(): Vector2 {
val self = this
return Allocator.allocationScope {
val _ret = Vector2()
val _retPtr = _ret._value.ptr
__method_bind.getSize.call(self._handle, emptyList(), _retPtr)
_ret._value = _retPtr.pointed.readValue()
_ret
}
}
fun getUsedRect(): Rect2 {
val self = this
return Allocator.allocationScope {
val _ret = Rect2()
val _retPtr = _ret._value.ptr
__method_bind.getUsedRect.call(self._handle, emptyList(), _retPtr)
_ret._value = _retPtr.pointed.readValue()
_ret
}
}
fun getWidth(): Int {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.getWidth.call(self._handle, emptyList(), _retPtr)
_ret.value
}
}
fun hasMipmaps(): Boolean {
val self = this
return Allocator.allocationScope {
val _ret = alloc<BooleanVar>()
val _retPtr = _ret.ptr
__method_bind.hasMipmaps.call(self._handle, emptyList(), _retPtr)
_ret.value
}
}
fun isCompressed(): Boolean {
val self = this
return Allocator.allocationScope {
val _ret = alloc<BooleanVar>()
val _retPtr = _ret.ptr
__method_bind.isCompressed.call(self._handle, emptyList(), _retPtr)
_ret.value
}
}
fun isEmpty(): Boolean {
val self = this
return Allocator.allocationScope {
val _ret = alloc<BooleanVar>()
val _retPtr = _ret.ptr
__method_bind.isEmpty.call(self._handle, emptyList(), _retPtr)
_ret.value
}
}
fun isInvisible(): Boolean {
val self = this
return Allocator.allocationScope {
val _ret = alloc<BooleanVar>()
val _retPtr = _ret.ptr
__method_bind.isInvisible.call(self._handle, emptyList(), _retPtr)
_ret.value
}
}
fun load(path: String): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.load.call(self._handle, listOf(path), _retPtr)
GDError.from(_ret.value)
}
}
fun loadJpgFromBuffer(buffer: PoolByteArray): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.loadJpgFromBuffer.call(self._handle, listOf(buffer), _retPtr)
GDError.from(_ret.value)
}
}
fun loadPngFromBuffer(buffer: PoolByteArray): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.loadPngFromBuffer.call(self._handle, listOf(buffer), _retPtr)
GDError.from(_ret.value)
}
}
fun loadWebpFromBuffer(buffer: PoolByteArray): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.loadWebpFromBuffer.call(self._handle, listOf(buffer), _retPtr)
GDError.from(_ret.value)
}
}
fun lock() {
val self = this
return Allocator.allocationScope {
__method_bind.lock.call(self._handle, emptyList(), null)
}
}
fun normalmapToXy() {
val self = this
return Allocator.allocationScope {
__method_bind.normalmapToXy.call(self._handle, emptyList(), null)
}
}
fun premultiplyAlpha() {
val self = this
return Allocator.allocationScope {
__method_bind.premultiplyAlpha.call(self._handle, emptyList(), null)
}
}
fun resize(
width: Int,
height: Int,
interpolation: Int = 1
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(width)
_args.add(height)
_args.add(interpolation)
__method_bind.resize.call(self._handle, _args, null)
}
}
fun resizeToPo2(square: Boolean = false) {
val self = this
return Allocator.allocationScope {
__method_bind.resizeToPo2.call(self._handle, listOf(square), null)
}
}
fun rgbeToSrgb(): Image {
val self = this
return Allocator.allocationScope {
lateinit var _ret: Image
val _tmp = alloc<COpaquePointerVar>()
val _retPtr = _tmp.ptr
__method_bind.rgbeToSrgb.call(self._handle, emptyList(), _retPtr)
_ret = objectToType<Image>(_tmp.value!!)
_ret
}
}
fun saveExr(path: String, grayscale: Boolean = false): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
val _args = mutableListOf<Any?>()
_args.add(path)
_args.add(grayscale)
__method_bind.saveExr.call(self._handle, _args, _retPtr)
GDError.from(_ret.value)
}
}
fun savePng(path: String): GDError {
val self = this
return Allocator.allocationScope {
val _ret = alloc<IntVar>()
val _retPtr = _ret.ptr
__method_bind.savePng.call(self._handle, listOf(path), _retPtr)
GDError.from(_ret.value)
}
}
fun setPixel(
x: Int,
y: Int,
color: Color
) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(x)
_args.add(y)
_args.add(color)
__method_bind.setPixel.call(self._handle, _args, null)
}
}
fun setPixelv(dst: Vector2, color: Color) {
val self = this
return Allocator.allocationScope {
val _args = mutableListOf<Any?>()
_args.add(dst)
_args.add(color)
__method_bind.setPixelv.call(self._handle, _args, null)
}
}
fun shrinkX2() {
val self = this
return Allocator.allocationScope {
__method_bind.shrinkX2.call(self._handle, emptyList(), null)
}
}
fun srgbToLinear() {
val self = this
return Allocator.allocationScope {
__method_bind.srgbToLinear.call(self._handle, emptyList(), null)
}
}
fun unlock() {
val self = this
return Allocator.allocationScope {
__method_bind.unlock.call(self._handle, emptyList(), null)
}
}
enum class AlphaMode(
val value: Int
) {
NONE(0),
BIT(1),
BLEND(2);
companion object {
fun from(value: Int): AlphaMode {
for (enumValue in values()) {
if (enumValue.value == value) {
return enumValue
}
}
throw AssertionError("""Unsupported enum value: $value""")
}
}
}
enum class CompressSource(
val value: Int
) {
GENERIC(0),
SRGB(1),
NORMAL(2);
companion object {
fun from(value: Int): CompressSource {
for (enumValue in values()) {
if (enumValue.value == value) {
return enumValue
}
}
throw AssertionError("""Unsupported enum value: $value""")
}
}
}
enum class Interpolation(
val value: Int
) {
INTERPOLATE_NEAREST(0),
INTERPOLATE_BILINEAR(1),
INTERPOLATE_CUBIC(2),
INTERPOLATE_TRILINEAR(3),
INTERPOLATE_LANCZOS(4);
companion object {
fun from(value: Int): Interpolation {
for (enumValue in values()) {
if (enumValue.value == value) {
return enumValue
}
}
throw AssertionError("""Unsupported enum value: $value""")
}
}
}
enum class CompressMode(
val value: Int
) {
S3TC(0),
PVRTC2(1),
PVRTC4(2),
ETC(3),
ETC2(4);
companion object {
fun from(value: Int): CompressMode {
for (enumValue in values()) {
if (enumValue.value == value) {
return enumValue
}
}
throw AssertionError("""Unsupported enum value: $value""")
}
}
}
enum class Format(
val value: Int
) {
L8(0),
LA8(1),
R8(2),
RG8(3),
RGB8(4),
RGBA8(5),
RGBA4444(6),
RGBA5551(7),
RF(8),
RGF(9),
RGBF(10),
RGBAF(11),
RH(12),
RGH(13),
RGBH(14),
RGBAH(15),
RGBE9995(16),
DXT1(17),
DXT3(18),
DXT5(19),
RGTC_R(20),
RGTC_RG(21),
BPTC_RGBA(22),
BPTC_RGBF(23),
BPTC_RGBFU(24),
PVRTC2(25),
PVRTC2A(26),
PVRTC4(27),
PVRTC4A(28),
ETC(29),
ETC2_R11(30),
ETC2_R11S(31),
ETC2_RG11(32),
ETC2_RG11S(33),
ETC2_RGB8(34),
ETC2_RGBA8(35),
ETC2_RGB8A1(36),
MAX(37);
companion object {
fun from(value: Int): Format {
for (enumValue in values()) {
if (enumValue.value == value) {
return enumValue
}
}
throw AssertionError("""Unsupported enum value: $value""")
}
}
}
companion object {
val MAX_HEIGHT: Int = 16384
val MAX_WIDTH: Int = 16384
internal fun __new(): COpaquePointer = Allocator.allocationScope {
val fnPtr = checkNotNull(Godot.gdnative.godot_get_class_constructor)("Image".cstr.ptr)
requireNotNull(fnPtr) { "No instance found for Image" }
val fn = fnPtr.reinterpret<CFunction<() -> COpaquePointer>>()
fn()
}
/**
* Container for method_bind pointers for Image
*/
private object __method_bind {
val blendRect: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"blend_rect".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method blend_rect" }
}
val blendRectMask: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"blend_rect_mask".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method blend_rect_mask" }
}
val blitRect: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"blit_rect".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method blit_rect" }
}
val blitRectMask: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"blit_rect_mask".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method blit_rect_mask" }
}
val bumpmapToNormalmap: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"bumpmap_to_normalmap".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method bumpmap_to_normalmap" }
}
val clearMipmaps: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"clear_mipmaps".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method clear_mipmaps" }
}
val compress: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"compress".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method compress" }
}
val convert: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"convert".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method convert" }
}
val copyFrom: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"copy_from".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method copy_from" }
}
val create: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"create".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method create" }
}
val createFromData: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"create_from_data".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method create_from_data" }
}
val crop: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"crop".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method crop" }
}
val decompress: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"decompress".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method decompress" }
}
val detectAlpha: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"detect_alpha".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method detect_alpha" }
}
val expandX2Hq2x: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"expand_x2_hq2x".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method expand_x2_hq2x" }
}
val fill: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"fill".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method fill" }
}
val fixAlphaEdges: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"fix_alpha_edges".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method fix_alpha_edges" }
}
val flipX: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"flip_x".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method flip_x" }
}
val flipY: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"flip_y".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method flip_y" }
}
val generateMipmaps: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"generate_mipmaps".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method generate_mipmaps" }
}
val getData: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_data".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_data" }
}
val getFormat: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_format".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_format" }
}
val getHeight: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_height".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_height" }
}
val getMipmapOffset: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_mipmap_offset".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_mipmap_offset" }
}
val getPixel: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_pixel".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_pixel" }
}
val getPixelv: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_pixelv".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_pixelv" }
}
val getRect: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_rect".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_rect" }
}
val getSize: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_size".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_size" }
}
val getUsedRect: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_used_rect".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_used_rect" }
}
val getWidth: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"get_width".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method get_width" }
}
val hasMipmaps: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"has_mipmaps".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method has_mipmaps" }
}
val isCompressed: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"is_compressed".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method is_compressed" }
}
val isEmpty: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"is_empty".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method is_empty" }
}
val isInvisible: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"is_invisible".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method is_invisible" }
}
val load: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"load".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method load" }
}
val loadJpgFromBuffer: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"load_jpg_from_buffer".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method load_jpg_from_buffer" }
}
val loadPngFromBuffer: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"load_png_from_buffer".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method load_png_from_buffer" }
}
val loadWebpFromBuffer: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"load_webp_from_buffer".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method load_webp_from_buffer" }
}
val lock: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"lock".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method lock" }
}
val normalmapToXy: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"normalmap_to_xy".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method normalmap_to_xy" }
}
val premultiplyAlpha: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"premultiply_alpha".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method premultiply_alpha" }
}
val resize: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"resize".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method resize" }
}
val resizeToPo2: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"resize_to_po2".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method resize_to_po2" }
}
val rgbeToSrgb: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"rgbe_to_srgb".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method rgbe_to_srgb" }
}
val saveExr: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"save_exr".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method save_exr" }
}
val savePng: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"save_png".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method save_png" }
}
val setPixel: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"set_pixel".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method set_pixel" }
}
val setPixelv: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"set_pixelv".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method set_pixelv" }
}
val shrinkX2: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"shrink_x2".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method shrink_x2" }
}
val srgbToLinear: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"srgb_to_linear".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method srgb_to_linear" }
}
val unlock: CPointer<godot_method_bind>
get() = Allocator.allocationScope {
val ptr = checkNotNull(Godot.gdnative.godot_method_bind_get_method)("Image".cstr.ptr,
"unlock".cstr.ptr)
requireNotNull(ptr) { "No method_bind found for method unlock" }
}}
}
}
| 30.84412 | 95 | 0.645585 |
45ab81169fda8d9ecec9bf134a1c83977a01a27e | 1,637 | kt | Kotlin | ZimLX/src/org/zimmob/zimlx/preferences/RecyclerViewFragment.kt | damoasda/ZimLX | 0a52e0fcb7a068135d938da4d93d5b0ac91d95fa | [
"Apache-2.0"
] | 183 | 2018-05-03T03:08:09.000Z | 2021-12-26T18:22:57.000Z | ZimLX/src/org/zimmob/zimlx/preferences/RecyclerViewFragment.kt | damoasda/ZimLX | 0a52e0fcb7a068135d938da4d93d5b0ac91d95fa | [
"Apache-2.0"
] | 75 | 2018-06-04T15:11:53.000Z | 2020-07-30T18:08:20.000Z | ZimLX/src/org/zimmob/zimlx/preferences/RecyclerViewFragment.kt | damoasda/ZimLX | 0a52e0fcb7a068135d938da4d93d5b0ac91d95fa | [
"Apache-2.0"
] | 28 | 2018-06-07T03:42:17.000Z | 2021-04-12T04:38:43.000Z | /*
* This file is part of Lawnchair Launcher.
*
* Lawnchair Launcher 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 3 of the License, or
* (at your option) any later version.
*
* Lawnchair Launcher 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 Lawnchair Launcher. If not, see <https://www.gnu.org/licenses/>.
*/
package org.zimmob.zimlx.preferences
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.RecyclerView
import com.android.launcher3.R
abstract class RecyclerViewFragment : Fragment() {
open val layoutId = R.layout.preference_insettable_recyclerview
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return LayoutInflater.from(container!!.context).inflate(layoutId, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
onRecyclerViewCreated(view.findViewById(R.id.list))
}
abstract fun onRecyclerViewCreated(recyclerView: RecyclerView)
}
| 38.069767 | 116 | 0.74832 |
290ceb7e46e3bd7a90b0fcd755675f3ecfeae87b | 814 | py | Python | billing/integrations/stripe_integration.py | SimpleTax/merchant | 12ec88f6e47f81748add84cd82b0f6c8ac0aa2fc | [
"BSD-3-Clause"
] | null | null | null | billing/integrations/stripe_integration.py | SimpleTax/merchant | 12ec88f6e47f81748add84cd82b0f6c8ac0aa2fc | [
"BSD-3-Clause"
] | null | null | null | billing/integrations/stripe_integration.py | SimpleTax/merchant | 12ec88f6e47f81748add84cd82b0f6c8ac0aa2fc | [
"BSD-3-Clause"
] | null | null | null | from billing import Integration, get_gateway
from django.conf import settings
from django.conf.urls import patterns, url
from billing.forms.stripe_forms import StripeForm
class StripeIntegration(Integration):
def __init__(self):
super(StripeIntegration, self).__init__()
self.gateway = get_gateway("stripe")
self.publishable_key = settings.STRIPE_PUBLISHABLE_KEY
def generate_form(self):
initial_data = self.fields
form = StripeForm(initial=initial_data)
return form
def transaction(self, request):
# Subclasses must override this
raise NotImplementedError
def get_urls(self):
urlpatterns = patterns('',
url('^stripe_token/$', self.transaction, name="stripe_transaction")
)
return urlpatterns
| 30.148148 | 78 | 0.697789 |
d7909f424ebd2528aa891a42af349004f7dc2030 | 1,122 | kt | Kotlin | library/src/main/kotlin/com/daniloaraujosilva/mathemagika/library/common/mathematica/functions/OutputControllabilityMatrix.kt | Danilo-Araujo-Silva/mathemagika | 4fcf68af14f55b8634132d34f61dae8bb2ee2942 | [
"Apache-2.0"
] | 2 | 2021-02-19T15:55:33.000Z | 2021-04-11T01:09:41.000Z | library/src/main/kotlin/com/daniloaraujosilva/mathemagika/library/common/mathematica/functions/OutputControllabilityMatrix.kt | Danilo-Araujo-Silva/mathemagika | 4fcf68af14f55b8634132d34f61dae8bb2ee2942 | [
"Apache-2.0"
] | null | null | null | library/src/main/kotlin/com/daniloaraujosilva/mathemagika/library/common/mathematica/functions/OutputControllabilityMatrix.kt | Danilo-Araujo-Silva/mathemagika | 4fcf68af14f55b8634132d34f61dae8bb2ee2942 | [
"Apache-2.0"
] | null | null | null | package com.daniloaraujosilva.mathemagika.library.common.mathematica.functions
import com.daniloaraujosilva.mathemagika.library.common.mathematica.MathematicaFunction
/**
*````
*
* Name: OutputControllabilityMatrix
*
* Full name: System`OutputControllabilityMatrix
*
* Usage: OutputControllabilityMatrix[ssm] gives the output controllability matrix of the state-space model ssm.
*
* Options: None
*
* Protected
* Attributes: ReadProtected
*
* local: paclet:ref/OutputControllabilityMatrix
* Documentation: web: http://reference.wolfram.com/language/ref/OutputControllabilityMatrix.html
*
* Definitions: None
*
* Own values: None
*
* Down values: None
*
* Up values: None
*
* Sub values: None
*
* Default value: None
*
* Numeric values: None
*/
fun outputControllabilityMatrix(vararg arguments: Any?, options: MutableMap<String, Any?> = mutableMapOf()): MathematicaFunction {
return MathematicaFunction("OutputControllabilityMatrix", arguments.toMutableList(), options)
}
| 28.769231 | 130 | 0.683601 |
53e75971968a161e253830ce21da6a93b338320d | 2,330 | java | Java | src/main/java/com/codetaylor/mc/athenaeum/integration/crafttweaker/PluginDelegate.java | codetaylor/athenaeum-1.12 | 4be7edcbffc4407165ca9fedddd55f397fae7616 | [
"Apache-2.0"
] | 1 | 2020-07-04T09:13:03.000Z | 2020-07-04T09:13:03.000Z | src/main/java/com/codetaylor/mc/athenaeum/integration/crafttweaker/PluginDelegate.java | codetaylor/athenaeum | 4be7edcbffc4407165ca9fedddd55f397fae7616 | [
"Apache-2.0"
] | 5 | 2017-12-24T00:03:03.000Z | 2020-01-02T16:21:32.000Z | src/main/java/com/codetaylor/mc/athenaeum/integration/crafttweaker/PluginDelegate.java | codetaylor/athenaeum | 4be7edcbffc4407165ca9fedddd55f397fae7616 | [
"Apache-2.0"
] | 1 | 2018-02-10T00:38:42.000Z | 2018-02-10T00:38:42.000Z | package com.codetaylor.mc.athenaeum.integration.crafttweaker;
import crafttweaker.IAction;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.ModContainer;
import java.util.HashMap;
import java.util.Map;
/**
* 2018.1.2:
* This class has been refactored to provide a delegate for each mod that requires one.
* This ensures that when each mod calls the init and apply methods, only the delegate
* for the calling mod will be executed. This prevents a problem with the previous
* implementation which caused each mod to execute this delegate, causing recipes and
* zen classes to be registered multiple times.
*
* @author codetaylor
*/
public class PluginDelegate {
private static final Map<String, PluginModDelegate> DELEGATE_MAP;
static {
DELEGATE_MAP = new HashMap<>();
}
/* package */ static void registerZenClass(Class<?> zenClass) {
PluginDelegate.getPluginModDelegate(PluginDelegate.getModId()).registerZenClass(zenClass);
}
public static void addAddition(String modId, IAction action) {
// The mod id has to be supplied externally here because when this is called,
// the active mod container belongs to "crafttweaker".
PluginDelegate.getPluginModDelegate(modId).addAddition(action);
}
public static void addRemoval(String modId, IAction action) {
// The mod id has to be supplied externally here because when this is called,
// the active mod container belongs to "crafttweaker".
PluginDelegate.getPluginModDelegate(modId).addRemoval(action);
}
/* package */ static void init() {
PluginModDelegate delegate = DELEGATE_MAP.get(PluginDelegate.getModId());
if (delegate != null) {
delegate.init();
}
}
/* package */ static void apply() {
PluginModDelegate delegate = DELEGATE_MAP.get(PluginDelegate.getModId());
if (delegate != null) {
delegate.apply();
}
}
private static PluginModDelegate getPluginModDelegate(String modId) {
return DELEGATE_MAP.computeIfAbsent(modId, s -> new PluginModDelegate());
}
private static String getModId() {
ModContainer modContainer = Loader.instance().activeModContainer();
if (modContainer == null) {
throw new RuntimeException("Active mod container is null");
}
return modContainer.getModId();
}
}
| 27.738095 | 94 | 0.727897 |
1aa3c5c20742e6cf2d0524acb04e5fd70fa23880 | 2,140 | rs | Rust | actix-redis/src/command/cluster_setslot.rs | Idein/actix-extras | f249474f01c50b70dbfaf065ea822629880c3c22 | [
"Apache-2.0",
"MIT"
] | null | null | null | actix-redis/src/command/cluster_setslot.rs | Idein/actix-extras | f249474f01c50b70dbfaf065ea822629880c3c22 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-05-01T09:39:27.000Z | 2020-05-08T03:02:58.000Z | actix-redis/src/command/cluster_setslot.rs | Idein/actix-extras | f249474f01c50b70dbfaf065ea822629880c3c22 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-04-30T06:16:26.000Z | 2020-04-30T06:16:26.000Z | use super::{DeserializeError, RedisCommand};
use crate::Error;
use actix::Message;
use redis_async::{resp::RespValue, resp_array};
#[derive(Debug)]
pub enum ClusterSetSlot {
Importing { slot: u16, source_node_id: String },
Migrating { slot: u16, dest_node_id: String },
Stable { slot: u16 },
Node { slot: u16, node_id: String },
}
pub fn importing(slot: u16, source_node_id: String) -> ClusterSetSlot {
ClusterSetSlot::Importing {
slot,
source_node_id,
}
}
pub fn migrating(slot: u16, dest_node_id: String) -> ClusterSetSlot {
ClusterSetSlot::Migrating { slot, dest_node_id }
}
pub fn stable(slot: u16) -> ClusterSetSlot {
ClusterSetSlot::Stable { slot }
}
pub fn node(slot: u16, node_id: String) -> ClusterSetSlot {
ClusterSetSlot::Node { slot, node_id }
}
impl RedisCommand for ClusterSetSlot {
type Output = ();
fn serialize(self) -> RespValue {
use ClusterSetSlot::*;
match self {
Importing {
slot,
source_node_id,
} => resp_array![
"CLUSTER",
"SETSLOT",
slot.to_string(),
"IMPORTING",
source_node_id
],
Migrating { slot, dest_node_id } => resp_array![
"CLUSTER",
"SETSLOT",
slot.to_string(),
"MIGRATING",
dest_node_id
],
Stable { slot } => {
resp_array!["CLUSTER", "SETSLOT", slot.to_string(), "STABLE"]
}
Node { slot, node_id } => {
resp_array!["CLUSTER", "SETSLOT", slot.to_string(), "NODE", node_id]
}
}
}
fn deserialize(resp: RespValue) -> Result<Self::Output, DeserializeError> {
match resp {
RespValue::SimpleString(s) if s == "OK" => Ok(()),
resp => Err(DeserializeError::new(
"invalid response to CLUSTER SETSLOT",
resp,
)),
}
}
}
impl Message for ClusterSetSlot {
type Result = Result<(), Error>;
}
| 26.419753 | 84 | 0.533178 |
01ba886e08360db0eb4af9d1358646016559bc48 | 529 | rs | Rust | examples/end2end_horizontal_switch_views.rs | Bolto720/cursive-multiplex | c4d5e5f4fdd5148d74a6b4ad166c1c9c06ab2dee | [
"BSD-3-Clause"
] | null | null | null | examples/end2end_horizontal_switch_views.rs | Bolto720/cursive-multiplex | c4d5e5f4fdd5148d74a6b4ad166c1c9c06ab2dee | [
"BSD-3-Clause"
] | null | null | null | examples/end2end_horizontal_switch_views.rs | Bolto720/cursive-multiplex | c4d5e5f4fdd5148d74a6b4ad166c1c9c06ab2dee | [
"BSD-3-Clause"
] | null | null | null | use cursive::views::TextView;
use cursive_multiplex::Mux;
fn main() {
let mut siv = cursive::default();
let mut mux = Mux::new();
let right = mux
.add_right_of(
TextView::new("Right".to_string()),
mux.root().build().unwrap(),
)
.expect("right failed");
let left = mux
.add_right_of(TextView::new("Left"), right)
.expect("Left failed");
mux.switch_views(right, left).expect("switch failed");
siv.add_fullscreen_layer(mux);
siv.run();
}
| 25.190476 | 58 | 0.57656 |
85603caffc760be5132982454dfeac190a53109d | 418 | swift | Swift | Opera/Opera/Domain/Repositories/MoviesRepository.swift | Mahmoud-Abdelwahab/Opera-MVVM-C-Clean-Architecture | f212c0cdcde614c2fc6c474b8e657228aed410d1 | [
"MIT"
] | 4 | 2021-06-21T13:11:20.000Z | 2021-07-27T05:20:29.000Z | Opera/Opera/Domain/Repositories/MoviesRepository.swift | Mahmoud-Abdelwahab/Opera-MVVM-C-Clean-Architecture | f212c0cdcde614c2fc6c474b8e657228aed410d1 | [
"MIT"
] | null | null | null | Opera/Opera/Domain/Repositories/MoviesRepository.swift | Mahmoud-Abdelwahab/Opera-MVVM-C-Clean-Architecture | f212c0cdcde614c2fc6c474b8e657228aed410d1 | [
"MIT"
] | 2 | 2021-06-21T13:49:36.000Z | 2021-09-23T15:09:40.000Z | //
// MoviesRepository.swift
// Opera
//
// Created by Mahmoud Abdul-Wahab on 20/06/2021.
//
import Foundation
import RxSwift
protocol MoviesRepository {
func getNowPlaying(page: Int)->Observable<Page<Movie>>
func getTopRated(page: Int)->Observable<Page<Movie>>
func getMovieDetails(id: Int)->Observable<MovieDetails>
func searchForMovie(searchText: String, page: Int)->Observable<Page<Movie>>
}
| 24.588235 | 79 | 0.729665 |
3d4688eb05815675efb6732d6446676675d2776e | 2,928 | rs | Rust | src/launcher.rs | choihongil/sway-cli | 73f3f5d4faa5f6c6cc7ef494039ee5e6b4c98c10 | [
"MIT"
] | null | null | null | src/launcher.rs | choihongil/sway-cli | 73f3f5d4faa5f6c6cc7ef494039ee5e6b4c98c10 | [
"MIT"
] | null | null | null | src/launcher.rs | choihongil/sway-cli | 73f3f5d4faa5f6c6cc7ef494039ee5e6b4c98c10 | [
"MIT"
] | null | null | null | use std::env;
use std::fs;
const CONTAINER_TYPES: [&str; 2] = ["con", "floating_con"];
pub fn node_tree() -> Result<serde_json::Value, crate::error::Error> {
let response = crate::sway_ipc::MessageType::GetTree.execute()?;
Ok(serde_json::from_slice(&response)?)
}
fn containers(node: &serde_json::Value) -> Vec<&serde_json::Value> {
let mut con_list = Vec::new();
let children = node["nodes"].as_array().into_iter().flatten();
for child in children {
let child_type = child["type"].as_str().unwrap_or_default();
let child_pid = child["pid"].as_u64();
if CONTAINER_TYPES.contains(&child_type) && child_pid.is_some() {
con_list.push(child);
} else {
con_list.extend(containers(child));
}
}
return con_list;
}
fn app_containers<'a>(
name: &str,
node: &'a serde_json::Value,
) -> Result<Vec<&'a serde_json::Value>, crate::error::Error> {
let con_list = containers(node)
.into_iter()
.filter(|c| {
c["app_id"]
.as_str()
.or(c["window_properties"]["class"].as_str())
.unwrap_or_default()
== name
})
.collect::<Vec<_>>();
Ok(con_list)
}
fn launch_application(name: &str) {
for f in env::var("XDG_DATA_DIRS")
.unwrap_or_default()
.split(':')
.map(|p| fs::read_dir(format!("{}/applications", p)))
.filter_map(Result::ok)
.flatten()
.map(Result::unwrap)
.map(|e| String::from(e.file_name().to_str().unwrap_or_default()))
.filter(|n| n.ends_with("desktop"))
.filter(|n| n.contains(name))
{
// println!("{:?}", f);
std::process::Command::new("gtk-launch")
.arg(f)
.spawn()
.unwrap();
}
}
pub fn switch_or_launch_application(
name: &str,
node: &serde_json::Value,
) -> Result<(), crate::error::Error> {
let app_containers = app_containers(name, node)?;
if app_containers.is_empty() {
launch_application(name);
} else {
let result = if let Some(focused_index) = app_containers
.iter()
.position(|c| c["focused"].as_bool().unwrap_or_default())
{
app_containers
.iter()
.nth(focused_index + 1)
.or(app_containers.first())
.unwrap_or(&&serde_json::Value::Null)
} else {
app_containers
.iter()
.find(|c| c["visible"].as_bool().unwrap_or_default())
.or(app_containers.first())
.unwrap_or(&&serde_json::Value::Null)
};
// TODO: unwrap
let command = format!("[con_id={}] focus", result["id"].as_u64().unwrap());
// println!("{}", command);
crate::sway_ipc::MessageType::RunCommand(&command).execute()?;
}
Ok(())
}
| 30.821053 | 83 | 0.53791 |
995a33e6b045a23a0ad4db8f32d9661eea961b58 | 846 | h | C | Password Sync 2/PSSEncryptor.h | remyvhw/passwordsync-2 | 3bed389cfb6cb56408d2940bb0ec03958dad40e8 | [
"MIT"
] | null | null | null | Password Sync 2/PSSEncryptor.h | remyvhw/passwordsync-2 | 3bed389cfb6cb56408d2940bb0ec03958dad40e8 | [
"MIT"
] | null | null | null | Password Sync 2/PSSEncryptor.h | remyvhw/passwordsync-2 | 3bed389cfb6cb56408d2940bb0ec03958dad40e8 | [
"MIT"
] | 1 | 2020-04-02T07:40:45.000Z | 2020-04-02T07:40:45.000Z | //
// PSSEncryptor.h
// Password Sync 2
//
// Created by Remy Vanherweghem on 2013-07-06.
// Copyright (c) 2013 Pumax. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PSSEncryptor : NSObject
+(NSData*)decryptData:(NSData*)encryptedData;
+(NSData*)encryptData:(NSData*)dataToEncrypt;
+(NSData*)encryptString:(NSString*)stringToEncrypt;
+(NSString*)decryptString:(NSData*)encryptedData;
/*! Will reencrypt provided data with provided hashed password. Can be useful for changing master password.
* \param originalData Data currently encrypted with master password in keychain.
* \param newPassword A hashed password that will be used to encrypt the provided password.
* \returns Data encrypted with the provided password.
*/
+(NSData*)reencryptData:(NSData*)originalData withPassword:(NSString*)newPassword;
@end
| 30.214286 | 107 | 0.765957 |
22edb9a37bf27293d95be7c9df8eaef3483fa902 | 358 | h | C | source/application/ui.h | Adv4nc3d/Win32App | ee6a1c237dac712ab56ee38ecb173e0d2a7ca581 | [
"BSD-3-Clause"
] | null | null | null | source/application/ui.h | Adv4nc3d/Win32App | ee6a1c237dac712ab56ee38ecb173e0d2a7ca581 | [
"BSD-3-Clause"
] | null | null | null | source/application/ui.h | Adv4nc3d/Win32App | ee6a1c237dac712ab56ee38ecb173e0d2a7ca581 | [
"BSD-3-Clause"
] | null | null | null | /**
*
* Win32 Application
* by Adv4nc3d
*
* Copyright 2021. All Rights Reserved.
*
* application/ui.h
*
*/
#ifndef UI_H
#define UI_H
// Context Menu
#define ID_CMENU_EXIT 200
#define ID_CMENU_APPNAME 201
/**
*
* extern
*
*/
void HandleButtonCmd(HWND hwnd, WPARAM wParam, HINSTANCE hInstance);
void HandleIconNotify(LPARAM lParam, HWND hwnd);
#endif | 11.1875 | 68 | 0.715084 |
b0fcc17787f4c394b850762619dc525df7509625 | 920 | rs | Rust | src/lib.rs | rhysd/detect_git_service | cd8dd9b5e733260457ee1d412093ea354e6294e8 | [
"MIT"
] | 1 | 2019-02-05T23:58:32.000Z | 2019-02-05T23:58:32.000Z | src/lib.rs | rhysd/detect_git_service | cd8dd9b5e733260457ee1d412093ea354e6294e8 | [
"MIT"
] | null | null | null | src/lib.rs | rhysd/detect_git_service | cd8dd9b5e733260457ee1d412093ea354e6294e8 | [
"MIT"
] | null | null | null | //! Detect Git hosting service from file path
//!
//! This library provides APIs to detect Git hosting service used for given
//! file path. Service is detected based on a URL of remote repository of the
//! path.
//!
//! ```
//! use std::path::Path;
//! use detect_git_service::GitService;
//!
//! let path = Path::new(".");
//! let service = detect_git_service::detect(&path).unwrap();
//!
//! assert_eq!(service.user(), "rhysd");
//! assert_eq!(service.repo(), "detect_git_service");
//! assert!(service.branch().is_some());
//!
//! if let GitService::GitHub{user, repo, branch} = service {
//! assert_eq!(user, "rhysd");
//! assert_eq!(repo, "detect_git_service");
//! assert!(branch.is_some());
//! }
//! ```
#![deny(missing_docs)]
extern crate diff_enum;
extern crate url;
mod error;
mod git;
mod service;
pub use crate::error::Error;
pub use crate::service::{detect, detect_with_git, GitService};
| 25.555556 | 77 | 0.656522 |
a9c0804dc587b865e59ef3abb909da674d4ba92f | 427 | html | HTML | components/form-tel-field/html/country-sync-input.html | Frontendcore/frontendcore | 5cb4dfa4b3940d341de9cee30be6fd69f9ba37de | [
"Apache-2.0"
] | 6 | 2015-02-18T14:02:15.000Z | 2018-11-05T08:31:32.000Z | components/form-tel-field/html/country-sync-input.html | Frontendcore/frontendcore | 5cb4dfa4b3940d341de9cee30be6fd69f9ba37de | [
"Apache-2.0"
] | 10 | 2015-04-01T14:42:21.000Z | 2017-05-31T10:06:38.000Z | components/form-tel-field/html/country-sync-input.html | Frontendcore/frontendcore | 5cb4dfa4b3940d341de9cee30be6fd69f9ba37de | [
"Apache-2.0"
] | 4 | 2015-04-01T14:34:36.000Z | 2016-04-22T09:05:07.000Z | <ol>
<li>
<label>Telephone number</label>
<input id="phone" type="tel" data-fc-modules="tel-field" data-fc-country-field="#address-country-sync-input" data-fc-code-field="#code-country-sync-input">
</li>
<li>
<label>Country</label>
<input type="text" id="address-country-sync-input" />
</li>
<li>
<label>Code</label>
<input type="text" id="code-country-sync-input" value="229" />
</li>
</ol> | 30.5 | 159 | 0.629977 |
41a1f81985fc9b8cc92379e1a9fee4ec95939798 | 688 | h | C | src/common.h | MartinezTorres/msx_qrcode | cc736e363f6c751f409eaabf18943559f6812372 | [
"MIT"
] | 2 | 2020-05-22T13:45:07.000Z | 2020-05-25T11:59:08.000Z | src/common.h | MartinezTorres/msx_qrcode | cc736e363f6c751f409eaabf18943559f6812372 | [
"MIT"
] | null | null | null | src/common.h | MartinezTorres/msx_qrcode | cc736e363f6c751f409eaabf18943559f6812372 | [
"MIT"
] | null | null | null | #pragma once
// If DEBUG is defined, the function debugBorder changes the border color, otherwise it does nothing.
//#define DEBUG TRUE
#include <msxhal.h>
#include <tms99X8.h>
#include <rand.h>
////////////////////////////////////////////////////////////////////////
// GRAPHICS
#include <graphics/graphics.h>
////////////////////////////////////////////////////////////////////////
// QR CODE GENERATOR
#include <qr/qrcodegen.h>
////////////////////////////////////////////////////////////////////////
// COMMON UTILITIES
extern uint8_t scratchpad[256];
////////////////////////////////////////////////////////////////////////
// QR EXAMPLE
void generateQR();
void printQR();
| 23.724138 | 101 | 0.418605 |
d40d5e9d739710b87e5548606fa758963e1c4256 | 1,625 | kt | Kotlin | mobile/src/main/java/com/siliconlabs/bledemo/blinky_thunderboard/ui/HueBackgroundView.kt | SiliconLabs/Bluegecko-android | b94a9c6a2b7cae0fda0ada7bed1b7ef2bb5906ff | [
"Apache-2.0"
] | 26 | 2017-06-20T05:35:27.000Z | 2020-01-16T07:42:47.000Z | mobile/src/main/java/com/siliconlabs/bledemo/blinky_thunderboard/ui/HueBackgroundView.kt | liunix61/EFRConnect-android | 46a72747a12ab63388138b7ccca08479057c764e | [
"Apache-2.0"
] | 9 | 2017-11-08T10:55:22.000Z | 2020-01-22T12:08:53.000Z | mobile/src/main/java/com/siliconlabs/bledemo/blinky_thunderboard/ui/HueBackgroundView.kt | liunix61/EFRConnect-android | 46a72747a12ab63388138b7ccca08479057c764e | [
"Apache-2.0"
] | 31 | 2017-07-24T06:55:49.000Z | 2020-03-20T13:22:28.000Z | package com.siliconlabs.bledemo.blinky_thunderboard.ui
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View
import com.siliconlabs.bledemo.R
class HueBackgroundView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : View(context, attrs, defStyleAttr) {
private val brush: Paint
private val hsvColor: FloatArray = FloatArray(3)
private val spectrumColors: IntArray = IntArray(360)
private val lineHeight: Float = context.resources.getDimension(R.dimen.color_hue_selection_line_height)
public override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
val width = width.toFloat()
val height = height.toFloat()
if (isEnabled) {
val grad = LinearGradient(height / 2, 0.0f,
width - height / 2, 0.0f,
spectrumColors, null, Shader.TileMode.CLAMP)
brush.shader = grad
canvas.drawRect(
height / 2, (height - lineHeight) / 2,
width - height / 2, (height + lineHeight) / 2,
brush)
}
}
private fun initSpectrumColors() {
for (i in 0..359) {
hsvColor[0] = i.toFloat()
hsvColor[1] = 1.0f
hsvColor[2] = 1.0f
spectrumColors[i] = Color.HSVToColor(hsvColor)
}
}
init {
initSpectrumColors()
brush = Paint().apply {
isAntiAlias = true
style = Paint.Style.FILL_AND_STROKE
}
}
} | 31.25 | 107 | 0.593846 |
bb5542fb746e7bf96c52e2cf672363fd2f9f3613 | 3,277 | rs | Rust | src/bin/gallery/mod.rs | sirion/static-gallery | 80fc5116c4f90a1d617ebca56c17d32140e65ceb | [
"MIT"
] | null | null | null | src/bin/gallery/mod.rs | sirion/static-gallery | 80fc5116c4f90a1d617ebca56c17d32140e65ceb | [
"MIT"
] | null | null | null | src/bin/gallery/mod.rs | sirion/static-gallery | 80fc5116c4f90a1d617ebca56c17d32140e65ceb | [
"MIT"
] | null | null | null | mod gallery;
mod collection;
mod picture;
// use crate::mi::img::Resolution;
pub use gallery::Gallery;
pub use collection::Collection;
pub use collection::CollectionInput;
pub use picture::Picture;
pub use picture::Image;
pub const GALLERY_CONFIGURATION_VERSION: u16 = 1;
pub const FULL_ARCHIVE_PATH: &str = "Gallery.zip";
// TODO: Support more modern picture formats
pub const PICTURE_EXTENSION: &str = "jpg";
// pub const BACKGROUNDS_DIR_NAME: &str = "b";
// pub const COLLECTIONS_DIR_NAME: &str = "c";
pub const PICTURES_DIR_NAME: &str = "p";
pub const PATTERM_DATA_START: &[u8] = b"/*{{BEGIN:data*/";
pub const PATTERM_DATA_END: &[u8] = b"/*END:data}}*/";
use crate::mi::img::Resolution;
pub const DEFAULT_RESOLUTION_THUMB: Resolution = Resolution{ width: 960, height: 540 };
pub const DEFAULT_RESOLUTION_DISPLAY: Resolution = Resolution{ width: 2560, height: 1440 };
pub const DEFAULT_RESOLUTION_BACKGROUND: Resolution = Resolution{ width: 2560, height: 1440 };
pub fn contains_images(dir: &std::path::PathBuf) -> bool {
if !dir.is_dir() {
return false;
}
for file in &crate::mi::fs::list_dir(&dir) {
if valid_extension(file) {
return true;
}
}
false
}
pub trait GalleryImages {
fn from(paths: &Vec<std::path::PathBuf>) -> Self;
fn filter_valid(&mut self);
fn clear_titles(&mut self);
}
impl GalleryImages for Vec<Picture> {
fn from(paths: &Vec<std::path::PathBuf>) -> Vec<Picture> {
let mut new = Vec::with_capacity(paths.len());
for path in paths {
let original_hash = crate::mi::fs::file_hash_quick(&path);
// let basename = clean_basename(&source_path);
let basename = format!("{}", original_hash);
let source_path = path.to_path_buf();
let title = String::from(source_path.file_stem().unwrap_or_default().to_string_lossy());
new.push(Picture{
title,
image: Image{
basename,
source_path,
original_hash,
update: true,
}
});
}
new
}
fn filter_valid(&mut self) {
let mut i = 0;
let mut len = self.len();
while i < len {
if !valid_extension(&self[i].image.source_path) {
self.remove(i);
len = len - 1;
} else {
i = i + 1;
}
}
}
fn clear_titles(&mut self) {
for pic in self {
pic.title.clear();
}
}
}
impl GalleryImages for Vec<Image> {
fn from(paths: &Vec<std::path::PathBuf>) -> Vec<Image> {
let mut new = Vec::with_capacity(paths.len());
for path in paths {
let original_hash = crate::mi::fs::file_hash_quick(&path);
// let basename = clean_basename(&source_path);
let basename = format!("{}", original_hash);
let source_path = path.to_path_buf();
new.push(Image{
basename,
source_path,
original_hash,
update: true,
});
}
new
}
fn filter_valid(&mut self) {
let mut i = 0;
let mut len = self.len();
while i < len {
if !valid_extension(&self[i].source_path) {
self.remove(i);
len = len - 1;
} else {
i = i + 1;
}
}
}
fn clear_titles(&mut self) {
// Does not do anything for Vec<Image>
}
}
fn valid_extension(path: &std::path::PathBuf) -> bool {
let ext = match path.extension() {
None => String::from(""),
Some(e) => e.to_str().unwrap().to_lowercase(),
};
match ext.as_str() {
"jpg" => true,
"jpeg" => true,
&_ => false,
}
}
| 21.418301 | 94 | 0.645713 |
aa9edda578ce652923e7d31a5712348cbd88ff3e | 1,556 | swift | Swift | Examples/Followers/Followers/Login/LoginView.swift | Goktug/Swiftagram | c8b340a9c1be91373a28b525983ff45f7c82ede8 | [
"Apache-2.0"
] | null | null | null | Examples/Followers/Followers/Login/LoginView.swift | Goktug/Swiftagram | c8b340a9c1be91373a28b525983ff45f7c82ede8 | [
"Apache-2.0"
] | null | null | null | Examples/Followers/Followers/Login/LoginView.swift | Goktug/Swiftagram | c8b340a9c1be91373a28b525983ff45f7c82ede8 | [
"Apache-2.0"
] | null | null | null | //
// LoginView.swift
// Followers
//
// Created by Stefano Bertagno on 10/03/2020.
// Copyright © 2020 Stefano Bertagno. All rights reserved.
//
import SwiftUI
import UIKit
import WebKit
import Swiftagram
import SwiftagramKeychain
class LoginViewController: UIViewController {
/// The completion handler.
var completion: ((Secret) -> Void)?
/// The web view.
var webView: WKWebView? {
didSet {
guard let webView = webView else { return }
webView.frame = view.frame
view.addSubview(webView)
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Authenticate.
WebViewAuthenticator(storage: KeychainStorage()) { self.webView = $0 }
.authenticate { [weak self] in
switch $0 {
case .failure(let error): print(error.localizedDescription)
case .success(let secret):
self?.completion?(secret)
self?.dismiss(animated: true, completion: nil)
}
}
}
}
/// A `struct` defining a `View` used for logging in.
struct LoginView: UIViewControllerRepresentable {
/// The current secret.
@Binding var secret: Secret?
func makeUIViewController(context: Context) -> LoginViewController {
let controller = LoginViewController()
controller.completion = { self.secret = $0 }
return controller
}
func updateUIViewController(_ uiViewController: LoginViewController, context: Context) {
}
}
| 28.290909 | 92 | 0.616324 |
2b8f6a7ae58cfc604bd21701137a8ac81e077881 | 610 | swift | Swift | TestTaskFlickr/TestTaskFlickr/Views/ViewModelFactory.swift | rdv0011/test-task-flickr-collectionview | a55025b2c33d7e21151d8f00c11af1449072d29c | [
"Apache-2.0"
] | null | null | null | TestTaskFlickr/TestTaskFlickr/Views/ViewModelFactory.swift | rdv0011/test-task-flickr-collectionview | a55025b2c33d7e21151d8f00c11af1449072d29c | [
"Apache-2.0"
] | null | null | null | TestTaskFlickr/TestTaskFlickr/Views/ViewModelFactory.swift | rdv0011/test-task-flickr-collectionview | a55025b2c33d7e21151d8f00c11af1449072d29c | [
"Apache-2.0"
] | null | null | null | //
// Copyright © 2020 Dmitry Rybakov. All rights reserved.
import Foundation
import UIKit
/// Create different types of view models
class ViewModelFactory {
private let photoServiceConfiguration: PhotoService.Configuration
private lazy var photoService: PhotoService = {
PhotoService(configuration: photoServiceConfiguration)
}()
func makePhotoViewModel() -> PhotoViewModel {
PhotoViewModel(photoService: photoService)
}
init(photoServiceConfiguration: PhotoService.Configuration) {
self.photoServiceConfiguration = photoServiceConfiguration
}
}
| 25.416667 | 69 | 0.742623 |
29052b7c968f2f47c6caa9476a4d4ce94d943cd2 | 1,489 | py | Python | examples/variables.py | cyrilbois/PFNET.py | 81d2fd911c6e6aae4c5de0d1739c6f5361799ce2 | [
"BSD-2-Clause"
] | 3 | 2018-03-21T11:54:38.000Z | 2020-12-29T16:46:14.000Z | examples/variables.py | cyrilbois/PFNET.py | 81d2fd911c6e6aae4c5de0d1739c6f5361799ce2 | [
"BSD-2-Clause"
] | 23 | 2018-03-29T00:42:06.000Z | 2021-01-05T19:15:05.000Z | examples/variables.py | cyrilbois/PFNET.py | 81d2fd911c6e6aae4c5de0d1739c6f5361799ce2 | [
"BSD-2-Clause"
] | 5 | 2018-10-01T19:05:11.000Z | 2020-05-27T06:19:11.000Z | #***************************************************#
# This file is part of PFNET. #
# #
# Copyright (c) 2015, Tomas Tinoco De Rubira. #
# #
# PFNET is released under the BSD 2-clause license. #
#***************************************************#
import sys
sys.path.append('.')
# Power Networks - Variables
import pfnet
net = pfnet.Parser(sys.argv[1]).parse(sys.argv[1])
print(net.num_vars)
net.set_flags('bus',
'variable',
'regulated by generator',
['voltage magnitude', 'voltage angle'])
print(net.num_vars, 2*net.get_num_buses_reg_by_gen())
values = net.get_var_values()
print(type(values))
print(values.shape)
bus = [bus for bus in net.buses if bus.is_regulated_by_gen()][0]
print(bus.has_flags('variable','voltage magnitude'))
print(bus.has_flags('variable','voltage angle'))
print(bus.v_mag, net.get_var_values()[bus.index_v_mag])
print(bus.v_ang, net.get_var_values()[bus.index_v_ang])
print(bus.has_flags('variable','voltage angle'))
values = net.get_var_values()
print(bus.v_mag)
values[bus.index_v_mag] = 1.20
net.set_var_values(values)
print(bus.v_mag)
net.clear_flags()
for bus in net.buses:
if bus.index % 3 == 0:
net.set_flags_of_component(bus,'variable','voltage magnitude')
print(net.num_vars, len([bus for bus in net.buses if bus.index % 3 == 0]), net.num_buses)
| 24.409836 | 89 | 0.584285 |
c3b7b449bffe3efacb45b471a3d4a5f4304a1733 | 3,526 | go | Go | web/ctxflag.go | stephenthedev/golib | 35def7de9f5ee1e1f3524c07bdcdc92b218a5d7b | [
"Apache-2.0"
] | 62 | 2015-05-29T10:55:30.000Z | 2022-03-10T13:29:49.000Z | web/ctxflag.go | stephenthedev/golib | 35def7de9f5ee1e1f3524c07bdcdc92b218a5d7b | [
"Apache-2.0"
] | 67 | 2015-06-11T18:07:21.000Z | 2021-11-19T16:01:48.000Z | web/ctxflag.go | stephenthedev/golib | 35def7de9f5ee1e1f3524c07bdcdc92b218a5d7b | [
"Apache-2.0"
] | 23 | 2017-11-02T16:16:50.000Z | 2021-12-20T08:34:14.000Z | package web
import (
"context"
"math/rand"
"net/http"
"strconv"
"sync"
"github.com/signalfx/golib/v3/log"
)
// HeaderCtxFlag sets a debug value in the context if HeaderName is not empty, a flag string has
// been set to non empty, and the header HeaderName or query string HeaderName is equal to the set
// flag string
type HeaderCtxFlag struct {
HeaderName string
mu sync.RWMutex
expectedVal string
}
// CreateMiddleware creates a handler that calls next as the next in the chain
func (m *HeaderCtxFlag) CreateMiddleware(next ContextHandler) ContextHandler {
return HandlerFunc(func(ctx context.Context, rw http.ResponseWriter, r *http.Request) {
m.ServeHTTPC(ctx, rw, r, next)
})
}
// SetFlagStr enabled flag setting for HeaderName if it's equal to headerVal
func (m *HeaderCtxFlag) SetFlagStr(headerVal string) {
m.mu.Lock()
m.expectedVal = headerVal
m.mu.Unlock()
}
// WithFlag returns a new Context that has the flag for this context set
func (m *HeaderCtxFlag) WithFlag(ctx context.Context) context.Context {
return context.WithValue(ctx, m, struct{}{})
}
// HasFlag returns true if WithFlag has been set for this context
func (m *HeaderCtxFlag) HasFlag(ctx context.Context) bool {
return ctx.Value(m) != nil
}
// FlagStr returns the currently set flag header
func (m *HeaderCtxFlag) FlagStr() string {
m.mu.RLock()
ret := m.expectedVal
m.mu.RUnlock()
return ret
}
// ServeHTTPC calls next with a context flagged if the headers match. Note it checks both headers and query parameters.
func (m *HeaderCtxFlag) ServeHTTPC(ctx context.Context, rw http.ResponseWriter, r *http.Request, next ContextHandler) {
debugStr := m.FlagStr()
if debugStr != "" && m.HeaderName != "" {
if r.Header.Get(m.HeaderName) == debugStr {
ctx = m.WithFlag(ctx)
} else if r.URL.Query().Get(m.HeaderName) == debugStr {
ctx = m.WithFlag(ctx)
}
}
next.ServeHTTPC(ctx, rw, r)
}
// HeadersInRequest adds headers to any context with a flag set
type HeadersInRequest struct {
Headers map[string]string
}
// ServeHTTPC will add headers to rw if ctx has the flag set
func (m *HeadersInRequest) ServeHTTPC(ctx context.Context, rw http.ResponseWriter, r *http.Request, next ContextHandler) {
for k, v := range m.Headers {
rw.Header().Add(k, v)
}
next.ServeHTTPC(ctx, rw, r)
}
// CreateMiddleware creates a handler that calls next as the next in the chain
func (m *HeadersInRequest) CreateMiddleware(next ContextHandler) ContextHandler {
return HandlerFunc(func(ctx context.Context, rw http.ResponseWriter, r *http.Request) {
m.ServeHTTPC(ctx, rw, r, next)
})
}
// CtxWithFlag adds useful request parameters to the logging context, as well as a random request_id
// to the request
type CtxWithFlag struct {
CtxFlagger *log.CtxDimensions
HeaderName string
}
// ServeHTTPC adds useful request dims to the next context
func (m *CtxWithFlag) ServeHTTPC(ctx context.Context, rw http.ResponseWriter, r *http.Request, next ContextHandler) {
headerid := rand.Int63()
rw.Header().Add(m.HeaderName, strconv.FormatInt(headerid, 10))
ctx = m.CtxFlagger.Append(ctx, "header_id", headerid, "http_remote_addr", r.RemoteAddr, "http_method", r.Method, "http_url", r.URL.String())
next.ServeHTTPC(ctx, rw, r)
}
// CreateMiddleware creates a handler that calls next as the next in the chain
func (m *CtxWithFlag) CreateMiddleware(next ContextHandler) ContextHandler {
return HandlerFunc(func(ctx context.Context, rw http.ResponseWriter, r *http.Request) {
m.ServeHTTPC(ctx, rw, r, next)
})
}
| 32.348624 | 141 | 0.740216 |
abd06746515c2d56bb191d41fcb036f4ec011152 | 375 | sql | SQL | mtgdm/Data/Database Schemas/aspnetuserclaims.sql | ZombieFleshEaters/mtgdm | e8405a3f33f82afe4685ef21ca60fabf9700ff22 | [
"MIT"
] | 4 | 2019-01-20T23:08:14.000Z | 2021-01-14T14:27:33.000Z | mtgdm/Data/Database Schemas/aspnetuserclaims.sql | ZombieFleshEaters/mtgdm | e8405a3f33f82afe4685ef21ca60fabf9700ff22 | [
"MIT"
] | 3 | 2019-10-24T19:28:53.000Z | 2019-11-05T10:14:26.000Z | mtgdm/Data/Database Schemas/aspnetuserclaims.sql | ZombieFleshEaters/mtgdm | e8405a3f33f82afe4685ef21ca60fabf9700ff22 | [
"MIT"
] | null | null | null | CREATE TABLE `aspnetuserclaims` (
`Id` int(11) NOT NULL,
`UserId` varchar(255) NOT NULL,
`ClaimType` longtext,
`ClaimValue` longtext,
PRIMARY KEY (`Id`),
KEY `IX_AspNetUserClaims_UserId` (`UserId`),
CONSTRAINT `FK_AspNetUserClaims_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `aspnetusers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | 41.666667 | 126 | 0.741333 |
bb50768ede07cf1a651c531f2f400bb69946d0e9 | 1,273 | swift | Swift | Demo/AppDelegate.swift | royhsu/enum-based-table-view | bc878d9aa19bb58ed8d38dfbd97bd02ef831a3a4 | [
"MIT"
] | null | null | null | Demo/AppDelegate.swift | royhsu/enum-based-table-view | bc878d9aa19bb58ed8d38dfbd97bd02ef831a3a4 | [
"MIT"
] | null | null | null | Demo/AppDelegate.swift | royhsu/enum-based-table-view | bc878d9aa19bb58ed8d38dfbd97bd02ef831a3a4 | [
"MIT"
] | null | null | null | //
// AppDelegate.swift
// Demo
//
// Created by Roy Hsu on 2018/8/15.
// Copyright © 2018 TinyWorld. All rights reserved.
//
// MARK: - AppDelegate
import CoreLocation
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder {
let window = UIWindow(frame: UIScreen.main.bounds)
}
// MARK: - UIApplicationDelegate
extension AppDelegate: UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
)
-> Bool {
let restaurantDetailViewController = RestaurantDetailTableViewController()
restaurantDetailViewController.restaurant = Restaurant(
name: "鼎泰豐 (信義總店)",
cuisine: .taiwanese,
phoneNumber: "02-2321-8928",
businessHours: "平日 10:00 ~ 21:00\n假日 09:00 ~ 21:00",
address: "106 台北市大安區信義路二段 194 號",
coordinate: CLLocationCoordinate2D(
latitude: 25.0334878,
longitude: 121.5279233
)
)
window.rootViewController = restaurantDetailViewController
window.makeKeyAndVisible()
return true
}
}
| 23.574074 | 91 | 0.608798 |
0b6a970c6ea0942a3a8927c5faff7c9dff07c309 | 4,096 | py | Python | tests/testJobQueue.py | hartloff/Tango | 9dd867a596441e0e2ba1069017781dddb9c79bdb | [
"Apache-2.0"
] | 2 | 2020-10-30T03:01:55.000Z | 2021-03-25T03:18:12.000Z | tests/testJobQueue.py | hartloff/Tango | 9dd867a596441e0e2ba1069017781dddb9c79bdb | [
"Apache-2.0"
] | 7 | 2018-06-26T02:48:09.000Z | 2021-01-21T03:12:19.000Z | tests/testJobQueue.py | hartloff/Tango | 9dd867a596441e0e2ba1069017781dddb9c79bdb | [
"Apache-2.0"
] | 9 | 2018-09-28T23:48:48.000Z | 2021-10-03T20:29:48.000Z | import unittest
import redis
from jobQueue import JobQueue
from tangoObjects import TangoIntValue, TangoJob
from config import Config
class TestJobQueue(unittest.TestCase):
def setUp(self):
if Config.USE_REDIS:
__db = redis.StrictRedis(
Config.REDIS_HOSTNAME, Config.REDIS_PORT, db=0)
__db.flushall()
self.job1 = TangoJob(
name="sample_job_1",
vm="ilter.img",
outputFile="sample_job_1_output",
input=[],
timeout=30,
notifyURL="notifyMeUrl",
maxOutputFileSize=4096)
self.job2 = TangoJob(
name="sample_job_2",
vm="ilter.img",
outputFile="sample_job_2_output",
input=[],
timeout=30,
notifyURL="notifyMeUrl",
maxOutputFileSize=4096)
self.jobQueue = JobQueue(None)
self.jobQueue.reset()
self.jobId1 = self.jobQueue.add(self.job1)
self.jobId2 = self.jobQueue.add(self.job2)
def test_sharedInt(self):
if Config.USE_REDIS:
num1 = TangoIntValue("nextID", 1000)
num2 = TangoIntValue("nextID", 3000)
self.assertEqual(num1.get(), 1000)
self.assertEqual(num1.get(), num2.get())
else:
return
def test_job(self):
self.job1.makeUnassigned()
self.assertTrue(self.job1.isNotAssigned())
job = self.jobQueue.get(self.jobId1)
self.assertTrue(job.isNotAssigned())
self.job1.makeAssigned()
print "Checkout:"
self.assertFalse(self.job1.isNotAssigned())
self.assertFalse(job.isNotAssigned())
def test_add(self):
info = self.jobQueue.getInfo()
self.assertEqual(info['size'], 2)
def test_addDead(self):
return self.assertEqual(1, 1)
def test_remove(self):
self.jobQueue.remove(self.jobId1)
info = self.jobQueue.getInfo()
self.assertEqual(info['size'], 1)
self.jobQueue.remove(self.jobId2)
info = self.jobQueue.getInfo()
self.assertEqual(info['size'], 0)
def test_delJob(self):
self.jobQueue.delJob(self.jobId1, 0)
info = self.jobQueue.getInfo()
self.assertEqual(info['size'], 1)
self.assertEqual(info['size_deadjobs'], 1)
self.jobQueue.delJob(self.jobId1, 1)
info = self.jobQueue.getInfo()
self.assertEqual(info['size_deadjobs'], 0)
return False
def test_get(self):
ret_job_1 = self.jobQueue.get(self.jobId1)
self.assertEqual(str(ret_job_1.id), self.jobId1)
ret_job_2 = self.jobQueue.get(self.jobId2)
self.assertEqual(str(ret_job_2.id), self.jobId2)
def test_getNextPendingJob(self):
self.jobQueue.assignJob(self.jobId2)
self.jobQueue.unassignJob(self.jobId1)
exp_id = self.jobQueue.getNextPendingJob()
self.assertMultiLineEqual(exp_id, self.jobId1)
def test_getNextPendingJobReuse(self):
return False
def test_assignJob(self):
self.jobQueue.assignJob(self.jobId1)
job = self.jobQueue.get(self.jobId1)
self.assertFalse(job.isNotAssigned())
def test_unassignJob(self):
self.jobQueue.assignJob(self.jobId1)
job = self.jobQueue.get(self.jobId1)
self.assertTrue(job.assigned)
self.jobQueue.unassignJob(self.jobId1)
job = self.jobQueue.get(self.jobId1)
return self.assertEqual(job.assigned, False)
def test_makeDead(self):
info = self.jobQueue.getInfo()
self.assertEqual(info['size_deadjobs'], 0)
self.jobQueue.makeDead(self.jobId1, "test")
info = self.jobQueue.getInfo()
self.assertEqual(info['size_deadjobs'], 1)
def test__getNextID(self):
init_id = self.jobQueue.nextID
for i in xrange(1, Config.MAX_JOBID + 100):
id = self.jobQueue._getNextID()
self.assertNotEqual(str(id), self.jobId1)
self.jobQueue.nextID = init_id
if __name__ == '__main__':
unittest.main()
| 29.681159 | 63 | 0.619141 |
f7723a2f8007da353eba482e0d1f8181f540a889 | 1,392 | kt | Kotlin | server-spring/src/main/kotlin/org/kotlink/core/exposed/DatabaseExceptionAspect.kt | ilya40umov/go-link | e4300ffeaa6b8d9ba8a3569e507f07ba6b679c54 | [
"Apache-2.0"
] | 35 | 2018-07-17T11:01:05.000Z | 2022-02-18T22:45:00.000Z | server-spring/src/main/kotlin/org/kotlink/core/exposed/DatabaseExceptionAspect.kt | ilya40umov/go-link | e4300ffeaa6b8d9ba8a3569e507f07ba6b679c54 | [
"Apache-2.0"
] | 29 | 2018-07-07T21:18:17.000Z | 2022-01-26T13:11:40.000Z | server-spring/src/main/kotlin/org/kotlink/core/exposed/DatabaseExceptionAspect.kt | ilya40umov/go-link | e4300ffeaa6b8d9ba8a3569e507f07ba6b679c54 | [
"Apache-2.0"
] | 3 | 2019-03-15T12:53:27.000Z | 2021-10-30T20:10:15.000Z | package org.kotlink.core.exposed
import org.aspectj.lang.ProceedingJoinPoint
import org.aspectj.lang.annotation.Around
import org.aspectj.lang.annotation.Aspect
import org.springframework.stereotype.Component
import java.lang.reflect.UndeclaredThrowableException
/**
* Makes sure PSQLException, ExposedSQLException, UndeclaredThrowableException and such
* aren't thrown by the repositories.
*/
@Aspect
@Component
@Suppress("TooGenericExceptionCaught", "ThrowsCount", "SwallowedException", "RethrowCaughtException")
class DatabaseExceptionAspect {
@Around("execution(* org.kotlink.core..*(..)) && @target(org.springframework.stereotype.Repository)")
@Throws(Throwable::class)
fun normalizeExceptions(joinPoint: ProceedingJoinPoint): Any? {
try {
return joinPoint.proceed()
} catch (e: UndeclaredThrowableException) {
// unwrapping UndeclaredThrowableException and re-wrapping its cause into DatabaseException
throw DatabaseException(e.cause?.message, e.cause)
} catch (e: RuntimeException) {
// unchecked exceptions are safe to re-throw as they aren't translated into UndeclaredThrowableException
throw e
} catch (e: Exception) {
// we wrap any checked exception into DatabaseException, so that they don
throw DatabaseException(e.message, e)
}
}
} | 40.941176 | 116 | 0.724856 |
185697be0633ad7feaf086956a6c168ad1530d22 | 88 | css | CSS | test/cases/keyframes-linebreak/input.css | yogesh-1952/css-2 | 838d0719889780c85ad1f7e4534df3daa2fb2f8d | [
"MIT"
] | 1,243 | 2015-01-02T03:55:08.000Z | 2022-03-31T07:45:13.000Z | test/cases/keyframes-linebreak/input.css | yogesh-1952/css-2 | 838d0719889780c85ad1f7e4534df3daa2fb2f8d | [
"MIT"
] | 85 | 2015-01-13T12:20:01.000Z | 2022-03-31T09:38:18.000Z | test/cases/keyframes-linebreak/input.css | yogesh-1952/css-2 | 838d0719889780c85ad1f7e4534df3daa2fb2f8d | [
"MIT"
] | 263 | 2015-01-10T14:42:43.000Z | 2022-03-09T01:34:34.000Z | @keyframes
test
{
from { opacity: 1; }
to { opacity: 0; }
}
| 12.571429 | 28 | 0.397727 |
26327188af4cc3b6bd83a96c0630ab795fb10a06 | 2,832 | java | Java | redis/src/main/java/com/jdcloud/sdk/service/redis/model/CacheAnalysis.java | Tanc009/jdcloud-sdk-java | 12181e43d1396218e79639dbee387852c85b93b2 | [
"Apache-2.0"
] | 38 | 2018-04-19T09:53:59.000Z | 2021-11-08T12:52:15.000Z | redis/src/main/java/com/jdcloud/sdk/service/redis/model/CacheAnalysis.java | Tanc009/jdcloud-sdk-java | 12181e43d1396218e79639dbee387852c85b93b2 | [
"Apache-2.0"
] | 22 | 2018-04-24T12:17:20.000Z | 2022-03-31T10:39:18.000Z | redis/src/main/java/com/jdcloud/sdk/service/redis/model/CacheAnalysis.java | Tanc009/jdcloud-sdk-java | 12181e43d1396218e79639dbee387852c85b93b2 | [
"Apache-2.0"
] | 53 | 2018-04-19T10:48:05.000Z | 2022-03-16T09:15:16.000Z | /*
* Copyright 2018 JDCLOUD.COM
*
* 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.
*
*
*
*
*
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
package com.jdcloud.sdk.service.redis.model;
import com.jdcloud.sdk.annotation.Required;
/**
* 缓存Redis实例的一个备份文件对象
*/
public class CacheAnalysis implements java.io.Serializable {
private static final long serialVersionUID = 1L;
/**
* 缓存分析的时间,rfc3339格式
* Required:true
*/
@Required
private String analysisTime;
/**
* 缓存分析的任务ID
* Required:true
*/
@Required
private String taskId;
/**
* 缓存分析任务状态, running, success, error, 只有sucess状态,才能根据taskId查询到结果
*/
private String status;
/**
* get 缓存分析的时间,rfc3339格式
*
* @return
*/
public String getAnalysisTime() {
return analysisTime;
}
/**
* set 缓存分析的时间,rfc3339格式
*
* @param analysisTime
*/
public void setAnalysisTime(String analysisTime) {
this.analysisTime = analysisTime;
}
/**
* get 缓存分析的任务ID
*
* @return
*/
public String getTaskId() {
return taskId;
}
/**
* set 缓存分析的任务ID
*
* @param taskId
*/
public void setTaskId(String taskId) {
this.taskId = taskId;
}
/**
* get 缓存分析任务状态, running, success, error, 只有sucess状态,才能根据taskId查询到结果
*
* @return
*/
public String getStatus() {
return status;
}
/**
* set 缓存分析任务状态, running, success, error, 只有sucess状态,才能根据taskId查询到结果
*
* @param status
*/
public void setStatus(String status) {
this.status = status;
}
/**
* set 缓存分析的时间,rfc3339格式
*
* @param analysisTime
*/
public CacheAnalysis analysisTime(String analysisTime) {
this.analysisTime = analysisTime;
return this;
}
/**
* set 缓存分析的任务ID
*
* @param taskId
*/
public CacheAnalysis taskId(String taskId) {
this.taskId = taskId;
return this;
}
/**
* set 缓存分析任务状态, running, success, error, 只有sucess状态,才能根据taskId查询到结果
*
* @param status
*/
public CacheAnalysis status(String status) {
this.status = status;
return this;
}
} | 19.943662 | 76 | 0.604873 |
c445fef9dbf9ffe02906183e7645bd251768836e | 9,074 | c | C | src/main/subrequest_lua.c | kurtace72/lighttpd2 | 505bfb053f481b39ffd0f03336e4a8511f45883e | [
"Apache-2.0"
] | null | null | null | src/main/subrequest_lua.c | kurtace72/lighttpd2 | 505bfb053f481b39ffd0f03336e4a8511f45883e | [
"Apache-2.0"
] | null | null | null | src/main/subrequest_lua.c | kurtace72/lighttpd2 | 505bfb053f481b39ffd0f03336e4a8511f45883e | [
"Apache-2.0"
] | null | null | null |
#include <lighttpd/core_lua.h>
#include <lighttpd/actions_lua.h>
#include <lualib.h>
#include <lauxlib.h>
typedef struct liSubrequest liSubrequest;
struct liSubrequest {
liWorker *wrk;
liLuaState *LL;
int func_notify_ref, func_error_ref;
liVRequest *vr;
liJobRef *parentvr_ref;
liConInfo coninfo;
gboolean have_response_headers;
gboolean notified_out_closed, notified_response_headers;
goffset notified_out_bytes;
};
static int li_lua_push_subrequest(lua_State *L, liSubrequest *sr);
static liSubrequest* li_lua_get_subrequest(lua_State *L, int ndx);
static int lua_subrequest_gc(lua_State *L);
#define LUA_SUBREQUEST "liSubrequest*"
typedef int (*lua_Subrequest_Attrib)(liSubrequest *sr, lua_State *L);
static int lua_subrequest_attr_read_in(liSubrequest *sr, lua_State *L) {
li_lua_push_chunkqueue(L, sr->coninfo.req->out);
return 1;
}
static int lua_subrequest_attr_read_out(liSubrequest *sr, lua_State *L) {
li_lua_push_chunkqueue(L, sr->coninfo.resp->out);
return 1;
}
static int lua_subrequest_attr_read_is_done(liSubrequest *sr, lua_State *L) {
lua_pushboolean(L, sr->coninfo.resp->out->is_closed);
return 1;
}
static int lua_subrequest_attr_read_have_headers(liSubrequest *sr, lua_State *L) {
lua_pushboolean(L, sr->have_response_headers);
return 1;
}
static int lua_subrequest_attr_read_vr(liSubrequest *sr, lua_State *L) {
li_lua_push_vrequest(L, sr->vr);
return 1;
}
#define AR(m) { #m, lua_subrequest_attr_read_##m, NULL }
#define AW(m) { #m, NULL, lua_subrequest_attr_write_##m }
#define ARW(m) { #m, lua_subrequest_attr_read_##m, lua_subrequest_attr_write_##m }
static const struct {
const char* key;
lua_Subrequest_Attrib read_attr, write_attr;
} subrequest_attribs[] = {
AR(in),
AR(out),
AR(is_done),
AR(have_headers),
AR(vr),
{ NULL, NULL, NULL }
};
#undef AR
#undef AW
#undef ARW
static int lua_subrequest_index(lua_State *L) {
liSubrequest *sr;
const char *key;
int i;
if (lua_gettop(L) != 2) {
lua_pushstring(L, "incorrect number of arguments");
lua_error(L);
}
if (li_lua_metatable_index(L)) return 1;
sr = li_lua_get_subrequest(L, 1);
if (!sr) return 0;
if (lua_isnumber(L, 2)) return 0;
if (!lua_isstring(L, 2)) return 0;
key = lua_tostring(L, 2);
for (i = 0; subrequest_attribs[i].key ; i++) {
if (0 == strcmp(key, subrequest_attribs[i].key)) {
if (subrequest_attribs[i].read_attr)
return subrequest_attribs[i].read_attr(sr, L);
break;
}
}
lua_pushstring(L, "cannot read attribute ");
lua_pushstring(L, key);
lua_pushstring(L, " in subrequest");
lua_concat(L, 3);
lua_error(L);
return 0;
}
static int lua_subrequest_newindex(lua_State *L) {
liSubrequest *sr;
const char *key;
int i;
if (lua_gettop(L) != 3) {
lua_pushstring(L, "incorrect number of arguments");
lua_error(L);
}
sr = li_lua_get_subrequest(L, 1);
if (!sr) return 0;
if (lua_isnumber(L, 2)) return 0;
if (!lua_isstring(L, 2)) return 0;
key = lua_tostring(L, 2);
for (i = 0; subrequest_attribs[i].key ; i++) {
if (0 == strcmp(key, subrequest_attribs[i].key)) {
if (subrequest_attribs[i].write_attr)
return subrequest_attribs[i].write_attr(sr, L);
break;
}
}
lua_pushstring(L, "cannot write attribute ");
lua_pushstring(L, key);
lua_pushstring(L, "in subrequest");
lua_concat(L, 3);
lua_error(L);
return 0;
}
static const luaL_Reg subrequest_mt[] = {
{ "__index", lua_subrequest_index },
{ "__newindex", lua_subrequest_newindex },
{ "__gc", lua_subrequest_gc },
{ NULL, NULL }
};
static void init_subrequest_mt(lua_State *L) {
luaL_register(L, NULL, subrequest_mt);
}
void li_lua_init_subrequest_mt(lua_State *L) {
if (luaL_newmetatable(L, LUA_SUBREQUEST)) {
init_subrequest_mt(L);
}
lua_pop(L, 1);
}
static liSubrequest* li_lua_get_subrequest(lua_State *L, int ndx) {
if (!lua_isuserdata(L, ndx)) return NULL;
if (!lua_getmetatable(L, ndx)) return NULL;
luaL_getmetatable(L, LUA_SUBREQUEST);
if (lua_isnil(L, -1) || lua_isnil(L, -2) || !lua_equal(L, -1, -2)) {
lua_pop(L, 2);
return NULL;
}
lua_pop(L, 2);
return *(liSubrequest**) lua_touserdata(L, ndx);
}
static int li_lua_push_subrequest(lua_State *L, liSubrequest *sr) {
liSubrequest **psr;
if (NULL == sr) {
lua_pushnil(L);
return 1;
}
psr = (liSubrequest**) lua_newuserdata(L, sizeof(liSubrequest*));
*psr = sr;
if (luaL_newmetatable(L, LUA_SUBREQUEST)) {
init_subrequest_mt(L);
}
lua_setmetatable(L, -2);
return 1;
}
static void subvr_run_lua(liSubrequest *sr, int func_ref) {
liServer *srv = sr->wrk->srv;
lua_State *L = sr->LL->L;
int errfunc;
if (NULL == L || LUA_REFNIL == func_ref) return;
li_lua_lock(sr->LL);
lua_rawgeti(L, LUA_REGISTRYINDEX, func_ref);
li_lua_push_subrequest(L, sr);
errfunc = li_lua_push_traceback(L, 1);
if (lua_pcall(L, 1, 0, errfunc)) {
ERROR(srv, "lua_pcall(): %s", lua_tostring(L, -1));
lua_pop(L, 1);
}
lua_remove(L, errfunc);
li_lua_unlock(sr->LL);
}
static void subvr_release_lua(liSubrequest *sr) {
lua_State *L;
liLuaState *LL = sr->LL;
if (NULL == LL) return;
L = LL->L;
sr->LL = NULL;
li_lua_lock(LL);
luaL_unref(L, LUA_REGISTRYINDEX, sr->func_notify_ref);
luaL_unref(L, LUA_REGISTRYINDEX, sr->func_error_ref);
li_lua_unlock(LL);
}
static void subvr_bind_lua(liSubrequest *sr, liLuaState *LL, int notify_ndx, int error_ndx) {
lua_State *L = LL->L;
sr->LL = LL;
lua_pushvalue(L, notify_ndx); /* +1 */
sr->func_notify_ref = luaL_ref(L, LUA_REGISTRYINDEX); /* -1 */
lua_pushvalue(L, error_ndx); /* +1 */
sr->func_error_ref = luaL_ref(L, LUA_REGISTRYINDEX); /* -1 */
}
static void subvr_check(liVRequest *vr) {
liSubrequest *sr = LI_CONTAINER_OF(vr->coninfo, liSubrequest, coninfo);
if (sr->notified_out_bytes < sr->coninfo.resp->out->bytes_in
|| sr->notified_out_closed != sr->coninfo.resp->out->is_closed
|| sr->notified_response_headers != sr->have_response_headers) {
subvr_run_lua(sr, sr->func_notify_ref);
}
sr->notified_out_bytes = sr->coninfo.resp->out->bytes_in;
sr->notified_out_closed = sr->coninfo.resp->out->is_closed;
sr->notified_response_headers = sr->have_response_headers;
if (sr->notified_out_closed) { /* reques done */
li_job_async(sr->parentvr_ref);
}
}
static void subvr_handle_response_error(liVRequest *vr) {
liSubrequest *sr = LI_CONTAINER_OF(vr->coninfo, liSubrequest, coninfo);
li_vrequest_free(sr->vr);
sr->vr = NULL;
subvr_run_lua(sr, sr->func_error_ref);
subvr_release_lua(sr);
}
/* TODO: support some day maybe... */
static liThrottleState* subvr_handle_throttle_out(liVRequest *vr) {
UNUSED(vr);
return NULL;
}
static liThrottleState* subvr_handle_throttle_in(liVRequest *vr) {
UNUSED(vr);
return NULL;
}
static void subvr_connection_upgrade(liVRequest *vr, liStream *backend_drain, liStream *backend_source) {
UNUSED(backend_drain); UNUSED(backend_source);
subvr_handle_response_error(vr);
}
static const liConCallbacks subrequest_callbacks = {
subvr_handle_response_error,
subvr_handle_throttle_out,
subvr_handle_throttle_in,
subvr_connection_upgrade
};
static liSubrequest* subrequest_new(liVRequest *vr) {
liSubrequest* sr = g_slice_new0(liSubrequest);
sr->wrk = vr->wrk;
sr->parentvr_ref = li_vrequest_get_ref(vr);
/* duplicate coninfo */
sr->coninfo.callbacks = &subrequest_callbacks;
sr->coninfo.remote_addr = li_sockaddr_dup(vr->coninfo->remote_addr);
sr->coninfo.local_addr = li_sockaddr_dup(vr->coninfo->local_addr);
sr->coninfo.remote_addr_str = g_string_new_len(GSTR_LEN(vr->coninfo->remote_addr_str));
sr->coninfo.local_addr_str = g_string_new_len(GSTR_LEN(vr->coninfo->local_addr_str));
sr->coninfo.is_ssl = vr->coninfo->is_ssl;
sr->coninfo.keep_alive = FALSE; /* doesn't mean anything here anyway */
sr->coninfo.req = li_stream_null_new(&vr->wrk->loop);
sr->coninfo.resp = li_stream_plug_new(&vr->wrk->loop);
sr->vr = li_vrequest_new(vr->wrk, &sr->coninfo);
li_vrequest_start(sr->vr);
li_request_copy(&sr->vr->request, &vr->request);
sr->vr->request.content_length = 0;
return sr;
}
static int lua_subrequest_gc(lua_State *L) {
liSubrequest *sr = li_lua_get_subrequest(L, 1);
liLuaState *LL;
if (NULL == sr) return 0;
LL = sr->LL;
sr->LL = NULL;
li_lua_unlock(LL); /* "pause" lua */
if (sr->vr) {
li_vrequest_free(sr->vr);
sr->vr = NULL;
}
li_sockaddr_clear(&sr->coninfo.remote_addr);
li_sockaddr_clear(&sr->coninfo.local_addr);
g_string_free(sr->coninfo.remote_addr_str, TRUE);
g_string_free(sr->coninfo.local_addr_str, TRUE);
g_slice_free(liSubrequest, sr);
li_job_async(sr->parentvr_ref);
li_job_ref_release(sr->parentvr_ref);
li_lua_lock(LL);
return 0;
}
int li_lua_vrequest_subrequest(lua_State *L) {
liVRequest *vr;
liSubrequest *sr;
liAction *a;
vr = li_lua_get_vrequest(L, 1);
if (NULL == vr) return 0;
a = li_lua_get_action_ref(L, 2);
if (a == NULL) a = vr->wrk->srv->mainaction;
sr = subrequest_new(vr);
if (NULL == sr) return 0;
subvr_bind_lua(sr, li_lua_state_get(L), 3, 4);
li_action_enter(sr->vr, a);
li_vrequest_handle_request_headers(sr->vr);
return li_lua_push_subrequest(L, sr);
}
| 23.630208 | 105 | 0.718757 |
bb45d2cadb2ca3f615cb821616d4d7aec1ad85c0 | 1,419 | html | HTML | app/templates/admin/logout.html | jasparkatt/flask_fishing | 3b55a8b1ebdccdfd908ab5ef2658d1958b4f0a2d | [
"MIT"
] | 1 | 2021-02-01T20:21:22.000Z | 2021-02-01T20:21:22.000Z | app/templates/admin/logout.html | jasparkatt/flask_fishing | 3b55a8b1ebdccdfd908ab5ef2658d1958b4f0a2d | [
"MIT"
] | 1 | 2020-11-12T02:10:58.000Z | 2020-11-14T02:40:11.000Z | app/templates/admin/logout.html | jasparkatt/flask_fishing | 3b55a8b1ebdccdfd908ab5ef2658d1958b4f0a2d | [
"MIT"
] | null | null | null | {% extends "admin/admin_base.html" %}
{% block title %}Log Out{% endblock %}
{% block css %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/logout.css') }}"> {% endblock %}
{% block favicon %}
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon_sa.ico') }}"> {% endblock %}
{% block content %}
<nav class="navbar navbar-dark bg-custom-2 navbar-expand-sm">
<span class="navbar-brand" href="#">
<img src="static/img/favicon.ico" width="30" height="30" alt="logo"> See You Soon! </span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup"
aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link" href="/login">Log In</a>
<a class="nav-item nav-link" href="/">Home</a>
</div>
</div>
</nav>
<header class="page-header header container-fluid"></header>
<footer class="page-footer font-small blue">
<!-- Copyright -->
<div class="footer-copyright text-center py-3">A Left Handed Production, 2020
<a class="fab fa-github btn fa-lg" href="https://github.com/jasparkatt/flask_fishing" style="color:#a39800de;"
target="_blank"></a>
</div>
</footer>
{% endblock %}
| 44.34375 | 114 | 0.667371 |
0b6b9493f9b4caffc3dc8d7eb74ffd39200333e1 | 6,891 | py | Python | hybmc/products/Swap.py | sschlenkrich/HybridMonteCarlo | 72f54aa4bcd742430462b27b72d70369c01f9ac4 | [
"MIT"
] | 3 | 2021-08-18T18:34:41.000Z | 2021-12-24T07:05:19.000Z | hybmc/products/Swap.py | sschlenkrich/HybridMonteCarlo | 72f54aa4bcd742430462b27b72d70369c01f9ac4 | [
"MIT"
] | null | null | null | hybmc/products/Swap.py | sschlenkrich/HybridMonteCarlo | 72f54aa4bcd742430462b27b72d70369c01f9ac4 | [
"MIT"
] | 3 | 2021-01-31T11:41:19.000Z | 2022-03-25T19:51:20.000Z | #!/usr/bin/python
import sys
sys.path.append('./')
import QuantLib as ql
from hybmc.simulations.Payoffs import Payoff, Fixed, ZeroBond, LiborRate, Cache, Asset
from hybmc.simulations.AmcPayoffs import AmcSum
from hybmc.products.Product import Product
def DiscountedPayoffFromCashFlow(cf, obsTime, payOrReceive, discYtsH=None, currencyAlias=None):
# this is a bit dangerous if someone changes evaluation date
today = ql.Settings.instance().getEvaluationDate()
# model time is measured via Act/365 (Fixed)
dc = ql.Actual365Fixed()
# first try a libor coupon
cp = ql.as_floating_rate_coupon(cf)
if cp is not None:
# first we need to puzzle out the dates for the index
projIndex = ql.as_iborindex(cp.index())
fixingDate = cp.fixingDate()
startDate = projIndex.valueDate(fixingDate)
endDate = projIndex.maturityDate(startDate)
#print(index, fixingDate, startDate, endDate)
tau = projIndex.dayCounter().yearFraction(startDate,endDate)
tenorBasis = 1.0 # default
if discYtsH is not None:
# we apply deterministic basis calculation
dfProj = 1.0 + tau*projIndex.fixing(fixingDate)
discIndex = projIndex.clone(discYtsH)
dfDisc = 1.0 + tau*discIndex.fixing(fixingDate)
tenorBasis = dfProj / dfDisc
#print(tenorBasis)
fixingTime = dc.yearFraction(today,fixingDate)
startTime = dc.yearFraction(today,startDate)
endTime = dc.yearFraction(today,endDate)
# fixed Libor or Libor forward rate
L = LiborRate(min(fixingTime,obsTime),startTime,endTime,tau,tenorBasis,currencyAlias)
if cp.spread()!=0.0:
L = L + cp.spread()
# we treat deterministic factors separately to avoid unneccessary multiplications
cpFactor = cp.nominal() * cp.accrualPeriod()
else:
L = 1.0 # used as pseudo-rate here
cpFactor = cf.amount() # treat it as a fixed cash flow
#
payTime = dc.yearFraction(today,cf.date())
cashFlow = payOrReceive * cpFactor * L * ZeroBond(obsTime,payTime,currencyAlias)
if currencyAlias is not None:
cashFlow = Asset(obsTime,currencyAlias) * cashFlow
#
return cashFlow @ obsTime
class Swap(Product):
# Python constructor
def __init__(self, qlLegs, payOrRecs, discYtsHs=None, currencyAliases=None):
self.qlLegs = qlLegs # a list of Legs
self.payOrRecs = payOrRecs # a list of Payer (-1) or Receiver (+1) flags
# we need to normalise optional inputs
if type(discYtsHs)==list:
self.discYtsHs = discYtsHs
else:
self.discYtsHs = [ discYtsHs for l in self.qlLegs ]
if type(currencyAliases)==list:
self.currencyAliases = currencyAliases
else:
self.currencyAliases = [ currencyAliases for l in self.qlLegs ]
def cashFlows(self, obsTime):
# we calculate times relative to global evaluation date
# this is a bit dangerous if someone changes evaluation date
today = ql.Settings.instance().getEvaluationDate()
# model time is measured via Act/365 (Fixed)
dc = ql.Actual365Fixed()
# we assume our swap has exactly two legs
cfs = []
for leg, por, discYtsH, alias in zip(self.qlLegs, self.payOrRecs,self.discYtsHs,self.currencyAliases):
for cf in leg:
payTime = dc.yearFraction(today,cf.date())
if payTime>obsTime: # only consider future cash flows
#print('%s: %f, %f' % (cf.date(),cf.amount(),payTime))
p = DiscountedPayoffFromCashFlow(cf,obsTime,por,discYtsH,alias)
cfs.append(p)
# print(p)
return cfs
def PayoffFromCashFlow(cf, payOrReceive, discYtsH=None):
# this is a bit dangerous if someone changes evaluation date
today = ql.Settings.instance().getEvaluationDate()
# model time is measured via Act/365 (Fixed)
dc = ql.Actual365Fixed()
#
payTime = dc.yearFraction(today,cf.date())
# first we try fixed rate cash flow
cp = ql.as_fixed_rate_coupon(cf)
if cp is not None:
return Fixed(payOrReceive*cp.amount()) @ payTime
# second try a libor coupon
cp = ql.as_floating_rate_coupon(cf)
if cp is not None:
# first we need to puzzle out the dates for the index
projIndex = ql.as_iborindex(cp.index())
fixingDate = cp.fixingDate()
startDate = projIndex.valueDate(fixingDate)
endDate = projIndex.maturityDate(startDate)
#print(index, fixingDate, startDate, endDate)
tau = projIndex.dayCounter().yearFraction(startDate,endDate)
tenorBasis = 1.0 # default
if discYtsH is not None:
# we apply deterministic basis calculation
dfProj = 1.0 + tau*projIndex.fixing(fixingDate)
discIndex = projIndex.clone(discYtsH)
dfDisc = 1.0 + tau*discIndex.fixing(fixingDate)
tenorBasis = dfProj / dfDisc
#print(tenorBasis)
fixingTime = dc.yearFraction(today,fixingDate)
startTime = dc.yearFraction(today,startDate)
endTime = dc.yearFraction(today,endDate)
# fixed Libor or Libor forward rate
L = LiborRate(fixingTime,startTime,endTime,tau,tenorBasis)
factor = payOrReceive * cp.nominal() * cp.accrualPeriod()
return ( factor * (L + cp.spread()) ) @ payTime
return None
class AmcSwap(Product):
# Python constructor, only single-currency
def __init__(self, qlLegs, payOrRecs, mcSim, maxDegree=2, discYtsH=None):
self.qlLegs = qlLegs # a list of Legs
self.payOrRecs = payOrRecs # a list of Payer (-1) or Receiver (+1) flags
self.mcSim = mcSim
self.maxDegree = maxDegree
self.discYtsH = discYtsH
# we want to re-use payoffs
today = ql.Settings.instance().getEvaluationDate()
# model time is measured via Act/365 (Fixed)
dc = ql.Actual365Fixed()
self.cfs = []
for leg, por in zip(self.qlLegs, self.payOrRecs):
for cf in leg:
payTime = dc.yearFraction(today,cf.date())
if payTime>0.0: # only consider future cash flows
p = PayoffFromCashFlow(cf,por,self.discYtsH)
self.cfs.append(Cache(p)) # this is the magic
def cashFlows(self, obsTime):
cfs = []
for cf in self.cfs:
if cf.obsTime>obsTime:
cfs.append(cf)
# we use a 'co-terminal' Libor rate as observable
tMax = max([ cf.obsTime for cf in self.cfs ])
L = LiborRate(obsTime,obsTime,tMax)
p = AmcSum(obsTime,cfs,[L],self.mcSim,self.maxDegree)
return [ p ]
| 43.06875 | 110 | 0.628646 |
2a84da66ed1eecf8d89f05218f61d7d7c4b5af23 | 1,084 | java | Java | Stack/leetcode_682_BaseballGames.java | FuyaoLi2017/leetcode | be6d5112944c08bef442d46960270af4f08fe7a8 | [
"Apache-2.0"
] | 1 | 2019-10-09T05:21:18.000Z | 2019-10-09T05:21:18.000Z | Stack/leetcode_682_BaseballGames.java | FuyaoLi2017/leetcode | be6d5112944c08bef442d46960270af4f08fe7a8 | [
"Apache-2.0"
] | null | null | null | Stack/leetcode_682_BaseballGames.java | FuyaoLi2017/leetcode | be6d5112944c08bef442d46960270af4f08fe7a8 | [
"Apache-2.0"
] | 1 | 2021-01-30T18:13:01.000Z | 2021-01-30T18:13:01.000Z | class Solution {
public int calPoints(String[] ops) {
int sum = 0;
Stack<Integer> stack = new Stack<>();
for(int i = 0; i < ops.length; i++){
// System.out.print(ops[i] + ": ");
if(ops[i].equals("+")){
int temp1 = stack.pop();
int temp2 = stack.pop();
int result = temp1 + temp2;
sum += result;
stack.push(temp2);
stack.push(temp1);
stack.push(result);
}
else if(ops[i].equals("D")){
int temp = stack.peek();
int result = temp * 2;
sum += result;
stack.push(result);
}
else if(ops[i].equals("C")){
int temp = stack.pop();
sum -= temp;
}
else{
int temp = Integer.parseInt(ops[i]);
stack.push(temp);
sum += temp;
}
// System.out.println(sum);
}
return sum;
}
}
| 29.297297 | 52 | 0.380074 |
6f874c6ef5270c2bd1b3af7a96b5fa078eb5c2da | 26,034 | rs | Rust | compiler/src/swc.rs | igaisin/aleph.js | e5078f0b95e817bcfa8a2f0d951e0d3954260948 | [
"MIT"
] | 3,825 | 2020-11-04T23:36:26.000Z | 2022-03-31T17:37:24.000Z | compiler/src/swc.rs | igaisin/aleph.js | e5078f0b95e817bcfa8a2f0d951e0d3954260948 | [
"MIT"
] | 358 | 2020-11-06T15:30:29.000Z | 2022-03-26T02:06:18.000Z | compiler/src/swc.rs | igaisin/aleph.js | e5078f0b95e817bcfa8a2f0d951e0d3954260948 | [
"MIT"
] | 162 | 2020-11-05T11:00:38.000Z | 2022-03-30T16:48:03.000Z | use crate::error::{DiagnosticBuffer, ErrorBuffer};
use crate::export_names::ExportParser;
use crate::import_map::ImportHashMap;
use crate::jsx::{jsx_magic_fold, jsx_magic_pass_2_fold};
use crate::resolve_fold::resolve_fold;
use crate::resolver::{is_remote_url, DependencyDescriptor, Resolver};
use crate::source_type::SourceType;
use crate::strip_ssr::strip_ssr_fold;
use path_slash::PathBufExt;
use std::{cell::RefCell, cmp::min, path::Path, rc::Rc};
use swc_common::{
chain,
comments::SingleThreadedComments,
errors::{Handler, HandlerFlags},
FileName, Globals, SourceMap,
};
use swc_ecma_transforms_proposal::decorators;
use swc_ecma_transforms_typescript::strip;
use swc_ecmascript::{
ast::{Module, Program},
codegen::{text_writer::JsWriter, Node},
parser::{lexer::Lexer, EsConfig, JscTarget, StringInput, Syntax, TsConfig},
transforms::{fixer, helpers, hygiene, pass::Optional, react},
visit::{Fold, FoldWith},
};
/// Options for transpiling a module.
#[derive(Debug, Clone)]
pub struct EmitOptions {
pub jsx_factory: String,
pub jsx_fragment_factory: String,
pub source_map: bool,
pub is_dev: bool,
}
impl Default for EmitOptions {
fn default() -> Self {
EmitOptions {
jsx_factory: "React.createElement".into(),
jsx_fragment_factory: "React.Fragment".into(),
is_dev: false,
source_map: false,
}
}
}
#[derive(Clone)]
pub struct SWC {
pub specifier: String,
pub module: Module,
pub source_type: SourceType,
pub source_map: Rc<SourceMap>,
pub comments: SingleThreadedComments,
}
impl SWC {
/// parse source code.
pub fn parse(
specifier: &str,
source: &str,
source_type: Option<SourceType>,
) -> Result<Self, anyhow::Error> {
let source_map = SourceMap::default();
let source_file = source_map.new_source_file(
FileName::Real(Path::new(specifier).to_path_buf()),
source.into(),
);
let sm = &source_map;
let error_buffer = ErrorBuffer::new(specifier);
let source_type = match source_type {
Some(source_type) => match source_type {
SourceType::Unknown => SourceType::from(Path::new(specifier)),
_ => source_type,
},
None => SourceType::from(Path::new(specifier)),
};
let syntax = get_syntax(&source_type);
let input = StringInput::from(&*source_file);
let comments = SingleThreadedComments::default();
let lexer = Lexer::new(syntax, JscTarget::Es2020, input, Some(&comments));
let mut parser = swc_ecmascript::parser::Parser::new_from(lexer);
let handler = Handler::with_emitter_and_flags(
Box::new(error_buffer.clone()),
HandlerFlags {
can_emit_warnings: true,
dont_buffer_diagnostics: true,
..HandlerFlags::default()
},
);
let module = parser
.parse_module()
.map_err(move |err| {
let mut diagnostic = err.into_diagnostic(&handler);
diagnostic.emit();
DiagnosticBuffer::from_error_buffer(error_buffer, |span| sm.lookup_char_pos(span.lo))
})
.unwrap();
Ok(SWC {
specifier: specifier.into(),
module,
source_type,
source_map: Rc::new(source_map),
comments,
})
}
/// parse export names in the module.
pub fn parse_export_names(&self) -> Result<Vec<String>, anyhow::Error> {
let program = Program::Module(self.module.clone());
let mut parser = ExportParser { names: vec![] };
program.fold_with(&mut parser);
Ok(parser.names)
}
pub fn strip_ssr_code(self, source_map: bool) -> Result<(String, Option<String>), anyhow::Error> {
swc_common::GLOBALS.set(&Globals::new(), || {
self.apply_fold(
chain!(
strip_ssr_fold(self.specifier.as_str()),
strip::strip_with_config(strip::Config {
use_define_for_class_fields: true,
..Default::default()
})
),
source_map,
)
})
}
/// transform a JS/TS/JSX/TSX file into a JS file, based on the supplied options.
///
/// ### Arguments
///
/// - `resolver` - a resolver to resolve import/export url.
/// - `options` - the options for emit code.
///
pub fn transform(
self,
resolver: Rc<RefCell<Resolver>>,
options: &EmitOptions,
) -> Result<(String, Option<String>), anyhow::Error> {
swc_common::GLOBALS.set(&Globals::new(), || {
let specifier_is_remote = resolver.borrow().specifier_is_remote;
let bundle_mode = resolver.borrow().bundle_mode;
let jsx = match self.source_type {
SourceType::JSX => true,
SourceType::TSX => true,
_ => false,
};
let passes = chain!(
Optional::new(
jsx_magic_fold(resolver.clone(), self.source_map.clone()),
jsx
),
Optional::new(
jsx_magic_pass_2_fold(resolver.clone(), self.source_map.clone(), options.is_dev),
jsx
),
Optional::new(
react::refresh(
true,
Some(react::RefreshOptions {
refresh_reg: "$RefreshReg$".into(),
refresh_sig: "$RefreshSig$".into(),
emit_full_signatures: false,
}),
self.source_map.clone(),
Some(&self.comments),
),
options.is_dev && !specifier_is_remote
),
Optional::new(
react::jsx(
self.source_map.clone(),
Some(&self.comments),
react::Options {
pragma: options.jsx_factory.clone(),
pragma_frag: options.jsx_fragment_factory.clone(),
// this will use `Object.assign()` instead of the `_extends` helper when spreading props.
use_builtins: true,
..Default::default()
},
),
jsx
),
resolve_fold(resolver.clone(), self.source_map.clone(), options.is_dev),
Optional::new(strip_ssr_fold(self.specifier.as_str()), bundle_mode),
decorators::decorators(decorators::Config {
legacy: true,
emit_metadata: false
}),
helpers::inject_helpers(),
strip::strip_with_config(strip::Config {
use_define_for_class_fields: true,
..Default::default()
}),
fixer(Some(&self.comments)),
hygiene()
);
let (mut code, map) = self.apply_fold(passes, options.source_map).unwrap();
let mut resolver = resolver.borrow_mut();
// remove unused deps by tree-shaking
let mut deps: Vec<DependencyDescriptor> = Vec::new();
for dep in resolver.deps.clone() {
if resolver.star_exports.contains(&dep.specifier)
|| code.contains(to_str_lit(dep.resolved.as_str()).as_str())
{
deps.push(dep);
}
}
resolver.deps = deps;
// ignore deps used by SSR
let has_ssr_options = resolver.ssr_props_fn.is_some() || resolver.ssg_paths_fn.is_some();
if !resolver.bundle_mode && (has_ssr_options || !resolver.deno_hooks.is_empty()) {
let module = SWC::parse(self.specifier.as_str(), code.as_str(), Some(SourceType::JS))
.expect("could not parse the module");
let (csr_code, _) = swc_common::GLOBALS.set(&Globals::new(), || {
module
.apply_fold(
chain!(strip_ssr_fold(self.specifier.as_str()), strip()),
false,
)
.unwrap()
});
let mut deps: Vec<DependencyDescriptor> = Vec::new();
for dep in resolver.deps.clone() {
let s = to_str_lit(dep.resolved.as_str());
if resolver.star_exports.contains(&dep.specifier) || csr_code.contains(s.as_str()) {
deps.push(dep);
} else {
let mut raw = "\"".to_owned();
if is_remote_url(dep.specifier.as_str()) {
raw.push_str(dep.specifier.as_str());
} else {
let path = Path::new(resolver.working_dir.as_str());
let path = path
.join(dep.specifier.trim_start_matches('/'))
.to_slash()
.unwrap();
raw.push_str(path.as_str());
}
raw.push('"');
code = code.replace(s.as_str(), raw.as_str());
}
}
resolver.deps = deps;
}
Ok((code, map))
})
}
/// Apply transform with the fold.
pub fn apply_fold<T: Fold>(
&self,
mut fold: T,
source_map: bool,
) -> Result<(String, Option<String>), anyhow::Error> {
let program = Program::Module(self.module.clone());
let program = helpers::HELPERS.set(&helpers::Helpers::new(false), || {
program.fold_with(&mut fold)
});
let mut buf = Vec::new();
let mut src_map_buf = Vec::new();
let src_map = if source_map {
Some(&mut src_map_buf)
} else {
None
};
{
let writer = Box::new(JsWriter::new(
self.source_map.clone(),
"\n",
&mut buf,
src_map,
));
let mut emitter = swc_ecmascript::codegen::Emitter {
cfg: swc_ecmascript::codegen::Config {
minify: false, // todo: use swc minify in the future, currently use terser
},
comments: Some(&self.comments),
cm: self.source_map.clone(),
wr: writer,
};
program.emit_with(&mut emitter).unwrap();
}
// output
let src = String::from_utf8(buf).unwrap();
if source_map {
let mut buf = Vec::new();
self
.source_map
.build_source_map_from(&mut src_map_buf, None)
.to_writer(&mut buf)
.unwrap();
Ok((src, Some(String::from_utf8(buf).unwrap())))
} else {
Ok((src, None))
}
}
}
fn get_es_config(jsx: bool) -> EsConfig {
EsConfig {
class_private_methods: true,
class_private_props: true,
class_props: true,
dynamic_import: true,
export_default_from: true,
export_namespace_from: true,
num_sep: true,
nullish_coalescing: true,
optional_chaining: true,
top_level_await: true,
import_meta: true,
import_assertions: true,
jsx,
..EsConfig::default()
}
}
fn get_ts_config(tsx: bool) -> TsConfig {
TsConfig {
decorators: true,
dynamic_import: true,
tsx,
..TsConfig::default()
}
}
fn get_syntax(source_type: &SourceType) -> Syntax {
match source_type {
SourceType::JS => Syntax::Es(get_es_config(false)),
SourceType::JSX => Syntax::Es(get_es_config(true)),
SourceType::TS => Syntax::Typescript(get_ts_config(false)),
SourceType::TSX => Syntax::Typescript(get_ts_config(true)),
_ => Syntax::Es(get_es_config(false)),
}
}
fn to_str_lit(sub_text: &str) -> String {
let mut s = "\"".to_owned();
s.push_str(sub_text);
s.push('"');
s
}
#[allow(dead_code)]
pub fn t<T: Fold>(specifier: &str, source: &str, tr: T, expect: &str) -> bool {
let module = SWC::parse(specifier, source, None).expect("could not parse module");
let (code, _) =
swc_common::GLOBALS.set(&Globals::new(), || module.apply_fold(tr, false).unwrap());
let matched = code.as_str().trim().eq(expect.trim());
if !matched {
let mut p: usize = 0;
for i in 0..min(code.len(), expect.len()) {
if code.get(i..i + 1) != expect.get(i..i + 1) {
p = i;
break;
}
}
println!(
"{}\x1b[0;31m{}\x1b[0m",
code.get(0..p).unwrap(),
code.get(p..).unwrap()
);
}
matched
}
#[allow(dead_code)]
pub fn st(specifer: &str, source: &str, bundle_mode: bool) -> (String, Rc<RefCell<Resolver>>) {
let module = SWC::parse(specifer, source, None).expect("could not parse module");
let resolver = Rc::new(RefCell::new(Resolver::new(
specifer,
"/test/",
ImportHashMap::default(),
false,
bundle_mode,
vec![],
Some("https://deno.land/x/aleph@v0.3.0".into()),
None,
)));
let (code, _) = module
.transform(resolver.clone(), &EmitOptions::default())
.unwrap();
println!("{}", code);
(code, resolver)
}
#[cfg(test)]
mod tests {
use super::*;
use crate::import_map::ImportHashMap;
use crate::resolver::{ReactOptions, Resolver};
use sha1::{Digest, Sha1};
use std::collections::HashMap;
#[test]
fn typescript() {
let source = r#"
enum D {
A,
B,
C,
}
function enumerable(value: boolean) {
return function (
_target: any,
_propertyKey: string,
descriptor: PropertyDescriptor,
) {
descriptor.enumerable = value;
};
}
export class A {
private b: string;
protected c: number = 1;
e: "foo";
constructor (public d = D.A) {
const e = "foo" as const;
this.e = e;
}
@enumerable(false)
bar() {}
}
"#;
let (code, _) = st("https://deno.land/x/mod.ts", source, false);
assert!(code.contains("var D;\n(function(D) {\n"));
assert!(code.contains("_applyDecoratedDescriptor("));
}
#[test]
fn react_jsx() {
let source = r#"
import React from "https://esm.sh/react"
export default function Index() {
return (
<>
<h1 className="title">Hello World</h1>
</>
)
}
"#;
let (code, _) = st("/pages/index.tsx", source, false);
assert!(code.contains("React.createElement(React.Fragment, null"));
assert!(code.contains("React.createElement(\"h1\", {"));
assert!(code.contains("className: \"title\""));
}
#[test]
fn parse_export_names() {
let source = r#"
export const name = "alephjs"
export const version = "1.0.1"
const start = () => {}
export default start
export const { build } = { build: () => {} }
export function dev() {}
export class Server {}
export const { a: { a1, a2 }, 'b': [ b1, b2 ], c, ...rest } = { a: { a1: 0, a2: 0 }, b: [ 0, 0 ], c: 0, d: 0 }
export const [ d, e, ...{f, g, rest3} ] = [0, 0, {f:0,g:0,h:0}]
let i
export const j = i = [0, 0]
export { exists, existsSync } from "https://deno.land/std/fs/exists.ts"
export * as DenoStdServer from "https://deno.land/std/http/sever.ts"
export * from "https://deno.land/std/http/sever.ts"
"#;
let module = SWC::parse("/app.ts", source, None).expect("could not parse module");
assert_eq!(
module.parse_export_names().unwrap(),
vec![
"name",
"version",
"default",
"build",
"dev",
"Server",
"a1",
"a2",
"b1",
"b2",
"c",
"rest",
"d",
"e",
"f",
"g",
"rest3",
"j",
"exists",
"existsSync",
"DenoStdServer",
"{https://deno.land/std/http/sever.ts}",
]
.into_iter()
.map(|s| s.to_owned())
.collect::<Vec<String>>()
)
}
#[test]
fn resolve_module_import_export() {
let source = r#"
import React from 'react'
import { redirect } from 'aleph'
import { useDeno } from 'aleph/hooks.ts'
import { render } from 'react-dom/server'
import { render as _render } from 'https://cdn.esm.sh/v1/react-dom@16.14.1/es2020/react-dom.js'
import Logo from '../component/logo.tsx'
import Logo2 from '~/component/logo.tsx'
import Logo3 from '@/component/logo.tsx'
const AsyncLogo = React.lazy(() => import('../components/async-logo.tsx'))
export { useState } from 'https://esm.sh/react'
export * from 'https://esm.sh/swr'
export { React, redirect, useDeno, render, _render, Logo, Logo2, Logo3, AsyncLogo }
"#;
let module = SWC::parse("/pages/index.tsx", source, None).expect("could not parse module");
let mut imports: HashMap<String, String> = HashMap::new();
imports.insert("@/".into(), "./".into());
imports.insert("~/".into(), "./".into());
imports.insert("aleph".into(), "https://deno.land/x/aleph/mod.ts".into());
imports.insert("aleph/".into(), "https://deno.land/x/aleph/".into());
imports.insert("react".into(), "https://esm.sh/react".into());
imports.insert("react-dom/".into(), "https://esm.sh/react-dom/".into());
let resolver = Rc::new(RefCell::new(Resolver::new(
"/pages/index.tsx",
"/",
ImportHashMap {
imports,
scopes: HashMap::new(),
},
false,
false,
vec![],
Some("https://deno.land/x/aleph@v1.0.0".into()),
Some(ReactOptions {
version: "17.0.2".into(),
esm_sh_build_version: 2,
}),
)));
let code = module
.transform(resolver.clone(), &EmitOptions::default())
.unwrap()
.0;
println!("{}", code);
assert!(code.contains("import React from \"../-/esm.sh/react@17.0.2.js\""));
assert!(code.contains("import { redirect } from \"../-/deno.land/x/aleph@v1.0.0/mod.js\""));
assert!(code.contains("import { useDeno } from \"../-/deno.land/x/aleph@v1.0.0/hooks.js\""));
assert!(code.contains("import { render } from \"../-/esm.sh/react-dom@17.0.2/server.js\""));
assert!(code.contains("import { render as _render } from \"../-/cdn.esm.sh/v2/react-dom@17.0.2/es2020/react-dom.js\""));
assert!(code.contains("import Logo from \"../component/logo.js#/component/logo.tsx@000000\""));
assert!(code.contains("import Logo2 from \"../component/logo.js#/component/logo.tsx@000001\""));
assert!(code.contains("import Logo3 from \"../component/logo.js#/component/logo.tsx@000002\""));
assert!(code.contains("const AsyncLogo = React.lazy(()=>import(\"../components/async-logo.js#/components/async-logo.tsx@000003\")"));
assert!(code.contains("export { useState } from \"../-/esm.sh/react@17.0.2.js\""));
assert!(code.contains("export * from \"[https://esm.sh/swr]:../-/esm.sh/swr.js\""));
assert_eq!(
resolver.borrow().deps.last().unwrap().specifier,
"https://esm.sh/swr"
);
}
#[test]
fn sign_use_deno_hook() {
let specifer = "/pages/index.tsx";
let source = r#"
const callback = async () => {
return {}
}
export default function Index() {
const verison = useDeno(() => Deno.version)
const data = useDeno(async function() {
return await readJson("./data.json")
}, 1000)
const data = useDeno(callback, 1000, "ID")
return null
}
"#;
let mut hasher = Sha1::new();
hasher.update(specifer.clone());
hasher.update("1");
hasher.update("() => Deno.version");
let id_1 = base64::encode(hasher.finalize())
.replace("/", "")
.replace("+", "")
.replace("=", "");
let mut hasher = Sha1::new();
hasher.update(specifer.clone());
hasher.update("2");
hasher.update(
r#"async function() {
return await readJson("./data.json")
}"#,
);
let id_2 = base64::encode(hasher.finalize())
.replace("+", "")
.replace("/", "")
.replace("=", "");
let mut hasher = Sha1::new();
hasher.update(specifer.clone());
hasher.update("3");
hasher.update("callback");
let id_3 = base64::encode(hasher.finalize())
.replace("+", "")
.replace("/", "")
.replace("=", "");
let (code, _) = st(specifer, source, false);
assert!(code.contains(format!(", null, \"useDeno-{}\"", id_1).as_str()));
assert!(code.contains(format!(", 1000, \"useDeno-{}\"", id_2).as_str()));
assert!(code.contains(format!(", 1000, \"useDeno-{}\"", id_3).as_str()));
let (code, _) = st(specifer, source, true);
assert!(code.contains(format!("null, null, \"useDeno-{}\"", id_1).as_str()));
assert!(code.contains(format!("null, 1000, \"useDeno-{}\"", id_2).as_str()));
assert!(code.contains(format!("null, 1000, \"useDeno-{}\"", id_3).as_str()));
}
#[test]
fn resolve_import_meta_url() {
let source = r#"
console.log(import.meta.url)
"#;
let (code, _) = st("/pages/index.tsx", source, false);
assert!(code.contains("console.log(\"/test/pages/index.tsx\")"));
}
#[test]
fn ssr_tree_shaking() {
let source = r#"
import { useDeno } from 'https://deno.land/x/aleph/framework/react/mod.ts'
import { join, basename, dirname } from 'https://deno.land/std/path/mod.ts'
import React from 'https://esm.sh/react'
import { get } from '../libs/db.ts'
export const ssr = {
props: async () => ({
filename: basename(import.meta.url),
data: get('foo')
}),
"paths": async () => ([join('/', 'foo')])
}
export default function Index() {
const { title } = useDeno(async () => {
const text = await Deno.readTextFile(join(dirname(import.meta.url), '../config.json'))
return JSON.parse(text)
})
return (
<h1>{title}</h1>
)
}
"#;
let module = SWC::parse("/pages/index.tsx", source, None).expect("could not parse module");
let resolver = Rc::new(RefCell::new(Resolver::new(
"/pages/index.tsx",
"/test",
ImportHashMap::default(),
false,
false,
vec![],
None,
None,
)));
let code = module
.transform(resolver.clone(), &EmitOptions::default())
.unwrap()
.0;
println!("{}", code);
assert!(
code.contains("import { useDeno } from \"../-/deno.land/x/aleph/framework/react/mod.js\"")
);
assert!(code.contains("import React from \"../-/esm.sh/react.js\""));
assert!(code
.contains("import { join, basename, dirname } from \"https://deno.land/std/path/mod.ts\""));
assert!(code.contains("import { get } from \"/test/libs/db.ts\""));
assert!(code.contains("export const ssr ="));
assert_eq!(resolver.borrow().deno_hooks.len(), 1);
assert_eq!(resolver.borrow().deps.len(), 2);
let mut hasher = Sha1::new();
let callback_code = r#"async () => ({
filename: basename(import.meta.url),
data: get('foo')
})"#;
hasher.update(callback_code.clone());
assert_eq!(
resolver.borrow().ssr_props_fn,
Some(base64::encode(hasher.finalize()))
);
assert_eq!(resolver.borrow().ssg_paths_fn, Some(true));
}
#[test]
fn bundle_mode() {
let source = r#"
import { useDeno } from 'https://deno.land/x/aleph/framework/react/mod.ts'
import { join, basename, dirname } from 'https://deno.land/std/path/mod.ts'
import React, { useState, useEffect as useEffect_ } from 'https://esm.sh/react'
import * as React_ from 'https://esm.sh/react'
import Logo from '../components/logo.tsx'
import Nav from '../components/nav.tsx'
import '../shared/iife.ts'
import '../shared/iife2.ts'
export * from "https://esm.sh/react"
export * as ReactDom from "https://esm.sh/react-dom"
export { render } from "https://esm.sh/react-dom"
const AsyncLogo = React.lazy(() => import('../components/async-logo.tsx'))
export const ssr = {
props: async () => ({
filename: basename(import.meta.url)
}),
paths: async () => ([join('/', 'foo')])
}
export default function Index() {
const { title } = useDeno(async () => {
const text = await Deno.readTextFile(join(dirname(import.meta.url), '../config.json'))
return JSON.parse(text)
})
return (
<>
<head>
<link rel="stylesheet" href="https://esm.sh/tailwindcss/dist/tailwind.min.css" />
<link rel="stylesheet" href="../style/index.css" />
</head>
<Logo />
<AsyncLogo />
<Nav />
<h1>{title}</h1>
</>
)
}
"#;
let module = SWC::parse("/pages/index.tsx", source, None).expect("could not parse module");
let resolver = Rc::new(RefCell::new(Resolver::new(
"/pages/index.tsx",
"/",
ImportHashMap::default(),
false,
true,
vec![
"https://esm.sh/react".into(),
"https://esm.sh/react-dom".into(),
"https://deno.land/x/aleph/framework/react/mod.ts".into(),
"https://deno.land/x/aleph/framework/react/components/Head.ts".into(),
"/components/logo.tsx".into(),
"/shared/iife.ts".into(),
],
None,
None,
)));
let code = module
.transform(resolver.clone(), &EmitOptions::default())
.unwrap()
.0;
println!("{}", code);
assert!(code.contains("const { /*#__PURE__*/ default: React , useState , useEffect: useEffect_ } = __ALEPH__.pack[\"https://esm.sh/react\"]"));
assert!(code.contains("const React_ = __ALEPH__.pack[\"https://esm.sh/react\"]"));
assert!(code.contains("const { default: Logo } = __ALEPH__.pack[\"/components/logo.tsx\"]"));
assert!(code.contains("import Nav from \"../components/nav.bundling.js\""));
assert!(!code.contains("__ALEPH__.pack[\"/shared/iife.ts\"]"));
assert!(code.contains("import \"../shared/iife2.bundling.js\""));
assert!(
code.contains("AsyncLogo = React.lazy(()=>__ALEPH__.import(\"/components/async-logo.tsx\"")
);
assert!(code.contains(
"const { default: __ALEPH__Head } = __ALEPH__.pack[\"https://deno.land/x/aleph/framework/react/components/Head.ts\"]"
));
assert!(code.contains(
"import __ALEPH__StyleLink from \"../-/deno.land/x/aleph/framework/react/components/StyleLink.bundling.js\""
));
assert!(code.contains("import \"../-/esm.sh/tailwindcss/dist/tailwind.min.css.bundling.js\""));
assert!(code.contains("import \"../style/index.css.bundling.js\""));
assert!(code.contains("export const $$star_0 = __ALEPH__.pack[\"https://esm.sh/react\"]"));
assert!(code.contains("export const ReactDom = __ALEPH__.pack[\"https://esm.sh/react-dom\"]"));
assert!(
code.contains("export const { render } = __ALEPH__.pack[\"https://esm.sh/react-dom\"]")
);
assert!(!code.contains("export const ssr ="));
assert!(!code.contains("deno.land/std/path"));
}
}
| 32.420922 | 148 | 0.575478 |
1ccad1d8147369586f46ef2c3e2d293f9916ad7f | 3,057 | css | CSS | css/navStyle.css | dev-arekusandoru/raisingTheBar | db5d53ee00cb561bd75188ee149278067d909ac3 | [
"MIT"
] | null | null | null | css/navStyle.css | dev-arekusandoru/raisingTheBar | db5d53ee00cb561bd75188ee149278067d909ac3 | [
"MIT"
] | null | null | null | css/navStyle.css | dev-arekusandoru/raisingTheBar | db5d53ee00cb561bd75188ee149278067d909ac3 | [
"MIT"
] | null | null | null | * {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/*defines background and font to be used on all pages*/
body {
background-color: #eaeaea;
font-family: 'Poppins', sans-serif;
overflow-x: hidden;
}
/*sets up nav*/
nav {
z-index: -1;
padding: 0;
display: flex;
flex-direction: row;
height: 70px;
background-color: #374b4a;
justify-content: space-between;
align-items: center;
}
/*styles for left side of nav*/
#left-nav {
margin-left: 20px;
margin-top: 1px;
display: flex;
flex-direction: row;
color: #eaeaea;
letter-spacing: 4px;
text-transform: uppercase;
font-size: 20px;
align-items: center;
width: 70%;
}
#left-nav img {
height: 70px;
}
#left-nav a:visited, #left-nav a {
color: #eaeaea;
text-decoration: none;
margin-left: 10px;
}
/*styles nav links*/
.nav-links {
/*set to 360px when merch */
min-width: 250px;
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
}
.nav-links li {
display: inline-block;
line-height: 70px;
text-transform: uppercase;
letter-spacing: 3px;
}
/*hides merch tab bc its not ready yet*/
#merch {
display: none;
}
/*nav link interactions*/
.nav-links li a {
text-decoration: none;
padding: 23px 20px 24px 20px;
color: #eaeaea;
transition-duration: 0.3s;
}
.nav-links li a:hover {
transition-duration: 0.3s;
background-color: #2b3b3a;
color: #eaeaea;
}
/*styles the burger icon*/
.burger {
display: none;
cursor: pointer;
margin-right: 15px;
}
.burger div {
width: 25px;
height: 3px;
background-color: #eaeaea;
margin: 5px;
transition: all 0.3s ease;
}
/*code inspired from https://www.youtube.com/watch?v=gXkqy0b4M5g*/
/*defines how the menu acts and adapts when the screen is small/for mobile devices*/
@media screen and (max-width: 700px) {
html, body {
position: relative;
overflow-x: hidden;
}
#left-nav img {
display: none;
}
#left-nav a {
letter-spacing: 0.6vw;
margin-left: 0;
}
#right-nav {
width: 0;
}
.nav-links {
z-index: 2;
position: absolute;
right: 0;
height: 92vh;
top: 70px;
background-color: #374b4a;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
width: 175px;
transform: translateX(100%);
transition: transform 0.5s ease-in;
}
.nav-links li {
opacity: 1;
}
.burger {
display: block;
}
}
.nav-active {
transform: translateX(0%);
}
@keyframes navLinkFade {
from {
opacity: 0;
transform: translateX(50px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.toggle #line1 {
transform: rotate(-45deg) translate(-5px, 6px);
}
.toggle #line2 {
opacity: 0;
}
.toggle #line3 {
transform: rotate(45deg) translate(-5px, -6px);
} | 16.983333 | 84 | 0.580635 |
65106635994d91a479c18b140e8932588b6e8457 | 2,385 | py | Python | result/forms.py | Uqhs-1/uqhs | 1c7199d8c23a9d9eb3f75b1e36633a145fd2cd40 | [
"MIT"
] | 3 | 2020-06-16T20:03:31.000Z | 2021-01-17T20:45:51.000Z | result/forms.py | Uqhs-1/uqhs | 1c7199d8c23a9d9eb3f75b1e36633a145fd2cd40 | [
"MIT"
] | 8 | 2020-02-08T09:04:08.000Z | 2021-06-09T18:31:03.000Z | result/forms.py | Uqhs-1/uqhs | 1c7199d8c23a9d9eb3f75b1e36633a145fd2cd40 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 08:25:37 2019
@author: AdeolaOlalekan
"""
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import BTUTOR, CNAME, Edit_User, QSUBJECT, Post
class login_form(forms.Form):
username = forms.CharField(max_length=18)#, help_text="Just type 'renew'")
password1 = forms.CharField(widget=forms.PasswordInput)#
def clean_data(self):
data = self.cleaned_data['username']
data = self.cleaned_data['password1']
return data
###############################################################################
class ProfileForm(forms.ModelForm):
class Meta:
model = Edit_User
fields = ('title', 'first_name', 'last_name', 'bio', 'phone', 'city', 'country', 'organization', 'location', 'birth_date', 'department', 'photo',)
exclude = ['user']
class SignUpForm(UserCreationForm):
email = forms.EmailField(max_length=254, help_text='Required for a valid signup!')
class Meta:
model = User
fields = ('username', 'email', 'password1', 'password2')
def save(self, commit=True):
user = super(SignUpForm, self).save(commit=False)
user.email = self.cleaned_data['email']
user.password = self.cleaned_data['password1']
if commit:
user.save()
return user
class subject_class_term_Form(forms.ModelForm):
class Meta:
model = BTUTOR
fields = ('Class', 'subject',)
class class_term(forms.ModelForm):
class Meta:
model = BTUTOR
fields = ('Class', 'term', )
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('Account_Username', 'subject', 'text')
class a_student_form_new(forms.ModelForm):
class Meta:
model = QSUBJECT
fields = ('student_name','test', 'agn','atd', 'exam','tutor',)
class student_name(forms.ModelForm):
class Meta:
model = CNAME
fields = ('last_name', 'first_name', 'gender', "birth_date",)
class new_student_name(forms.Form):
student_name = forms.CharField(help_text="enter student's surename to search.")
def clean_renewal_date(self):
data = self.cleaned_data['student_name']
return data
# | 29.8125 | 154 | 0.609224 |
d29b97677a88a2086ea4edf0620ce0901cf434a9 | 2,141 | php | PHP | protected/modules/orderService/models/Report/concreteReport/AbstractReport.php | VVIkon/kmp-old | 85a4e8a5e1e42dfeae3f8265534a42af72633a80 | [
"MIT"
] | 1 | 2019-10-04T10:19:28.000Z | 2019-10-04T10:19:28.000Z | protected/modules/orderService/models/Report/concreteReport/AbstractReport.php | VVIkon/kmp-old | 85a4e8a5e1e42dfeae3f8265534a42af72633a80 | [
"MIT"
] | null | null | null | protected/modules/orderService/models/Report/concreteReport/AbstractReport.php | VVIkon/kmp-old | 85a4e8a5e1e42dfeae3f8265534a42af72633a80 | [
"MIT"
] | null | null | null | <?php
/**
* Created by PhpStorm.
* User: rock
* Date: 13.09.17
* Time: 17:56
*/
abstract class AbstractReport
{
const NA = 'N/A';
/**
* @var SOReport
*/
protected $SOReport;
/**
* @var OrdersServices[]|OrderModel[]
*/
protected $data;
/**
*
* @return mixed
*/
abstract public function makeReport();
abstract protected function init($params);
abstract public function getEmailSubject();
/**
* @param $reportConstructType
* @param $dateFrom
* @param $dateTo
* @param $companyId
*/
abstract protected function extractData($reportConstructType, $dateFrom, $dateTo, $companyIds);
public function __construct()
{
$this->SOReport = new SOReport();
}
public function getSOReport()
{
return $this->SOReport;
}
/**
* Создание класса отчета
* @param $reportName
* @param $params
* @return AbstractReport
*/
public static function createReportClass($reportName, $params)
{
$className = ucfirst($reportName) . 'Report';
if (class_exists($className)) {
$class = new $className();
$class->init($params);
$class->extractData(
$params['reportConstructType'],
$params['dateFrom'],
$params['dateTo'],
StdLib::nvl($params['holdingCompaniesIds'])
);
return $class;
}
}
/**
* Создание пустой строки заданной длины с началом и/или концом из массива
* @param $length
* @param array $head
* @param array $tail
* @return array
*/
protected function createEmptyRow($length, $head = [], $tail = [])
{
if (count($head) + count($tail) > $length) {
return [];
}
$row = array_fill(0, $length, '');
if (!empty($head)) {
array_splice($row, 0, count($head), $head);
}
if (!empty($tail)) {
array_splice($row, count($row) - count($tail), count($tail), $tail);
}
return $row;
}
} | 21.626263 | 99 | 0.52639 |
4a3cbb389b4b531ccf3c89281a1d0aaa662a7fe9 | 271 | js | JavaScript | src/const/size.js | mtngun/gatsby-starter | b9e9dacf17fc5dacf4d9ce4222ffff44d0126305 | [
"MIT"
] | null | null | null | src/const/size.js | mtngun/gatsby-starter | b9e9dacf17fc5dacf4d9ce4222ffff44d0126305 | [
"MIT"
] | 1 | 2018-11-10T03:47:10.000Z | 2018-11-10T03:47:10.000Z | src/const/size.js | mtngun/gatsby-starter | b9e9dacf17fc5dacf4d9ce4222ffff44d0126305 | [
"MIT"
] | null | null | null | export default {
FONT: {
BASE: 14,
MEDIUM: 16,
LARGE: 18,
},
RADIUS: {
BASE: 4
},
MEDIA: {
X_SMALL: 320,
SMALL: 576,
MEDIUM: 768,
LARGE: 992,
X_LARGE: 1200
},
HEADER: {
HEIGHT: 32
},
MAIN: {
WIDTH: 1024
}
}
| 11.291667 | 17 | 0.468635 |
1e1b66fca985925f28673dcab55c163a7b0ccac6 | 482 | css | CSS | css/myresponsive.css | Ishtiakur/kamla.com | e357eb44f41636688e4e53ddf9be151773a0030f | [
"Apache-2.0"
] | null | null | null | css/myresponsive.css | Ishtiakur/kamla.com | e357eb44f41636688e4e53ddf9be151773a0030f | [
"Apache-2.0"
] | null | null | null | css/myresponsive.css | Ishtiakur/kamla.com | e357eb44f41636688e4e53ddf9be151773a0030f | [
"Apache-2.0"
] | null | null | null | @media only screen and (max-width: 390px) {
.jobs-top-nav{
background: #277DC7;
padding: 15px 0;
}
.carousel-caption {
top: 50%;
transform: translateY(-50%);
}
.carousel-caption h1 {
display: none;
}
.carousel-caption h3 {
display: none;
}
.spacebtn {
margin-top: 15px;
}
}
@media only screen and (min-width: 391px) {
.carousel-caption {
vertical-align: middle;
}
.spacebtn {
margin-top: 0px;
}
} | 11.47619 | 43 | 0.564315 |
9c29b6a69aef5d4201d8584cc4c8c4d8bae33356 | 4,213 | js | JavaScript | src/js/components/Datasets/DatasetDataGrid.js | codeaudit/DIVE-frontend | 2c630f28319612dd2a050f0744f9dad8a0b06657 | [
"MIT"
] | null | null | null | src/js/components/Datasets/DatasetDataGrid.js | codeaudit/DIVE-frontend | 2c630f28319612dd2a050f0744f9dad8a0b06657 | [
"MIT"
] | 1 | 2022-02-14T12:19:37.000Z | 2022-02-14T12:19:37.000Z | src/js/components/Datasets/DatasetDataGrid.js | RBozydar/DIVE-frontend | 75070a7eecfa37d918099e6ea29c3ffbe472d1cd | [
"MIT"
] | 2 | 2018-07-03T19:33:26.000Z | 2018-07-03T19:34:20.000Z | import React, { Component, PropTypes } from 'react';
import styles from './Datasets.sass';
import DatasetRow from './DatasetRow';
import MetadataRow from './MetadataRow';
import DatasetHeaderCell from './DatasetHeaderCell';
import DatasetMetadataCell from './DatasetMetadataCell';
import DataGrid from '../Base/DataGrid';
export default class DatasetDataGrid extends Component {
render() {
const { dataset, fieldProperties } = this.props;
if (!dataset.data) {
return;
}
var dataRows = [];
var headerRows = [];
var metadataRows = [];
if (fieldProperties.items.length && fieldProperties.datasetId == dataset.id) {
const createCellContent = function (value, children) {
return (
<div
key={ `cell-content-${ value }` }
title={ value }
className={ styles.cellContent + ' ' + styles.dataCellContent + ' ' + ((value === null) ? ' ' + styles.nullContent : '')}
>
<span className={ styles.fieldValue }>{ value }</span>
{ children }
</div>
);
};
const createDataCellContent = ((value) => createCellContent(value));
const createHeaderCellContent = function(value, fieldProperty, context) {
return (
<DatasetHeaderCell key={ `header-cell-${ value }` } value={ value } fieldProperty={ fieldProperty } preloaded={ dataset.preloaded }/>
);
};
const createMetadataCellContent = function(value, fieldProperty, context) {
const color = fieldProperties.fieldNameToColor[fieldProperty.name] || null;
return (
<div key={ `cell-content-${ fieldProperty.id }` } title={ value } className={ styles.cellContent }>
<DatasetMetadataCell key={ `metadata-cell-${ fieldProperty.id }` } fieldProperty={ fieldProperty } color={ color } preloaded={ dataset.preloaded }/>
</div>
);
};
const createCell = function(key, i, value, cellContentGenerator) {
const fieldProperty = fieldProperties.items.find((fieldProperty) => fieldProperty.index == i);
return {
id: fieldProperty.id,
index: i,
value: cellContentGenerator(value, fieldProperty, this),
columnType: fieldProperty.type,
columnGeneralType: fieldProperty.generalType
}
}
const createHeaderCell = ((key, i) => createCell(key, i, key, createHeaderCellContent));
const createMetadataCell = ((key, i) => createCell(key, i, key, createMetadataCellContent));
const headerRow = [...dataset.data[0].keys()].map(createHeaderCell);
const metadataRow = [...dataset.data[0].keys()].map(createMetadataCell);
dataRows = dataset.data.map(function(row, i) {
const createDataCell = ((key, j) => createCell(key, j, row.get(key), createDataCellContent));
return {
rowType: 'data',
items: [...row.keys()].map(createDataCell)
};
});
headerRows = [
{
rowType: 'header',
items: headerRow
}
];
metadataRows = [
{
rowType: 'metadata',
items: metadataRow
}
];
}
return (
<div className={ styles.gridContainer }>
<div className={ styles.scrollContainer }>
<DataGrid
containerClassName={ styles.headerRowTable }
datasetId={ `${ dataset.id }` }
data={ headerRows }
customRowComponent={ DatasetRow }/>
<DataGrid
preloaded={ dataset.preloaded }
containerClassName={ styles.metadataRowTable }
datasetId={ `${ dataset.id }` }
data={ metadataRows }
customRowComponent={ MetadataRow }/>
<DataGrid
containerClassName={ styles.dataRowsTable }
datasetId={ `${ dataset.id }` }
data={ dataRows }
customRowComponent={ DatasetRow }/>
</div>
</div>
);
}
}
DatasetDataGrid.propTypes = {
dataset: PropTypes.object.isRequired,
fieldProperties: PropTypes.object.isRequired
}
DatasetDataGrid.defaultProps = {
dataset: {},
fieldProperties: {}
}
| 32.407692 | 160 | 0.591028 |
a7248637553c229af45a6b05b8e815d229e60e7c | 1,841 | kt | Kotlin | app/src/main/kotlin/tech/hombre/bluetoothchatter/ui/widget/GoDownButton.kt | HombreTech/BluetoothChat | c50f4579bbe899ab2138b2c4ab795237c1d470af | [
"Apache-2.0"
] | null | null | null | app/src/main/kotlin/tech/hombre/bluetoothchatter/ui/widget/GoDownButton.kt | HombreTech/BluetoothChat | c50f4579bbe899ab2138b2c4ab795237c1d470af | [
"Apache-2.0"
] | 2 | 2022-03-25T08:14:00.000Z | 2022-03-30T11:07:40.000Z | app/src/main/kotlin/tech/hombre/bluetoothchatter/ui/widget/GoDownButton.kt | HombreTech/BluetoothChat | c50f4579bbe899ab2138b2c4ab795237c1d470af | [
"Apache-2.0"
] | null | null | null | package tech.hombre.bluetoothchatter.ui.widget
import android.annotation.SuppressLint
import android.content.Context
import com.google.android.material.floatingactionbutton.FloatingActionButton
import androidx.core.view.ViewCompat
import android.util.AttributeSet
import android.widget.FrameLayout
import android.widget.TextView
import tech.hombre.bluetoothchatter.R
import tech.hombre.bluetoothchatter.utils.getLayoutInflater
import tech.hombre.bluetoothchatter.utils.isNumber
import tech.hombre.bluetoothchatter.utils.toPx
class GoDownButton : FrameLayout {
private var goDownButton: FloatingActionButton
private var newMessagesCount: TextView
private var onClickListener: (() -> Unit)? = null
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
init {
@SuppressLint("InflateParams")
val root = context.getLayoutInflater().inflate(R.layout.view_go_down_button, null)
goDownButton = root.findViewById(R.id.fab_go_down)
newMessagesCount = root.findViewById(R.id.tv_new_messages)
ViewCompat.setElevation(newMessagesCount, 6.toPx().toFloat())
goDownButton.setOnClickListener { onClickListener?.invoke() }
addView(root)
}
fun setOnClickListener(listener: () -> Unit) {
onClickListener = listener
}
fun setUnreadMessageNumber(number: Int) {
newMessagesCount.text = number.toString()
newMessagesCount.visibility = if (number > 0) VISIBLE else GONE
}
fun getUnreadMessageNumber(): Int {
val text = newMessagesCount.text.toString()
return if (text.isEmpty() || !text.isNumber()) 0 else text.toInt()
}
}
| 34.092593 | 112 | 0.741988 |
774f51ebd5f162453ea432ec5dfb5314efc903d6 | 1,222 | html | HTML | myblog/templates/blog/_posts.html | gloomyline/MyBlog | dbe6bee7671a678b5380d5da6aab2e8c8222b861 | [
"MIT"
] | null | null | null | myblog/templates/blog/_posts.html | gloomyline/MyBlog | dbe6bee7671a678b5380d5da6aab2e8c8222b861 | [
"MIT"
] | null | null | null | myblog/templates/blog/_posts.html | gloomyline/MyBlog | dbe6bee7671a678b5380d5da6aab2e8c8222b861 | [
"MIT"
] | null | null | null | {% from 'bootstrap/pagination.html' import render_pagination %}
{% if posts %}
{% for post in posts %}
<h3 class="text-primary">
<a href="{{ url_for('.show_post', post_id=post.id) }}">{{ post.title }}</a>
</h3>
<p>{{ post.body|striptags|truncate }}<small><a href="{{ url_for('.show_post', post_id=post.id) }}">ReadMore>>></a></small></p>
<small>
Comments: <a href="{{ url_for('.show_post', post_id=post.id) }}">{{ post.comments|length }}</a>
Category: <a href="{{ url_for('.show_category', category_id=post.category.id) }}">{{ post.category.name }}</a>
<span class="float-right" data-toggle="tooltip" data-placement="top" data-delay="500" data-timestamp="{{ post.timestamp.strftime('%Y-%m-%dT%H:%M:%SZ') }}">{{ moment(post.timestamp).fromNow(refresh=True) }}</span>
</small>
{% if not loop.last %}<hr>{% endif %}
{% endfor %}
{{ render_pagination(pagination, align='center') }}
{% else %}
<div class="tip">
<h5>No posts yet.</h5>
{% if current_user.is_authenticated %}
<a href="{{ url_for('admin.new_post') }}">Write here.</a>
{% endif %}
</div>
{% endif %} | 50.916667 | 224 | 0.562193 |
965dd8ca53af857cba56deff4f798db029abf152 | 223 | php | PHP | app/VotesCategory.php | santiagogo2/api-rest-votaciones | a7c155615b5326a5384be03214b79da4cab66629 | [
"MIT"
] | null | null | null | app/VotesCategory.php | santiagogo2/api-rest-votaciones | a7c155615b5326a5384be03214b79da4cab66629 | [
"MIT"
] | 1 | 2020-05-11T17:08:38.000Z | 2020-05-11T17:08:38.000Z | app/VotesCategory.php | santiagogo2/api-rest-votaciones | a7c155615b5326a5384be03214b79da4cab66629 | [
"MIT"
] | null | null | null | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class VotesCategory extends Model
{
protected $table = 'votes_category';
protected $fillable = [
'name','startDate','startTime','endDate','endTime'
];
}
| 14.866667 | 52 | 0.717489 |
a95b883c0038c7b5c9e6ef30d8652778024c1c24 | 64 | sql | SQL | application/models/al.sql | tejas-webmavens/success4u | a5c22acc59e543d94101331ad9e4beefb54cdbc6 | [
"MIT"
] | null | null | null | application/models/al.sql | tejas-webmavens/success4u | a5c22acc59e543d94101331ad9e4beefb54cdbc6 | [
"MIT"
] | null | null | null | application/models/al.sql | tejas-webmavens/success4u | a5c22acc59e543d94101331ad9e4beefb54cdbc6 | [
"MIT"
] | null | null | null |
update `arm_history` set `Balance`='1000' where HistoryId='67'; | 32 | 63 | 0.734375 |
0a50b213a58be1d40ed7b7958443182618d0441c | 221 | h | C | CCTimePicker/UIView+CCUtil.h | bref-Chan/CCTimePickerDemo | 40a218b8a655935e7e951c1161880939ff525b14 | [
"MIT"
] | 97 | 2017-08-01T01:59:56.000Z | 2021-09-26T14:29:41.000Z | CCTimePicker/UIView+CCUtil.h | MrDML/CCTimePickerDemo | 40a218b8a655935e7e951c1161880939ff525b14 | [
"MIT"
] | 1 | 2018-01-12T03:27:19.000Z | 2018-01-12T03:27:19.000Z | CCTimePicker/UIView+CCUtil.h | MrDML/CCTimePickerDemo | 40a218b8a655935e7e951c1161880939ff525b14 | [
"MIT"
] | 18 | 2017-09-18T06:44:03.000Z | 2021-09-26T14:29:43.000Z | //
// UIView+CCUtil.h
// CCTimePickerDemo
//
// Created by eHome on 17/3/31.
// Copyright © 2017年 Bref. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (CCUtil)
+ (instancetype)viewFromXib;
@end
| 13.8125 | 48 | 0.674208 |
e163b96d1a777a4ca323a62216c18c25a81c434b | 2,397 | swift | Swift | DynamicRegistration/RegistrationViewModel.swift | allbto/iOS-DynamicRegistration | fc2ccab1f5b2bbbbcdce5ff3abd97806a9accbcb | [
"MIT"
] | 3 | 2016-02-12T14:12:39.000Z | 2017-01-29T06:21:51.000Z | DynamicRegistration/RegistrationViewModel.swift | allbto/iOS-DynamicRegistration | fc2ccab1f5b2bbbbcdce5ff3abd97806a9accbcb | [
"MIT"
] | null | null | null | DynamicRegistration/RegistrationViewModel.swift | allbto/iOS-DynamicRegistration | fc2ccab1f5b2bbbbcdce5ff3abd97806a9accbcb | [
"MIT"
] | null | null | null | //
// RegistrationViewModel.swift
// ReactiveRegistration
//
// Allan Barbato on 09.02.16.
// Copyright © 2016 Allan Barbato. All rights reserved.
//
import Swiftility
struct RegistrationForm
{
var email = String()
var password = String()
var passwordAgain = String()
var isEmailValid: Bool {
return email.isValidEmail()
}
var isPasswordValid: Bool {
return (password.characters.count > 5) && (password == passwordAgain)
}
}
struct CreditCard
{
enum Status {
case NotVerified
case Verifying
case Verified
case Denied
}
var useCard = true
var status: Status = .NotVerified
var number = String() {
didSet {
if status == .Verified {
status = .NotVerified
}
}
}
var isValid: Bool {
return !useCard || status == .Verified
}
}
class RegistrationViewModel
{
// MARK: - Dynamic
var form = Dynamic(RegistrationForm()) {
didSet { _checkCorrectInput() }
}
var creditCard = Dynamic(CreditCard()) {
didSet { _checkCorrectInput() }
}
var correctEmail = Dynamic<Bool>(false)
var correctPassword = Dynamic<Bool>(false)
var correctCreditCard = Dynamic<Bool>(false)
var correctInput = Dynamic<Bool>(false)
// MARK: - Actions
func verifyCardNumber()
{
creditCard.value.status = .Verifying
FakeAPIService.sharedInstance.validateCreditCardNumber(creditCard.value.number)
.then { valid -> Void in
self.creditCard.value.status = valid ? .Verified : .Denied
}
}
// MARK: - View Models
func createSummaryViewModel() -> SummaryViewModel
{
let summaryViewModel = SummaryViewModel()
summaryViewModel.email = form.value.email
summaryViewModel.creditCardNumber = creditCard.value.useCard ? creditCard.value.number : nil
return summaryViewModel
}
// MARK: - Private
private func _checkCorrectInput()
{
correctEmail.value = form.value.isEmailValid
correctPassword.value = form.value.isPasswordValid
correctCreditCard.value = creditCard.value.isValid
correctInput.value = correctEmail.value && correctPassword.value && correctCreditCard.value
}
}
| 23.271845 | 100 | 0.610346 |
477698ec6de2b648fd3c4ebb7db80f1a789ec228 | 826 | html | HTML | client/angular-commerce/src/app/demoangular/demoangular.component.html | PANCnnss/MEANCapOrig | 4e89ec653c93b443b332bc904bc8529a1b18edf6 | [
"MIT"
] | 1 | 2021-08-28T04:32:44.000Z | 2021-08-28T04:32:44.000Z | client/angular-commerce/src/app/demoangular/demoangular.component.html | EffrenAnthony/MEANCap | f624d7278682ccd7617bc742a83f652a5ef7d557 | [
"MIT"
] | null | null | null | client/angular-commerce/src/app/demoangular/demoangular.component.html | EffrenAnthony/MEANCap | f624d7278682ccd7617bc742a83f652a5ef7d557 | [
"MIT"
] | null | null | null | <p>Hola {{title}}</p>
<input type="text" [(ngModel)]="nuevoNombre">
<button type="button" (click)='addPerson()'>Agregar nuevo</button>
<div [ngSwitch]='nuevoNombre'>
<p *ngSwitchCase="'Pedro'">el es Pedro</p>
<p *ngSwitchCase="'Gricel'">ella es Gricel</p>
<p *ngSwitchCase="'Carlos'">el es Carlos</p>
<p *ngSwitchDefault>no te conozco</p>
</div>
<p>{{nuevoNombre}}</p>
<ul>
<li *ngIf='listNombres.length === 0'>la lista está vacía</li>
<li *ngFor="let nombre of listNombres; index as indice">
<!-- {{nombre | uppercase}} {{indice}} -->
<!-- {{nombre | slice: 4: 10}} {{indice | currency: 'S/.'}} -->
{{nombre | slice: 4: 10}} {{indice | currency: 'S/.'}} {{time | date: 'HH'}}
<button (click)="deleteItem(indice)">Delete</button>
</li>
</ul>
<button (click)="hacerClick()">Presioname</button>
| 34.416667 | 80 | 0.606538 |
5c7a3805a90118da849d790d4fd285021514ce33 | 160 | css | CSS | wwwroot/css/AdicionarPedido.css | joaomlfa/doceglamourcore | bd8aaac619956c258c6fe72c26d48d5781e88109 | [
"MIT"
] | null | null | null | wwwroot/css/AdicionarPedido.css | joaomlfa/doceglamourcore | bd8aaac619956c258c6fe72c26d48d5781e88109 | [
"MIT"
] | 1 | 2020-06-01T00:25:00.000Z | 2020-06-01T00:25:00.000Z | wwwroot/css/AdicionarPedido.css | joaomlfa/doceglamourcore | bd8aaac619956c258c6fe72c26d48d5781e88109 | [
"MIT"
] | 2 | 2020-05-31T17:54:32.000Z | 2020-08-03T00:10:02.000Z | #buscarCliente {
padding-top: 40px;
padding-left: 0;
}
main {
}
#quantidade {
margin-top: 32px;
}
#AdicionarProduto {
margin-top: 32px;
}
| 8.888889 | 22 | 0.59375 |
3e9faa9bc1f054b1e720fa736fe410b89ada98d9 | 2,681 | h | C | C Plus Plus/Graph/Graph/Vertex.h | felixsoum/Data-Structure-and-Algorithm | 4e8e70e3e1f844bd8cbcf7f37af43c496fbf4587 | [
"MIT"
] | 3 | 2019-05-10T00:47:52.000Z | 2020-10-26T05:16:05.000Z | C Plus Plus/Graph/Graph/Vertex.h | felixsoum/Data-Structure-and-Algorithm | 4e8e70e3e1f844bd8cbcf7f37af43c496fbf4587 | [
"MIT"
] | null | null | null | C Plus Plus/Graph/Graph/Vertex.h | felixsoum/Data-Structure-and-Algorithm | 4e8e70e3e1f844bd8cbcf7f37af43c496fbf4587 | [
"MIT"
] | 1 | 2020-11-18T00:46:06.000Z | 2020-11-18T00:46:06.000Z | /*
* Author: Alexandre Lepage
* Date: March 2020
*/
#ifndef VERTEX
#define VERTEX
#include <limits.h>
#include <iostream>
/// <summary>
/// Enumerator class color
/// </summary>
enum class Color
{
White,
Grey,
Black
};
/// <summary>
/// overload of the left shift operator for the Color enumerator color
/// </summary>
/// <param name="os">output stream</param>
/// <param name="e">enumerator</param>
/// <returns>color</returns>
std::ostream& operator<<(std::ostream& os, const Color& e)
{
// write obj to stream
switch (e)
{
default:
break;
case Color::White:
return os << "White";
break;
case Color::Grey:
return os << "Grey";
break;
case Color::Black:
return os << "Black";
break;
}
return os;
}
/// <summary>
/// Custom vertex class
/// </summary>
class Vertex
{
public:
unsigned int key; // The number of the vertex
int distance; // How far from the source this vertex is
int discoveryTime; // For DFS, set when the vertex is discovered
int finishingTime; // For DFS, set when the vertex is used
Vertex* predecessor; // The vertex preceding this one
Color color; // The color of this key
Vertex(int key);
/// <summary>
/// Overloading the equal operator
/// compares the vertices' key
/// </summary>
bool operator==(const Vertex& a) const {
return this->key == a.key;
};
/// <summary>
/// overload of the left shift operator for vertex
/// </summary>
/// <param name="os">output stream</param>
/// <param name="e">vertex</param>
/// <returns>vertex key</returns>
friend std::ostream& operator<<(std::ostream& os, const Vertex& v)
{
return os << v.key;// << ':' << v.color;
}
/// <summary>
/// overload of the left shift operator for vertex pointer
/// </summary>
/// <param name="os">output stream</param>
/// <param name="e">vertex</param>
/// <returns>vertex key</returns>
friend std::ostream& operator<<(std::ostream& os, const Vertex* v)
{
return os << v->key;// << ':' << v->color;
}
};
/// <summary>
/// Class constructor
/// -----PSEUDO CODE-----
/// (V is the vertex, key is the number of the vertex)
/// Vertex(V,key)
/// V.key = key
/// V.distance = Infinity
/// V.predecessor = NIL
/// V.color = WHITE
/// -----PSEUDO CODE-----
/// </summary>
/// <param name="key"></param>
Vertex::Vertex(int key) {
this->key = key;
this->distance = INT_MAX;
this->predecessor = nullptr;
this->color = Color::White;
this->discoveryTime = -1;
this->finishingTime = -1;
}
/// <summary>
/// Comparer used for std::priority_queue
/// </summary>
class VertexCompareMax
{
public:
bool operator()(const Vertex* a, const Vertex* b) {
return a->distance > b->distance;
}
};
#endif // !VERTEX
| 20.945313 | 70 | 0.633346 |
cb321cfe2769949a908a84380d97d6bb7f9f388d | 673 | go | Go | go/vt/vtgate/planbuilder/filter.go | guokeno0/vitess | 2228de2d8f0c5032c5a53277abf5515ae9fc38a1 | [
"BSD-3-Clause"
] | null | null | null | go/vt/vtgate/planbuilder/filter.go | guokeno0/vitess | 2228de2d8f0c5032c5a53277abf5515ae9fc38a1 | [
"BSD-3-Clause"
] | null | null | null | go/vt/vtgate/planbuilder/filter.go | guokeno0/vitess | 2228de2d8f0c5032c5a53277abf5515ae9fc38a1 | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2016, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package planbuilder
import "github.com/youtube/vitess/go/vt/sqlparser"
// splitAndExpression breaks up the BoolExpr into AND-separated conditions
// and appends them to filters, which can be shuffled and recombined
// as needed.
func splitAndExpression(filters []sqlparser.BoolExpr, node sqlparser.BoolExpr) []sqlparser.BoolExpr {
if node, ok := node.(*sqlparser.AndExpr); ok {
filters = splitAndExpression(filters, node.Left)
return splitAndExpression(filters, node.Right)
}
return append(filters, node)
}
| 35.421053 | 101 | 0.768202 |
a5b20420eaea481560b95d60de01dfe8c7e3dc1e | 9,632 | kt | Kotlin | jvm/src/main/kotlin/org/ionproject/core/common/Uri.kt | i-on-project/core | 339407d56e66ec164ecdc4172347272d97cc26b3 | [
"Apache-2.0"
] | 7 | 2020-02-24T14:20:55.000Z | 2021-03-13T17:59:37.000Z | jvm/src/main/kotlin/org/ionproject/core/common/Uri.kt | i-on-project/core | 339407d56e66ec164ecdc4172347272d97cc26b3 | [
"Apache-2.0"
] | 201 | 2020-02-22T16:11:44.000Z | 2022-02-28T01:49:15.000Z | jvm/src/main/kotlin/org/ionproject/core/common/Uri.kt | i-on-project/core | 339407d56e66ec164ecdc4172347272d97cc26b3 | [
"Apache-2.0"
] | 1 | 2021-03-15T14:59:29.000Z | 2021-03-15T14:59:29.000Z | package org.ionproject.core.common
import org.ionproject.core.search.model.SearchQuery
import org.springframework.web.util.UriTemplate
import java.net.URI
object Uri {
private const val DEFAULT_BASE_URL = "http://localhost:8080"
val baseUrl = System.getenv("ION_CORE_BASE_URL")
?: DEFAULT_BASE_URL
const val error = "/error"
const val apiBase = "/api"
const val rfcPagingQuery = "{?page,limit}"
const val springWebPagingQuery = "?page={page}&limit={limit}"
// Ingestion
const val ingestionWebhook = "$apiBase/ingestion"
// Calendar Terms
const val calendarTerms = "$apiBase/calendar-terms"
const val calendarTermById = "$apiBase/calendar-terms/{calterm}"
val calendarTermByIdTemplate = UriTemplate("$baseUrl$calendarTermById")
val pagingCalendarTerms = UriTemplate("$baseUrl${calendarTerms}$rfcPagingQuery")
val pagingCalendarTermById = UriTemplate("$baseUrl${calendarTermById}$rfcPagingQuery")
fun forCalTerms() = URI("$baseUrl$calendarTerms")
fun forCalTermById(calterm: String) = calendarTermByIdTemplate.expand(calterm)
fun forPagingCalTerms(page: Int, limit: Int) =
UriTemplate("$baseUrl${calendarTerms}$springWebPagingQuery").expand(page, limit)
fun forPagingCalTermById(calterm: String, page: Int, limit: Int) =
UriTemplate("$baseUrl${calendarTermById}$springWebPagingQuery").expand(calterm, page, limit)
// Courses
const val courses = "$apiBase/courses"
const val courseById = "$apiBase/courses/{cid}"
val courseByIdTemplate = UriTemplate("$baseUrl$courseById")
val pagingCourses = UriTemplate("$baseUrl${courses}$rfcPagingQuery")
fun forCourses() = URI("$baseUrl$courses")
fun forCourseById(courseId: Int) = courseByIdTemplate.expand(courseId)
fun forPagingCourses(page: Int, limit: Int) =
UriTemplate("$baseUrl${courses}$springWebPagingQuery").expand(page, limit)
// Programmes
const val programmes = "$apiBase/programmes"
const val programmesById = "$apiBase/programmes/{id}"
const val programmeOfferById = "$apiBase/programmes/{idProgramme}/offers/{idOffer}"
const val programmeByIdOffer = "$apiBase/programmes/{id}/offers"
val programmesByIdTemplate = UriTemplate("$baseUrl$programmesById")
val programmeOfferByIdTemplate = UriTemplate("$baseUrl$programmeOfferById")
val pagingProgrammes = UriTemplate("$baseUrl${programmes}$rfcPagingQuery")
fun forProgrammes() =
URI("$baseUrl$programmes")
fun forPagingProgrammes(page: Int, limit: Int) =
UriTemplate("$baseUrl${programmes}$springWebPagingQuery").expand(page, limit)
fun forProgrammesById(id: Int) =
programmesByIdTemplate.expand(id)
fun forProgrammeOfferById(idProgramme: Int, idOffer: Int) =
programmeOfferByIdTemplate.expand(idProgramme, idOffer)
fun forOffers(id: Int) =
UriTemplate("$baseUrl$programmeByIdOffer").expand(id)
fun forPagingOffers(id: Int, page: Int, limit: Int) =
UriTemplate("$baseUrl${programmeByIdOffer}$springWebPagingQuery").expand(id, page, limit)
// Classes
const val klasses = "$apiBase/courses/{cid}/classes"
const val klassByCalTerm = "$apiBase/courses/{cid}/classes/{calterm}"
val klassesTemplate = UriTemplate("$baseUrl$klasses")
val klassByCalTermTemplate = UriTemplate("$baseUrl$klassByCalTerm")
val pagingKlassesTemplate = UriTemplate("$baseUrl${klasses}$rfcPagingQuery")
fun forKlasses(cid: Int) = klassesTemplate.expand(cid)
fun forKlassByCalTerm(cid: Int, calterm: String) = klassByCalTermTemplate.expand(cid, calterm)
fun forPagingKlass(cid: Int, page: Int, limit: Int) =
UriTemplate("$baseUrl${klasses}$springWebPagingQuery").expand(cid, page, limit)
// Class Sections
const val classSectionById = "$apiBase/courses/{cid}/classes/{calterm}/{sid}"
val classSectionByIdTemplate = UriTemplate("$baseUrl$classSectionById")
fun forClassSectionById(cid: Int, calterm: String, sid: String) =
classSectionByIdTemplate.expand(cid, calterm, sid)
// Calendars
const val calendarByClass = "$apiBase/courses/{cid}/classes/{calterm}/calendar"
const val calendarByClassSection = "$apiBase/courses/{cid}/classes/{calterm}/{sid}/calendar"
const val componentByClassCalendar = "$apiBase/courses/{cid}/classes/{calterm}/calendar/{cmpid}"
const val componentByClassSectionCalendar = "$apiBase/courses/{cid}/classes/{calterm}/{sid}/calendar/{cmpid}"
val calendarByClassTemplate =
UriTemplate("$baseUrl$calendarByClass")
val calendarByClassSectionTemplate =
UriTemplate("$baseUrl$calendarByClassSection")
val componentByClassCalendarTemplate =
UriTemplate("$baseUrl$componentByClassCalendar")
val componentByClassSectionCalendarTemplate =
UriTemplate("$baseUrl$componentByClassSectionCalendar")
fun forCalendarByClass(cid: Int, calterm: String) =
calendarByClassTemplate.expand(cid, calterm)
fun forCalendarByClassSection(cid: Int, calterm: String, sid: String) =
calendarByClassSectionTemplate.expand(cid, calterm, sid)
fun forCalendarComponentByClass(cid: Int, calterm: String, cmpid: String) =
componentByClassCalendarTemplate.expand(cid, calterm, cmpid)
fun forCalendarComponentByClassSection(cid: Int, calterm: String, sid: String, cmpid: String) =
componentByClassSectionCalendarTemplate.expand(cid, calterm, sid, cmpid)
// Access Control
const val revokeToken = "$apiBase/revokeToken"
const val issueToken = "$apiBase/issueToken"
const val importClassCalendar = "$apiBase/import/courses/{cid}/classes/{calterm}/calendar"
const val importClassSectionCalendar = "$apiBase/import/courses/{cid}/classes/{calterm}/{sid}/calendar"
val revokeTokenUri = URI("$baseUrl$revokeToken")
val importClassCalendarTemplate =
UriTemplate("$baseUrl$importClassCalendar")
val importClassSectionCalendarTemplate =
UriTemplate("$baseUrl$importClassSectionCalendar")
fun forImportClassCalendar(cid: Int, calterm: String) =
importClassCalendarTemplate.expand(cid, calterm)
fun forImportClassSectionCalendar(cid: Int, calterm: String, sid: String) =
importClassSectionCalendarTemplate.expand(cid, calterm, sid)
// Search
const val search = "$apiBase/search"
val searchTemplate =
UriTemplate("$baseUrl$search?query={query}&types={types}&limit={limit}&page={page}")
val pagingSearch =
UriTemplate("$baseUrl$search{?query,types,limit,page}")
fun forSearch(query: SearchQuery): URI =
searchTemplate.expand(query.query, query.types.joinToString(","), query.limit, query.page)
// User Authentication
private const val authBase = "$apiBase/auth"
const val authMethods = "$authBase/methods"
const val authRequest = "$authBase/request/{reqId}"
const val authVerify = "$authBase/verify"
const val authBackchannel = "$authBase/backchannel"
const val authToken = "$authBase/token"
const val authRevokeToken = "$authBase/revoke"
val authVerifyUri = URI("$baseUrl$authVerify")
fun forAuthBackChannel() =
URI(authBackchannel)
fun forAuthVerify() =
URI(authVerify)
fun forAuthToken() =
URI(authToken)
fun forTokenRevoke() =
URI(authRevokeToken)
fun forAuthVerifyFrontend(reqId: String, secret: String) =
UriTemplate("$baseUrl/auth/request/{reqId}/verify?secret={secret}").expand(reqId, secret)
// User API
const val userBase = "$apiBase/users"
const val userClasses = "$userBase/classes"
const val userSections = "$userBase/sections"
const val userClass = "$userClasses/{classId}"
const val userClassSection = "$userClasses/{classId}/{sectionId}"
private const val actionsBase = "$userBase/actions"
const val userClassActions = "$actionsBase/classes/{classId}"
const val userClassSectionActions = "$userClassActions/{sectionId}"
val userTemplate = UriTemplate("$baseUrl$userBase")
fun forUser(userId: String) =
userTemplate.expand(userId)
fun forUserClasses() =
URI("$baseUrl$userClasses")
fun forUserSections() =
URI("$baseUrl$userSections")
fun forPagingUserClasses(page: Int, limit: Int) =
UriTemplate("$baseUrl$userClasses$springWebPagingQuery").expand(page, limit)
fun forPagingUserClassSections(page: Int, limit: Int) =
UriTemplate("$baseUrl$userSections$springWebPagingQuery").expand(page, limit)
fun forUserClass(classId: Int) =
UriTemplate("$baseUrl$userClass").expand(classId)
fun forUserClassSection(classId: Int, sectionId: String) =
UriTemplate("$baseUrl$userClassSection").expand(classId, sectionId)
fun forUserClassActions(classId: Int) =
UriTemplate("$baseUrl$userClassActions").expand(classId)
fun forUserClassSectionActions(classId: Int, sectionId: String) =
UriTemplate("$baseUrl$userClassSectionActions").expand(classId, sectionId)
// custom link rel
const val relClass = "/rel/class"
const val relClassSection = "/rel/classSection"
const val relProgrammeOffer = "/rel/programmeOffer"
const val relCourse = "/rel/course"
const val relCalendar = "/rel/calendar"
const val relProgramme = "/rel/programme"
const val relProgrammes = "/rel/programmes"
const val relOffers = "/rel/offers"
const val relUserClassSections = "/rel/userSections"
const val relUserClassActions = "/rel/userClassActions"
const val relUserClassSectionActions = "/rel/userClassSectionActions"
}
| 39.63786 | 113 | 0.7201 |
408a418b0aa079bf2f133b522eb5c3ea7c6a6495 | 3,136 | py | Python | Test.py | kaifamiao/geSinaStockData | 417f81b45eca1bd0ce42d1218218feb82895ba7a | [
"Apache-2.0"
] | null | null | null | Test.py | kaifamiao/geSinaStockData | 417f81b45eca1bd0ce42d1218218feb82895ba7a | [
"Apache-2.0"
] | null | null | null | Test.py | kaifamiao/geSinaStockData | 417f81b45eca1bd0ce42d1218218feb82895ba7a | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import urllib.request
import re
import pandas as pd
import pymysql
import time
def sinaStockUrl(pageNum):
print('pageNum : ' + str(pageNum))
rows = 10
url = 'http://vip.stock.finance.sina.com.cn/quotes_service/api/json_v2.php/Market_Center.getHQNodeData?'
url += 'page=' + str(pageNum)
url += '&num=' + str(rows)
url += '&sort=symbol&asc=1&node=hs_a&symbol=&_s_r_a=init'
print(url)
return url
def sinaStockData(url):
# http://www.cnblogs.com/sysu-blackbear/p/3629420.html
stockDataResponse = urllib.request.urlopen(url)
stockData = stockDataResponse.read()
# stockData = stockDataResponse.decode('utf8')
# stockData = stockData.decode('gbk')
stockData = stockData.decode('gb2312')
print(stockData)
return stockData
# 在地址里symbol指的是股票代码,这里需要注意的是不能只填数字代码,还需要把交易市场的前缀加上去,比如sz000001指的是平安银行,
# 而sh000001则是上证指数;
# scale表示的是时间长度,以分钟为基本单位,输入240就表示下载日K线数据,
# 60就是小时K线数据,貌似最短时间是5分钟,并没有提供分钟数据;
# datalen则是获取数据的条数,在日K线的时间长度了,
# datalen就是获取60天日K数据,当然也可以获取60小时K数据。
#sinaStockData((sinaStockUrl(240)))
url ="https://money.finance.sina.com.cn/quotes_service/api/jsonp_v2.php/var=/CN_MarketData.getKLineData?symbol=sz000001&scale=15&ma=no&datalen=10"
page = urllib.request.urlopen(url)
html = page.read()
html = html.decode("gbk")
print("原始字符","="*50)
# print(html)
tmpHtml =html[html.index("var=(")+len("var=("):]
final_html =tmpHtml[:len(tmpHtml)-2]
final_html=eval(final_html)
print("原始字符",type(final_html))
print(final_html)
df = pd.DataFrame(final_html)
print("df=================================================================df====================================================================df")
print(df)
print("df=================================================================df====================================================================df")
# print(df)
# print("datalist...........................................................datalist................................................................datalist")
# # print(final_html)
# for i in range(len(final_html)):
# all_item = final_html[i].split(',')
# print(all_item)
print("=getdata===============================================================================================================================")
def getdata(code,scale,datalen):
links = 'http://money.finance.sina.com.cn/quotes_service/api/jsonp_v2.php/var=/CN_MarketData.getKLineData?symbol=' + code + '&scale=' + str(scale) + '&ma=no&datalen='+str(datalen)
histData = urllib.request.urlopen(links).read()
histData = str(histData).split('[')[1]
histData = histData[1:len(histData) - 4].split('},{')
datas = []
for i in range(0, len(histData)):
column = {}
dayData = histData[i].split(',')
for j in range(0, len(dayData)):
field = dayData[j].split(':"')
if field[0] == 'day':
column['date'] = field[1].replace('"', '')
else:
column[field[0]] = field[1].replace('"', '')
datas.append(column)
return datas
dfata = getdata("sz000001",15,10)
print(dfata)
df = pd.DataFrame(dfata)
print(df) | 33.72043 | 183 | 0.563776 |
b3ac8792e71f653aff11fffb3d2473c15e281a12 | 1,624 | rb | Ruby | cookbooks/ssh/recipes/default.rb | digilist/my-server-chef | 08bb8b8acd0962e0d4912a9df78d38558cdd5b44 | [
"MIT"
] | null | null | null | cookbooks/ssh/recipes/default.rb | digilist/my-server-chef | 08bb8b8acd0962e0d4912a9df78d38558cdd5b44 | [
"MIT"
] | null | null | null | cookbooks/ssh/recipes/default.rb | digilist/my-server-chef | 08bb8b8acd0962e0d4912a9df78d38558cdd5b44 | [
"MIT"
] | null | null | null | #
# Cookbook Name:: ssh
# Recipe:: default
#
# Copyright 2013, Markus Fasselt
#
# 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 "openssh-server"
service "ssh" do
supports [:start, :stop, :restart]
provider Chef::Provider::Service::Upstart
action :nothing
end
users = node[:users].keys
users << 'root'
users << 'vagrant' if File.exists? '/vagrant' # if this is a vagrant box
template 'sshd_config' do
path "#{node[:ssh][:conf_dir]}/sshd_config"
mode 0600
variables :users => users
notifies :restart, resources(:service => 'ssh')
end
firewall_rule 'ssh' do
port 22
action :allow
end
| 32.48 | 72 | 0.748768 |
d5c50d9caf7f65d50e42174496dfc211ae8ac3a6 | 425 | c | C | hw/xfree86/vgahw/vgaHWmodule.c | larsclausen/xglamo | 4176d6fdc061553b8366c20890635a464fe7fee2 | [
"X11"
] | 2 | 2016-05-08T18:39:05.000Z | 2018-11-01T06:58:35.000Z | hw/xfree86/vgahw/vgaHWmodule.c | larsclausen/xglamo | 4176d6fdc061553b8366c20890635a464fe7fee2 | [
"X11"
] | null | null | null | hw/xfree86/vgahw/vgaHWmodule.c | larsclausen/xglamo | 4176d6fdc061553b8366c20890635a464fe7fee2 | [
"X11"
] | 1 | 2021-12-05T20:56:48.000Z | 2021-12-05T20:56:48.000Z | /*
* Copyright 1998 by The XFree86 Project, Inc
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "xf86Module.h"
static XF86ModuleVersionInfo VersRec = {
"vgahw",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
0, 1, 0,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
MOD_CLASS_NONE,
{0, 0, 0, 0}
};
_X_EXPORT XF86ModuleData vgahwModuleData = { &VersRec, NULL, NULL };
| 17 | 68 | 0.743529 |
2e2514178dfe8923840f615b5326fd56fe108c41 | 4,786 | sql | SQL | SE228_Web Development/The third iteration/mystore.sql | jiayangchen/SJTU_courses | 14b165c454feaaca5691c97f227946159d1cda24 | [
"MIT"
] | null | null | null | SE228_Web Development/The third iteration/mystore.sql | jiayangchen/SJTU_courses | 14b165c454feaaca5691c97f227946159d1cda24 | [
"MIT"
] | null | null | null | SE228_Web Development/The third iteration/mystore.sql | jiayangchen/SJTU_courses | 14b165c454feaaca5691c97f227946159d1cda24 | [
"MIT"
] | null | null | null | /*
Navicat MySQL Data Transfer
Source Server : ChenJiayang
Source Server Version : 50505
Source Host : localhost:3306
Source Database : mystore
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2016-06-14 19:06:44
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `administrator`
-- ----------------------------
DROP TABLE IF EXISTS `administrator`;
CREATE TABLE `administrator` (
`id` int(11) NOT NULL,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of administrator
-- ----------------------------
INSERT INTO `administrator` VALUES ('1', '5140379036', 'root');
-- ----------------------------
-- Table structure for `book`
-- ----------------------------
DROP TABLE IF EXISTS `book`;
CREATE TABLE `book` (
`BookID` int(11) NOT NULL,
`BookName` varchar(255) DEFAULT NULL,
`Author` varchar(255) DEFAULT NULL,
`Category` varchar(255) DEFAULT NULL,
`Price` double DEFAULT NULL,
`Quantity` int(11) DEFAULT NULL,
PRIMARY KEY (`BookID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of book
-- ----------------------------
INSERT INTO `book` VALUES ('1', 'Readers', 'NULL', 'Literature', '4', '10');
INSERT INTO `book` VALUES ('2', 'MarsTask', 'Lisa', 'Fiction', '56', '20');
INSERT INTO `book` VALUES ('4', 'Internet+', 'Yang', 'Science', '25', '30');
INSERT INTO `book` VALUES ('5', 'DB', 'Kan', 'IT', '108', '20');
INSERT INTO `book` VALUES ('6', 'CSAPP', 'Byrant', 'IT', '100', '10');
-- ----------------------------
-- Table structure for `myorder`
-- ----------------------------
DROP TABLE IF EXISTS `myorder`;
CREATE TABLE `myorder` (
`OrderID` int(11) NOT NULL AUTO_INCREMENT,
`BookID` int(11) DEFAULT NULL,
`UserID` int(11) DEFAULT NULL,
`Amount` int(11) DEFAULT NULL,
`Date` date DEFAULT NULL,
PRIMARY KEY (`OrderID`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of myorder
-- ----------------------------
INSERT INTO `myorder` VALUES ('9', '1', '2', '1', '2016-06-10');
INSERT INTO `myorder` VALUES ('10', '1', '2', '1', '2016-06-10');
INSERT INTO `myorder` VALUES ('11', '1', '2', '1', '2016-06-10');
INSERT INTO `myorder` VALUES ('12', '1', '2', '1', '2016-06-10');
INSERT INTO `myorder` VALUES ('13', '1', '2', '1', '2016-06-11');
INSERT INTO `myorder` VALUES ('14', '1', '2', '1', '2016-06-11');
INSERT INTO `myorder` VALUES ('15', '6', '2', '1', '2016-06-11');
INSERT INTO `myorder` VALUES ('16', '1', '2', '1', '2016-06-11');
INSERT INTO `myorder` VALUES ('17', '1', '4', '2', '2016-06-12');
INSERT INTO `myorder` VALUES ('18', '2', '4', '1', '2016-06-12');
INSERT INTO `myorder` VALUES ('19', '4', '4', '1', '2016-06-12');
-- ----------------------------
-- Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('2', '5140379040', 'cao');
INSERT INTO `user` VALUES ('3', '5140379030', 'hanyikai');
INSERT INTO `user` VALUES ('4', 'Eason', '123');
-- ----------------------------
-- Function structure for `fn_category`
-- ----------------------------
DROP FUNCTION IF EXISTS `fn_category`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `fn_category`(`bid` int) RETURNS int(100)
BEGIN
#Routine body goes here...
SELECT Category into @cate FROM book where BookID = bid;
RETURN @cate;
END
;;
DELIMITER ;
-- ----------------------------
-- Function structure for `fn_order`
-- ----------------------------
DROP FUNCTION IF EXISTS `fn_order`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `fn_order`(`bid` int) RETURNS int(100)
BEGIN
#Routine body goes here...
SELECT count(*) INTO @result from myorder WHERE BookID = bid;
RETURN @result;
END
;;
DELIMITER ;
-- ----------------------------
-- Function structure for `fn_users`
-- ----------------------------
DROP FUNCTION IF EXISTS `fn_users`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `fn_users`(`userid` int) RETURNS int(100)
BEGIN
#Routine body goes here...
SELECT count(*) INTO @result FROM myorder where UserID = userid;
RETURN @result;
END
;;
DELIMITER ;
DROP TRIGGER IF EXISTS `updateStock`;
DELIMITER ;;
CREATE TRIGGER `updateStock` AFTER INSERT ON `myorder` FOR EACH ROW begin
update book
set Quantity = Quantity - new.Amount where BookID = new.BookID;
end
;;
DELIMITER ;
| 31.486842 | 84 | 0.571249 |
b99d5a9bddebb95e954406a8e8d15ee1eb8cd178 | 3,338 | c | C | kubernetes/model/io_k8s_api_node_v1_overhead.c | zouxiaoliang/nerv-kubernetes-client-c | 07528948c643270fd757d38edc68da8c9628ee7a | [
"Apache-2.0"
] | null | null | null | kubernetes/model/io_k8s_api_node_v1_overhead.c | zouxiaoliang/nerv-kubernetes-client-c | 07528948c643270fd757d38edc68da8c9628ee7a | [
"Apache-2.0"
] | null | null | null | kubernetes/model/io_k8s_api_node_v1_overhead.c | zouxiaoliang/nerv-kubernetes-client-c | 07528948c643270fd757d38edc68da8c9628ee7a | [
"Apache-2.0"
] | null | null | null | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "io_k8s_api_node_v1_overhead.h"
io_k8s_api_node_v1_overhead_t *io_k8s_api_node_v1_overhead_create(
list_t* pod_fixed
) {
io_k8s_api_node_v1_overhead_t *io_k8s_api_node_v1_overhead_local_var = malloc(sizeof(io_k8s_api_node_v1_overhead_t));
if (!io_k8s_api_node_v1_overhead_local_var) {
return NULL;
}
io_k8s_api_node_v1_overhead_local_var->pod_fixed = pod_fixed;
return io_k8s_api_node_v1_overhead_local_var;
}
void io_k8s_api_node_v1_overhead_free(io_k8s_api_node_v1_overhead_t *io_k8s_api_node_v1_overhead) {
if(NULL == io_k8s_api_node_v1_overhead){
return ;
}
listEntry_t *listEntry;
if (io_k8s_api_node_v1_overhead->pod_fixed) {
list_ForEach(listEntry, io_k8s_api_node_v1_overhead->pod_fixed) {
keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data;
free (localKeyValue->key);
free (localKeyValue->value);
keyValuePair_free(localKeyValue);
}
list_free(io_k8s_api_node_v1_overhead->pod_fixed);
io_k8s_api_node_v1_overhead->pod_fixed = NULL;
}
free(io_k8s_api_node_v1_overhead);
}
cJSON *io_k8s_api_node_v1_overhead_convertToJSON(io_k8s_api_node_v1_overhead_t *io_k8s_api_node_v1_overhead) {
cJSON *item = cJSON_CreateObject();
// io_k8s_api_node_v1_overhead->pod_fixed
if(io_k8s_api_node_v1_overhead->pod_fixed) {
cJSON *pod_fixed = cJSON_AddObjectToObject(item, "podFixed");
if(pod_fixed == NULL) {
goto fail; //primitive map container
}
cJSON *localMapObject = pod_fixed;
listEntry_t *pod_fixedListEntry;
if (io_k8s_api_node_v1_overhead->pod_fixed) {
list_ForEach(pod_fixedListEntry, io_k8s_api_node_v1_overhead->pod_fixed) {
keyValuePair_t *localKeyValue = (keyValuePair_t*)pod_fixedListEntry->data;
if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL)
{
goto fail;
}
}
}
}
return item;
fail:
if (item) {
cJSON_Delete(item);
}
return NULL;
}
io_k8s_api_node_v1_overhead_t *io_k8s_api_node_v1_overhead_parseFromJSON(cJSON *io_k8s_api_node_v1_overheadJSON){
io_k8s_api_node_v1_overhead_t *io_k8s_api_node_v1_overhead_local_var = NULL;
// io_k8s_api_node_v1_overhead->pod_fixed
cJSON *pod_fixed = cJSON_GetObjectItemCaseSensitive(io_k8s_api_node_v1_overheadJSON, "podFixed");
list_t *pod_fixedList;
if (pod_fixed) {
cJSON *pod_fixed_local_map;
if(!cJSON_IsObject(pod_fixed)) {
goto end;//primitive map container
}
pod_fixedList = list_create();
keyValuePair_t *localMapKeyPair;
cJSON_ArrayForEach(pod_fixed_local_map, pod_fixed)
{
cJSON *localMapObject = pod_fixed_local_map;
if(!cJSON_IsString(localMapObject))
{
goto end;
}
localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring));
list_addElement(pod_fixedList , localMapKeyPair);
}
}
io_k8s_api_node_v1_overhead_local_var = io_k8s_api_node_v1_overhead_create (
pod_fixed ? pod_fixedList : NULL
);
return io_k8s_api_node_v1_overhead_local_var;
end:
return NULL;
}
| 31.790476 | 121 | 0.723787 |
1e2967899a91834411d60faac37c146f869f4266 | 6,333 | swift | Swift | Hoppla/HopplaSummaryBoard.swift | orucrob/Hoppla | 7fff3596940b400ef633d9872e556cd64aeeea45 | [
"MIT"
] | null | null | null | Hoppla/HopplaSummaryBoard.swift | orucrob/Hoppla | 7fff3596940b400ef633d9872e556cd64aeeea45 | [
"MIT"
] | 1 | 2015-01-21T12:59:40.000Z | 2015-02-16T14:15:30.000Z | Hoppla/HopplaSummaryBoard.swift | orucrob/Hoppla | 7fff3596940b400ef633d9872e556cd64aeeea45 | [
"MIT"
] | null | null | null | /*
The MIT License (MIT)
Copyright (c) 2015 Rob
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.
*/
import Foundation
import UIKit
class HopplaSummaryBoard: UIView {
enum Mode{
case NORMAL, DETAIL
}
var titleLabel : UILabel?{
didSet{
oldValue?.removeFromSuperview()
if let t = titleLabel{
addSubview(t)
bringSubviewToFront(t)
layoutTitle(skipSizing: false, forMode: mode)
}
}
}
/// duration for animation between modes
@IBInspectable var animationDuration = 0.3
///board
var board: HopplaBoard?{
didSet{
oldValue?.removeFromSuperview()
if let b = board{
addSubview(b)
b.frame = bounds
bringSubviewToFront(b)
}
}
}
///title
var title:String?{
get{
return titleLabel?.text
}
set(v){
if(v == nil){
titleLabel?.text = nil
}else{
if( titleLabel == nil){
titleLabel = UILabel()
}
titleLabel?.text = v
layoutTitle(skipSizing: false, forMode: mode)
}
}
}
///background view
var backgroundView:UIView?{
didSet{
oldValue?.removeFromSuperview()
if let b = backgroundView{
addSubview(b)
sendSubviewToBack(b)
b.frame = bounds
}
}
}
///display mode
private var _mode:Mode = .NORMAL
var mode:Mode {
get{
return _mode
}
set(v){
setMode(v, animate:false)
}
}
///set mode with animate option
func setMode(mode:Mode, animate:Bool=true){
if (mode == .DETAIL){
_transformToDetail(animate)
}else if (mode == .NORMAL){
_transformToNormal(animate)
}
_mode = mode
}
// ///MARK: - copy properties from board
// private var _levels = 0
// @IBInspectable var boardLevels: Int{
// get{
// return _levels
// }
// set(v){
// _levels = v
// _board?.levels = _levels
// }
// }
// private var _indexesInLevel = 0
// @IBInspectable var boardIndexesInLevel:Int{
// get{
// return _indexesInLevel
// }
// set(v){
// _indexesInLevel = v
// _board?.indexesInLevel = _indexesInLevel
// }
// }
//
///MARK: - layout
private var _h:CGFloat = 0, _w:CGFloat = 0
override func layoutSubviews() {
if(_h != bounds.height || _w != bounds.width){
_h = bounds.height; _w = bounds.width
board?.frame = bounds
layoutTitle(skipSizing: false, forMode: mode)
backgroundView?.frame = bounds
if(mode == .DETAIL){
_transformToDetail(false)//TODO double layout title
}
super.layoutSubviews()
}
}
private func layoutTitle(skipSizing: Bool = false, forMode: Mode){
if let t = titleLabel{
if( !skipSizing){
t.sizeToFit()
if (t.bounds.size.width > bounds.width){
t.adjustsFontSizeToFitWidth = true
t.bounds.size.width = bounds.width
}
}
if(forMode == .NORMAL){
t.frame.origin = CGPoint(x: 8 , y: bounds.height/2 - t.bounds.height/2)
}else{
t.frame.origin = CGPoint(x: bounds.width/2 - t.bounds.width/2, y: 8)
}
}
}
///MARK: - transformation between modes
private func _transformToDetail(animate:Bool){
board?.setMode(HopplaBoard.Mode.DETAIL, animate: animate)
if(animate){
UIView.animateWithDuration(animationDuration, animations: { () -> Void in
if let bv = self.backgroundView{
bv.frame = CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.height/2)
}
self.layoutTitle(skipSizing: true, forMode: .DETAIL)
})
}else{
if let bv = self.backgroundView{
bv.frame = CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.height/2)
}
layoutTitle(skipSizing: true, forMode: .DETAIL)
}
}
private func _transformToNormal(animate:Bool){
board?.setMode(HopplaBoard.Mode.NORMAL, animate: animate)
if(animate){
UIView.animateWithDuration(animationDuration, animations: { () -> Void in
if let bv = self.backgroundView{
bv.frame = CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.height)
}
self.layoutTitle(skipSizing: true, forMode: .NORMAL)
})
}else{
if let bv = self.backgroundView{
bv.frame = CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.height)
}
layoutTitle(skipSizing: true, forMode: .NORMAL)
}
}
} | 31.507463 | 109 | 0.544292 |
a9a1db335eb4b5e8b753249219b43d718d2ca423 | 3,654 | html | HTML | app/index.html | anowell/pagerdash | d975b38d3676784e346b13d2aec49ff9bc9f79b5 | [
"MIT"
] | null | null | null | app/index.html | anowell/pagerdash | d975b38d3676784e346b13d2aec49ff9bc9f79b5 | [
"MIT"
] | null | null | null | app/index.html | anowell/pagerdash | d975b38d3676784e346b13d2aec49ff9bc9f79b5 | [
"MIT"
] | null | null | null | <!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/styles/main.css">
<!-- build:js scripts/vendor/modernizr.js -->
<script src="/bower_components/modernizr/modernizr.js"></script>
<!-- endbuild -->
</head>
<body>
<div class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><span class="glyphicon glyphicon-phone"></span> PagerDash</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="incidents">Incidents</a></li>
<li><a href="#">TBD</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<!--[if lt IE 7]>
<h2>Oh, an antique browser? That's cute. Now go away.</h2>
<![endif]-->
<div id="main" class="container">
<!-- Backbone should be driving the content in here -->
</div>
<!-- build:js scripts/vendor.js -->
<script src="/bower_components/jquery/jquery.js"></script>
<script src="/bower_components/lodash/dist/lodash.js"></script>
<script src="/bower_components/backbone/backbone.js"></script>
<script src="/bower_components/backbone-query-parameters/backbone.queryparams.js"></script>
<!-- endbuild -->
<!-- build:js scripts/plugins.js -->
<!--script src="/bower_components/sass-bootstrap/js/affix.js"></script-->
<script src="/bower_components/sass-bootstrap/js/alert.js"></script>
<script src="/bower_components/sass-bootstrap/js/dropdown.js"></script>
<!--script src="/bower_components/sass-bootstrap/js/tooltip.js"></script-->
<script src="/bower_components/sass-bootstrap/js/modal.js"></script>
<script src="/bower_components/sass-bootstrap/js/transition.js"></script>
<script src="/bower_components/sass-bootstrap/js/button.js"></script>
<!--script src="/bower_components/sass-bootstrap/js/popover.js"></script-->
<!--script src="/bower_components/sass-bootstrap/js/carousel.js"></script-->
<!--script src="/bower_components/sass-bootstrap/js/scrollspy.js"></script-->
<!--script src="/bower_components/sass-bootstrap/js/collapse.js"></script-->
<script src="/bower_components/sass-bootstrap/js/tab.js"></script>
<!-- endbuild -->
<script src="/scripts/config.js"></script>
<!-- build:js({.tmp,app}) scripts/main.js -->
<script src="/scripts/main.js"></script>
<script src="/scripts/vm.js"></script>
<script src="/scripts/templates.js"></script>
<script src="/scripts/models/base.js"></script>
<script src="/scripts/models/incident.js"></script>
<script src="/scripts/routes/pagerduty.js"></script>
<script src="/scripts/views/incidents-weekly.js"></script>
<script src="/scripts/views/incidents-list.js"></script>
<!-- endbuild -->
</body>
</html>
| 46.253165 | 112 | 0.582649 |
652230e81ba4d8d4037cbc54fc3f6d5ceb60f00b | 2,779 | rs | Rust | src/test/instruction_tests/setne.rs | epakskape/rust-x86asm | adb4128f7b12642336a919e32bd56509c9a835d4 | [
"MIT"
] | 49 | 2017-10-31T10:26:54.000Z | 2021-07-06T09:04:12.000Z | src/test/instruction_tests/setne.rs | epakskape/rust-x86asm | adb4128f7b12642336a919e32bd56509c9a835d4 | [
"MIT"
] | 6 | 2018-02-28T05:57:28.000Z | 2020-01-05T01:54:41.000Z | src/test/instruction_tests/setne.rs | epakskape/rust-x86asm | adb4128f7b12642336a919e32bd56509c9a835d4 | [
"MIT"
] | 7 | 2018-09-09T13:08:16.000Z | 2020-06-14T00:06:07.000Z | use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn setne_1() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(Direct(CL)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 193], OperandSize::Word)
}
fn setne_2() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(IndirectScaledIndexedDisplaced(BP, DI, One, 2725, Some(OperandSize::Byte), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 131, 165, 10], OperandSize::Word)
}
fn setne_3() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(Direct(BL)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 195], OperandSize::Dword)
}
fn setne_4() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(IndirectDisplaced(ECX, 1041130851, Some(OperandSize::Byte), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 129, 99, 101, 14, 62], OperandSize::Dword)
}
fn setne_5() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(Direct(CL)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 193], OperandSize::Qword)
}
fn setne_6() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(IndirectScaledDisplaced(RDX, Eight, 1630667080, Some(OperandSize::Byte), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 4, 213, 72, 1, 50, 97], OperandSize::Qword)
}
fn setne_7() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(Direct(CL)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 193], OperandSize::Qword)
}
fn setne_8() {
run_test(&Instruction { mnemonic: Mnemonic::SETNE, operand1: Some(IndirectScaledIndexedDisplaced(RCX, RSI, Four, 1730729533, Some(OperandSize::Byte), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[15, 149, 132, 177, 61, 214, 40, 103], OperandSize::Qword)
}
| 69.475 | 364 | 0.709248 |
5604e10233e4a7eb4e05a1f3b2bc784088fe4552 | 1,792 | go | Go | monitorables/ping/api/usecase/ping_test.go | YoannMa/monitoror | c2861a418734e60c5bd09ecbac4d54eac1da8d49 | [
"MIT"
] | 3,645 | 2019-04-06T17:55:13.000Z | 2022-03-31T19:11:10.000Z | monitorables/ping/api/usecase/ping_test.go | YoannMa/monitoror | c2861a418734e60c5bd09ecbac4d54eac1da8d49 | [
"MIT"
] | 330 | 2019-04-06T20:05:07.000Z | 2022-03-24T14:44:07.000Z | monitorables/ping/api/usecase/ping_test.go | jsdidierlaurent/monitoror | 66235d0d604fa3db1b552b108ad4dd960e892690 | [
"MIT"
] | 179 | 2019-10-22T08:59:28.000Z | 2022-03-25T17:48:27.000Z | package usecase
import (
"errors"
"testing"
"time"
coreModels "github.com/monitoror/monitoror/models"
"github.com/monitoror/monitoror/monitorables/ping/api"
"github.com/monitoror/monitoror/monitorables/ping/api/mocks"
"github.com/monitoror/monitoror/monitorables/ping/api/models"
"github.com/stretchr/testify/assert"
. "github.com/stretchr/testify/mock"
)
func TestUsecase_Ping_Success(t *testing.T) {
// Init
mockRepo := new(mocks.Repository)
mockRepo.On("ExecutePing", AnythingOfType("string")).Return(&models.Ping{
Average: time.Second,
Min: time.Second,
Max: time.Second,
}, nil)
usecase := NewPingUsecase(mockRepo)
// Params
param := &models.PingParams{
Hostname: "monitoror.example.com",
}
// Expected
eTile := coreModels.NewTile(api.PingTileType).WithMetrics(coreModels.MillisecondUnit)
eTile.Label = param.Hostname
eTile.Status = coreModels.SuccessStatus
eTile.Metrics.Values = append(eTile.Metrics.Values, "1000")
// Test
rTile, err := usecase.Ping(param)
if assert.NoError(t, err) {
assert.Equal(t, eTile, rTile)
mockRepo.AssertNumberOfCalls(t, "ExecutePing", 1)
mockRepo.AssertExpectations(t)
}
}
func TestUsecase_Ping_Fail(t *testing.T) {
// Init
mockRepo := new(mocks.Repository)
mockRepo.On("ExecutePing", AnythingOfType("string")).Return(nil, errors.New("ping error"))
usecase := NewPingUsecase(mockRepo)
// Params
param := &models.PingParams{
Hostname: "monitoror.example.com",
}
// Expected
eTile := coreModels.NewTile(api.PingTileType)
eTile.Label = param.Hostname
eTile.Status = coreModels.FailedStatus
// Test
rTile, err := usecase.Ping(param)
if assert.NoError(t, err) {
assert.Equal(t, eTile, rTile)
mockRepo.AssertNumberOfCalls(t, "ExecutePing", 1)
mockRepo.AssertExpectations(t)
}
}
| 24.216216 | 91 | 0.732143 |
71784457b131e2a4b8ba9c97a96aaa95f1ac6339 | 3,610 | ts | TypeScript | src/Reactions/composeReactions.spec.ts | atomservicesjs/atomservices | ebcb3fa7a95422eda49fbcc19a041d6ba7fb8724 | [
"MIT"
] | 2 | 2018-01-30T11:27:31.000Z | 2019-03-05T12:00:25.000Z | src/Reactions/composeReactions.spec.ts | atomservicesjs/atomservices | ebcb3fa7a95422eda49fbcc19a041d6ba7fb8724 | [
"MIT"
] | 23 | 2018-01-31T02:32:09.000Z | 2021-05-08T03:58:12.000Z | src/Reactions/composeReactions.spec.ts | atomservicesjs/atomservices | ebcb3fa7a95422eda49fbcc19a041d6ba7fb8724 | [
"MIT"
] | null | null | null | import { expect } from "chai";
import * as sinon from "sinon";
import { composeReactions } from "./composeReactions";
describe("composeReactions.ts tests", () => {
it("expect to compose an instance of Reactions", async () => {
// arranges
const reaction1: any = {
name: "Reaction1",
scope: "TEST",
type: "Test",
};
const reaction2: any = {
name: "Reaction2",
scope: "TEST",
type: "Test",
};
const type = "test";
// acts
const result = composeReactions(reaction1, reaction2)(type);
// asserts
expect(result).to.be.an("object");
});
describe("Reactions.resolve()", () => {
it("expect to resolve the matching reactions and returning an empty array when not matched", async () => {
// arranges
const reaction1: any = {
name: "Event_A",
scope: "Scope",
type: "Type",
};
const reaction2: any = {
name: "Event_B",
scope: "Scope",
type: "Type",
};
const reaction3: any = {
name: "Event_A",
scope: "Scope",
type: "Type",
};
const type = "test";
const reactions = composeReactions(reaction1, reaction2, reaction3)(type);
const event: any = {
name: "Event_C",
type: "Type",
};
// acts
const result = reactions.resolve(event, "Scope");
// asserts
expect(result.length).to.equal(0);
expect(result).to.deep.equal([]);
});
it("expect to resolve the matching reactions", async () => {
// arranges
const reaction1: any = {
name: "Event_A",
scope: "Scope",
type: "Type",
};
const reaction2: any = {
name: "Event_B",
scope: "Scope",
type: "Type",
};
const reaction3: any = {
name: "Event_A",
scope: "Scope",
type: "Type",
};
const type = "test";
const reactions = composeReactions(reaction1, reaction2, reaction3)(type);
const event: any = {
name: "Event_A",
type: "Type",
};
// acts
const result = reactions.resolve(event, "Scope");
// asserts
expect(result.length).to.equal(2);
expect(result).to.deep.equal([reaction1, reaction3]);
});
});
describe("Reactions.forEach()", () => {
it("expect to callback with reaction", async () => {
// arranges
const reaction1: any = {
name: "Event_A",
scope: "Scope",
type: "Type",
};
const reaction2: any = {
name: "Event_B",
scope: "Scope",
type: "Type",
};
const reaction3: any = {
name: "Event_C",
scope: "Scope",
type: "Type",
};
const type = "test";
const reactions = composeReactions(reaction1, reaction2, reaction3)(type);
const callback = sinon.spy();
// acts
const result = reactions.forEach(callback);
// asserts
expect(result).to.equal(3);
expect(callback.callCount).to.equal(3);
expect(callback.getCall(0).calledWith(reaction1)).to.equal(true);
expect(callback.getCall(1).calledWith(reaction2)).to.equal(true);
expect(callback.getCall(2).calledWith(reaction3)).to.equal(true);
});
});
describe("Reactions.forEach()", () => {
it("expect to callback with reaction", async () => {
// arranges
const type = "test";
const reactions = composeReactions()(type);
// acts
const result = reactions.type();
// asserts
expect(result).to.equal(type);
});
});
});
| 25.602837 | 110 | 0.538504 |
92ffbea79aa3c828e7ec5f334af9632f863fb4e3 | 6,533 | c | C | std/races/shapeshifted_races/life_elemental.c | SwusInABox/SunderingShadows | 07dfe6ee378ca3266fc26fdc39ff2f29223ae002 | [
"MIT"
] | 9 | 2021-07-05T15:24:54.000Z | 2022-02-25T19:44:15.000Z | std/races/shapeshifted_races/life_elemental.c | SwusInABox/SunderingShadows | 07dfe6ee378ca3266fc26fdc39ff2f29223ae002 | [
"MIT"
] | 4 | 2021-03-15T18:56:39.000Z | 2021-08-17T17:08:22.000Z | std/races/shapeshifted_races/life_elemental.c | SwusInABox/SunderingShadows | 07dfe6ee378ca3266fc26fdc39ff2f29223ae002 | [
"MIT"
] | 10 | 2021-03-13T00:18:03.000Z | 2022-03-29T15:02:42.000Z | #include <std.h>
#include <daemons.h>
#include <magic.h>
inherit SHAPESHIFT;
// all of the functions set in create below need to be there so it doesn't bug when trying to shapeshift -Ares
// when making a new shape, be sure to include those functions or it'll fall back to the defaults
void create()
{
::create();
set_attack_limbs( ({ "right arm","left arm" }) );
set_new_damage_type("bludgeoning");
set_limbs( ({ "head","torso","right arm", "left arm" }) );
// set_attack_functions(([ "right arm" : (:TO,"arm_attack":), "left arm" : (:TO,"arm_attack":) ])); // moving this to an on-demand command
set_attack_functions(([ "right arm" : (:TO,"shape_attack":), "left arm" : (:TO,"shape_attack":) ]));
set_ac_bonus(0); // ac bonus is different from the other bonuses because of the way ac is calculated with different body types -Ares
set_base_attack_num(0);
set_castable(1);
set_can_talk(1);
set_shape_race("elemental");
set_shape_language("celestial");
set_shape_profile("life_elemental_999"); // needs to be something the player is unlikely to name one of their profiles when disguise goes in
set_shape_bonus("perception",4);
set_shape_bonus("spellcraft",4);
set_shape_bonus("sight bonus",3);
set_shape_bonus("empowered",2);
set_shape_bonus("damage resistance",10);
set_shape_bonus("spell damage resistance",10);
set_shape_height(200+random(40));
set_shape_weight(5000+random(2000));
}
string * query_subraces() {
return ({ "elemental","life elemental" });
}
// custom descriptions here, override this function
int default_descriptions(object obj)
{
if(!objectp(obj)) { return 0; }
obj->set_description("%^RESET%^%^CRST%^%^C064%^Vibrant %^C221%^g%^C228%^o%^C223%^l%^C230%^d%^C221%^e%^C228%^n %^C223%^f%^C230%^l%^C221%^a%^C228%^m%^C223%^e%^C230%^s %^C064%^make up this elemental creature, radiating a feeling of %^C214%^ye%^C208%^a%^C202%^rn%^C208%^i%^C214%^ng %^C064%^and %^C028%^po%^C034%^te%^C040%^n%^C034%^ti%^C028%^al%^RESET%^%^C064%^. Images of %^C229%^l%^C231%^i%^C229%^f%^C227%^e%^C064%^, animals and insects and all living things flicker and form among the writhing tongues of %^C221%^f%^C228%^i%^C223%^r%^C230%^e%^C064%^, granting brief glimpses of a %^C130%^lion %^C144%^stalking among the savanna %^C064%^or a %^C033%^great heron %^C045%^in flight%^C064%^. The embers and sparks rising from this being shift into other shapes, appearing as beetles or other winged insects as they trail off into obscurity. Its visage appears to transition fluidly between all manner of beasts, but the eyes always remain the same... %^C220%^two piercing %^C228%^o%^C230%^r%^C228%^b%^C226%^s %^C220%^of absolute %^C226%^br%^C228%^il%^C230%^li%^C228%^an%^C226%^ce%^C064%^.%^CRST%^");
obj->setDescriptivePhrase("%^RESET%^%^CRST%^%^C214%^w%^C208%^r%^C202%^i%^C214%^t%^C208%^h%^C202%^i%^C214%^n%^C208%^g %^C220%^$R of %^C221%^g%^C228%^o%^C223%^l%^C230%^d%^C221%^e%^C228%^n %^C223%^f%^C230%^l%^C221%^a%^C228%^m%^C223%^e%^CRST%^");
obj->set("speech string","voice");
obj->set("describe string","eerily");
obj->force_me("message in moves in");
obj->force_me("message out moves off to the $D");
return 1;
}
// custom shapeshift messages here, override this function
int change_into_message(object obj)
{
if(!objectp(obj)) { return 0; }
tell_object(obj,"%^RESET%^%^YELLOW%^You turn your mind out to the wilds as you focus on the core of your spirit.");
tell_object(obj,"%^RESET%^%^BOLD%^You can feel your body beginning to change!");
tell_object(obj,"%^RESET%^%^BLUE%^You reach out to the planes beyond the material, harnessing the very essence of "
"life. Your bond with positive energy grows stronger, attuned as you are now with the magical energies of the "
"world around you. You are ELEMENTAL!");
tell_room(environment(obj),"%^RESET%^%^BOLD%^"+obj->QCN+" grows very still and appears to concentrate deeply.",obj);
tell_room(environment(obj),"%^RESET%^%^YELLOW%^"+obj->QCN+" begins to change in front of your very eyes!",obj);
tell_room(environment(obj),"%^RED%^Where "+obj->QCN+" once stood, now stands an ELEMENTAL!",obj);
return 1;
}
// custom unshapeshift messages here, override this function
int change_outof_message(object obj)
{
if(!objectp(obj)) { return 0; }
tell_object(obj,"%^RESET%^%^BOLD%^You relax your focus on the nature of life.");
tell_object(obj,"%^RESET%^%^BLUE%^You can feel a tinge of remorse as you feel your elemental form slipping away.");
tell_object(obj,"%^RESET%^%^GREEN%^You inhale a breath and stretch as you grow accustomed to the foreign sensation of your own body once again.");
tell_room(environment(obj),"%^RESET%^%^BOLD%^"+obj->QCN+"'s motions slow and "+obj->QS+" gets a far-away look in "+obj->QP+" eyes.",obj);
tell_room(environment(obj),"%^RESET%^%^BLUE%^"+obj->QCN+"'s body begins to change shape, shrinking and gaining definition!",obj);
tell_room(environment(obj),"%^RESET%^%^GREEN%^Where "+obj->QCN+" once stood, now stands a "+obj->query_race()+"!",obj);
return 1;
}
// custom unarmed attack functions go here, functions can be added just like hit functions for weapons
int shape_attack(object tp, object targ)
{
object place, *attackers, *allies, *targets;
int dam;
if(!tp || !targ)
return 0;
place = environment(tp);
if(place != environment(targ))
return 0;
//30% chance of firing
if(random(3))
return 0;
attackers = tp->query_attackers();
allies = PARTY_D->query_party_members(tp->query_party());
if(!sizeof(attackers) && !sizeof(allies))
return 0;
//Elemental does positive energy to friendly living and enemy undead
sizeof(attackers) && attackers = filter_array(attackers, (: $1->is_undead() :));
sizeof(allies) && allies = filter_array(allies, (: !($1->is_undead()) :));
if(!sizeof(attackers) && !sizeof(allies))
return 0;
targets = attackers + allies;
tell_room(place, "%^WHITE%^Wisps of healing energy emanate from " + tp->query_cap_name() + ", caressing everyone with healing energy!", ({ tp }));
tell_object(tp, "%^WHITE%^Wisps of healing energy emanate from your form, caressing everyone with healing energies!");
foreach(object ob in targets)
ob->cause_typed_damage(ob, "torso", roll_dice(1, 6) + tp->query_class_level("oracle"), "positive energy");
return roll_dice(1, 6);
}
| 49.120301 | 1,097 | 0.666769 |
e72bd611305070862192c1c29c44cd81c27d9beb | 1,882 | js | JavaScript | src/pages/downloads/toki-news.js | alijaya/toki-web | 6c4115178cd694662500468acf2e9330c9162906 | [
"MIT"
] | 2 | 2020-02-23T05:01:19.000Z | 2020-02-29T03:33:18.000Z | src/pages/downloads/toki-news.js | alijaya/toki-web | 6c4115178cd694662500468acf2e9330c9162906 | [
"MIT"
] | 4 | 2020-03-26T06:41:26.000Z | 2020-03-26T07:00:12.000Z | src/pages/downloads/toki-news.js | alijaya/toki-web | 6c4115178cd694662500468acf2e9330c9162906 | [
"MIT"
] | 1 | 2020-03-26T08:52:55.000Z | 2020-03-26T08:52:55.000Z | import { faDownload, faFilePdf } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { graphql } from "gatsby";
import React from "react";
import Footer from "../../components/footer";
import Layout from "../../components/layout";
import LightNavbar from "../../components/light-navbar";
import "../../styles/global.scss";
import "./toki-news.scss";
const TOKINews = ({ data }) => {
return (
<Layout>
<LightNavbar />
<div className="container offset-navbar mb-4 content">
<h1 className="offset-navbar text-center pt-4 pb-3">
Download TOKI News
</h1>
<div className="row justify-content-center">
<div className="col-12 col-md-10 col-lg-8">
{data.allTOKINews.edges.map(TOKINewsNode => {
const file = TOKINewsNode.node;
return (
<div className="toki-news-box" key={file.publicURL}>
<FontAwesomeIcon
icon={faFilePdf}
className="text-danger mr-3"
size="2x"
/>
<span className="toki-news-name">{file.name}</span>{" "}
<div className="mr-auto" />
<a href={file.publicURL} className="toki-button">
<FontAwesomeIcon icon={faDownload} className="mr-2" />
DOWNLOAD
</a>
</div>
);
})}
</div>
</div>
</div>
<Footer />
</Layout>
);
};
export const pageQuery = graphql`
query {
allTOKINews: allFile(
filter: { name: { regex: "/TOKI News/" } }
sort: { fields: [name], order: DESC }
) {
edges {
node {
name
publicURL
}
}
}
}
`;
export default TOKINews;
| 29.40625 | 74 | 0.514878 |
9f06b7cacd5ed55e24adee966e44acf748fc6c74 | 600 | sql | SQL | coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/log/Release_1_0_logs/s2s/procfunpacks/get_budget_sub_award_att_all.sql | mrudulpolus/kc | 55f529e5ff0985f3bf5247e2a1e63c5dec07f560 | [
"ECL-2.0"
] | null | null | null | coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/log/Release_1_0_logs/s2s/procfunpacks/get_budget_sub_award_att_all.sql | mrudulpolus/kc | 55f529e5ff0985f3bf5247e2a1e63c5dec07f560 | [
"ECL-2.0"
] | null | null | null | coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/log/Release_1_0_logs/s2s/procfunpacks/get_budget_sub_award_att_all.sql | mrudulpolus/kc | 55f529e5ff0985f3bf5247e2a1e63c5dec07f560 | [
"ECL-2.0"
] | null | null | null | CREATE OR REPLACE PROCEDURE GET_BUDGET_SUB_AWARD_ATT_ALL
( AW_PROPOSAL_NUMBER IN OSP$BUDGET_SUB_AWARD_ATT.proposal_number%TYPE,
AW_VERSION_NUMBER IN OSP$BUDGET_SUB_AWARD_ATT.VERSION_NUMBER%TYPE,
cur_budget_sub_award_att IN OUT result_sets.cur_generic) is
begin
open cur_budget_sub_award_att for
select PROPOSAL_NUMBER, VERSION_NUMBER, SUB_AWARD_NUMBER, CONTENT_ID, CONTENT_TYPE,ATTACHMENT,
UPDATE_USER, UPDATE_TIMESTAMP from OSP$BUDGET_SUB_AWARD_ATT
WHERE PROPOSAL_NUMBER = AW_PROPOSAL_NUMBER and
VERSION_NUMBER = AW_VERSION_NUMBER order by SUB_AWARD_NUMBER asc;
end;
/
| 42.857143 | 98 | 0.835 |
50683c884d7dbc2b79ef143364749c690bb1f3d3 | 1,921 | go | Go | controllers/util/drpolicy_util.go | vdeenadh/ramen | 4cec36b58f32b28207444e822b32abc003377d21 | [
"Apache-2.0"
] | 1 | 2021-12-30T10:12:42.000Z | 2021-12-30T10:12:42.000Z | controllers/util/drpolicy_util.go | vdeenadh/ramen | 4cec36b58f32b28207444e822b32abc003377d21 | [
"Apache-2.0"
] | 1 | 2021-12-24T06:35:09.000Z | 2021-12-24T06:35:09.000Z | controllers/util/drpolicy_util.go | vdeenadh/ramen | 4cec36b58f32b28207444e822b32abc003377d21 | [
"Apache-2.0"
] | null | null | null | /*
Copyright 2021 The RamenDR authors.
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 util
import (
rmn "github.com/ramendr/ramen/api/v1alpha1"
)
func DrpolicyClusterNames(drpolicy *rmn.DRPolicy) []string {
clusterNames := make([]string, len(drpolicy.Spec.DRClusterSet))
for i := range drpolicy.Spec.DRClusterSet {
clusterNames[i] = drpolicy.Spec.DRClusterSet[i].Name
}
return clusterNames
}
// Return a list of unique S3 profiles to upload the relevant cluster state of
// the given home cluster
func s3UploadProfileList(drPolicy rmn.DRPolicy, homeCluster string) (s3ProfileList []string) {
for _, drCluster := range drPolicy.Spec.DRClusterSet {
if drCluster.Name != homeCluster {
// This drCluster is not the home cluster and is hence, a candidate to
// upload cluster state to if this S3 profile is not already on the list.
found := false
for _, s3ProfileName := range s3ProfileList {
if s3ProfileName == drCluster.S3ProfileName {
found = true
}
}
if !found {
s3ProfileList = append(s3ProfileList, drCluster.S3ProfileName)
}
}
}
return
}
// Return the S3 profile to download the relevant cluster state to the given
// home cluster
func S3DownloadProfile(drPolicy rmn.DRPolicy, homeCluster string) (s3Profile string) {
for _, drCluster := range drPolicy.Spec.DRClusterSet {
if drCluster.Name == homeCluster {
s3Profile = drCluster.S3ProfileName
}
}
return
}
| 28.671642 | 94 | 0.745966 |
61b1b08e62796d171b0198abfff71f76a8d19284 | 367 | swift | Swift | swift-pd/Sources/Playdate/Display.swift | mossprescott/swift-pd | c4ef6d1907e1288765c7db44c37d6ff4fb9b020e | [
"MIT"
] | 2 | 2022-03-23T03:31:46.000Z | 2022-03-23T03:48:57.000Z | swift-pd/Sources/Playdate/Display.swift | mossprescott/swift-pd | c4ef6d1907e1288765c7db44c37d6ff4fb9b020e | [
"MIT"
] | 1 | 2022-03-30T17:10:52.000Z | 2022-03-30T17:10:52.000Z | swift-pd/Sources/Playdate/Display.swift | mossprescott/swift-pd | c4ef6d1907e1288765c7db44c37d6ff4fb9b020e | [
"MIT"
] | null | null | null | import CPlaydate
public enum Display {
public static var width: Int {
Int(Playdate.c_api.display.pointee.getWidth())
}
public static var height: Int {
Int(Playdate.c_api.display.pointee.getHeight())
}
public static func setRefreshRate(_ rate: Float) {
Playdate.c_api.display.pointee.setRefreshRate(Float32(rate))
}
} | 24.466667 | 68 | 0.675749 |
26752924d0d67677b6965867c2d91d2ad51d4872 | 5,592 | java | Java | parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserReader.java | mahamuniraviraj/parancoe | 69d7ab126b7a6ff54335f48caa76e100eec7f53c | [
"Apache-2.0"
] | 1 | 2019-05-22T18:54:04.000Z | 2019-05-22T18:54:04.000Z | parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserReader.java | mahamuniraviraj/parancoe | 69d7ab126b7a6ff54335f48caa76e100eec7f53c | [
"Apache-2.0"
] | null | null | null | parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserReader.java | mahamuniraviraj/parancoe | 69d7ab126b7a6ff54335f48caa76e100eec7f53c | [
"Apache-2.0"
] | null | null | null | /**
* Copyright (C) 2006-2010 The Parancoe Team <info@parancoe.org>
*
* This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.parancoe.yaml.parser;
import java.io.IOException;
import java.io.Reader;
/**
* A character Reader with some additional functionality.<br>
*
* <ul>
* <li>nested mark-unmark-reset
* <li>current() returns next character that will be read, without consuming it
* <li>string() returns a string since the last mark
* <li>previous() returns the character before the last one readed
* </ul>
*
* <p>
* This implementation uses a circular buffer with a default size of 64k. To
* create a ParserReader from a Reader do:
* </p>
*
* <p>
* ParserReader parserReader = ParserReader(reader);
* </p>
*
* <p>
* The constructor accepts any reader and returns a new reader with the
* functions defined here. As of now, this class is not an extension of Reader.
* </p>
*
* <p>
* Care has to be taken when using mark(), unmark() and reset(), since they can
* be nested. Each mark() call has to be matched by exactly one unmark() or
* reset(). This code is now legal:
* <p>
*
* <pre>
* ParserReader r = new ParserReader(reader);
*
* mark(); // position 1
* mark(); // position 2
* reset(); // return to position 2
* if (condition)
* reset(); // return to position 1
* else
* unmark();
*
* </pre>
*
* @autor: Rolf Veen
* @date: March 2002
* @license: Open-source compatible TBD (Apache or zlib or Public Domain)
*/
public final class ParserReader {
Reader reader;
int c;
char[] buffer; /* used for mark(), unmark() and reset() operations */
int index, fileIndex, level;
int eofIndex; /* where in buffer[] is the eof */
int[] mark;
final int BUFLEN = 3500000; /*
* this constant determines how much lookahead
* we can have
*/
public ParserReader(Reader reader) throws Exception {
this.reader = reader;
buffer = new char[BUFLEN]; // maximum mark-reset range. Circular buffer
// !
buffer[buffer.length - 1] = 0; // correct response from previous()
// after start.
index = 0;
fileIndex = 0;
level = 0;
eofIndex = -1;
mark = new int[32];
}
/** return a string begining at the last mark() untill the current position */
public String string() {
int begin = mark[level - 1];
int end = index;
if (begin > end)
return new String(buffer, begin, BUFLEN - begin) + new String(buffer, 0, end);
else
return new String(buffer, begin, end - begin);
}
/**
* read and return one character from the stream.
*
* <ul>
* <li>If index != fileIndex, read from buffer
* <li>else check if eof has been readed. If so return eof
* <li>else read a new character from the stream
* </ul>
*
*/
public int read() throws IOException {
if (index == eofIndex) {
index++;
return -1;
} else if (index < (fileIndex % BUFLEN)) // assuming index <
// fileIndex
c = (int) buffer[index];
else { // assuming index == fileIndex
if (eofIndex != -1)
return -1;
c = reader.read();
fileIndex++;
if (c == -1)
eofIndex = index;
buffer[index] = (char) c;
}
index++;
if (index >= BUFLEN)
index = 0;
return c;
}
/** return one character from the stream without 'consuming' it */
public int current() throws IOException {
read();
unread();
return c;
}
/** return the previous character */
public int previous() {
if (index == 0)
return (int) buffer[BUFLEN - 2];
else if (index == 1)
return (int) buffer[BUFLEN - 1];
else
return (int) buffer[index - 2];
}
/** remember the current position for a future reset() */
public void mark() {
mark[level] = index;
level++;
}
public void unmark() {
level--;
if (level < 0)
throw new IndexOutOfBoundsException("no more mark()'s to unmark()");
}
/** return to the position of a previous mark(). */
public void reset() {
unmark();
index = mark[level];
}
/** unread one character. */
public void unread() {
index--;
// if (index == mark[level-1])
// throw new IndexOutOfBoundsException("too much unreads");
if (index < 0)
index = BUFLEN - 1;
}
}
| 28.385787 | 91 | 0.540594 |
2db937da0e082ed863284d2266d29e18c0176a35 | 2,728 | html | HTML | campeoes-brasileiro/index.html | jonathanslima/jonathanslima.github.io | d6c9e0d59339c5b15cf31aec5a173dc78037fc56 | [
"MIT"
] | 2 | 2016-04-07T16:03:41.000Z | 2016-11-16T21:05:29.000Z | campeoes-brasileiro/index.html | jonathanslima/jonathanslima.github.io | d6c9e0d59339c5b15cf31aec5a173dc78037fc56 | [
"MIT"
] | 25 | 2016-04-11T00:09:33.000Z | 2018-06-15T03:48:37.000Z | campeoes-brasileiro/index.html | jonathanslima/jonathanslima.github.io | d6c9e0d59339c5b15cf31aec5a173dc78037fc56 | [
"MIT"
] | 2 | 2016-02-08T14:46:19.000Z | 2020-01-23T15:07:00.000Z | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<ul class="times">
<li class="pos pos-amg">
<picture>
<img src="img/ateliticomg.png" alt="">
</picture>
<div class="atleticomg"></div>
</li>
<li class="pos pos-apr">
<picture>
<img src="img/atlheticopr.png" alt="">
</picture>
<div class="atleticopr"></div>
</li>
<li class="pos pos-bahia">
<picture>
<img src="img/bahia.png" alt="">
</picture>
<div class="bahia"></div>
</li>
<li class="pos pos-bot">
<picture>
<img src="img/botafogo.gif" alt="">
</picture>
<div class="botafogo"></div>
</li>
<li class="pos pos-cor">
<picture>
<img src="img/corinthians.png" alt="">
</picture>
<div class="corinthians"></div>
</li>
<li class="pos pos-cori">
<picture>
<img src="img/coritiba.png" alt="">
</picture>
<div class="coritiba"></div>
</li>
<li class="pos pos-cru">
<picture>
<img src="img/cruzeiro.png" alt="">
</picture>
<div class="cruzeiro"></div>
</li>
<li class="pos pos-fla">
<picture>
<img src="img/flamengo.png" alt="">
</picture>
<div class="flamengo"></div>
</li>
<li class="pos pos-flu">
<picture>
<img src="img/fluminense.png" alt="">
</picture>
<div class="fluminense"></div>
</li>
<li class="pos pos-gre">
<picture>
<img src="img/gremio.png" alt="">
</picture>
<div class="gremio"></div>
</li>
<li class="pos pos-gua">
<picture>
<img src="img/guarani.gif" alt="">
</picture>
<div class="guarani"></div>
</li>
<li class="pos pos-int">
<picture>
<img src="img/internacional.png" alt="">
</picture>
<div class="internacional"></div>
</li>
<li class="pos pos-palm">
<picture>
<img src="img/palmeiras.png" alt="">
</picture>
<div class="palmeiras"></div>
</li>
<li class="pos pos-san">
<picture>
<img src="img/santos.png" alt="">
</picture>
<div class="santos"></div>
</li>
<li class="pos pos-spa">
<picture>
<img src="img/saopaulo.png" alt="">
</picture>
<div class="saopaulo"></div>
</li>
<li class="pos pos-spo">
<picture>
<img src="img/sport.gif" alt="">
</picture>
<div class="sport"></div>
</li>
<li class="pos pos-vas">
<picture>
<img src="img/vasco.png" alt="">
</picture>
<div class="vasco"></div>
</li>
</div>
<div class="year">1959</div>
<!-- <button id="change" class="change">change</button> -->
</body>
<script src="./main.js"></script>
</html> | 19.625899 | 71 | 0.554985 |
2fe3ab683484a3abd0541c1934735e4c9ea7e105 | 704 | rs | Rust | chapter-3-exercises/fibonnaci/src/main.rs | tlow22/learn-rust | 0fca60d9c0a8c5cfdade714583c0f65f240416b9 | [
"MIT"
] | null | null | null | chapter-3-exercises/fibonnaci/src/main.rs | tlow22/learn-rust | 0fca60d9c0a8c5cfdade714583c0f65f240416b9 | [
"MIT"
] | null | null | null | chapter-3-exercises/fibonnaci/src/main.rs | tlow22/learn-rust | 0fca60d9c0a8c5cfdade714583c0f65f240416b9 | [
"MIT"
] | null | null | null | use std::io;
// generates the n-th fibonnaci number
fn main() {
// get user input
println!("Enter n-th Fibonnaci number desired");
let mut idx = String::new();
io::stdin()
.read_line(&mut idx)
.expect("Failed to read");
let idx:u32 = match idx.trim().parse() {
Ok(num) => num,
Err(_) => 0
};
// generate specified Fibonnaci number
match idx {
0 => println!("Invalid input detected. No calculation will be done"),
_ => println!("The {}-th Fibonnaci number is {}", idx, fibonnaci(idx)),
}
}
fn fibonnaci(n: u32) -> u32 {
if n <= 1 {
return n;
}
return fibonnaci(n-1) + fibonnaci(n-2);
}
| 22 | 79 | 0.544034 |