code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
require File.dirname(__FILE__) + '/../spec_helper'
describe Muck::OaiEndpointsController do
render_views
describe "oai endpoints controller" do
describe "logged in as admin" do
before do
@user = Factory(:user)
activate_authlogic
login_as @user
end
describe "GET new" do
before do
get :new
end
it { should_not set_the_flash }
it { should respond_with :success }
it { should render_template :new }
end
describe "POST create" do
before do
post :create, :oai_endpoint => { :uri => 'http://www.example.com', :title => 'example' }
end
it { should set_the_flash.to(I18n.t('muck.services.oai_endpoint_successfully_created')) }
it { should redirect_to( oai_endpoint_url(assigns(:oai_endpoint)) ) }
end
describe "GET show" do
before do
@oai_endpoint = Factory(:oai_endpoint)
get :show, :id => @oai_endpoint.to_param
end
it { should_not set_the_flash }
it { should respond_with :success }
it { should render_template :show }
end
end
end
end
|
tatemae/muck-services
|
test/spec/controllers/oai_endpoints_controller_spec.rb
|
Ruby
|
mit
| 1,178
|
//
// AppDelegate.h
// multiplicationTable
//
// Created by Olivier Delecueillerie on 19/12/2014.
// Copyright (c) 2014 lagspoon. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
delecueillerie/multiplicationTable
|
multiplicationTable/AppDelegate.h
|
C
|
mit
| 302
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /wp-content/themes/blocksy/static/sass/frontend/5-modules/footer</title>
</head>
<body>
<h1>Index of /wp-content/themes/blocksy/static/sass/frontend/5-modules/footer</h1>
<ul>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/"> Parent Directory</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/common.scss"> common.scss</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/copyright.scss"> copyright.scss</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/divider.scss"> divider.scss</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/footer-grid.scss"> footer-grid.scss</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/footer-reveal.scss"> footer-reveal.scss</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/main.scss"> main.scss</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/socials.scss"> socials.scss</a></li>
<li><a href="/wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/widgets.scss"> widgets.scss</a></li>
</ul>
</body>
</html>
|
zavrelj/zavrelj.github.io
|
wp-content/themes/blocksy/static/sass/frontend/5-modules/footer/index.html
|
HTML
|
mit
| 1,324
|
---
layout: post
title: 谈元编程与表达能力
permalink: /metaprogramming
tags: metaprogramming macro runtime c elixir rust ruby iOS server
toc: true
desc: 在这篇文章中,作者会介绍不同的编程语言如何增强自身的表达能力,也就是不同的元编程能力,包括宏和运行时两种实现元编程的方法,文章不仅会介绍 C、Elixir 和 Rust 语言中的宏系统的优劣以及特性,还会介绍 Objective-C 和 Ruby 的面向对象模型以及它们在运行期间修改对象行为的原理。
---
在这篇文章中,作者会介绍不同的编程语言如何增强自身的表达能力,在写这篇文章的时候其实就已经想到这可能不是一篇有着较多受众和读者的文章。不过作者仍然想跟各位读者分享一下对不同编程语言的理解,同时也对自己的知识体系进行简单的总结。

当我们刚刚开始学习和了解编程这门手艺或者说技巧时,一切的知识与概念看起来都非常有趣,随着学习的深入和对语言的逐渐了解,我们可能会发现原来看起来无所不能的编程语言成为了我们的限制,尤其是在我们想要使用一些**元编程**技巧的时候,你会发现有时候语言限制了我们的能力,我们只能一遍一遍地写重复的代码来解决本可以轻松搞定的问题。
## 元编程
元编程(Metaprogramming)是计算机编程中一个非常重要、有趣的概念,[维基百科](https://en.wikipedia.org/wiki/Metaprogramming) 上将元编程描述成一种计算机程序可以**将代码看待成数据**的能力。
> Metaprogramming is a programming technique in which computer programs have the ability to treat programs as their data.
如果能够将代码看做数据,那么代码就可以像数据一样在运行时被修改、更新和替换;元编程赋予了编程语言更加强大的表达能力,能够让我们将一些计算过程从运行时挪到编译时、通过编译期间的展开生成代码或者允许程序在运行时改变自身的行为。

总而言之,**元编程其实是一种使用代码生成代码的方式**,无论是编译期间生成代码,还是在运行时改变代码的行为都是『生成代码』的一种,下面的代码其实就可以看作一种最简单的元编程技巧:
~~~c
int main() {
for(int i = 0; i < 10; i++) {
char *echo = (char*)malloc(6 * sizeof(char));
sprintf(echo, "echo %d", i);
system(echo);
}
return 0;
}
~~~
这里的代码其实等价于执行了以下的 shell 脚本,也可以说这里使用了 C 语言的代码生成来生成 shell 脚本:
~~~shell
echo 0
echo 1
...
echo 9
~~~
## 编译时和运行时
现代的编程语言大都会为我们提供不同的元编程能力,从总体来看,根据『生成代码』的时机不同,我们将元编程能力分为两种类型,其中一种是编译期间的元编程,例如:宏和模板;另一种是运行期间的元编程,也就是运行时,它赋予了编程语言在运行期间修改行为的能力,当然也有一些特性既可以在编译期实现,也可以在运行期间实现。

不同的语言对于泛型就有不一样的实现,Java 的泛型就是在编译期间实现的,它的泛型其实是伪泛型,在编译期间所有的泛型就会被编译器擦除(type erasure),生成的 Java 字节码是不包含任何的泛型信息的,但是 C# 对于泛型就有着不同的实现了,它的泛型类型在运行时进行替换,为实例化的对象保留了泛型的类型信息。
> C++ 的模板其实与这里讨论的泛型有些类似,它会为每一个具体类型生成一份独立的代码,而 Java 的泛型只会生成一份经过类型擦除后的代码,总而言之 C++ 的模板完全是在编译期间实现的,而 Java 的泛型是编译期间和运行期间协作产生的;模板和泛型虽然非常类似,但是在这里提到的模板大都特指 C++ 的模板,而泛型这一概念其实包含了 C++ 的模板。
虽然泛型和模板为各种编程语言提供了非常强大的表达能力,但是在这篇文章中,我们会介绍另外两种元编程能力:*宏*和*运行时*,前者是在编译期间完成的,而后者是在代码运行期间才发生的。
## 宏(Macro)
宏是很多编程语言具有的特性之一,它是一个将输入的字符串映射成其他字符串的过程,这个映射的过程也被我们称作宏展开。

宏其实就是一个在编译期间中定义的展开过程,通过预先定义好的宏,我们可以使用少量的代码完成更多的逻辑和工作,能够减少应用程序中大量的重复代码。
很多编程语言,尤其是编译型语言都实现了宏这个特性,包括 C、Elixir 和 Rust,然而这些语言却使用了不同的方式来实现宏;我们在这里会介绍两种不同的宏,一种是基于文本替换的宏,另一种是基于语法的宏。

C、C++ 等语言使用基于文本替换的宏,而类似于 Elixir、Rust 等语言的宏系统其实都是基于语法树和语法元素的,它的实现会比前者复杂很多,应用也更加广泛。
在这一节的剩余部分,我们会分别介绍 C、Elixir 和 Rust 三种不同的编程语言实现的宏系统,它们的使用方法、适用范围和优缺点。
### C
作者相信很多工程师入门使用的编程语言其实都是 C 语言,而 C 语言的宏系统看起来还是相对比较简单的,虽然在实际使用时会遇到很多非常诡异的问题。C 语言的宏使用的就是文本替换的方式,所有的宏其实并不是通过编译器展开的,而是由预编译器来处理的。

编译器 GCC 根据『长相』将 C 语言中的宏分为两种,其中的一种宏与编程语言中定义变量非常类似:
~~~c
#define BUFFER_SIZE 1024
char *foo = (char *)malloc(BUFFER_SIZE);
char *foo = (char *)malloc(1024);
~~~
这些宏的定义就是一个简单的标识符,它们会在预编译的阶段被预编译器替换成定义后半部分出现的**字符**,这种宏定义其实比较类似于变量的声明,我们经常会使用这种宏定义替代一些无意义的数字,能够让程序变得更容易理解。
另一种宏定义就比较像对函数的定义了,与其他 C 语言的函数一样,这种宏在定义时也会包含一些宏的参数:
~~~c
#define plus(a, b) a + b
#define multiply(a, b) a * b
~~~
通过在宏的定义中引入参数,宏定义的内部就可以直接使用对应的标识符引入外界传入的参数,在定义之后我们就可以像使用函数一样使用它们:
~~~c
#define plus(a, b) a + b
#define multiply(a, b) a * b
int main(int argc, const char * argv[]) {
printf("%d", plus(1, 2)); // => 3
printf("%d", multiply(3, 2)); // => 6
return 0;
}
~~~
上面使用宏的代码与下面的代码是完全等价的,在预编译阶段之后,上面的代码就会被替换成下面的代码,也就是编译器其实是不负责宏展开的过程:
~~~c
int main(int argc, const char * argv[]) {
printf("%d", 1 + 2); // => 3
printf("%d", 3 * 2); // => 6
return 0;
}
~~~
宏的作用其实非常强大,基于文本替换的宏能做到很多函数无法做到的事情,比如使用宏根据传入的参数创建类并声明新的方法:
~~~c
#define pickerify(KLASS, PROPERTY) interface \
KLASS (Night_ ## PROPERTY ## _Picker) \
@property (nonatomic, copy, setter = dk_set ## PROPERTY ## Picker:) DKColorPicker dk_ ## PROPERTY ## Picker; \
@end \
@implementation \
KLASS (Night_ ## PROPERTY ## _Picker) \
- (DKColorPicker)dk_ ## PROPERTY ## Picker { \
return objc_getAssociatedObject(self, @selector(dk_ ## PROPERTY ## Picker)); \
} \
- (void)dk_set ## PROPERTY ## Picker:(DKColorPicker)picker { \
objc_setAssociatedObject(self, @selector(dk_ ## PROPERTY ## Picker), picker, OBJC_ASSOCIATION_COPY_NONATOMIC); \
[self setValue:picker(self.dk_manager.themeVersion) forKeyPath:@keypath(self, PROPERTY)];\
NSMutableDictionary *pickers = [self valueForKeyPath:@"pickers"];\
[pickers setValue:[picker copy] forKey:_DKSetterWithPROPERTYerty(@#PROPERTY)]; \
} \
@end
@pickerify(Button, backgroundColor);
~~~
上面的代码是我在一个 iOS 的开源库 [DKNightVersion](https://github.com/Draveness/DKNightVersion/blob/master/DKNightVersion/DKNightVersion.h#L57-L72) 中使用的代码,通过宏的文本替换功能,我们在这里创建了类、属性并且定义了属性的 getter/setter 方法,然而使用者对此其实是一无所知的。
C 语言中的宏只是提供了一些文本替换的功能再加上一些高级的 API,虽然它非常强大,但是强大的事物都是一把双刃剑,再加上 C 语言的宏从实现原理上就有一些无法避免的缺陷,所以在使用时还是要非常小心。
由于预处理器只是对宏进行替换,并没有做任何的语法检查,所以在宏出现问题时,编译器的报错往往会让我们摸不到头脑,不知道哪里出现了问题,还需要脑内对宏进行展开分析出现错误的原因;除此之外,类似于 `multiply(1+2, 3)` 的展开问题导致人和机器对于同一段代码的理解偏差,作者相信也广为人知了;更高级一些的**分号吞噬**、**参数的重复调用**以及**递归引用时不会递归展开**等问题其实在这里也不想多谈。
~~~c
multiply(1+2, 3) // #=> 1+2 * 3
~~~
#### 卫生宏
然而 C 语言宏的实现导致的另一个问题却是非常严重的:
~~~c
#define inc(i) do { int a = 0; ++i; } while(0)
int main(int argc, const char * argv[]) {
int a = 4, b = 8;
inc(a);
inc(b);
printf("%d, %d\n", a, b); // => 4, 9 !!
return 0;
}
~~~
> 这一小节与卫生宏有关的 C 语言代码取自 [Hygienic macro](https://en.wikipedia.org/wiki/Hygienic_macro) 中的代码示例。
上述代码中的 `printf` 函数理应打印出 `5, 9` 然而却打印出了 `4, 9`,我们来将上述代码中使用宏的部分展开来看一下:
~~~c
int main(int argc, const char * argv[]) {
int a = 4, b = 8;
do { int a = 0; ++a; } while(0);
do { int a = 0; ++b; } while(0);
printf("%d, %d\n", a, b); // => 4, 9 !!
return 0;
}
~~~
这里的 `a = 0` 按照逻辑应该不发挥任何的作用,但是在这里却覆盖了上下文中 `a` 变量的值,导致父作用域中变量 `a` 的值并没有 `+1`,这其实就是因为 C 语言中实现的宏不是*卫生宏*(Hygiene macro)。
作者认为卫生宏(Hygiene macro)是一个非常让人困惑的翻译,它其实指一些**在宏展开之后不会意外捕获上下文中标识符的宏**,从定义中我们就可以看到 C 语言中的宏明显不是卫生宏,而接下来要介绍的两种语言的宏系统就实现了卫生宏。
### Elixir
Elixir 是一门动态的函数式编程语言,它被设计用来构建可扩展、可维护的应用,所有的 Elixir 代码最终都会被编译成二进制文件运行在 Erlang 的虚拟机 Beam 上,构建在 Erlang 上的 Elixir 也继承了很多 Erlang 的优秀特性。然而在这篇文章中并不会展开介绍 Elixir 语言以及它的某些特点和应用,我们只想了解 Elixir 中的宏系统是如何使用和实现的。

宏是 Elixir 具有强大表达能力的一个重要原因,通过内置的宏系统可以减少系统中非常多的重复代码,我们可以使用 `defmacro` 定义一个宏来实现 `unless` 关键字:
~~~elixir
defmodule Unless do
defmacro macro_unless(clause, do: expression) do
quote do
if(!unquote(clause), do: unquote(expression))
end
end
end
~~~
这里的 `quote` 和 `unquote` 是宏系统中最重要的两个函数,你可以从字面上理解 `quote` 其实就是在一段代码的两侧加上双引号,让这段代码变成字符串,而 `unquote` 会将传入的多个参数的文本**原封不动**的插入到相应的位置,你可以理解为 `unquote` 只是将 `clause` 和 `expression` 代表的字符串当做了返回值。
~~~elixir
Unless.macro_unless true, do: IO.puts "this should never be printed"
~~~
上面的 Elixir 代码在真正执行之前会被替换成一个使用 `if` 的表达式,我们可以使用下面的方法获得宏展开之后的代码:
~~~elixir
iex> expr = quote do: Unless.macro_unless true, do: IO.puts "this should never be printed"
iex> expr |> Macro.expand_once(__ENV__) |> Macro.to_string |> IO.puts
if(!true) do
IO.puts("this should never be printed")
end
:ok
~~~
当我们为 `quote` 函数传入一个表达式的时候,它会将当前的表达式转换成一个抽象语法树:
~~~elixir
{% raw %}{{:., [], [{:__aliases__, [alias: false], [:Unless]}, :macro_unless]}, [],
[true,
[do: {{:., [], [{:__aliases__, [alias: false], [:IO]}, :puts]}, [],
["this should never be printed"]}]]}{% endraw %}
~~~
在 Elixir 中,抽象语法数是可以直接通过下面的 `Code.eval_quoted` 方法运行:
~~~elixir
iex> Code.eval_quoted [expr]
** (CompileError) nofile:1: you must require Unless before invoking the macro Unless.macro_unless/2
(elixir) src/elixir_dispatch.erl:97: :elixir_dispatch.dispatch_require/6
(elixir) lib/code.ex:213: Code.eval_quoted/3
iex> Code.eval_quoted [quote(do: require Unless), expr]
{[Unless, nil], []}
~~~
我们只运行当前的语法树,我们会发现当前的代码由于 `Unless` 模块没有加载导致宏找不到报错,所以我们在执行 `Unless.macro_unless` 之前需要先 `require` 对应的模块。

在最开始对当前的宏进行定义时,我们就会发现宏其实输入的是一些语法元素,实现内部也通过 `quote` 和 `unquote` 方法对当前的语法树进行修改,最后返回新的语法树:
~~~elixir
{% raw %}defmacro macro_unless(clause, do: expression) do
quote do
if(!unquote(clause), do: unquote(expression))
end
end
iex> expr = quote do: Unless.macro_unless true, do: IO.puts "this should never be printed"
{{:., [], [{:__aliases__, [alias: false], [:Unless]}, :macro_unless]}, [],
[true,
[do: {{:., [], [{:__aliases__, [alias: false], [:IO]}, :puts]}, [],
["this should never be printed"]}]]}
iex> Macro.expand_once expr, __ENV__
{:if, [context: Unless, import: Kernel],
[{:!, [context: Unless, import: Kernel], [true]},
[do: {{:., [],
[{:__aliases__, [alias: false, counter: -576460752303422687], [:IO]},
:puts]}, [], ["this should never be printed"]}]]}{% endraw %}
~~~
Elixir 中的宏相比于 C 语言中的宏更强大,这是因为它不是对代码中的文本直接进行替换,它能够为我们直接提供操作 Elixir 抽象语法树的能力,让我们能够参与到 Elixir 的编译过程,影响编译的结果;除此之外,Elixir 中的宏还是卫生宏(Hygiene Macro),宏中定义的参数并不会影响当前代码执行的上下文。
~~~elixir
defmodule Example do
defmacro hygienic do
quote do
val = 1
end
end
end
iex> val = 42
42
iex> Example.hygienic
1
iex> val
42
~~~
在上述代码中,虽然宏内部的变量与当前环境上下文中的变量重名了,但是宏内部的变量并没有影响上下文中 `val` 变量的变化,所以 Elixir 中宏系统是『卫生的』,如果我们真的想要改变上下文中的变量,可以使用 `var!` 来做这件事情:
~~~elixir
defmodule Example do
defmacro unhygienic do
quote do
var!(val) = 2
end
end
end
iex> val = 42
42
iex> Example.unhygienic
2
iex> val
2
~~~
相比于使用文本替换的 C 语言宏,Elixir 的宏系统解决了很多问题,例如:卫生宏,不仅如此,Elixir 的宏还允许我们修改当前的代码中的语法树,提供了更加强大的表达能力。
### Rust
Elixir 的宏系统其实已经足够强大了,不止避免了基于文本替换的宏带来的各种问题,我们还可以直接使用宏操作上下文的语法树,作者在一段时间内都觉得 Elixir 的宏系统是接触到的最强大的宏系统,直到开始学习 [Rust](https://www.rust-lang.org/en-US/) 才发现更复杂的宏系统。

Rust 是一门非常有趣的编程语言,它是一门有着极高的性能的系统级的编程语言,能够避免当前应用中发生的段错误并且保证线程安全和内存安全,但是这些都不是我们今天想要关注的事情,与 Elixir 一样,在这篇文章中我们仅仅关心 Rust 的宏系统到底是什么样的:
~~~rust
macro_rules! foo {
(x => $e:expr) => (println!("mode X: {}", $e));
(y => $e:expr) => (println!("mode Y: {}", $e));
}
~~~
上面的 Rust 代码定义了一个名为 `foo` 的宏,我们在代码中需要使用 `foo!` 来调用上面定义的宏:
~~~rust
fn main() {
foo!(y => 3); // => mode Y: 3
}
~~~
上述的宏 `foo` 的主体部分其实会将传入的**语法元素**与宏中的条件进行模式匹配,如果匹配到了,就会返回条件右侧的表达式,到这里其实与 Elixir 的宏系统没有太大的区别,Rust 宏相比 Elixir 更强大主要在于其提供了更加灵活的匹配系统,在宏 `foo` 的定义中使用的 `$e:expr` 就会匹配一个表达式并将表达式绑定到 `$e` 这个上下文的变量中,除此之外,在 Rust 中我们还可以组合使用以下的匹配符:

为了实现功能更强大的宏系统,Rust 的宏还提供了重复操作符和递归宏的功能,结合这两个宏系统的特性,我们能直接使用宏构建一个生成 HTML 的 DSL:
~~~rust
{% raw %}macro_rules! write_html {
($w:expr, ) => (());
($w:expr, $e:tt) => (write!($w, "{}", $e));
($w:expr, $tag:ident [ $($inner:tt)* ] $($rest:tt)*) => {{
write!($w, "<{}>", stringify!($tag));
write_html!($w, $($inner)*);
write!($w, "</{}>", stringify!($tag));
write_html!($w, $($rest)*);
}};
}{% endraw %}
~~~
在上述的 `write_html` 宏中,我们总共有三个匹配条件,其中前两个是宏的终止条件,第一个条件不会做任何的操作,第二个条件会将匹配到的 Token 树求值并写回到传入的字符串引用 `$w` 中,最后的条件就是最有意思的部分了,在这里我们使用了形如的 `$(...)*` 语法来**匹配零个或多个相同的语法元素**,例如 `$($inner:tt)*` 就是匹配零个以上的 Token 树(tt);在右侧的代码中递归调用了 `write_html` 宏并分别传入 `$($inner)*` 和 `$($rest)*` 两个参数,这样我们的 `write_html` 就能够解析 DSL 了。
有了 `write_html` 宏,我们就可以直接使用形如 `html[head[title["Macros guide"]]` 的代码返回如下所示的 HTML:
~~~html
<html><head><title>Macros guide</title></head></html>
~~~
> 这一节中提供的与 Rust 宏相关的例子都取自 [官方文档](https://doc.rust-lang.org/book/first-edition/macros.html) 中对宏的介绍这一部分内容。
Rust 的宏系统其实是基于一篇 1986 年的论文 [Macro-by-Example](https://www.cs.indiana.edu/ftp/techreports/TR206.pdf) 实现的,如果想要深入了解 Rust 的宏系统可以阅读这篇论文;Rust 的宏系统确实非常完备也足够强大,能够做很多我们使用 C 语言宏时无法做到的事情,极大地提高了语言的表达能力。
## 运行时(Runtime)
宏是一种能在程序执行的预编译或者编译期间改变代码行为的能力,通过编译期的处理过程赋予编程语言元编程能力;而运行时,顾名思义一般是指**面向对象**的编程语言在程序运行的某一个时间的上下文,在这里我们想要介绍的运行时可以理解为**能够在运行期间改变对象行为的机制**。

当相应的行为在当前对象上没有被找到时,运行时会提供一个改变当前对象行为的入口,在篇文章中提到的运行时不是广义上的运行时系统,它特指**面向对象语言在方法决议的过程中为外界提供的入口,让工程师提供的代码也能参与到当前的方法决议和信息发送的过程**。
在这一节中,我们将介绍的两个使用了运行时的面向对象编程语言 Objective-C 和 Ruby,它们有着相似的消息发送的流程,但是由于 OOP 模型实现的不同导致方法调用的过程稍微有一些差别;除此之外,由于 Objective-C 是需要通过编译器编译成二进制文件才能执行的,而 Ruby 可以直接被各种解释器运行,所以两者的元编程能力也会受到这一差别的影响,我们会在下面展开进行介绍。
### Objective-C
Objective-C 是一种通用的面向对象编程语言,它将 Smalltalk 消息发送的语法引入了 C 语言;ObjC 语言的面向对象模型其实都是运行在 ObjC Runtime 上的,整个运行时也为 ObjC 提供了方法查找的策略。

如上图所示,我们有一个 `Dog` 类的实例,当我们执行了 `dog.wtf` 方法时,运行时会先向右再向上的方式在整个继承链中查找相应的方法是否存在,如果当前方法在整个继承链中都完全不存在就会进入**动态方法决议**和**消息转发**的过程。

> 上述图片取自 [从代理到 RACSignal](https://draveness.me/racdelegateproxy),使用时对图片中的颜色以及字号稍作修改。
当 ObjC 的运行时在方法查找的过程中已经查找到了上帝类 `NSObject` 时,仍然没有找到方法的实现就会进入上面的流程,先执行的 `+resolveInstanceMethod:` 方法就是一个可以为当前的类添加方法的入口:
~~~objc
void dynamicMethodIMP(id self, SEL _cmd) { }
+ (BOOL)resolveInstanceMethod:(SEL)aSEL {
if (aSEL == @selector(resolveThisMethodDynamically)) {
class_addMethod([self class], aSEL, (IMP) dynamicMethodIMP, "v@:");
return YES;
}
return [super resolveInstanceMethod:aSel];
}
~~~
在这里可以通过 `class_addMethod` 动态的为当前的类添加新的方法和对应的实现,如果错过了这个入口,我们就进入了消息转发的流程;在这里,我们有两种选择,一种情况是通过 `-forwardTargetForSelector:` 将当前方法的调用直接转发到其他方法上,另一种就是组合 `-methodSignatureForSelector:` 和 `-forwardInvocation:` 两个方法,直接执行一个 `NSInvocation` 对象。
~~~objc
- (void)forwardInvocation:(NSInvocation *)anInvocation {
if ([someOtherObject respondsToSelector:[anInvocation selector]]) {
[anInvocation invokeWithTarget:someOtherObject];
} else {
[super forwardInvocation:anInvocation];
}
}
~~~
`-forwardTargetForSelector:` 方法只能简单地将方法直接转发给其他的对象,但是在 `-forwardInvocation:` 中我们可以得到一个 `NSInvocation` 实例,可以自由地选择需要执行哪些方法,并修改当前方法调用的上下文,包括:方法名、参数和目标对象。
虽然 Objective-C 的运行时系统能够为我们提供动态方法决议的功能,也就是某一个方法在编译期间哪怕不存在,我们也可以在运行时进行调用,这虽然听起来很不错,在很多时候我们都可以通过 `-performSelector:` 调用**编译器看起来不存的方法**,但是作为一门执行之前需要编译的语言,如果我们在 `+resolveInstanceMethod:` 中确实动态实现了一些方法,但是编译器在编译期间对这一切都毫不知情。
~~~objectivec
void dynamicMethodIMP(id self, SEL _cmd) { }
+ (BOOL)resolveInstanceMethod:(SEL)aSEL {
NSString *selector = NSStringFromSelector(aSEL);
if ([selector hasPrefix:@"find"]) {
class_addMethod([self class], aSEL, (IMP) dynamicMethodIMP, "v@:");
return YES;
}
return [super resolveInstanceMethod:aSel];
}
- (void)func {
[self findFoo];
[self findBar];
[self find];
}
~~~
从 `-func` 中调用的三个以 `find` 开头的方法其实会在运行期间添加到当前类上,但是编译器在编译期间对此一无所知,所以它会提示编译错误,在编译期间将可以运行的代码拦截了下来,这样的代码如果跳过编译器检查,直接运行是不会出问题的,但是代码的执行必须通过编译器编译,这一过程是无法跳过的。

我们只能通过 `-performSelector:` 方法绕过编译器的检查,不过使用 `-performSelector:` 会为代码添加非常多的噪音:
~~~objectivec
- (void)func {
[self performSelector:@selector(findFoo)];
[self performSelector:@selector(findBar)];
[self performSelector:@selector(find)];
}
~~~
所以虽然 Objective-C 通过运行时提供了比较强大的元编程能力,但是由于代码执行时需要经过编译器的检查,所以在很多时候我们都没有办法直接发挥运行时为我们带来的好处,需要通过其他的方式完成方法的调用。
### Ruby
除了 Objective-C 之外,Ruby 也提供了一些相似的运行时修改行为的特性,它能够在运行时修改自身特性的功能还是建立在它的 OOP 模型之上;Ruby 提供了一些在运行期间能够改变自身行为的入口和 API 可以帮助我们快速为当前的类添加方法或者实例变量。

当我们调用 `Dog` 实例的一个方法时,Ruby 会先找到当前对象的类,然后在由 `superclass` 构成的链上查找并调用相应的方法,这是 OOP 中非常常见的,**向右再向上**的方法查找过程。
与 Objective-C 几乎相同,Ruby 也提供了类似与 `+resolveInstanceMethod:` 的方法,如果方法在整个继承链上都完全不存在时,就会调用 `#method_missing` 方法,并传入与这次方法调用有关的参数:
~~~ruby
def method_missing(method, *args, &block)
end
~~~
传入的参数包括方法的符号,调用原方法时传入的参数和 block,在这里我们就可以为当前的类添加方法了:
~~~ruby
class Dog
def method_missing(m, *args, &block)
if m.to_s.start_with? 'find'
define_singleton_method(m) do |*args|
puts "#{m}, #{args}"
end
send(m, *args, &block)
else
super
end
end
end
~~~
通过 Ruby 提供的一些 API,例如 `define_method`、`define_singleton_method` 我们可以直接在运行期间快速改变对象的行为,在使用时也非常简单:
~~~ruby
pry(main)> d = Dog.new
=> #<Dog:0x007fe31e3f87a8>
pry(main)> d.find_by_name "dog"
find_by_name, ["dog"]
=> nil
pry(main)> d.find_by_name "dog", "another_dog"
find_by_name, ["dog", "another_dog"]
=> nil
~~~
当我们调用以 `find` 开头的实例方法时,由于在当前实例的类以及父类上没有实现,所以就会进入 `#method_missing` 方法并为**当前实例**定义新的方法 `#find_by_name`。
> 注意:当前的 `#find_by_name` 方法只是定义在当前实例上的,存储在当前实例的单类上。
由于 Ruby 是脚本语言,解释器在脚本执行之前不会对代码进行检查,所以哪怕在未执行期间并不存在的 `#find_by_name` 方法也不会导致解释器报错,在运行期间通过 `#define_singleton_method` 动态地
定义了新的 `#find_by_name` 方法修改了对象的行为,达到了为对象批量添加相似功能的目的。
## 总结
在文章中介绍的两种不同的元编程能力,宏系统和运行时,前者通过预先定义好的一些宏规则,在预编译和编译期间对代码进行展开和替换,而后者提供了在运行期间改变代码行为的能力,两种方式的本质都是通过少量的代码生成一些非常相似的代码和逻辑,能够增强编程语言的表达能力并减少开发者的工作量。
无论是宏还是运行时其实都是简化程序中代码的一种手段,归根结底就是一种使用代码生成代码的思想,如果我们能够掌握这种元编程的思想并在编程中熟练的运用就能够很好地解决程序中一些诡异的问题,还能消灭重复的代码,提高我们运用以及掌控编程语言的能力,能够极大地增强编程语言的表达能力,所以元编程确实是一种非常重要并且需要学习的思想。
## Reference
+ [Metaprogramming](https://en.m.wikipedia.org/wiki/Metaprogramming)
+ [C++ 模板和 C# 泛型之间的区别(C# 编程指南)](https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/generics/differences-between-cpp-templates-and-csharp-generics)
+ [C++ 模板和 Java 泛型有什么异同?](https://www.zhihu.com/question/33304378)
+ [Macro (computer science)](https://en.wikipedia.org/wiki/Macro_(computer_science))
+ [Macros · Elixir Doc](https://elixir-lang.org/getting-started/meta/macros.html)
+ [Macros · GCC](https://gcc.gnu.org/onlinedocs/cpp/Macros.html)
+ [C 语言宏的特殊用法和几个坑](http://hbprotoss.github.io/posts/cyu-yan-hong-de-te-shu-yong-fa-he-ji-ge-keng.html)
+ [Hygienic macro](https://en.wikipedia.org/wiki/Hygienic_macro)
+ [Metaprogramming · ElixirSchool](https://elixirschool.com/en/lessons/advanced/metaprogramming/)
+ [Macros · Rust Doc](https://doc.rust-lang.org/book/first-edition/macros.html)
+ [Macro-by-Example](https://www.cs.indiana.edu/ftp/techreports/TR206.pdf)
+ [Rust](https://www.rust-lang.org/en-US/)
+ [从源代码看 ObjC 中消息的发送](https://draveness.me/message)
+ [Dynamic Method Resolution](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtDynamicResolution.html)
+ [Message Forwarding](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtForwarding.html#//apple_ref/doc/uid/TP40008048-CH105-SW1)
+ [从代理到 RACSignal](https://draveness.me/racdelegateproxy)
+ [resolveInstanceMethod(_:)](https://developer.apple.com/documentation/objectivec/nsobject/1418500-resolveinstancemethod)
+ [Ruby Method Missing](http://rubylearning.com/satishtalim/ruby_method_missing.html)
+ [Ruby Metaprogramming - Method Missing](https://www.leighhalliday.com/ruby-metaprogramming-method-missing)
|
Draveness/draveness-blog
|
_posts/2017-12-10-metaprogramming.md
|
Markdown
|
mit
| 31,524
|
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('Favorites', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
userId: {
type: Sequelize.STRING
},
recipeId: {
type: Sequelize.STRING
},
recipeId: {
type: Sequelize.INTEGER,
onDelete: 'CASCADE',
references: {
model: 'Recipes',
key: 'id'
}
},
userId: {
type: Sequelize.INTEGER,
onDelete: 'CASCADE',
references: {
model: 'Users',
key: 'id'
}
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('Favorites');
}
};
|
emmabaye/more-recipes
|
server/migrations/20171030225732-create-favorite.js
|
JavaScript
|
mit
| 1,065
|
package matchers
import (
"fmt"
"github.com/bfontaine/go-tchoutchou/Godeps/_workspace/src/github.com/onsi/gomega/format"
"reflect"
)
type BeEquivalentToMatcher struct {
Expected interface{}
}
func (matcher *BeEquivalentToMatcher) Match(actual interface{}) (success bool, err error) {
if actual == nil && matcher.Expected == nil {
return false, fmt.Errorf("Both actual and expected must not be nil.")
}
convertedActual := actual
if actual != nil && matcher.Expected != nil && reflect.TypeOf(actual).ConvertibleTo(reflect.TypeOf(matcher.Expected)) {
convertedActual = reflect.ValueOf(actual).Convert(reflect.TypeOf(matcher.Expected)).Interface()
}
return reflect.DeepEqual(convertedActual, matcher.Expected), nil
}
func (matcher *BeEquivalentToMatcher) FailureMessage(actual interface{}) (message string) {
return format.Message(actual, "to be equivalent to", matcher.Expected)
}
func (matcher *BeEquivalentToMatcher) NegatedFailureMessage(actual interface{}) (message string) {
return format.Message(actual, "not to be equivalent to", matcher.Expected)
}
|
bfontaine/go-tchoutchou
|
Godeps/_workspace/src/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go
|
GO
|
mit
| 1,078
|
/*
FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that has become a de facto standard. *
* *
* Help yourself get started quickly and support the FreeRTOS *
* project by purchasing a FreeRTOS tutorial book, reference *
* manual, or both from: http://www.FreeRTOS.org/Documentation *
* *
* Thank you! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
FreeRTOS 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. Full license text is available from the following
link: http://www.freertos.org/a00114.html
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
license and Real Time Engineers Ltd. contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#ifndef configINTERRUPT_CONTROLLER_BASE_ADDRESS
#error configINTERRUPT_CONTROLLER_BASE_ADDRESS must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
#endif
#ifndef configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET
#error configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
#endif
#ifndef configUNIQUE_INTERRUPT_PRIORITIES
#error configUNIQUE_INTERRUPT_PRIORITIES must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
#endif
#ifndef configSETUP_TICK_INTERRUPT
#error configSETUP_TICK_INTERRUPT() must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
#endif /* configSETUP_TICK_INTERRUPT */
#ifndef configMAX_API_CALL_INTERRUPT_PRIORITY
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
#endif
#if configMAX_API_CALL_INTERRUPT_PRIORITY == 0
#error configMAX_API_CALL_INTERRUPT_PRIORITY must not be set to 0
#endif
#if configMAX_API_CALL_INTERRUPT_PRIORITY > configUNIQUE_INTERRUPT_PRIORITIES
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be less than or equal to configUNIQUE_INTERRUPT_PRIORITIES as the lower the numeric priority value the higher the logical interrupt priority
#endif
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
/* Check the configuration. */
#if( configMAX_PRIORITIES > 32 )
#error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
#endif
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
/* In case security extensions are implemented. */
#if configMAX_API_CALL_INTERRUPT_PRIORITY <= ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
#endif
#ifndef configCLEAR_TICK_INTERRUPT
#define configCLEAR_TICK_INTERRUPT()
#endif
/* The number of bits to shift for an interrupt priority is dependent on the
number of bits implemented by the interrupt controller. */
#if configUNIQUE_INTERRUPT_PRIORITIES == 16
#define portPRIORITY_SHIFT 4
#define portMAX_BINARY_POINT_VALUE 3
#elif configUNIQUE_INTERRUPT_PRIORITIES == 32
#define portPRIORITY_SHIFT 3
#define portMAX_BINARY_POINT_VALUE 2
#elif configUNIQUE_INTERRUPT_PRIORITIES == 64
#define portPRIORITY_SHIFT 2
#define portMAX_BINARY_POINT_VALUE 1
#elif configUNIQUE_INTERRUPT_PRIORITIES == 128
#define portPRIORITY_SHIFT 1
#define portMAX_BINARY_POINT_VALUE 0
#elif configUNIQUE_INTERRUPT_PRIORITIES == 256
#define portPRIORITY_SHIFT 0
#define portMAX_BINARY_POINT_VALUE 0
#else
#error Invalid configUNIQUE_INTERRUPT_PRIORITIES setting. configUNIQUE_INTERRUPT_PRIORITIES must be set to the number of unique priorities implemented by the target hardware
#endif
/* A critical section is exited when the critical section nesting count reaches
this value. */
#define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
/* In all GICs 255 can be written to the priority mask register to unmask all
(but the lowest) interrupt priority. */
#define portUNMASK_VALUE ( 0xFFUL )
/* Tasks are not created with a floating point context, but can be given a
floating point context after they have been created. A variable is stored as
part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
does not have an FPU context, or any other value if the task does have an FPU
context. */
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
/* Interrupt controller access addresses. */
#define portICCPMR_PRIORITY_MASK_OFFSET ( 0x04 )
#define portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET ( 0x0C )
#define portICCEOIR_END_OF_INTERRUPT_OFFSET ( 0x10 )
#define portICCBPR_BINARY_POINT_OFFSET ( 0x08 )
#define portICCRPR_RUNNING_PRIORITY_OFFSET ( 0x14 )
#define portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS ( configINTERRUPT_CONTROLLER_BASE_ADDRESS + configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET )
#define portICCPMR_PRIORITY_MASK_REGISTER ( *( ( volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET ) ) )
#define portICCIAR_INTERRUPT_ACKNOWLEDGE_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCIAR_INTERRUPT_ACKNOWLEDGE_OFFSET )
#define portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCEOIR_END_OF_INTERRUPT_OFFSET )
#define portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCPMR_PRIORITY_MASK_OFFSET )
#define portICCBPR_BINARY_POINT_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCBPR_BINARY_POINT_OFFSET ) ) )
#define portICCRPR_RUNNING_PRIORITY_REGISTER ( *( ( const volatile uint32_t * ) ( portINTERRUPT_CONTROLLER_CPU_INTERFACE_ADDRESS + portICCRPR_RUNNING_PRIORITY_OFFSET ) ) )
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
point is zero. */
#define portBINARY_POINT_BITS ( ( uint8_t ) 0x03 )
/* Constants required to setup the initial task context. */
#define portINITIAL_SPSR ( ( StackType_t ) 0x1f ) /* System mode, ARM mode, interrupts enabled. */
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
#define portTHUMB_MODE_ADDRESS ( 0x01UL )
/* Masks all bits in the APSR other than the mode bits. */
#define portAPSR_MODE_BITS_MASK ( 0x1F )
/* The value of the mode bits in the APSR when the CPU is executing in user
mode. */
#define portAPSR_USER_MODE ( 0x10 )
/* Macro to unmask all interrupt priorities. */
#define portCLEAR_INTERRUPT_MASK() \
{ \
__disable_irq(); \
portICCPMR_PRIORITY_MASK_REGISTER = portUNMASK_VALUE; \
__asm( "DSB \n" \
"ISB \n" ); \
__enable_irq(); \
}
/*-----------------------------------------------------------*/
/*
* Starts the first task executing. This function is necessarily written in
* assembly code so is implemented in portASM.s.
*/
extern void vPortRestoreTaskContext( void );
/*
* Used to catch tasks that attempt to return from their implementing function.
*/
static void prvTaskExitError( void );
/*-----------------------------------------------------------*/
/* A variable is used to keep track of the critical section nesting. This
variable has to be stored as part of the task context and must be initialised to
a non zero value to ensure interrupts don't inadvertently become unmasked before
the scheduler starts. As it is stored as part of the task context it will
automatically be set to 0 when the first task is started. */
volatile uint32_t ulCriticalNesting = 9999UL;
/* Used to pass constants into the ASM code. The address at which variables are
placed is the constant value so indirect loads in the asm code are not
required. */
uint32_t ulICCIAR __attribute__( ( at( portICCIAR_INTERRUPT_ACKNOWLEDGE_REGISTER_ADDRESS ) ) );
uint32_t ulICCEOIR __attribute__( ( at( portICCEOIR_END_OF_INTERRUPT_REGISTER_ADDRESS ) ) );
uint32_t ulICCPMR __attribute__( ( at( portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS ) ) );
uint32_t ulAsmAPIPriorityMask __attribute__( ( at( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) ) );
/* Saved as part of the task context. If ulPortTaskHasFPUContext is non-zero then
a floating point context must be saved and restored for the task. */
uint32_t ulPortTaskHasFPUContext = pdFALSE;
/* Set to 1 to pend a context switch from an ISR. */
uint32_t ulPortYieldRequired = pdFALSE;
/* Counts the interrupt nesting depth. A context switch is only performed if
if the nesting depth is 0. */
uint32_t ulPortInterruptNesting = 0UL;
/*-----------------------------------------------------------*/
/*
* See header file for description.
*/
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
{
/* Setup the initial stack of the task. The stack is set exactly as
expected by the portRESTORE_CONTEXT() macro.
The fist real value on the stack is the status register, which is set for
system mode, with interrupts enabled. A few NULLs are added first to ensure
GDB does not try decoding a non-existent return address. */
*pxTopOfStack = NULL;
pxTopOfStack--;
*pxTopOfStack = NULL;
pxTopOfStack--;
*pxTopOfStack = NULL;
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
if( ( ( uint32_t ) pxCode & portTHUMB_MODE_ADDRESS ) != 0x00UL )
{
/* The task will start in THUMB mode. */
*pxTopOfStack |= portTHUMB_MODE_BIT;
}
pxTopOfStack--;
/* Next the return address, which in this case is the start of the task. */
*pxTopOfStack = ( StackType_t ) pxCode;
pxTopOfStack--;
/* Next all the registers other than the stack pointer. */
*pxTopOfStack = ( StackType_t ) prvTaskExitError; /* R14 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x12121212; /* R12 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x11111111; /* R11 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x10101010; /* R10 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x09090909; /* R9 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x08080808; /* R8 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x07070707; /* R7 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x06060606; /* R6 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x05050505; /* R5 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x04040404; /* R4 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x03030303; /* R3 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x02020202; /* R2 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) 0x01010101; /* R1 */
pxTopOfStack--;
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
pxTopOfStack--;
/* The task will start with a critical nesting count of 0 as interrupts are
enabled. */
*pxTopOfStack = portNO_CRITICAL_NESTING;
pxTopOfStack--;
/* The task will start without a floating point context. A task that uses
the floating point hardware must call vPortTaskUsesFPU() before executing
any floating point instructions. */
*pxTopOfStack = portNO_FLOATING_POINT_CONTEXT;
return pxTopOfStack;
}
/*-----------------------------------------------------------*/
static void prvTaskExitError( void )
{
/* A function that implements a task must not exit or attempt to return to
its caller as there is nothing to return to. If a task wants to exit it
should instead call vTaskDelete( NULL ).
Artificially force an assert() to be triggered if configASSERT() is
defined, then stop here so application writers can catch the error. */
configASSERT( ulPortInterruptNesting == ~0UL );
portDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
BaseType_t xPortStartScheduler( void )
{
uint32_t ulAPSR;
/* Only continue if the CPU is not in User mode. The CPU must be in a
Privileged mode for the scheduler to start. */
__asm( "MRS ulAPSR, APSR" );
ulAPSR &= portAPSR_MODE_BITS_MASK;
configASSERT( ulAPSR != portAPSR_USER_MODE );
if( ulAPSR != portAPSR_USER_MODE )
{
/* Only continue if the binary point value is set to its lowest possible
setting. See the comments in vPortValidateInterruptPriority() below for
more information. */
configASSERT( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE );
if( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE )
{
/* Start the timer that generates the tick ISR. */
configSETUP_TICK_INTERRUPT();
__enable_irq();
vPortRestoreTaskContext();
}
}
/* Will only get here if xTaskStartScheduler() was called with the CPU in
a non-privileged mode or the binary point register was not set to its lowest
possible value. */
return 0;
}
/*-----------------------------------------------------------*/
void vPortEndScheduler( void )
{
/* Not implemented in ports where there is nothing to return to.
Artificially force an assert. */
configASSERT( ulCriticalNesting == 1000UL );
}
/*-----------------------------------------------------------*/
void vPortEnterCritical( void )
{
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
ulPortSetInterruptMask();
/* Now interrupts are disabled ulCriticalNesting can be accessed
directly. Increment ulCriticalNesting to keep a count of how many times
portENTER_CRITICAL() has been called. */
ulCriticalNesting++;
/* This is not the interrupt safe version of the enter critical function so
assert() if it is being called from an interrupt context. Only API
functions that end in "FromISR" can be used in an interrupt. Only assert if
the critical nesting count is 1 to protect against recursive calls if the
assert function also uses a critical section. */
if( ulCriticalNesting == 1 )
{
configASSERT( ulPortInterruptNesting == 0 );
}
}
/*-----------------------------------------------------------*/
void vPortExitCritical( void )
{
if( ulCriticalNesting > portNO_CRITICAL_NESTING )
{
/* Decrement the nesting count as the critical section is being
exited. */
ulCriticalNesting--;
/* If the nesting level has reached zero then all interrupt
priorities must be re-enabled. */
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
{
/* Critical nesting has reached zero so all interrupt priorities
should be unmasked. */
portCLEAR_INTERRUPT_MASK();
}
}
}
/*-----------------------------------------------------------*/
void FreeRTOS_Tick_Handler( void )
{
/* Set interrupt mask before altering scheduler structures. The tick
handler runs at the lowest priority, so interrupts cannot already be masked,
so there is no need to save and restore the current mask value. */
__disable_irq();
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
__asm( "DSB \n"
"ISB \n" );
__enable_irq();
/* Increment the RTOS tick. */
if( xTaskIncrementTick() != pdFALSE )
{
ulPortYieldRequired = pdTRUE;
}
/* Ensure all interrupt priorities are active again. */
portCLEAR_INTERRUPT_MASK();
configCLEAR_TICK_INTERRUPT();
}
/*-----------------------------------------------------------*/
void vPortTaskUsesFPU( void )
{
uint32_t ulInitialFPSCR = 0;
/* A task is registering the fact that it needs an FPU context. Set the
FPU flag (which is saved as part of the task context). */
ulPortTaskHasFPUContext = pdTRUE;
/* Initialise the floating point status register. */
__asm( "FMXR FPSCR, ulInitialFPSCR" );
}
/*-----------------------------------------------------------*/
void vPortClearInterruptMask( uint32_t ulNewMaskValue )
{
if( ulNewMaskValue == pdFALSE )
{
portCLEAR_INTERRUPT_MASK();
}
}
/*-----------------------------------------------------------*/
uint32_t ulPortSetInterruptMask( void )
{
uint32_t ulReturn;
__disable_irq();
if( portICCPMR_PRIORITY_MASK_REGISTER == ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
{
/* Interrupts were already masked. */
ulReturn = pdTRUE;
}
else
{
ulReturn = pdFALSE;
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
__asm( "DSB \n"
"ISB \n" );
}
__enable_irq();
return ulReturn;
}
/*-----------------------------------------------------------*/
#if( configASSERT_DEFINED == 1 )
void vPortValidateInterruptPriority( void )
{
/* The following assertion will fail if a service routine (ISR) for
an interrupt that has been assigned a priority above
configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
function. ISR safe FreeRTOS API functions must *only* be called
from interrupts that have been assigned a priority at or below
configMAX_SYSCALL_INTERRUPT_PRIORITY.
Numerically low interrupt priority numbers represent logically high
interrupt priorities, therefore the priority of the interrupt must
be set to a value equal to or numerically *higher* than
configMAX_SYSCALL_INTERRUPT_PRIORITY.
FreeRTOS maintains separate thread and ISR API functions to ensure
interrupt entry is as fast and simple as possible.
The following links provide detailed information:
http://www.freertos.org/RTOS-Cortex-M3-M4.html
http://www.freertos.org/FAQHelp.html */
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );
/* Priority grouping: The interrupt controller (GIC) allows the bits
that define each interrupt's priority to be split between bits that
define the interrupt's pre-emption priority bits and bits that define
the interrupt's sub-priority. For simplicity all bits must be defined
to be pre-emption priority bits. The following assertion will fail if
this is not the case (if some bits represent a sub-priority).
The priority grouping is configured by the GIC's binary point register
(ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest
possible value (which may be above 0). */
configASSERT( portICCBPR_BINARY_POINT_REGISTER <= portMAX_BINARY_POINT_VALUE );
}
#endif /* configASSERT_DEFINED */
|
Velleman/VM204-Firmware
|
common/freertos/portable/rvds/arm_ca9/port.c
|
C
|
mit
| 21,215
|
package vidada.model.images.cache;
import archimedes.core.geometry.Size;
import archimedes.core.images.IMemoryImage;
import java.util.Set;
/**
* Combines two caches
* @author IsNull
*
*/
public class LeveledImageCache implements IImageCache {
// Add cached images from second cache to the first one
private final boolean updateFirstFromSecond = true;
// Add cached images in the first level cache to the second one
private final boolean updateSecondFromFirst = true;
private final IImageCache firstLevelCache;
private final IImageCache secondLevelCache;
/**
*
* @param firstLevelCache
* @param secondLevelCache
*/
public LeveledImageCache(IImageCache firstLevelCache, IImageCache secondLevelCache) {
if(firstLevelCache == null) throw new IllegalArgumentException("firstLevelCache");
if(secondLevelCache == null) throw new IllegalArgumentException("secondLevelCache");
this.firstLevelCache = firstLevelCache;
this.secondLevelCache = secondLevelCache;
}
@Override
public IMemoryImage getImageById(String id, Size size) {
IMemoryImage image = firstLevelCache.getImageById(id, size);
if(image == null){
// image does not exist in firstLevel cache
image = secondLevelCache.getImageById(id, size);
if(updateFirstFromSecond && image != null){
firstLevelCache.storeImage(id, image);
}
}else if(updateSecondFromFirst && !secondLevelCache.exists(id, size)) {
secondLevelCache.storeImage(id, image);
}
return image;
}
@Override
public Set<Size> getCachedDimensions(String id) {
Set<Size> fd = firstLevelCache.getCachedDimensions(id);
Set<Size> sd = secondLevelCache.getCachedDimensions(id);
fd.addAll(sd); // Merge
return fd;
}
@Override
public boolean exists(String id, Size size) {
return firstLevelCache.exists(id, size) || secondLevelCache.exists(id, size);
}
@Override
public void storeImage(String id, IMemoryImage image) {
firstLevelCache.storeImage(id, image);
secondLevelCache.storeImage(id, image);
}
@Override
public void removeImage(String id) {
firstLevelCache.removeImage(id);
secondLevelCache.removeImage(id);
}
}
|
Vidada-Project/Vidada
|
vidada.core/src/main/java/vidada/model/images/cache/LeveledImageCache.java
|
Java
|
mit
| 2,131
|
var group___d_m_a_ex =
[
[ "DMAEx Exported Types", "group___d_m_a_ex___exported___types.html", "group___d_m_a_ex___exported___types" ],
[ "DMAEx Exported Functions", "group___d_m_a_ex___exported___functions.html", "group___d_m_a_ex___exported___functions" ],
[ "DMAEx Private Functions", "group___d_m_a_ex___private___functions.html", null ]
];
|
team-diana/nucleo-dynamixel
|
docs/html/group___d_m_a_ex.js
|
JavaScript
|
mit
| 356
|
var relativeImports = /import\s*{[a-zA-Z\,\s]+}\s*from\s*'\.\/[a-zA-Z\-]+';\s*/g;
var nonRelativeImports = /import\s*{?[a-zA-Z\*\,\s]+}?\s*from\s*'[a-zA-Z\-]+';\s*/g;
var importGrouper = /import\s*{([a-zA-Z\,\s]+)}\s*from\s*'([a-zA-Z\-]+)'\s*;\s*/;
exports.extractImports = function(content, importsToAdd){
var matchesToKeep = content.match(nonRelativeImports);
if(matchesToKeep){
matchesToKeep.forEach(function(toKeep){ importsToAdd.push(toKeep) });
}
content = content.replace(nonRelativeImports, '');
content = content.replace(relativeImports, '');
return content;
};
exports.createImportBlock = function(importsToAdd){
var finalImports = {}, importBlock = '';
importsToAdd.forEach(function(toAdd){
var groups = importGrouper.exec(toAdd);
if(!groups) {
toAdd = toAdd.trim();
if(importBlock.indexOf(toAdd) === -1){
importBlock += toAdd + '\n';
}
return;
};
var theImports = groups[1].split(',');
var theSource = groups[2].trim();
var theList = finalImports[theSource] || (finalImports[theSource] = []);
theImports.forEach(function(item){
item = item.trim();
if(theList.indexOf(item) === -1){
theList.push(item);
}
});
});
Object.keys(finalImports).forEach(function(key) {
importBlock += 'import {' + finalImports[key].join(',') + '} from \'' + key + '\';\n';
});
return importBlock + '\n';
};
|
bryanrsmith/tools
|
src/build.js
|
JavaScript
|
mit
| 1,428
|
// old skool dw textbox:
// gen-dq-textbox dw.png
// old skool ff textbox:
// gen-dq-textbox -bg "rgb(100,100,200)" -xbg "rgb(0,0,0)" -mbg 0.125 ff.png
package main
import (
"flag"
"fmt"
"image"
"image/color"
"log"
"math"
"os"
"github.com/qeedquan/go-media/image/chroma"
"github.com/qeedquan/go-media/image/imageutil"
)
var flags struct {
Width int
Height int
Thickness int
MFG, MBG float64
FG, XFG color.RGBA
BG, XBG color.RGBA
}
func main() {
log.SetFlags(0)
log.SetPrefix("gen-dq-textbox: ")
parseFlags()
m := gen(flags.Width, flags.Height, flags.Thickness, flags.FG, flags.BG,
flags.XFG, flags.XBG, flags.MFG, flags.MBG)
err := imageutil.WriteRGBAFile(flag.Arg(0), m)
ck(err)
}
func ck(err error) {
if err != nil {
log.Fatal(err)
}
}
func parseFlags() {
var dim, fg, bg, xfg, xbg string
flag.StringVar(&dim, "d", "1024x128", "image dimension")
flag.StringVar(&fg, "fg", "#ffffff", "foreground color")
flag.StringVar(&bg, "bg", "#000000", "backround color")
flag.StringVar(&xfg, "xfg", "", "foreground color gradient")
flag.StringVar(&xbg, "xbg", "", "background color gradient")
flag.IntVar(&flags.Thickness, "t", 8, "thickness")
flag.Float64Var(&flags.MFG, "mfg", 0, "multiple step size for foreground linear gradient")
flag.Float64Var(&flags.MBG, "mbg", 0, "multiple step size for background linear gradient")
flag.Usage = usage
flag.Parse()
if flag.NArg() < 1 {
usage()
}
fmt.Sscanf(dim, "%dx%d", &flags.Width, &flags.Height)
flags.FG = parseRGBA(fg)
flags.BG = parseRGBA(bg)
flags.XFG = flags.FG
flags.XBG = flags.BG
if xfg != "" {
flags.XFG = parseRGBA(xfg)
}
if xbg != "" {
flags.XBG = parseRGBA(xbg)
}
if flags.MFG == 0 {
flags.MFG = 1.0 / float64(flags.Thickness)
}
if flags.MBG == 0 {
flags.MBG = 1.0 / float64(flags.Height)
}
}
func parseRGBA(s string) color.RGBA {
c, err := chroma.ParseRGBA(s)
ck(err)
return c
}
func usage() {
fmt.Fprintln(os.Stderr, "usage: gen-dq-textbox [options] output")
flag.PrintDefaults()
os.Exit(2)
}
func gen(w, h int, thickness int, fg, bg, xfg, xbg color.RGBA, mfg, mbg float64) *image.RGBA {
r := image.Rect(0, 0, w, h)
m := image.NewRGBA(r)
// bg
for y := r.Min.Y; y < r.Max.Y; y++ {
for x := r.Min.X; x < r.Max.X; x++ {
t := float64(y-r.Min.Y) / float64(r.Max.Y-r.Min.Y)
t = multiple(t, mbg)
c := mix(bg, xbg, t)
m.Set(x, y, c)
}
}
// border
s := r.Inset(8)
for x := s.Min.X; x < s.Max.X; x++ {
for y := 0; y < thickness; y++ {
t := float64(y) / float64(thickness)
t = multiple(t, mfg)
c := mix(fg, xfg, t)
m.Set(x, s.Min.Y+y, c)
m.Set(x, s.Max.Y-y-1, c)
}
}
for y := s.Min.Y; y < s.Max.Y; y++ {
for x := 0; x < thickness; x++ {
t := float64(x) / float64(thickness)
t = multiple(t, mfg)
c := mix(fg, xfg, t)
m.Set(s.Min.X+x, y, c)
m.Set(s.Max.X-x-1, y, c)
}
}
// round
n := thickness * 3 / 4
for y := 0; y < n; y++ {
for x := 0; x < n; x++ {
t := float64(s.Min.Y+y-s.Min.Y) / float64(s.Max.Y-s.Min.Y)
t = multiple(t, mbg)
bg1 := mix(bg, xbg, t)
t = float64(s.Max.Y-y-s.Min.Y) / float64(s.Max.Y-s.Min.Y)
t = multiple(t, mbg)
bg2 := mix(bg, xbg, t)
m.Set(s.Min.X+x, s.Min.Y+y, bg1)
m.Set(s.Min.X+x+thickness, s.Min.Y+y+thickness, fg)
m.Set(s.Max.X-x, s.Min.Y+y, bg1)
m.Set(s.Max.X-x-thickness, s.Min.Y+y+thickness, fg)
m.Set(s.Min.X+x, s.Max.Y-y, bg2)
m.Set(s.Min.X+x+thickness, s.Max.Y-y-thickness, fg)
m.Set(s.Max.X-x, s.Max.Y-y, bg2)
m.Set(s.Max.X-x-thickness, s.Max.Y-y-thickness, fg)
}
}
return m
}
func mix(a, b color.RGBA, t float64) color.RGBA {
return color.RGBA{
uint8(float64(a.R)*(1-t) + t*float64(b.R)),
uint8(float64(a.G)*(1-t) + t*float64(b.G)),
uint8(float64(a.B)*(1-t) + t*float64(b.B)),
uint8(float64(a.A)*(1-t) + t*float64(b.A)),
}
}
func multiple(a, m float64) float64 {
return math.Ceil(a/m) * m
}
|
qeedquan/misc_utilities
|
game_tools/gen-dq-textbox.go
|
GO
|
mit
| 4,070
|
#import <SpriteKit/SpriteKit.h>
@interface FFGameOverScene : SKScene
@end
|
marioizquierdo/flappy_fart_ios_game
|
flappy_fart/FFGameOverScene.h
|
C
|
mit
| 76
|
# Loading Data #
To load data use the charts_\_load\_model\_ tcl command.
This command supports loading files in the following formats:
+ csv
+ Comma Separated Value data
+ tsv
+ Tab Separated Value Data
+ json
+ JSON Data
+ data
+ GNUPlot like data (space separated)
and also allows the data to be generated from a tcl expression or read from a tcl variable (list of lists).
For csv, csv and data formats the reader recognises lines starting with # as comments. Headers for the columns can be take from the first non-comment line or first comment line.
csv defaults to using a comma for the value separator. This can be changed to any character to support other separator types.
csv format also supports specially formated comments to support meta data for specifying additional column data e.g. column types and formats.
The tcl expression is run on a specified number of rows (default 100).
The data processed can be limited by specifying a maximum number of rows, a tcl filter expression or specific columns.
The types of the columns can be specified.
The command returns a unique identifier the for model which can be used in other commands e.g. as the input model for a plot.
|
colinw7/CQCharts
|
doc/load_model.md
|
Markdown
|
mit
| 1,216
|
<?php
return array(
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
|
*/
'driver' => 'mail',
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'host' => '',
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => 465,
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => array('address' => '', 'name' => ''),
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => 'tls',
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => '',
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => '',
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
'pretend' => false,
);
|
wcernetwork/NetworkEd
|
app/config/mail.php
|
PHP
|
mit
| 3,967
|
'use strict';
module.exports = function(app) {
// Root routing
var core = require('../../app/controllers/core.server.controller');
app.route('/').get(core.index);
app.route('/check').put(core.check);
};
|
michaelhowden/CoverCheck
|
app/routes/core.server.routes.js
|
JavaScript
|
mit
| 208
|
from tools import *
from default_record import *
from xen.xend import uuid
from xen.xend import XendDomain, XendNode
from xen.xend import BNVMAPI, BNStorageAPI
from xen.xend.server.netif import randomMAC
from xen.xend.ConfigUtil import getConfigVar
from xen.xend.XendAPIConstants import *
from xen.xend.XendAuthSessions import instance as auth_manager
from xen.xend.XendLogging import log_unittest, init
init("/var/log/xen/unittest.log", "DEBUG", log_unittest)
log = log_unittest
MB = 1024 * 1024
XEND_NODE = XendNode.instance()
XEND_DOMAIN = XendDomain.instance()
VMAPI = BNVMAPI.instance()
STORAGEAPI = BNStorageAPI.instance()
SESSION = "SessionForTest"
# SESSION = VMAPI.session_login_with_password('root', 'onceas').get('Value')
SR_TYPE = 'ocfs2'
ISO_SR_TYPE = 'gpfs_iso'
VM_VDI_MAP = {}
if getConfigVar('compute', 'VM', 'disk_limit'):
DISK_LIMIT = int(getConfigVar('compute', 'VM', 'disk_limit'))
else:
DISK_LIMIT = 6
if getConfigVar('compute', 'VM', 'interface_limit'):
INTERFACE_LIMIT = int(getConfigVar('compute', 'VM', 'interface_limit'))
else:
INTERFACE_LIMIT = 6
def _get_ocfs2_SR():
sr = XEND_NODE.get_sr_by_type(SR_TYPE)
if not sr:
raise Exception("We need ocfs2 SR_ref here!")
else:
return sr[0]
SR_ref = _get_ocfs2_SR()
log.debug(">>>>>>>>>>>SR is: %s" % SR_ref)
def login_session():
return "SessionForTest"
def negative_session():
return "NegativeSession"
def negative_host():
return "NegativeHost"
def logout_session(session):
auth_manager().logout(session)
def destroy_VM_and_VDI(vm_ref, hard_shutdown_before_delete=False):
if VM_VDI_MAP:
vdi_ref = VM_VDI_MAP.get(vm_ref)
log.debug("destroy_VM_and_VDI, vdi_ref: %s" % vdi_ref)
if not vdi_ref:
vdi_ref = vm_ref
XEND_NODE.srs[SR_ref].destroy_vdi(vdi_ref, True, True)
if hard_shutdown_before_delete:
XEND_DOMAIN.domain_destroy(vm_ref)
XEND_DOMAIN.domain_delete(vm_ref, True)
def destroy_VDI(vdi_ref):
sr = XEND_NODE.get_sr_by_vdi(vdi_ref)
XEND_NODE.srs[sr].destroy_vdi(vdi_ref, True, True)
def start_VM(vm_ref, start_paused=False, force_start=True):
try:
log.debug(">>>>>>>>>>>start_VM")
VMAPI._VM_start(SESSION, vm_ref, start_paused, force_start)
power_state = VMAPI._VM_get_power_state(vm_ref).get('Value')
log.debug(">>>>>>>>>>>>>VM power state: %s<<<<<<<<<<<<<<" % power_state)
if cmp(power_state, XEN_API_VM_POWER_STATE[XEN_API_VM_POWER_STATE_RUNNING]) == 0:
return True
else:
return False
except Exception, e:
log.exception("<<<<<<<<<<<<start_VM failed! VM: %s;Exception: %s" %(vm_ref, e))
raise e
def set_VM_is_a_template(vm_ref):
return VMAPI._VM_set_is_a_template(SESSION, vm_ref, True)
def create_bootable_VM_with_VDI(memory_size = 512, vcpu_num = 1, disk_size = 10):
log.debug(">>>>>>>>>>>create_running_VM_with_VDI")
memory_size = memory_size * MB
vm_rec = dict(VM_default)
vm_rec['memory_static_max'] = memory_size
vm_rec['memory_dynamic_max'] = memory_size
vm_rec['VCPUs_max'] = vcpu_num
vm_rec['VCPUs_at_startup'] = vcpu_num
vm_ref = XEND_DOMAIN.create_domain(vm_rec)
try:
if vm_ref :
create_VBD_and_VDI(vm_ref, disk_size, True)
create_CD_attached_VM(vm_ref, "hdc", False)
create_console_attached_VM(vm_ref, "rfb")
return vm_ref
except Exception, e:
log.exception("<<<<<<<<<<<create_VM_with_VDI failed! VM: %s; Exception: %s" % (vm_ref, e))
XEND_DOMAIN.domain_delete(vm_ref, True)
raise e
def create_VM_with_VDI(memory_size = 512, vcpu_num = 1, disk_size = 10):
log.debug(">>>>>>>>>>>create_VM_with_VDI")
memory_size = memory_size * MB
vm_rec = dict(VM_default)
vm_rec['memory_static_max'] = memory_size
vm_rec['memory_dynamic_max'] = memory_size
vm_rec['VCPUs_max'] = vcpu_num
vm_rec['VCPUs_at_startup'] = vcpu_num
vm_ref = XEND_DOMAIN.create_domain(vm_rec)
try:
if vm_ref :
create_VBD_and_VDI(vm_ref, disk_size, True)
return vm_ref
except Exception, e:
log.exception("<<<<<<<<<<<create_VM_with_VDI failed! VM: %s; Exception: %s" % (vm_ref, e))
XEND_DOMAIN.domain_delete(vm_ref, True)
raise e
def create_VM(memory_size = 512, vcpu_num = 1):
try:
log.debug(">>>>>>>>>>>create VM")
memory_size = memory_size * MB
vm_rec = dict(VM_default)
vm_rec['memory_static_max'] = memory_size
vm_rec['memory_dynamic_max'] = memory_size
vm_rec['VCPUs_max'] = vcpu_num
vm_rec['VCPUs_at_startup'] = vcpu_num
vm_ref = XEND_DOMAIN.create_domain(vm_rec)
return vm_ref
except Exception, e:
log.exception("<<<<<<<<<<<create_VM failed! Exception: %s" % (e))
raise e
def create_VIF_attached_VM(attached_vm, mac, network):
try:
log.debug(">>>>>>>>>>>create_VIF_attached_VM")
vif_record = dict(vif_default)
vif_record['VM'] = attached_vm
vif_record['MTU'] = 1500
vif_record['MAC'] = mac
vif_record['network'] = network
response = VMAPI._VIF_create(SESSION, vif_record)
return response
except Exception, e:
log.exception("<<<<<<<<<<<create_VIF_attached_VM failed! VM: %s; Exception: %s" % (attached_vm, e))
raise e
def create_console_attached_VM(attached_vm, protocol):
try:
log.debug(">>>>>>>>>>create_console_attached_VM")
console_record = dict(console_default)
console_record['VM'] = attached_vm
console_record['protocol'] = protocol
response = VMAPI._console_create(SESSION, console_record)
return response
except Exception, e:
log.exception("<<<<<<<<<<<create_console_attached_VM failed! VM: %s; Exception: %s" % (attached_vm, e))
raise e
def create_CD_attached_VM(attached_vm, device, bootable):
try:
log.debug(">>>>>>>>>>create_CD_attached_VM")
vdi_uuid = _get_ISO_VDI()
vbd_record = dict(vbd_default)
vbd_record['VM'] = attached_vm
vbd_record['bootable'] = bootable
vbd_record['device'] = device
vbd_record['VDI'] = vdi_uuid
vbd_record['type'] = "CD"
response = VMAPI._VBD_create(SESSION, vbd_record)
return response
except Exception, e:
log.exception("<<<<<<<<<<<create_CD_attached_VM failed! VM: %s; Exception: %s" % (attached_vm, e))
raise e
def create_data_VBD_attached_VM(attached_vm, vdi_ref):
try:
return VMAPI._VM_create_data_VBD(SESSION, attached_vm, vdi_ref)
except Exception, e:
log.exception("<<<<<<<<<<<create_data_VBD_attached_VM failed! VM: %s; Exception: %s" % (attached_vm, e))
raise e
def get_first_VIF(vm_ref):
try:
vifs = VMAPI._VM_get_VIFs().get('Value')
if vifs:
return vifs[0]
return None
except Exception, e:
log.exception("<<<<<<<<<<<get_first_VIF failed! VM: %s; Exception: %s" % (vm_ref, e))
raise e
def get_VIF_ovs_bridge(vif_ref):
try:
return XEND_DOMAIN.get_dev_property_by_uuid('vif', vif_ref, 'bridge')
except Exception, e:
log.exception("<<<<<<<<<<<get_VIF_ovs_bridge failed! VM: %s; Exception: %s" % (vm_ref, e))
raise e
def get_negative_VIF():
return "THIS_IS_NEGATIVE_VIF"
def _get_ISO_VDI():
srs_ref = XEND_NODE.get_sr_by_type(ISO_SR_TYPE)
if srs_ref:
sr = XEND_NODE.get_sr(srs_ref[0])
vdis = sr.get_vdis()
if vdis:
for vdi in vdis:
if cmp(sr.get_vdi_by_uuid(vdi).name_label, 'cd-rom') == 0:
continue
return vdi
else:
raise Exception, "No ISO disk in system."
else:
raise Exception, "No ISO storage in system."
def gen_randomMAC():
return randomMAC()
def gen_negativeMAC():
return "THIS_IS_NEGATIVE_MAC"
def _createUuid():
return uuid.uuidFactory()
def gen_regularUuid():
return uuid.toString(_createUuid())
def gen_negativeUuid():
return "THIS_IS_NEGATIVE_UUID"
def gen_negativeName():
return "THIS_IS_NEGATIVE_NAME_$%!"
def gen_regularSnapshotName(ref):
return "ss-%s" % ref
def gen_negativeSnapshotName():
return "ss-!&&!"
def vm_api_VM_create_on_from_template(session, host, template_vm, new_vm_name, param_dict, ping):
try:
return VMAPI.VM_create_on_from_template(session, host, template_vm, new_vm_name, param_dict, ping)
except Exception, e:
log.exception("<<<<<<<<<<<vm_api_VM_create_on_from_template failed! VM: %s; Exception: %s" % (new_vm_name, e))
raise e
def vm_api_VM_snapshot(session, vm_ref, snap_name):
try:
return VMAPI.VM_snapshot(session, vm_ref, snap_name)
except Exception, e:
log.exception("<<<<<<<<<<<vm_api_VM_snapshot failed! VM: %s; Exception: %s" % (vm_ref, e))
raise e
def vm_api_VM_get_system_VDI(session, vm_ref):
try:
return VMAPI._VM_get_system_VDI(session, vm_ref)
except Exception, e:
log.exception("<<<<<<<<<<<vm_api_VM_get_system_VDI failed! VM: %s; Exception: %s" % (vm_ref, e))
raise e
def vm_api_VM_rollback(session, vm_ref, snap_name):
try:
return VMAPI.VM_rollback(session, vm_ref, snap_name)
except Exception, e:
log.exception("<<<<<<<<<<<vm_api_VM_rollback failed! VM: %s; Exception: %s" % (vm_ref, e))
raise e
def storage_api_VDI_snapshot(session, vdi_ref, snap_name):
try:
return STORAGEAPI.VDI_snapshot(session, vdi_ref, snap_name)
except Exception, e:
log.exception("<<<<<<<<<<<storage_api_VDI_snapshot failed! VDI: %s; Exception: %s" % (vdi_ref, e))
raise e
def storage_api_VDI_rollback(session, vdi_ref, snap_name):
try:
return STORAGEAPI.VDI_rollback(session, vdi_ref, snap_name)
except Exception, e:
log.exception("<<<<<<<<<<<storage_api_VDI_rollback failed! VDI: %s; Exception: %s" % (vdi_ref, e))
raise e
def storage_api_VDI_destroy_snapshot(session, vdi_ref, snap_name):
try:
return STORAGEAPI.VDI_destroy_snapshot(session, vdi_ref, snap_name)
except Exception, e:
log.exception("<<<<<<<<<<<storage_api_VDI_destroy_snapshot failed! VDI: %s; Exception: %s" % (vdi_ref, e))
raise e
def create_data_VDI(disk_size=10):
try:
log.debug(">>>>>>>>>>>in create_data_VDI")
vdi_uuid = gen_regularUuid()
vdi_record = dict(vdi_default)
vdi_record['uuid'] = vdi_uuid
vdi_record['virtual_size'] = disk_size
vdi_record['type'] = 'metadata'
vdi_record['sharable'] = True
vdi_record = STORAGEAPI._VDI_select_SR(SESSION, vdi_record)
sr = vdi_record.get('SR')
vdi_ref = XEND_NODE.srs[sr].create_vdi(vdi_record, True)
return vdi_ref
except Exception, e:
log.exception("<<<<<<<<<<<create_data_VDI failed! Exception: %s" % (e))
raise e
def create_VBD_and_VDI(vm_ref, disk_size, is_system_vbd):
log.debug(">>>>>>>>>>>in create_VBD_and_VDI")
vdi_uuid = gen_regularUuid()
sr_instance = XEND_NODE.get_sr(SR_ref)
location = "tap:aio:"+sr_instance.get_location()+"/"+vdi_uuid+"/disk.vhd";
vdi_record = dict(vdi_default)
vdi_record['uuid'] = vdi_uuid
vdi_record['virtual_size'] = disk_size
if is_system_vbd:
vdi_record['type'] = 'user'
else:
vdi_record['type'] = 'metadata'
vdi_record['sharable'] = True
vdi_record['SR_ref'] = SR_ref
vdi_record['location'] = location
vbd_record = dict(vbd_default)
vbd_record['VM'] = vm_ref
if is_system_vbd:
vbd_record['bootable'] = True
else:
vbd_record['bootable'] = False
if is_system_vbd:
vbd_record['device'] = 'hda'
vbd_record['mode'] ='RW'
vbd_record['type'] ='Disk'
vdi_ref = XEND_NODE.srs[SR_ref].create_vdi(vdi_record, True)
try:
VM_VDI_MAP[vm_ref] = vdi_ref
vbd_record['VDI'] = vdi_ref
dominfo = XEND_DOMAIN.get_vm_by_uuid(vm_ref)
vbd_ref = dominfo.create_vbd_for_xenapi(vbd_record, location)
log.debug(">>>>>>>>>>>vbd ref: %s" % vbd_ref)
XEND_DOMAIN.managed_config_save(dominfo)
return vbd_ref
except Exception, e:
log.debug("<<<<<<<<<<<VBD create failed! Destroy attached VDI: %s. %s" % (vdi_ref, e))
destroy_VDI(vdi_ref)
raise e
|
Hearen/OnceServer
|
pool_management/bn-xend-core/xend/tests/util/BNVMAPI_Util.py
|
Python
|
mit
| 13,032
|
<!DOCTYPE html>
<!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en" dir="ltr">
<!--<![endif]-->
<!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) -->
<!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca -->
<head>
<!-- Title begins / Début du titre -->
<title>
ARKTIS Piusitippaa Incorporated -
Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
</title>
<!-- Title ends / Fin du titre -->
<!-- Meta-data begins / Début des métadonnées -->
<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />
<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />
<!-- EPI-11240 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- MCG-202 -->
<meta content="width=device-width,initial-scale=1" name="viewport">
<!-- EPI-11567 -->
<meta name = "format-detection" content = "telephone=no">
<!-- EPI-12603 -->
<meta name="robots" content="noarchive">
<!-- EPI-11190 - Webtrends -->
<script>
var startTime = new Date();
startTime = startTime.getTime();
</script>
<!--[if gte IE 9 | !IE ]><!-->
<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">
<!--<![endif]-->
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">
<!--[if lt IE 9]>
<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script>
<![endif]-->
<!--[if lte IE 9]>
<![endif]-->
<noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript>
<!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER -->
<script>dataLayer1 = [];</script>
<!-- End Google Tag Manager -->
<!-- EPI-11235 -->
<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />
</head>
<body class="home" vocab="http://schema.org/" typeof="WebPage">
<!-- EPIC HEADER BEGIN -->
<!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER -->
<noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script>
<!-- End Google Tag Manager -->
<!-- EPI-12801 -->
<span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span>
<ul id="wb-tphp">
<li class="wb-slc">
<a class="wb-sl" href="#wb-cont">Skip to main content</a>
</li>
<li class="wb-slc visible-sm visible-md visible-lg">
<a class="wb-sl" href="#wb-info">Skip to "About this site"</a>
</li>
</ul>
<header role="banner">
<div id="wb-bnr" class="container">
<section id="wb-lng" class="visible-md visible-lg text-right">
<h2 class="wb-inv">Language selection</h2>
<div class="row">
<div class="col-md-12">
<ul class="list-inline mrgn-bttm-0">
<li><a href="nvgt.do?V_TOKEN=1492240095119&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=3686&V_SEARCH.docsStart=3685&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/updt.sec?_flId?_flxKy=e1s1&estblmntNo=234567041301&profileId=61&_evId=bck&lang=eng&V_SEARCH.showStricts=false&prtl=1&_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li>
</ul>
</div>
</div>
</section>
<div class="row">
<div class="brand col-xs-8 col-sm-9 col-md-6">
<a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a>
</div>
<section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn">
<h2>Search and menus</h2>
<ul class="list-inline text-right chvrn">
<li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li>
</ul>
<div id="mb-pnl"></div>
</section>
<!-- Site Search Removed -->
</div>
</div>
<nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement">
<h2 class="wb-inv">Topics menu</h2>
<div class="container nvbar">
<div class="row">
<ul class="list-inline menu">
<li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li>
<li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li>
<li><a href="https://travel.gc.ca/">Travel</a></li>
<li><a href="https://www.canada.ca/en/services/business.html">Business</a></li>
<li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li>
<li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li>
<li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li>
<li><a href="https://www.canada.ca/en/services.html">More services</a></li>
</ul>
</div>
</div>
</nav>
<!-- EPIC BODY BEGIN -->
<nav role="navigation" id="wb-bc" class="" property="breadcrumb">
<h2 class="wb-inv">You are here:</h2>
<div class="container">
<div class="row">
<ol class="breadcrumb">
<li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li>
<li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li>
<li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li>
</ol>
</div>
</div>
</nav>
</header>
<main id="wb-cont" role="main" property="mainContentOfPage" class="container">
<!-- End Header -->
<!-- Begin Body -->
<!-- Begin Body Title -->
<!-- End Body Title -->
<!-- Begin Body Head -->
<!-- End Body Head -->
<!-- Begin Body Content -->
<br>
<!-- Complete Profile -->
<!-- Company Information above tabbed area-->
<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>
<h1 id="wb-cont">
Company profile - Canadian Company Capabilities
</h1>
<div class="profileInfo hidden-print">
<ul class="list-inline">
<li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&rstBtn.x=" class="btn btn-link">New Search</a> |</li>
<li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">
<input type="hidden" name="lang" value="eng" />
<input type="hidden" name="profileId" value="" />
<input type="hidden" name="prtl" value="1" />
<input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" />
<input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />
<input type="hidden" name="V_SEARCH.depth" value="1" />
<input type="hidden" name="V_SEARCH.showStricts" value="false" />
<input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />
</form></li>
<li>| <a href="nvgt.do?V_SEARCH.docsStart=3684&V_DOCUMENT.docRank=3685&V_SEARCH.docsCount=3&lang=eng&prtl=1&sbPrtl=&profile=cmpltPrfl&V_TOKEN=1492240112272&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=%2fprfl.do&estblmntNo=234567100060&profileId=&key.newSearchLabel=">Previous Company</a></li>
<li>| <a href="nvgt.do?V_SEARCH.docsStart=3686&V_DOCUMENT.docRank=3687&V_SEARCH.docsCount=3&lang=eng&prtl=1&sbPrtl=&profile=cmpltPrfl&V_TOKEN=1492240112272&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=%2fprfl.do&estblmntNo=234567151023&profileId=&key.newSearchLabel=">Next Company</a></li>
</ul>
</div>
<details>
<summary>Third-Party Information Liability Disclaimer</summary>
<p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p>
</details>
<h2>
ARKTIS Piusitippaa Incorporated
</h2>
<div class="row">
<div class="col-md-5">
<h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2>
<p>ARKTIS Piusitippaa Incorporated</p>
</div>
<div class="col-md-4 mrgn-sm-sm">
<h2 class="h5 mrgn-bttm-0">Mailing Address:</h2>
<address class="mrgn-bttm-md">
P.O. Box 242<br/>
GJOA HAVEN,
Nunavut<br/>
X0B 1J0
<br/>
</address>
<p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>:
(867) 446-0036
</p>
<p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>:
</p>
</div>
<div class="col-md-3 mrgn-tp-md">
</div>
</div>
<div class="row mrgn-tp-md mrgn-bttm-md">
<div class="col-md-12">
<h2 class="wb-inv">Company Profile</h2>
<br> ARKTIS Piusitippaa Inc. is an management consulting & engineering firm experienced in cold and remote regions including Aboriginal affairs and northern development<br>
</div>
</div>
<!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> -->
<div class="wb-tabs ignore-session">
<div class="tabpanels">
<details id="details-panel1">
<summary>
Full profile
</summary>
<!-- Tab 1 -->
<h2 class="wb-invisible">
Full profile
</h2>
<!-- Contact Information -->
<h3 class="page-header">
Contact information
</h3>
<section class="container-fluid">
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
Joseph
Murdock
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
<!--if client gender is not null or empty we use gender based job title-->
Vice President
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Area of Responsibility:
</strong>
</div>
<div class="col-md-7">
Customer Service,
Export Sales & Marketing,
Domestic Sales & Marketing,
Government Relations,
Management Executive,
Research/Development/Engineering.
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Telephone:
</strong>
</div>
<div class="col-md-7">
(867) 446-0036
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Email:
</strong>
</div>
<div class="col-md-7">
murdock@arktissolutions.com
</div>
</div>
</section>
<p class="mrgn-tp-lg text-right small hidden-print">
<a href="#wb-cont">top of page</a>
</p>
<!-- Company Description -->
<h3 class="page-header">
Company description
</h3>
<section class="container-fluid">
<div class="row">
<div class="col-md-5">
<strong>
Exporting:
</strong>
</div>
<div class="col-md-7">
Yes
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Industry (NAICS):
</strong>
</div>
<div class="col-md-7">
541330 - Engineering Services
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Alternate Industries (NAICS):
</strong>
</div>
<div class="col-md-7">
541990 - All Other Professional, Scientific and Technical Services<br>
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Business Activity:
</strong>
</div>
<div class="col-md-7">
Services
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Aboriginal Firm:
</strong>
</div>
<div class="col-md-7">
Registered Aboriginal Business under the Procurement Strategy for Aboriginal Business (PSAB)<br/>
</div>
</div>
</section>
<!-- Products / Services / Licensing -->
<h3 class="page-header">
Product / Service / Licensing
</h3>
<section class="container-fluid">
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
Service Name:
</strong>
</div>
<div class="col-md-9">
Engineering and Professional Services<br>
</div>
</div>
</section>
<p class="mrgn-tp-lg text-right small hidden-print">
<a href="#wb-cont">top of page</a>
</p>
<!-- Technology Profile -->
<!-- Market Profile -->
<!-- Sector Information -->
<details class="mrgn-tp-md mrgn-bttm-md">
<summary>
Third-Party Information Liability Disclaimer
</summary>
<p>
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
</p>
</details>
</details>
<details id="details-panel2">
<summary>
Contacts
</summary>
<h2 class="wb-invisible">
Contact information
</h2>
<!-- Contact Information -->
<section class="container-fluid">
<div class="row mrgn-tp-lg">
<div class="col-md-3">
<strong>
Joseph
Murdock
</strong></div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Title:
</strong>
</div>
<div class="col-md-7">
<!--if client gender is not null or empty we use gender based job title-->
Vice President
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Area of Responsibility:
</strong>
</div>
<div class="col-md-7">
Customer Service,
Export Sales & Marketing,
Domestic Sales & Marketing,
Government Relations,
Management Executive,
Research/Development/Engineering.
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Telephone:
</strong>
</div>
<div class="col-md-7">
(867) 446-0036
</div>
</div>
<div class="row mrgn-lft-md">
<div class="col-md-5">
<strong>
Email:
</strong>
</div>
<div class="col-md-7">
murdock@arktissolutions.com
</div>
</div>
</section>
</details>
<details id="details-panel3">
<summary>
Description
</summary>
<h2 class="wb-invisible">
Company description
</h2>
<section class="container-fluid">
<div class="row">
<div class="col-md-5">
<strong>
Exporting:
</strong>
</div>
<div class="col-md-7">
Yes
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Industry (NAICS):
</strong>
</div>
<div class="col-md-7">
541330 - Engineering Services
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Alternate Industries (NAICS):
</strong>
</div>
<div class="col-md-7">
541990 - All Other Professional, Scientific and Technical Services<br>
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Primary Business Activity:
</strong>
</div>
<div class="col-md-7">
Services
</div>
</div>
<div class="row">
<div class="col-md-5">
<strong>
Aboriginal Firm:
</strong>
</div>
<div class="col-md-7">
Registered Aboriginal Business under the Procurement Strategy for Aboriginal Business (PSAB)<br/>
</div>
</div>
</section>
</details>
<details id="details-panel4">
<summary>
Products, services and licensing
</summary>
<h2 class="wb-invisible">
Product / Service / Licensing
</h2>
<section class="container-fluid">
<div class="row mrgn-bttm-md">
<div class="col-md-3">
<strong>
Service Name:
</strong>
</div>
<div class="col-md-9">
Engineering and Professional Services<br>
</div>
</div>
</section>
</details>
</div>
</div>
<div class="row">
<div class="col-md-12 text-right">
Last Update Date 2015-03-11
</div>
</div>
<!--
- Artifact ID: CBW - IMBS - CCC Search WAR
- Group ID: ca.gc.ic.strategis.imbs.ccc.search
- Version: 3.26
- Built-By: bamboo
- Build Timestamp: 2017-03-02T21:29:28Z
-->
<!-- End Body Content -->
<!-- Begin Body Foot -->
<!-- End Body Foot -->
<!-- END MAIN TABLE -->
<!-- End body -->
<!-- Begin footer -->
<div class="row pagedetails">
<div class="col-sm-5 col-xs-12 datemod">
<dl id="wb-dtmd">
<dt class=" hidden-print">Date Modified:</dt>
<dd class=" hidden-print">
<span><time>2017-03-02</time></span>
</dd>
</dl>
</div>
<div class="clear visible-xs"></div>
<div class="col-sm-4 col-xs-6">
</div>
<div class="col-sm-3 col-xs-6 text-right">
</div>
<div class="clear visible-xs"></div>
</div>
</main>
<footer role="contentinfo" id="wb-info">
<nav role="navigation" class="container wb-navcurr">
<h2 class="wb-inv">About government</h2>
<!-- EPIC FOOTER BEGIN -->
<!-- EPI-11638 Contact us -->
<ul class="list-unstyled colcount-sm-2 colcount-md-3">
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&from=Industries">Contact us</a></li>
<li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li>
<li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li>
<li><a href="https://www.canada.ca/en/news.html">News</a></li>
<li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li>
<li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li>
<li><a href="http://pm.gc.ca/eng">Prime Minister</a></li>
<li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li>
<li><a href="http://open.canada.ca/en/">Open government</a></li>
</ul>
</nav>
<div class="brand">
<div class="container">
<div class="row">
<nav class="col-md-10 ftr-urlt-lnk">
<h2 class="wb-inv">About this site</h2>
<ul>
<li><a href="https://www.canada.ca/en/social.html">Social media</a></li>
<li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li>
<li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li>
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li>
<li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li>
</ul>
</nav>
<div class="col-xs-6 visible-sm visible-xs tofpg">
<a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a>
</div>
<div class="col-xs-6 col-md-2 text-right">
<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>
</div>
</div>
</div>
</div>
</footer>
<!--[if gte IE 9 | !IE ]><!-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script>
<!--<![endif]-->
<!--[if lt IE 9]>
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script>
<![endif]-->
<script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script>
<!-- EPI-10519 -->
<span class="wb-sessto"
data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span>
<script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script>
<!-- EPI-11190 - Webtrends -->
<script src="/eic/home.nsf/js/webtrends.js"></script>
<script>var endTime = new Date();</script>
<noscript>
<div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=9.4.0&dcssip=www.ic.gc.ca"/></div>
</noscript>
<!-- /Webtrends -->
<!-- JS deps -->
<script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script>
<!-- EPI-11262 - Util JS -->
<script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script>
<!-- EPI-11383 -->
<script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script>
<span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span>
</body></html>
<!-- End Footer -->
<!--
- Artifact ID: CBW - IMBS - CCC Search WAR
- Group ID: ca.gc.ic.strategis.imbs.ccc.search
- Version: 3.26
- Built-By: bamboo
- Build Timestamp: 2017-03-02T21:29:28Z
-->
|
GoC-Spending/data-corporations
|
html/234567133876.html
|
HTML
|
mit
| 34,026
|
from setuptools import setup, find_packages
setup(
name="mould",
version="0.1",
packages=find_packages(),
package_data={
"mould": ["*.tpl"],
},
install_requires=[
"Flask",
"Flask-Script",
"Flask-Testing",
"alembic",
"gunicorn",
"sqlalchemy"
],
)
|
kates/mould
|
setup.py
|
Python
|
mit
| 440
|
---
id: 401
title: Bash Script for Sitelutions.com DynDNS
author: bradford
layout: post
guid: /?p=401
permalink: /2009/bash-script-for-sitelutions-com-dyndns
categories:
- Home Server
- Linux
---
I use sitelutions.com for my websites and subdomains; I love using sitelutions because it’s the best free solution I found for my servers with dynamic IPs. The only problem is that there’s not very many dyndns update clients available. So, I tried my hand at scripting and this is what I’ve come up with.<!--more-->
<pre class="brush:shell">#!/bin/sh
#### SITELUTIONS DYNDNS UPDATE SCRIPT ####
USERNAME="email"
PASSWORD="password"
#Separate record ids by a comma
RECORDIDS="1234567"
TTL="600"
LOGFILE="/var/log/sitelutions.log"
### Ways to retrieve IP address ##
##(Default) use sitelutions
IP="&detectip=1"
##Retrieve from external site (HTTP)
##icanhazip.com (alternatives: ipid.shat.net/iponly, whatismyip.com, etc)
#IP=`wget -O - -q icanhazip.com`
##existing domain IP
#IP=`nslookup domain.com | grep Add | grep -v '#' | cut -f 2 -d ' '`
#Build https request
REQUEST="https://www.sitelutions.com/dnsup?user=$USERNAME&pass=$PASSWORD&id=$RECORDIDS&ip=$IP"
OUTPUT=`wget -O - -q $REQUEST`
LOG=`date +%c`" "$OUTPUT
echo $LOG >> $LOGFILE</pre>
Once you’ve confirmed that this works you can simply throw it in as a cronjob that runs every 30 minutes or so. I have mine run every 3 hours.
Hope this is helpful to anyone else using sitelutions! Bash scripting is pretty cool, I’m definitely going to use it more. If you have any tips on how to improve the script feel free to comment.
**Resources**:
* <a href="https://www.sitelutions.com/help/sitelutions_dns_update.php3.txt" target="_blank">Sitelutions PHP Script</a>
* <a href="http://bubble.gritto.net/db/query.php?id=46&ty=HOWTO" target="_blank">Resolve a hostname to IP in a bash script</a>
* <a href="http://tips4linux.com/find-out-your-routers-external-ip-address-using-the-linux-command-line/" target="_blank">Find out your router’s external IP address using the Linux command line</a>
* <a href="http://ubuntuforums.org/showthread.php?t=526176" target="_blank">HOWTO: Check you external IP Address from the command line</a>
* <a href="http://snipplr.com/view/4212/append-line-to-a-file/" target="_blank">Append Line to a File</a>
* <a href="http://www.justlinux.com/forum/showthread.php?t=140388" target="_blank">string concatenation in bash</a>
**Update 12/1/2010:** I’ve stopped updating the TTL in my script below because I’m getting an error “failure (invalid ttl)” – it appears 600 is not a good value for the TTL. You can add it back if you want, though it works without it and will simply use the existing value for TTL. More on the Sitelutions api can be found <a href="http://sitelutions.com/help/dynamic_dns_clients" target="_blank">here</a>.
|
elBradford/elBradford.github.io
|
_posts/2009-10-07-bash-script-for-sitelutions-com-dyndns.md
|
Markdown
|
mit
| 2,935
|
// Copyright (c) 2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <string>
#include "version.h"
// Name of client reported in the 'version' message. Report the same name
// for both bitcoind and bitcoin-qt, to make it harder for attackers to
// target servers or GUI users specifically.
const std::string CLIENT_NAME("BlastCoin");
// Client version number
#define CLIENT_VERSION_SUFFIX ""
// The following part of the code determines the CLIENT_BUILD variable.
// Several mechanisms are used for this:
// * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is
// generated by the build environment, possibly containing the output
// of git-describe in a macro called BUILD_DESC
// * secondly, if this is an exported version of the code, GIT_ARCHIVE will
// be defined (automatically using the export-subst git attribute), and
// GIT_COMMIT will contain the commit id.
// * then, three options exist for determining CLIENT_BUILD:
// * if BUILD_DESC is defined, use that literally (output of git-describe)
// * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]
// * otherwise, use v[maj].[min].[rev].[build]-unk
// finally CLIENT_VERSION_SUFFIX is added
// First, include build.h if requested
#ifdef HAVE_BUILD_INFO
# include "build.h"
#endif
// git will put "#define GIT_ARCHIVE 1" on the next line inside archives.
#define GIT_ARCHIVE 1
#ifdef GIT_ARCHIVE
# define GIT_COMMIT_ID ""
# define GIT_COMMIT_DATE "$Format:%cD"
#endif
#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "" commit
#define BUILD_DESC_FROM_UNKNOWN(maj,min,rev,build) \
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) ""
#ifndef BUILD_DESC
# ifdef GIT_COMMIT_ID
# define BUILD_DESC BUILD_DESC_FROM_COMMIT(DISPLAY_VERSION_MAJOR, DISPLAY_VERSION_MINOR, DISPLAY_VERSION_REVISION, DISPLAY_VERSION_BUILD, GIT_COMMIT_ID)
# else
# define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(DISPLAY_VERSION_MAJOR, DISPLAY_VERSION_MINOR, DISPLAY_VERSION_REVISION, DISPLAY_VERSION_BUILD)
# endif
#endif
#ifndef BUILD_DATE
# ifdef GIT_COMMIT_DATE
# define BUILD_DATE GIT_COMMIT_DATE
# else
# define BUILD_DATE __DATE__ ", " __TIME__
# endif
#endif
const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX);
const std::string CLIENT_DATE(BUILD_DATE);
|
blastcoin/blastcoin
|
src/version.cpp
|
C++
|
mit
| 2,607
|
require "net/http"
require "curb"
require "addressable/uri"
require "json"
require "objspace"
require "bitset"
class FoursquareSearcher
def initialize( attributes = {} )
bs = Bitset.new(2000000000)
puts " " + ObjectSpace.memsize_of(bs).to_s;
while 1 do
end
end
end
test = FoursquareSearcher.new
|
Nemanicka/pathToFriend
|
lib/searchers/foursquare.rb
|
Ruby
|
mit
| 353
|
error() {
echo " ! $*" >&2
exit 1
}
status() {
echo "-----> $*"
}
protip() {
echo
echo "PRO TIP: $*" | indent
echo "See https://devcenter.heroku.com/articles/nodejs-support" | indent
echo
}
# sed -l basically makes sed replace and buffer through stdin to stdout
# so you get updates while the command runs and dont wait for the end
# e.g. npm install | indent
indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";; # mac/bsd sed: -l buffers on line boundaries
*) sed -u "$c";; # unix/gnu sed: -u unbuffered (arbitrary) chunks of data
esac
}
cat_npm_debug_log() {
test -f $build_dir/npm-debug.log && cat $build_dir/npm-debug.log
}
mktmpdir() {
dir=$(mktemp -t node-$1-XXXX)
rm -rf $dir
mkdir -p $dir
echo $dir
}
|
johnnypez/heroku-buildpack-mrt
|
bin/common.sh
|
Shell
|
mit
| 774
|
const AuthUtil = require('../thulib/auth')
const User = require('../models/user')
const updateCourseInfo = require('./update_course_info')
const updateCurriculumInfo = require('./update_curriculum_info')
const updateScheduleInfo = require('./update_schedule_info')
const taskScheduler = require('./task_scheduler')
const register = async(username, password) => {
const authResult = await AuthUtil.auth(username, password)
if (authResult) {
let user = await User.findOne({username: username})
const existed = !!user
if (!existed) {
const info = await AuthUtil.getUserInfo(username, password)
user = new User({
username: username,
password: password,
info: info
})
await user.save()
taskScheduler.add(updateCourseInfo, user, 3600000)
taskScheduler.add(updateCurriculumInfo, user, 3600000)
taskScheduler.add(updateScheduleInfo, user, 3600000)
} else if (existed && user.getPassword() !== password) {
user.password = password
user.save()
}
return [user, existed]
} else {
return [null, false]
}
}
module.exports = register
|
TennyZhuang/CamusAPI
|
app/tasks/register.js
|
JavaScript
|
mit
| 1,142
|
/**
* Created by hbzhang on 8/5/15.
*/
'use strict';
angular.module('mean.helpers').factory('AllWidgetData',['$resource','$rootScope', function($resource,$rootScope) {
var allwidgets=[
{
name: 'Announcement',
data: []
},
{
name: 'Information',
data: []
}
];
return {
allwidgets:allwidgets
};
}]);
|
hbzhang/me
|
me/packages/custom/helpers/public/services/widgets/allwidgets.js
|
JavaScript
|
mit
| 442
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang=
"en-US">
<head>
<title>Object Serialization Enhancements</title><script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "//hm.baidu.com/hm.js?dd1361ca20a10cc161e72d4bc4fef6df";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script>
<link rel="stylesheet" type="text/css" href="../../../technotes/css/guide.css" />
</head>
<body>
<!-- STATIC HEADER -->
<!-- header start -->
<div id="javaseheader">
<div id="javaseheaderlogo">
<img src="../../../images/javalogo.gif"
alt="Java logo" />
</div>
<div id="javaseheaderindex">
<a href=
"../../../index.html">Documentation Contents</a>
</div>
<div class="clear"></div>
</div>
<!-- header end -->
<h1>Object Serialization Enhancements</h1>
<p>The following topics are covered:</p>
<ul>
<li><a href="#jdk6">Enhancements in Java SE 6</a></li>
<li><a href="#jdk5.0">Enhancements in Java SE 5.0</a></li>
<li><a href="#jdk1.4">Enhancements in Java SE 1.4</a></li>
<li><a href="#jdk1.3">Enhancements in Java SE 1.3</a></li>
<li><a href="#jdk1.2">Enhancements in Java SE 1.2</a></li>
</ul>
<h2><a name="jdk6">Enhancements in Java SE 6</a></h2>
<dl>
<dt><b><code>java.io.ObjectStreamClass.lookupAny</code></b></dt>
<dd>In previous releases, it was difficult to programmatically
obtain an <code>ObjectStreamClass</code> instance for a
non-serializable <code>Class</code>, although doing so can be
desirable when customizing the stream format for class descriptors
(see <a href=
"http://bugs.java.com/view_bug.do?bug_id=4413615">4413615</a> for
more information). The new method <a href=
"../../../api/java/io/ObjectStreamClass.html#lookupAny-java.lang.Class-">
<tt>ObjectStreamClass.lookupAny</tt></a> can now be used for this
purpose.</dd>
<dt><b>Bug fix: delayed garbage collection</b></dt>
<dd>In previous releases, bug <a href=
"http://bugs.java.com/view_bug.do?bug_id=6232010">6232010</a> could
cause serializable classes and subclasses of
<code>ObjectOutputStream</code> and <code>ObjectInputStream</code>
to be strongly referenced long after their use in a serialization
operation, thus possibly delaying garbage collection of their
defining class loaders indefinitely. Internal caches in the
serialization implementation have been restructured to fix this
bug.</dd>
</dl>
<h2><a name="jdk5.0">Enhancements in Java SE 5.0</a></h2>
<dl>
<dt><b>Support for serialization of enumerated type instances</b></dt>
<dd>Support has been added to serialization to handle enumerated
types, which are new in this release. The rules for serializing an
enum instance differ from those for serializing an "ordinary"
serializable object: the serialized form of an enum instance
consists only of its enum constant name, along with information
identifying its base enum type. Deserialization behavior differs as
well--the class information is used to find the appropriate enum
class, and the <code>Enum.valueOf</code> method is called with that
class and the received constant name in order to obtain the enum
constant to return.</dd>
<dt><b>Bug fix: java.io.StreamCorruptedException thrown due to
java.lang.ClassNotFoundException</b></dt>
<dd>In previous releases starting with 1.4.0, a
<code>ClassNotFoundException</code> thrown by the
<code>ObjectInputStream.readClassDescriptor</code> method would be
reflected to the top-level caller of
<code>ObjectInputStream.readObject</code> as a
<code>StreamCorruptedException</code> with an empty cause. It is
now reflected to the top-level caller as an
<code>InvalidClassException</code> with the original
<code>ClassNotFoundException</code> as the cause.</dd>
<dt><b>Bug fix: thread waiting on a
java.io.ObjectStreamClass$EntryFuture for notification from [sic]</b></dt>
<dd>In previous releases starting with 1.4.0, the
<code>ObjectStreamClass.lookup</code> method could deadlock if
called from within the static initializer of the class represented
by the method's <code>Class</code> argument. Deadlock should no
longer occur in this case.</dd>
<dt><b>Bug fix: no spec for serialVersionUID</b></dt>
<dd>The javadoc for the <code>Serializable</code> interface has
been expanded to more completely specify the role and usage of
<code>serialVersionUID</code>s, and to emphasize the need to
specify explicit <code>serialVersionUID</code>s for serializable
classes.</dd>
</dl>
<h2><a name="jdk1.4">Enhancements in Java SE 1.4</a></h2>
<dl>
<dt><b>Support for deserialization of unshared objects</b></dt>
<dd>Serialization now provides extra support for deserialization of
objects which are known to be unshared in the data-serialization
stream. The new support is provided by the following API additions
in package <tt>java.io</tt>:
<ul>
<li><a href=
"../../../api/java/io/ObjectInputStream.html#readUnshared--"><tt>ObjectInputStream.readUnshared()</tt></a></li>
<li><a href=
"../../../api/java/io/ObjectOutputStream.html#writeUnshared-java.lang.Object-">
<tt>ObjectOutputStream.writeUnshared(Object obj)</tt></a></li>
<li><a href=
"../../../api/java/io/ObjectStreamField.html#ObjectStreamField-java.lang.Strin%0Ag-java.lang.Class-boolean-">
<tt>ObjectStreamField(String name, Class type, boolean unshared)</tt></a></li>
</ul>
<p>These APIs can be used to more efficiently read contained array
objects in a secure fashion.</p>
</dd>
<dt><b>Security permissions now required to override putFields,
readFields</b></dt>
<dd>ObjectOutputStream's <a href=
"../../../api/java/io/ObjectOutputStream.html#ObjectOutputStream-java.io.Outpu%0AtStream-">
public one-argument constructor</a> requires the
"enableSubclassImplementation" SerializablePermission when invoked
(either directly or indirectly) by a subclass which overrides
<a href=
"../../../api/java/io/ObjectOutputStream.html#putFields--"><tt>ObjectOutputStream.putFields</tt></a>
or <a href=
"../../../api/java/io/ObjectOutputStream.html#writeUnshared-java.lang.Object-">
<tt>ObjectOutputStream.writeUnshared</tt></a>.
<p>ObjectInputStream's <a href=
"../../../api/java/io/ObjectInputStream.html#ObjectInputStream-java.io.InputSt%0Aream-">
public one-argument constructor</a> requires the
"enableSubclassImplementation" SerializablePermission when invoked
(either directly or indirectly) by a subclass which overrides
<a href=
"../../../api/java/io/ObjectInputStream.html#readFields--"><tt>ObjectInputStream.readFields</tt></a>
or <a href=
"../../../api/java/io/ObjectInputStream.html#readUnshared--"><tt>ObjectInputStream.readUnshared</tt></a>.</p>
<p>These changes will not affect the great majority of
applications. However, it will affect any
ObjectInputStream/ObjectOutputStream subclasses which override the
<tt>putFields</tt> or <tt>readFields</tt> methods without also
overriding the rest of the serialization infrastructure.</p>
</dd>
<dt><b>Support for class-defined readObjectNoData method</b></dt>
<dd>In addition to supporting class-defined <tt>writeObject()</tt>
and <tt>readObject()</tt> methods, serialization now includes
support for class-defined <tt>readObjectNoData()</tt> methods. Each
class-defined <tt>readObjectNoData()</tt> method is required to
have the following signature:
<pre class="codeblock">
private void readObjectNoData() throws ObjectStreamException;
</pre>
The <tt>readObjectNoData()</tt> method is analogous to the
class-defined <tt>readObject()</tt> method, except that (if
defined) it is called in cases where the class descriptor for a
superclass of the object being deserialized (and hence the object
data described by that class descriptor) is not present in the
serialization stream. More formally: If object O of class C is
being deserialized, and S is a superclass of C in the VM which is
deserializing O, then <tt>S.readObjectNoData()</tt> is invoked by
ObjectInputStream during the deserialization of O if and only if
the following conditions are true:
<ol>
<li>S implements java.io.Serializable (directly or
indirectly).</li>
<li>S defines an <tt>readObjectNoData()</tt> method with the
signature listed above.</li>
<li>The serialization stream containing O does not include a class
descriptor for S among its list of superclass descriptors for
C.</li>
</ol>
Note that <tt>readObjectNoData()</tt> is never invoked in cases
where a class-defined <tt>readObject()</tt> method could be called,
though serializable class implementors can call
<tt>readObjectNoData()</tt> from within <tt>readObject()</tt> as a
means of consolidating initialization code.
<p>See the class description in the API specification of <a href=
"../../../api/java/io/ObjectInputStream.html">ObjectInputStream</a>
for more information.</p>
</dd>
<dt><b>Bug fix: Deserialization fails for Class object of primitive
type</b></dt>
<dd>In previous releases, bug <a href=
"http://bugs.java.com/view_bug.do?bug_id=4171142">4171142</a> caused
attempts to deserialize Class objects of primitive types to fail
with a <tt>ClassNotFoundException</tt>. The problem was that
<tt>ObjectInputStream.resolveClass()</tt> did not work for
ObjectStreamClass descriptors for primitive types. This bug is
fixed in this release.</dd>
<dt><b>Bug fix: ObjectInputStream.resolveProxyClass can fail for
non-public interface cases</b></dt>
<dd>In previous releases, <a href=
"../../../api/java/io/ObjectInputStream.html#resolveProxyClass-java.lang.Strin%0Ag:A-">
<tt>ObjectInputStream.resolveProxyClass</tt></a> would not always
select the proper class loader to define the proxy class in if one
or more of the proxy interfaces were non-public. In this release,
if <tt>ObjectInputStream.resolveProxyClass</tt> detects a
non-public interface, it attempts to define the implementing proxy
class in the same class loader as the interface (barring conflicts,
in which case an exception is thrown), which is necessary in order
for the proxy to implement the interface.</dd>
<dt><b>Bug fix: Invalid serialPersistentFields field name causes
NullPointerException</b></dt>
<dd>In previous releases, bug <a href=
"http://bugs.java.com/view_bug.do?bug_id=4387368">4387368</a> caused
NullPointerExceptions to be thrown when serializing objects which
used default serialization but also declared serialPersistentField
entries which did not map to actual class fields. Serialization
will now throw InvalidClassExceptions in such cases (since it is
never necessary to define such "unbacked" serialPersistentFields
when using default serialization).</dd>
<dt><b>Bug fix: ClassNotFoundException in skipped objects causes
serialization to fail</b></dt>
<dd>In previous releases, ClassNotFoundExceptions triggered by
"skipped" objects—objects associated with fields not present in
the classes loaded by the deserializing party—would cause
deserialization of the entire object graph to fail, even though the
skipped values would not be included in the graph. This release of
serialization addresses this problem by ignoring
ClassNotFoundExceptions associated with such skipped objects, thus
eliminating a class of unnecessary deserialization errors. Other
miscellaneous changes have also been made to improve the overall
robustness of serialization with regards to ClassNotFoundExceptions
encountered during deserialization.</dd>
</dl>
<h2><a name="jdk1.3">Enhancements in Java SE 1.3</a></h2>
<dl>
<dt><b>Strings longer than 64K can now be serialized</b></dt>
<dd>Prior to this release, an attempt to serialize a string longer than 64K
would result in a <code>java.io.UTFDataFormatException</code> being
thrown. In this release, the serialization protocol has been enhanced to
allow strings longer than 64K to be serialized. Note that if a 1.2
(or earlier) JVM attempts to read a long string written from a
1.3-compatible JVM, the 1.2 (or earlier) JVM will receive a
<code>java.io.StreamCorruptedException</code>.</dd>
<dt><b>Serialization performance enhancements</b></dt>
<dd>Several changes have been made to serialization to improve
overall performance:
<ul>
<li>UTF string reads/writes have been optimized to reduce
unnecessary memory allocation and synchronization/method call
overhead.</li>
<li>Code for reading and writing primitive data arrays has been
streamlined. Float and double array reads/writes have been
reimplemented to minimize the number of calls to native
methods.</li>
<li>Internal buffering has been improved.</li>
<li>Reflective operations for getting/setting primitive field
values have been batched to minimize the number of separate native
method calls.</li>
</ul>
</dd>
<dt><b>Improved exception reporting</b></dt>
<dd>If a class cannot be found during the class resolution process
of deserialization, the original
<code>java.lang.ClassNotFoundException</code> is thrown instead of
a generic one so that more information about the failure is
available. Also, deserialization exception reporting now includes
maintaining the name of the original class that could not be found
instead of reporting a higher-level class that was being
deserialized. For example, if (in an RMI call) the stub class
<i>can</i> be found but the remote interface class cannot, the
serialization mechanism will now report correctly that the
interface class was the class that could not be found instead of
erroneously reporting that the stub class could not be found.</dd>
<dt>
<b><code>java.io.ObjectOutputStream.writeClassDescriptor</code>,<br />
<code>java.io.ObjectInputStream.readClassDescriptor</code></b></dt>
<dd>The <code>writeClassDescriptor</code> and
<code>readClassDescriptor</code> methods have been added to provide
a means of customizing the serialized representation of
<code>java.io.ObjectStreamClass</code> class descriptors.
<code>writeClassDescriptor</code> is called when an instance of
<code>java.io.ObjectStreamClass</code> needs to be serialized, and
is responsible for writing the <code>ObjectStreamClass</code> to
the serialization stream. Conversely,
<code>readClassDescriptor</code> is called when the
<code>ObjectInputStream</code> expects an
<code>ObjectStreamClass</code> instance as the next item in the
serialization stream. By overriding these methods, subclasses of
<code>ObjectOutputStream</code> and <code>ObjectInputStream</code>
can transmit class descriptors in an application-specific format.
For more information, refer to sections 2.1 and 3.1 of the <i>Java
Object Serialization Specification</i>.</dd>
<dt>
<b><code>java.io.ObjectOutputStream.annotateProxyClass</code>,<br />
<code>java.io.ObjectInputStream.resolveProxyClass</code></b></dt>
<dd>These methods are similar in purpose to
<code>ObjectOutputStream.annotateClass</code> and
<code>ObjectInputStream.resolveClass</code>, except that they apply
to dynamic proxy classes (see
<code>java.lang.reflect.Proxy</code>), as opposed to non-proxy
classes. Subclasses of <code>ObjectOutputStream</code> may override
<code>annotateProxyClass</code> to store custom data in the stream
along with descriptors for dynamic proxy classes.
<code>ObjectInputStream</code> subclasses may then override
<code>resolveProxyClass</code> to make use of the custom data in
selecting a local class to associate with the given proxy class
descriptor. For details, see section 4 of the <i>Java Object
Serialization Specification</i>.</dd>
<dt><b>The javadoc tool tags <code>@serial</code>,
<code>@serialField</code>, and <code>@serialData</code></b></dt>
<dd>The javadoc tags <code>@serial</code>,
<code>@serialField</code>, and <code>@serialData</code> have been
added to provide a way to document the serialized form of a class.
Javadoc generates a serialization specification based on the
contents of these tags. For details, refer to section 1.6 of the
<i>Java Object Serialization Specification</i>.</dd>
</dl>
<h2><a name="jdk1.2">Enhancements in Java SE 1.2</a></h2>
<dl>
<dt><b>Protocol versioning</b></dt>
<dd>Prior to this release, object serialization used a protocol that did not
support skipping over objects implementing the
<code>java.io.Externalizable</code> interface if the classes for
those objects were not available. In this release, a new protocol version
was added which addressed this deficiency. For backwards
compatibility, <code>ObjectOutputStream</code> and
<code>ObjectInputStream</code> can read and write serialization
streams written in either protocol; the protocol version used can
be selected by calling the
<code>ObjectOutputStream.useProtocolVersion</code> method. For
details and a discussion of compatibility issues, see section 6.3
of the <i>Java Object Serialization Specification</i>.</dd>
<dt><b>Class-defined <code>writeReplace</code> and
<code>readResolve</code> methods</b></dt>
<dd>Classes can define <code>writeReplace</code> and
<code>readResolve</code> methods which allow instances of the given
classes to nominate replacements for themselves during
serialization and deserialization. The required signatures of these
methods, along with further details, are described in sections 2.5
and 3.6 of the <i>Java Object Serialization Specification</i>.</dd>
<dt><b><code>java.io.ObjectOutputStream.writeObjectOverride</code>,
<code>java.io.ObjectInputStream.readObjectOverride</code></b></dt>
<dd>Subclasses of <code>ObjectOutputStream</code> and
<code>ObjectInputStream</code> can implement a custom serialization
protocol by overriding the <code>writeObjectOverride</code> and
<code>readObjectOverride</code> methods. Note that these methods
will only be called if the
<code>ObjectOutputStream/ObjectInputStream</code> subclasses
possess the permission
<code>java.io.SerializablePermission("enableSubclassImplementation")</code>,
and call the no-argument constructors of
<code>ObjectOutputStream/ObjectInputStream</code>. See sections 2.1
and 3.1 of the <i>Java Object Serialization Specification</i> for
more information.</dd>
<dt><b>Security permission checks</b></dt>
<dd>Subclasses of <code>ObjectOutputStream</code> and
<code>ObjectInputStream</code> may override inherited methods to
obtain "hooks" into certain aspects of the serialization process.
Since this release, object serialization uses the 1.2 security model to
verify that subclasses possess adequate permissions to override
certain hooks. The permissions
<code>java.io.SerializablePermission("enableSubclassImplementation</code>")
and
<code>java.io.SerializablePermission("enableSubstitution</code>")
govern whether or not the methods
<code>ObjectOutputStream.writeObjectOverride</code>,
<code>ObjectOutputStream.replaceObject</code>,
<code>ObjectInputStream.readObjectOverride</code>, and
<code>ObjectInputStream.resolveObject</code> will be called during
the course of serialization. See sections 2.1 and 3.1 of the
<i>Java Object Serialization Specifications</i> for more
information.</dd>
<dt><b>Defining serializable fields for a class</b></dt>
<dd>By default, the values of all non-static and non-transient
fields of a serializable class are written when an instance of that
class is serialized. In this release, a new mechanism was introduced to
allow classes finer control of this process. By declaring a special
field <code>serialPersistentFields</code>, serializable classes can
dictate which fields will be written when instances of the class
(or subclasses) are serialized. This feature also enables classes
to "define" serializable fields which do not correspond directly to
actual fields in the class. Used in conjunction with the
serializable fields API (described below), this capability allows
fields to be added or removed from a class without altering the
serialized representation of the class. See sections 1.5 and 1.7 of
the <i>Java Object Serialization Specification</i> for
details.</dd>
<dt><b>Serializable fields API</b></dt>
<dd>Introduced in this release, the serializable fields API allows
class-defined <code>writeObject</code>/<code>readObject</code>
methods to explicitly set and retrieve serializable field values by
name and type. This API is particularly useful for classes that
need to maintain backwards compatibility with older class versions;
in some cases, the older version of the class may have defined a
set of serializable fields that cannot be mapped directly to the
fields of the current class. In this case, newer versions of the
class can define custom <code>writeObject</code> and
<code>readObject</code> methods that convert the internal state of
a given instance of the (new) class into the "old" serialized form,
and vice versa. For more information, see section 1.7 of the
<i>Java Object Serialization Specification</i>.</dd>
</dl>
<!-- Body text ends here -->
<!-- footer start -->
<div id="javasefooter">
<div class="hr">
<hr /></div>
<div id="javasecopyright">
<img id="oraclelogofooter" src=
"../../../images/oraclelogo.gif" alt="Oracle and/or its affiliates"
border="0" width="100" height="29" name=
"oraclelogofooter" />
<a href="../../../legal/cpyr.html">Copyright
©</a> 1993, 2015, Oracle and/or its affiliates. All rights
reserved.</div>
<div id="javasecontactus">
<a href=
"http://docs.oracle.com/javase/feedback.html">Contact
Us</a>
</div>
</div>
<!-- footer end -->
<!-- STATIC FOOTER -->
</body>
</html>
|
piterlin/piterlin.github.io
|
doc/technotes/guides/serialization/relnotes.html
|
HTML
|
mit
| 21,218
|
<?php
/**
* Template Name: Gallery Archive 3 Columns Wide
* The main template file for display gallery page.
*
* @package WordPress
*/
/**
* Get Current page object
**/
$ob_page = get_page($post->ID);
$current_page_id = '';
if(isset($ob_page->ID))
{
$current_page_id = $ob_page->ID;
}
get_header();
//Check if disable slideshow hover effect
$tg_gallery_hover_slide = kirki_get_option( "tg_gallery_hover_slide" );
if(!empty($tg_gallery_hover_slide))
{
wp_enqueue_script("jquery.cycle2.min", get_template_directory_uri()."/js/jquery.cycle2.min.js", false, THEMEVERSION, true);
wp_enqueue_script("custom_cycle", get_template_directory_uri()."/js/custom_cycle.js", false, THEMEVERSION, true);
}
?>
<?php
global $page_content_class;
$page_content_class = 'wide';
//Include custom header feature
get_template_part("/templates/template-header");
?>
<!-- Begin content -->
<?php
?>
<div class="inner">
<div class="inner_wrapper nopadding">
<div id="page_main_content" class="sidebar_content full_width nopadding fixed_column">
<div id="portfolio_filter_wrapper" class="gallery three_cols portfolio-content section content clearfix wide" data-columns="3">
<?php
//Get galleries
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$pp_portfolio_items_page = -1;
$query_string = 'paged='.$paged.'&orderby=menu_order&order=ASC&post_type=galleries&posts_per_page=-1&suppress_filters=0';
if(!empty($term))
{
$query_string .= '&gallerycat='.$term;
}
if(THEMEDEMO)
{
$query_string .= '&gallerycat='.DEMOGALLERYID;
}
query_posts($query_string);
$key = 0;
if (have_posts()) : while (have_posts()) : the_post();
$small_image_url = array();
$image_url = '';
$gallery_ID = get_the_ID();
if(has_post_thumbnail($gallery_ID, 'original'))
{
$image_id = get_post_thumbnail_id($gallery_ID);
$small_image_url = wp_get_attachment_image_src($image_id, 'gallery_grid', true);
}
$permalink_url = get_permalink($gallery_ID);
?>
<div class="element grid classic3_cols">
<div class="one_third gallery3 static filterable gallery_type archive animated<?php echo esc_attr($key+1); ?>" data-id="post-<?php echo esc_attr($key+1); ?>">
<?php
if(!empty($small_image_url[0]))
{
?>
<a href="<?php echo esc_url($permalink_url); ?>">
<div class="gallery_archive_desc">
<h4><?php the_title(); ?></h4>
<div class="post_detail"><?php the_excerpt(); ?></div>
</div>
<?php
$all_photo_arr = array();
if(!empty($tg_gallery_hover_slide))
{
//Get gallery images
$all_photo_arr = get_post_meta($gallery_ID, 'wpsimplegallery_gallery', true);
//Get only 5 recent photos
$all_photo_arr = array_slice($all_photo_arr, 0, 5);
}
if(!empty($all_photo_arr))
{
?>
<ul class="gallery_img_slides">
<?php
foreach($all_photo_arr as $photo)
{
$slide_image_url = wp_get_attachment_image_src($photo, 'gallery_grid', true);
?>
<li><img src="<?php echo esc_url($slide_image_url[0]); ?>" alt="" class="static"/></li>
<?php
}
?>
</ul>
<?php
}
?>
<img src="<?php echo esc_url($small_image_url[0]); ?>" alt="<?php echo esc_attr(get_the_title()); ?>" />
</a>
<?php
}
?>
</div>
</div>
<?php
$key++;
endwhile; endif;
?>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
<!-- End content -->
|
rsantellan/wordpress-ecommerce
|
wp-content/themes/photome/gallery-archive-3-wide.php
|
PHP
|
mit
| 3,767
|
/*
* The MIT License
*
* Copyright 2015 Ahseya.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.github.horrorho.liquiddonkey;
import com.github.horrorho.liquiddonkey.settings.PropertiesFactory;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Properties;
import java.util.TreeSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Dump out properties files.
*
* @author Ahseya
*/
public class Dump {
private static final Logger logger = LoggerFactory.getLogger(Dump.class);
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
logger.trace("<< main() < args: {}", Arrays.asList(args));
Properties properties = PropertiesFactory.create().fromDefaults();
Path path = Paths.get("liquiddonkey.properties");
try (OutputStream outputStream = Files.newOutputStream(path, CREATE, WRITE, TRUNCATE_EXISTING)) {
// Ordered store
Properties ordered = new Properties() {
@Override
public synchronized Enumeration<Object> keys() {
return Collections.enumeration(new TreeSet<Object>(super.keySet()));
}
};
ordered.putAll(properties);
ordered.store(outputStream, "liquiddonkey");
logger.info("-- main() > properties written to: {}", path.toAbsolutePath());
} catch (IOException ex) {
logger.warn("-- main() > exception: ", ex);
}
logger.trace(">> main");
}
}
|
horrorho/LiquidDonkey
|
src/main/java/com/github/horrorho/liquiddonkey/Dump.java
|
Java
|
mit
| 2,954
|
require 'csv'
def convert(name, review_column)
text = File.read("../data/#{name}.tsv").gsub(/\\"/, '""')
all_lines = CSV.parse(text, col_sep: "\t")
#aa = a[10][2].encode!("UTF-8")
all_subs = [
['‘', "'"],
['´', "'"],
['`', "'"],
['’', "'"],
['“', '"'],
['«', '"'],
['»', '"'],
]
all_subs += [
['®', 'CPYRGHT'],
['<em>', 'EM'],
['</em>', 'EEM'],
['<i>', 'STARTI'],
['</i>', 'ENDI'],
["'s ", 'APS'],
[/\t+/, 'TAB'],
].map { |v| [v[0], " SPECIALCHAR#{v[1]} "] }
all_subs += [
['<br /><br />', 'DBR'],
['<br />', 'BR'],
['<hr>', 'HR'],
].map { |v| [v[0], " PARAGRAPHEND SPECIALPARACHAR#{v[1]} "] }
all_subs += [':-)', ':-p', ':-P', ':-(', ':-D', '</3', '<3', '<=8'].each_with_index.map do |x, i|
[x, " SPECIALCHARSMILEY#{i} "]
end
# xxxx--yyyy
# replace X.Y.
# numbera/numberb
# (?????)
# ?!?!
# letter*****letter****letter
# many ...
# many !!!
# many ???
# many $$$
# many ---
# many *** (including count!)
all_subs += [
[/([a-z0-9])--+([a-z0-9])/i, '\1 SPECIAL \2'],
[/([a-z0-9])\.([a-z0-9])\./i, ' \1\2SPECIAL '],
[/([a-z0-9])\.([a-z0-9])\./i, ' \1\2SPECIAL '],
[/([0-9])\/([0-9][0-9]?)/i, ' \1SPECIAL\2 '],
[/([a-z]\*\*+)([a-z]\*\*+)?([a-z]\*\*+)?[a-z]?/i, ' SPECIAL '],
[/(\!|\?)*(\!\?|\?\!)(\!|\?)*/i, ' SPECIAL SENTENCEEND '],
[/\(\?+\)/i, ' SPECIAL SENTENCEEND '],
[/\.\.+/i, ' SPECIAL SENTENCEEND '],
[/\!\!+/i, ' SPECIAL SENTENCEEND '],
[/\$\$+/i, ' SPECIAL '],
[/\-\-+/i, ' SPECIAL '],
[/ \*\*\*\*\* /i, ' SPECIAL '],
[/ \*\*\*\* /i, ' SPECIAL '],
[/ \*\*\* /i, ' SPECIAL '],
[/ \*\* /i, ' SPECIAL '],
[/\*\*+/i, ' SPECIAL '],
[/#[ ]?([0-9])/i, ' SPECIAL\1 '],
].each_with_index.map { |x, i| [x[0], x[1].gsub('SPECIAL', "EXSPEC#{i}")] }
all_subs += [['₤', '$'], ['£', '$']]
all_subs += '!.?'.split('').each_with_index.map { |x, i| [x, " SENTSPECL#{i} SENTENCEEND "] }
all_subs += '),;:'.split('').each_with_index.map { |x, i| [x, " SUBSENTSPECL#{i} SUBSENTENCEEND "] }
all_subs += '('.split('').each_with_index.map { |x, i| [x, " SUBSENTENCEEND SUBSENTSPECLBRA#{i} "] }
all_subs += '|~#"\'{}[]+-–°*ç%&/=\\<>_^§$@'.split('').each_with_index.map { |x, i| [x, " SPECSINGL#{i} "] }
#all_subs += 'êßãåøñíÊùáóäüöëéà轨'.split('').map { |x| [x, ''] }
#all_subs += %W(\u0096 \u0097 \u0091 \u0084).map { |v| [v, ''] }
all_subs += ([[' ', ' ']] * 10)
#while line = gets do
# all_subs.each do |find, replace|
# line = line.gsub(find, replace)
# end
# puts line
#end
i = 0
updated_lines = all_lines.map do |line|
i += 1
if i % 5000 == 0
puts i
end
if false
new_line = line.dup
review = new_line[review_column].downcase
all_subs.each do |find, replace|
review = review.gsub(find, replace)
end
review = review.gsub(/[^0-9a-z ]+/i, '')
else
new_line = line.dup
review = new_line[review_column].downcase
end
#extracted = review.scan(/[^0-9a-z ]+/i)
#if extracted.length > 0
# strange += extracted
#end
new_line[review_column] = review.strip
new_line
end
#p strange.uniq.sort.join('')
CSV.open("#{name}Clean.csv", 'w') do |csv|
updated_lines.each do |new_line|
csv << new_line
end
end
end
convert('labeledTrainData', 2)
convert('testData', 1)
convert('unlabeledTrainData', 1)
|
lukaselmer/hierarchical-paragraph-vectors
|
code/preprocess/replace.rb
|
Ruby
|
mit
| 3,480
|
import JoiBase from 'joi';
import {postHandlerFactory, getHandlerFactory} from './common';
import FullDateValidator from '../../../../shared/lib/joi-full-date-validator';
const Joi = JoiBase.extend(FullDateValidator);
const schema = Joi.object().keys({
'day': Joi.number().integer().min(1).max(31).required().label('Day')
.meta({
componentType: 'numeric',
fieldset: true,
legendText:'What is your date of birth?',
legendClass: 'legend-hidden' })
.options({
language: {
number: {
base: 'Please enter a valid day using numbers only',
min: 'Please enter a valid day',
max: 'Please enter a valid day'
}
}
}),
'month': Joi.number().integer().min(1).max(12).required().label('Month').meta({ componentType: 'numeric' }).options({
language: {
number: {
base: 'Please enter a valid month using numbers only',
min: 'Please enter a valid month',
max: 'Please enter a valid month'
}
}
}),
'year': Joi.number().integer().min(1885).max(2025).required().label('Year')
.meta({
componentType: 'numeric',
fieldsetEnd: true })
.options({
language: {
number: {
base: 'Please enter a valid year using numbers only',
min: 'Please enter a year after 1885',
max: 'Please enter a valid year'
}
}
}),
'submit': Joi.any().optional().strip()
}).fulldate();
const title = 'What is your date of birth?';
const key = 'dateOfBirth';
const slug = 'date-of-birth';
const defails = {
hint: 'For example, 31 3 1980'
};
const handlers = {
GET: (prevSteps) => getHandlerFactory(key, title, schema, prevSteps, defails),
POST: (prevSteps, nextSteps) => postHandlerFactory(key, title, schema, prevSteps, nextSteps, defails),
};
/**
* @type Step
*/
export default {
key,
slug,
title,
schema,
handlers
};
|
nhsuk/register-with-a-gp-beta-web
|
src/server/plugins/register-form/steps/date-of-birth.js
|
JavaScript
|
mit
| 1,864
|
vty-integrate
================
integration testing of vty
|
coreyoconnor/vty-integrate
|
README.md
|
Markdown
|
mit
| 59
|
#ifndef CALLBACK_HPP_
# define CALLBACK_HPP_
# include "my_opengl.hpp"
# include "vect.hpp"
# include "logic.hpp"
namespace Callback
{
void setCallbacks(GLFWwindow *window);
void mouseCallback(GLFWwindow *window, double x, double y);
void mouseButtonCallback(GLFWwindow *window, int button, int action, int mods);
void keyCallback(GLFWwindow *window, int key, int scancode, int action, int mode);
Vect<2u, double> screenToGame(Vect<2u, double> pos);
void selectBots();
// mouse data
extern Vect<2u, double> pos;
extern Vect<2u, double> dragOrigin;
extern bool leftPressed;
extern bool rightPressed;
// key data
extern Vect<4u, bool> keyPressed;
extern bool spacePressed;
};
#endif /* !CALLBACK_HPP_ */
|
baillyjamy/Nano-Swarm
|
include/callback.hpp
|
C++
|
mit
| 737
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Trirand jqTreeGrid - jQuery based tree grid HTML5 component for Javascript</title>
<!-- Temporary fix -->
<script src="../js/jquery.min.js" type="text/javascript"></script>
<script src="../js/jquery-ui.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../css/jquery-ui.css" media="screen" />
<style type="text/css">
.examples {padding-left: 10px;}
#loading { height: 150px !important}
</style>
<script type="text/javascript">
jQuery(document).ready(function () {
$("#accordion").accordion();
$("#demoFrame").attr("src", "nested_model_1/index.html");
});
</script>
</head>
<body>
<form id="Form1">
<div id="wrap">
<!-- Content -->
<table cellspacing="10" cellpadding="10">
<tr>
<td width="250px" style="vertical-align:top">
<div id="accordion" style="font-size: 75%; height: 600px; width: 240px;">
<h3><a href="#">Tree Models</a></h3>
<div>
<ul class="examples">
<li>
<a href="nested_model_1/index.html" target="demoFrame">Nested Set Model</a>
</li>
<li>
<a href="adj_model/index.html" target="demoFrame">Adjacency model</a>
</li>
</ul>
</div>
<h3><a href="#">Loading</a></h3>
<div id="loading">
<ul class="examples">
<li>
<a href="ajax/index.html" target="demoFrame">Load Rows On Demand (AJAX)</a>
</li>
<li>
<a href="loadonce_collapsed/index.html" target="demoFrame">Load All Rows At Once Collapsed</a>
</li>
<li>
<a href="loadonce_expanded/index.html" target="demoFrame">Load All Rows At Once Expanded</a>
</li>
</ul>
</div>
<h3><a href="#">Look and Feel</a></h3>
<div>
<ul class="examples">
<li>
<a href="expand_col_click/index.html" target="demoFrame">Expand a node by click the name</a>
</li>
<li>
<a href="fixed_height/index.html" target="demoFrame">Fixed height</a>
</li>
<li>
<a href="icon_change/index.html" target="demoFrame">Icon can be changed</a>
</li>
<li>
<a href="icon_change_data/index.html" target="demoFrame">Icon from data field</a>
</li>
</ul>
</div>
<h3><a href="#">Functionalities</a></h3>
<div>
<ul class="examples">
<li>
<a href="searching/index.html" target="demoFrame">Search in TreeGrid</a>
</li>
<li>
<a href="key_nav/index.html" target="demoFrame">Navigation with keyboard</a>
</li>
<li>
<a href="onselect_event/index.html" target="demoFrame"> Action on selecting node</a>
</li>
<li>
<a href="simple_tree/index.html" target="demoFrame">Simulate simple tree</a>
</li>
</ul>
</div>
<h3><a href="#">Add/Update/Delete Nodes</a></h3>
<div>
<ul class="examples">
<li>
<a href="add_node/index.html" target="demoFrame">Add Node</a>
</li>
<li>
<a href="delete_node/index.html" target="demoFrame"> Delete Node</a>
</li>
<li>
<a href="all_crud/index.html" target="demoFrame">Add, Edit, Delete Nodes</a>
</li>
</ul>
</div>
</div>
</td>
<td width="800px" valign="top">
<iframe id="demoFrame"
name="demoFrame"
style="width: 800px; height: 1000px; border-width: 0;"></iframe>
</td>
</tr>
</table>
<!-- Content -->
</div>
</form>
</body>
</html>
|
lapakku2016/ciproject
|
assets/lib/gurido/treegridjs/index.html
|
HTML
|
mit
| 5,953
|
module GemFuzzy
class FuzzyMatcher
def initialize(name, version)
@name = name
@version = version
end
def all_available_matches
matches([])
end
def matches(specs)
specs = matches_for(specs, :name, @name)
specs = matches_for(specs, :version, @version) if @version
specs
end
def matches_for(specs, attribute, value)
[:exact, :substring, :subsequence].each do |type|
matches = send("#{type}_matches", specs, attribute, value)
return matches if !matches.empty?
end
[]
end
private
def exact_matches(specs, attribute, value)
specs.select{|spec| spec.send(attribute).to_s == value}
end
def substring_matches(specs, attribute, value)
specs.select{|spec| spec.send(attribute).to_s.include?(value)}
end
def subsequence_matches(specs, attribute, value)
specs.select{|spec| include_subsequence?(spec.send(attribute).to_s, value)}
end
def include_subsequence?(string, subsequence)
string_index = 0
subsequence_index = 0
while string_index < string.length
if string[string_index] == subsequence[subsequence_index]
subsequence_index += 1
return true if subsequence_index == subsequence.length
end
string_index += 1
end
return false
end
end
end
|
oggy/gem_info
|
lib/gem_fuzzy/fuzzy_matcher.rb
|
Ruby
|
mit
| 1,370
|
I am the graph built from a FAMIX/Orion model.
|
juliendelplanque/SFDiff
|
repository/SimilarityFlooding.package/SFEdgeNamedGraph.class/README.md
|
Markdown
|
mit
| 46
|
Divers scripts de manipulation des tableaux de lignes de transport du wiki
La structure de chaque tableau pouvant varier, ces scripts restent à adapter au contexte.
* wiki2csv : récupère la liste des lignes depuis le wiki (`wiki2csv_routes_list.csv`)
* osm2wiki : crée le tableau à mettre sur la wiki à partir des éléments déjà dans OSM (extraits avec osm-transit-extractor)
* csv2wiki : crée le tableau à mettre sur la wiki à partir d'un fichier csv
* navitia2wiki : crée le tableau à mettre sur la wiki à partir d'appels à l'API navitia.io
|
nlehuby/OSM_snippets
|
wiki/README.md
|
Markdown
|
mit
| 561
|
#!/bin/bash
#################################################
# Libs
#################################################
Originator__autoload "$Originator__module_directory"/lib
#################################################
# Dispatch
#
# @param $1: The action to take
# @param $2+: Any additional params to pass to
# the action
#################################################
Self_dispatch() {
if [ "$1" = "self:init" ]; then
Self__init
else
Logger__error "Action invalid"
fi
}
#################################################
# Start
#################################################
Self_dispatch "$@"
|
DigitalCitadel/originator
|
modules/self/bootstrap.bash
|
Shell
|
mit
| 653
|
<?php
// C:\xampp\htdocs\login\vendor\bundles\Symfony\Bundle\WebConfiguratorBundle/Resources/views\layout.html.twig
return array (
);
|
VelvetMirror/login
|
app/cache/dev/assetic/config/a/a55d388ad257d169e5d2b873492b1b4d.php
|
PHP
|
mit
| 135
|
from __future__ import absolute_import
from .validates import *
|
openelections/openelections-core
|
openelex/us/vt/validate/__init__.py
|
Python
|
mit
| 64
|
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterViewVisitKpi3 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
$query[] = <<<EOD
CREATE or REPLACE view view_kpi_order_day as
SELECT
fdate,
femp_id,
DATE_FORMAT(o.fdate, '%Y-%m') AS fmonth,
sum(ftotal_amount) as famount
FROM
st_sale_orders o
group by fdate, femp_id;
EOD;
$query[] = <<<EOD
CREATE or REPLACE view view_kpi_order_month as
SELECT
femp_id,
fmonth,
sum(famount) as famount
from view_kpi_order_day
group by femp_id,fmonth
EOD;
$query[] = <<<EOD
CREATE or REPLACE view view_kpi_order_sended_day as
SELECT
fdate,
femp_id,
DATE_FORMAT(o.fdate, '%Y-%m') AS fmonth,
sum(ftotal_amount) as famount
FROM
st_sale_orders o
where fsend_status='C'
group by fdate, femp_id
;
EOD;
$query[] = <<<EOD
CREATE or REPLACE view view_kpi_order_sended_month as
SELECT
femp_id,
fmonth,
sum(famount) as famount
from view_kpi_order_sended_day
group by femp_id,fmonth
EOD;
$query[] = <<<EOD
CREATE OR REPLACE VIEW view_visit_kpi AS
SELECT
ed.fdate,
ed.femp_id,
emp.fname,
pos.fname AS position_name,
st.store_total,
vst.valid_store_total,
ds.day_store_total,
dsd.day_store_done_total,
ms.month_store_total,
msd.month_store_total as month_store_done_total,
msd.month_store_total / vst.valid_store_total * 100 AS rate,
dcs.store_cost_second_total AS day_cost_total,
mcs.store_cost_second_total AS month_cost_total,
round(
mcs.store_cost_second_total / msd.month_store_total
) AS store_avg_cost,
mst.times as month_times_total,
msdt.times as month_done_times_total,
msdt.times / mst.times * 100 as month_times_rate,
kod.famount as day_amount,
kom.famount as month_amount,
round( kom.famount / msd.month_store_total ) as num_amount,
round( kom.famount / msdt.times ) as times_amount,
kosd.famount as sended_day_amount,
kosm.famount as sended_month_amount
FROM
view_visit_employee_day ed
INNER JOIN bd_employees emp ON ed.femp_id = emp.id
LEFT JOIN bd_positions pos ON emp.fpost_id = pos.id
LEFT JOIN view_visit_store st ON ed.femp_id = st.femp_id
LEFT JOIN view_visit_valid_store vst ON ed.femp_id = vst.femp_id
LEFT JOIN view_visit_day_store ds on ed.femp_id = ds.femp_id and ds.fdate=ed.fdate
LEFT JOIN view_visit_day_store_done dsd on ed.femp_id=dsd.femp_id and dsd.fdate=ed.fdate
LEFT JOIN view_visit_month_store ms ON ed.femp_id = ms.femp_id AND ed.fmonth = ms.fmonth
LEFT JOIN view_visit_month_store_done msd ON ed.femp_id = msd.femp_id AND ed.fmonth = msd.fmonth
LEFT JOIN view_visit_day_cost_sum dcs on ed.femp_id=dcs.femp_id and dcs.fdate=ed.fdate
LEFT JOIN view_visit_month_cost_sum mcs ON ed.femp_id = mcs.femp_id AND ed.fmonth = mcs.fmonth
LEFT JOIN view_visit_month_store_times mst on ed.femp_id=mst.femp_id AND ed.fmonth = mst.fmonth
LEFT JOIN view_visit_month_store_done_times msdt on ed.femp_id=msdt.femp_id AND ed.fmonth = msdt.fmonth
LEFT JOIN view_kpi_order_day kod on ed.femp_id = kod.femp_id and ed.fdate=kod.fdate
LEFT JOIN view_kpi_order_month kom on ed.femp_id = kom.femp_id and ed.fmonth = kom.fmonth
LEFT JOIN view_kpi_order_sended_day kosd on ed.femp_id = kosd.femp_id and ed.fdate=kosd.fdate
LEFT JOIN view_kpi_order_sended_month kosm on ed.femp_id = kosm.femp_id and ed.fmonth = kosm.fmonth
;
EOD;
foreach ($query as $q)
DB::statement($q);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
|
seed-builder/mmk
|
database/migrations/2017_10_25_150048_alter_view_visit_kpi3.php
|
PHP
|
mit
| 3,660
|
# VariableGridLayoutGroup
The built-in GridLayoutGroup component in Unity's UI is limited to identical cell sizes specified in the inspector. This custom script allows you to create a grid whose columns and rows are variable sizes, dynamically resizing to fit the largest content in that row or column.
An explainer video is hosted at: https://www.youtube.com/watch?v=m4a_WFMDB50
NB: If a cell contains a Text element which is set to wrap, the cell may become taller than needed. To get round this, it is best practice to make every cell a GameObject containing a Horizontal Layout Group, with Child Controls Size true and Child Force Expand false. Then attach a child to this cell object, and add the text element there instead. If desired, you can add a LayoutElement to the cell root object and set a preferred width/height.
NB: If you add a VariableGridCell element to a cell, you can override Force Expand etc. However, if you disable the VariableGridCell, you may need to disable and enable the GridLayoutGroup to refresh the layout.
|
quoxel/VariableGridLayoutGroup
|
README.md
|
Markdown
|
mit
| 1,044
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
$config['base_url'] = 'http://localhost/learning/T_Report/';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.php';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'AUTO';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify with a regular expression which characters are permitted
| within your URLs. When someone tries to submit a URL with disallowed
| characters they will get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ folder. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Session class you
| MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = 'new_fact';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_cookie_name' = the name you want for the cookie
| 'sess_expiration' = the number of SECONDS you want the session to last.
| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
| 'sess_expire_on_close' = Whether to cause the session to expire automatically
| when the browser window is closed
| 'sess_encrypt_cookie' = Whether to encrypt the cookie
| 'sess_use_database' = Whether to save the session data to a database
| 'sess_table_name' = The name of the session database table
| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
|
*/
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = TRUE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
|
*/
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or 'gmt'. This pref tells the system whether to use
| your server's local time as the master 'now' reference, or convert it to
| GMT. See the 'date helper' page of the user guide for information
| regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy IP
| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
| header in order to properly identify the visitor's IP address.
| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
|
*/
$config['proxy_ips'] = '';
/* End of file config.php */
/* Location: ./application/config/config.php */
|
ramasamys/T_Report
|
application/config/config.php
|
PHP
|
mit
| 12,850
|
/*
* This file is part of ArborianQuests for Bukkit, licensed under the MIT License (MIT).
*
* Copyright (c) JCThePants (www.jcwhatever.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.jcwhatever.arborianquests.commands.admin.flags;
import com.jcwhatever.nucleus.managed.commands.utils.AbstractCommand;
import com.jcwhatever.nucleus.managed.commands.CommandInfo;
@CommandInfo(
command={"flags"},
description="Manage quest flags.")
public class FlagsCommand extends AbstractCommand {
public FlagsCommand() {
super();
registerCommand(ClearSubCommand.class);
registerCommand(ListSubCommand.class);
registerCommand(SetSubCommand.class);
}
}
|
JCThePants/ArborianQuests
|
src/com/jcwhatever/arborianquests/commands/admin/flags/FlagsCommand.java
|
Java
|
mit
| 1,748
|
#ifndef CG_OPENGL_OPENGL_DEF_H_
#define CG_OPENGL_OPENGL_DEF_H_
#include "cg/rnd/opengl/glcorearb.h"
extern "C" {
extern PFNGLCULLFACEPROC glCullFace;
extern PFNGLFRONTFACEPROC glFrontFace;
extern PFNGLHINTPROC glHint;
extern PFNGLLINEWIDTHPROC glLineWidth;
extern PFNGLPOINTSIZEPROC glPointSize;
extern PFNGLPOLYGONMODEPROC glPolygonMode;
extern PFNGLSCISSORPROC glScissor;
extern PFNGLTEXPARAMETERFPROC glTexParameterf;
extern PFNGLTEXPARAMETERFVPROC glTexParameterfv;
extern PFNGLTEXPARAMETERIPROC glTexParameteri;
extern PFNGLTEXPARAMETERIVPROC glTexParameteriv;
extern PFNGLTEXIMAGE1DPROC glTexImage1D;
extern PFNGLTEXIMAGE2DPROC glTexImage2D;
extern PFNGLDRAWBUFFERPROC glDrawBuffer;
extern PFNGLCLEARPROC glClear;
extern PFNGLCLEARCOLORPROC glClearColor;
extern PFNGLCLEARSTENCILPROC glClearStencil;
extern PFNGLCLEARDEPTHPROC glClearDepth;
extern PFNGLSTENCILMASKPROC glStencilMask;
extern PFNGLCOLORMASKPROC glColorMask;
extern PFNGLDEPTHMASKPROC glDepthMask;
extern PFNGLDISABLEPROC glDisable;
extern PFNGLENABLEPROC glEnable;
extern PFNGLFINISHPROC glFinish;
extern PFNGLFLUSHPROC glFlush;
extern PFNGLBLENDFUNCPROC glBlendFunc;
extern PFNGLLOGICOPPROC glLogicOp;
extern PFNGLSTENCILFUNCPROC glStencilFunc;
extern PFNGLSTENCILOPPROC glStencilOp;
extern PFNGLDEPTHFUNCPROC glDepthFunc;
extern PFNGLPIXELSTOREFPROC glPixelStoref;
extern PFNGLPIXELSTOREIPROC glPixelStorei;
extern PFNGLREADBUFFERPROC glReadBuffer;
extern PFNGLREADPIXELSPROC glReadPixels;
extern PFNGLGETBOOLEANVPROC glGetBooleanv;
extern PFNGLGETDOUBLEVPROC glGetDoublev;
extern PFNGLGETERRORPROC glGetError;
extern PFNGLGETFLOATVPROC glGetFloatv;
extern PFNGLGETINTEGERVPROC glGetIntegerv;
extern PFNGLGETSTRINGPROC glGetString;
extern PFNGLGETTEXIMAGEPROC glGetTexImage;
extern PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv;
extern PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv;
extern PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv;
extern PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv;
extern PFNGLISENABLEDPROC glIsEnabled;
extern PFNGLDEPTHRANGEPROC glDepthRange;
extern PFNGLVIEWPORTPROC glViewport;
extern PFNGLDRAWARRAYSPROC glDrawArrays;
extern PFNGLDRAWELEMENTSPROC glDrawElements;
extern PFNGLGETPOINTERVPROC glGetPointerv;
extern PFNGLPOLYGONOFFSETPROC glPolygonOffset;
extern PFNGLCOPYTEXIMAGE1DPROC glCopyTexImage1D;
extern PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D;
extern PFNGLCOPYTEXSUBIMAGE1DPROC glCopyTexSubImage1D;
extern PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D;
extern PFNGLTEXSUBIMAGE1DPROC glTexSubImage1D;
extern PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D;
extern PFNGLBINDTEXTUREPROC glBindTexture;
extern PFNGLDELETETEXTURESPROC glDeleteTextures;
extern PFNGLGENTEXTURESPROC glGenTextures;
extern PFNGLISTEXTUREPROC glIsTexture;
extern PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements;
extern PFNGLTEXIMAGE3DPROC glTexImage3D;
extern PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D;
extern PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D;
extern PFNGLACTIVETEXTUREPROC glActiveTexture;
extern PFNGLSAMPLECOVERAGEPROC glSampleCoverage;
extern PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D;
extern PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D;
extern PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D;
extern PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D;
extern PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D;
extern PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D;
extern PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage;
extern PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate;
extern PFNGLMULTIDRAWARRAYSPROC glMultiDrawArrays;
extern PFNGLMULTIDRAWELEMENTSPROC glMultiDrawElements;
extern PFNGLPOINTPARAMETERFPROC glPointParameterf;
extern PFNGLPOINTPARAMETERFVPROC glPointParameterfv;
extern PFNGLPOINTPARAMETERIPROC glPointParameteri;
extern PFNGLPOINTPARAMETERIVPROC glPointParameteriv;
extern PFNGLBLENDCOLORPROC glBlendColor;
extern PFNGLBLENDEQUATIONPROC glBlendEquation;
extern PFNGLGENQUERIESPROC glGenQueries;
extern PFNGLDELETEQUERIESPROC glDeleteQueries;
extern PFNGLISQUERYPROC glIsQuery;
extern PFNGLBEGINQUERYPROC glBeginQuery;
extern PFNGLENDQUERYPROC glEndQuery;
extern PFNGLGETQUERYIVPROC glGetQueryiv;
extern PFNGLGETQUERYOBJECTIVPROC glGetQueryObjectiv;
extern PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv;
extern PFNGLBINDBUFFERPROC glBindBuffer;
extern PFNGLDELETEBUFFERSPROC glDeleteBuffers;
extern PFNGLGENBUFFERSPROC glGenBuffers;
extern PFNGLISBUFFERPROC glIsBuffer;
extern PFNGLBUFFERDATAPROC glBufferData;
extern PFNGLBUFFERSUBDATAPROC glBufferSubData;
extern PFNGLGETBUFFERSUBDATAPROC glGetBufferSubData;
extern PFNGLMAPBUFFERPROC glMapBuffer;
extern PFNGLUNMAPBUFFERPROC glUnmapBuffer;
extern PFNGLGETBUFFERPARAMETERIVPROC glGetBufferParameteriv;
extern PFNGLGETBUFFERPOINTERVPROC glGetBufferPointerv;
extern PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate;
extern PFNGLDRAWBUFFERSPROC glDrawBuffers;
extern PFNGLSTENCILOPSEPARATEPROC glStencilOpSeparate;
extern PFNGLSTENCILFUNCSEPARATEPROC glStencilFuncSeparate;
extern PFNGLSTENCILMASKSEPARATEPROC glStencilMaskSeparate;
extern PFNGLATTACHSHADERPROC glAttachShader;
extern PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation;
extern PFNGLCOMPILESHADERPROC glCompileShader;
extern PFNGLCREATEPROGRAMPROC glCreateProgram;
extern PFNGLCREATESHADERPROC glCreateShader;
extern PFNGLDELETEPROGRAMPROC glDeleteProgram;
extern PFNGLDELETESHADERPROC glDeleteShader;
extern PFNGLDETACHSHADERPROC glDetachShader;
extern PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;
extern PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;
extern PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib;
extern PFNGLGETACTIVEUNIFORMPROC glGetActiveUniform;
extern PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders;
extern PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation;
extern PFNGLGETPROGRAMIVPROC glGetProgramiv;
extern PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
extern PFNGLGETSHADERIVPROC glGetShaderiv;
extern PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
extern PFNGLGETSHADERSOURCEPROC glGetShaderSource;
extern PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
extern PFNGLGETUNIFORMFVPROC glGetUniformfv;
extern PFNGLGETUNIFORMIVPROC glGetUniformiv;
extern PFNGLGETVERTEXATTRIBDVPROC glGetVertexAttribdv;
extern PFNGLGETVERTEXATTRIBFVPROC glGetVertexAttribfv;
extern PFNGLGETVERTEXATTRIBIVPROC glGetVertexAttribiv;
extern PFNGLGETVERTEXATTRIBPOINTERVPROC glGetVertexAttribPointerv;
extern PFNGLISPROGRAMPROC glIsProgram;
extern PFNGLISSHADERPROC glIsShader;
extern PFNGLLINKPROGRAMPROC glLinkProgram;
extern PFNGLSHADERSOURCEPROC glShaderSource;
extern PFNGLUSEPROGRAMPROC glUseProgram;
extern PFNGLUNIFORM1FPROC glUniform1f;
extern PFNGLUNIFORM2FPROC glUniform2f;
extern PFNGLUNIFORM3FPROC glUniform3f;
extern PFNGLUNIFORM4FPROC glUniform4f;
extern PFNGLUNIFORM1IPROC glUniform1i;
extern PFNGLUNIFORM2IPROC glUniform2i;
extern PFNGLUNIFORM3IPROC glUniform3i;
extern PFNGLUNIFORM4IPROC glUniform4i;
extern PFNGLUNIFORM1FVPROC glUniform1fv;
extern PFNGLUNIFORM2FVPROC glUniform2fv;
extern PFNGLUNIFORM3FVPROC glUniform3fv;
extern PFNGLUNIFORM4FVPROC glUniform4fv;
extern PFNGLUNIFORM1IVPROC glUniform1iv;
extern PFNGLUNIFORM2IVPROC glUniform2iv;
extern PFNGLUNIFORM3IVPROC glUniform3iv;
extern PFNGLUNIFORM4IVPROC glUniform4iv;
extern PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv;
extern PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv;
extern PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv;
extern PFNGLVALIDATEPROGRAMPROC glValidateProgram;
extern PFNGLVERTEXATTRIB1DPROC glVertexAttrib1d;
extern PFNGLVERTEXATTRIB1DVPROC glVertexAttrib1dv;
extern PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f;
extern PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv;
extern PFNGLVERTEXATTRIB1SPROC glVertexAttrib1s;
extern PFNGLVERTEXATTRIB1SVPROC glVertexAttrib1sv;
extern PFNGLVERTEXATTRIB2DPROC glVertexAttrib2d;
extern PFNGLVERTEXATTRIB2DVPROC glVertexAttrib2dv;
extern PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f;
extern PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv;
extern PFNGLVERTEXATTRIB2SPROC glVertexAttrib2s;
extern PFNGLVERTEXATTRIB2SVPROC glVertexAttrib2sv;
extern PFNGLVERTEXATTRIB3DPROC glVertexAttrib3d;
extern PFNGLVERTEXATTRIB3DVPROC glVertexAttrib3dv;
extern PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f;
extern PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv;
extern PFNGLVERTEXATTRIB3SPROC glVertexAttrib3s;
extern PFNGLVERTEXATTRIB3SVPROC glVertexAttrib3sv;
extern PFNGLVERTEXATTRIB4NBVPROC glVertexAttrib4Nbv;
extern PFNGLVERTEXATTRIB4NIVPROC glVertexAttrib4Niv;
extern PFNGLVERTEXATTRIB4NSVPROC glVertexAttrib4Nsv;
extern PFNGLVERTEXATTRIB4NUBPROC glVertexAttrib4Nub;
extern PFNGLVERTEXATTRIB4NUBVPROC glVertexAttrib4Nubv;
extern PFNGLVERTEXATTRIB4NUIVPROC glVertexAttrib4Nuiv;
extern PFNGLVERTEXATTRIB4NUSVPROC glVertexAttrib4Nusv;
extern PFNGLVERTEXATTRIB4BVPROC glVertexAttrib4bv;
extern PFNGLVERTEXATTRIB4DPROC glVertexAttrib4d;
extern PFNGLVERTEXATTRIB4DVPROC glVertexAttrib4dv;
extern PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f;
extern PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv;
extern PFNGLVERTEXATTRIB4IVPROC glVertexAttrib4iv;
extern PFNGLVERTEXATTRIB4SPROC glVertexAttrib4s;
extern PFNGLVERTEXATTRIB4SVPROC glVertexAttrib4sv;
extern PFNGLVERTEXATTRIB4UBVPROC glVertexAttrib4ubv;
extern PFNGLVERTEXATTRIB4UIVPROC glVertexAttrib4uiv;
extern PFNGLVERTEXATTRIB4USVPROC glVertexAttrib4usv;
extern PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
extern PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv;
extern PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv;
extern PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv;
extern PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv;
extern PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv;
extern PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv;
extern PFNGLCOLORMASKIPROC glColorMaski;
extern PFNGLGETBOOLEANI_VPROC glGetBooleani_v;
extern PFNGLGETINTEGERI_VPROC glGetIntegeri_v;
extern PFNGLENABLEIPROC glEnablei;
extern PFNGLDISABLEIPROC glDisablei;
extern PFNGLISENABLEDIPROC glIsEnabledi;
extern PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback;
extern PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback;
extern PFNGLBINDBUFFERRANGEPROC glBindBufferRange;
extern PFNGLBINDBUFFERBASEPROC glBindBufferBase;
extern PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings;
extern PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glGetTransformFeedbackVarying;
extern PFNGLCLAMPCOLORPROC glClampColor;
extern PFNGLBEGINCONDITIONALRENDERPROC glBeginConditionalRender;
extern PFNGLENDCONDITIONALRENDERPROC glEndConditionalRender;
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
extern PFNGLGETVERTEXATTRIBIIVPROC glGetVertexAttribIiv;
extern PFNGLGETVERTEXATTRIBIUIVPROC glGetVertexAttribIuiv;
extern PFNGLVERTEXATTRIBI1IPROC glVertexAttribI1i;
extern PFNGLVERTEXATTRIBI2IPROC glVertexAttribI2i;
extern PFNGLVERTEXATTRIBI3IPROC glVertexAttribI3i;
extern PFNGLVERTEXATTRIBI4IPROC glVertexAttribI4i;
extern PFNGLVERTEXATTRIBI1UIPROC glVertexAttribI1ui;
extern PFNGLVERTEXATTRIBI2UIPROC glVertexAttribI2ui;
extern PFNGLVERTEXATTRIBI3UIPROC glVertexAttribI3ui;
extern PFNGLVERTEXATTRIBI4UIPROC glVertexAttribI4ui;
extern PFNGLVERTEXATTRIBI1IVPROC glVertexAttribI1iv;
extern PFNGLVERTEXATTRIBI2IVPROC glVertexAttribI2iv;
extern PFNGLVERTEXATTRIBI3IVPROC glVertexAttribI3iv;
extern PFNGLVERTEXATTRIBI4IVPROC glVertexAttribI4iv;
extern PFNGLVERTEXATTRIBI1UIVPROC glVertexAttribI1uiv;
extern PFNGLVERTEXATTRIBI2UIVPROC glVertexAttribI2uiv;
extern PFNGLVERTEXATTRIBI3UIVPROC glVertexAttribI3uiv;
extern PFNGLVERTEXATTRIBI4UIVPROC glVertexAttribI4uiv;
extern PFNGLVERTEXATTRIBI4BVPROC glVertexAttribI4bv;
extern PFNGLVERTEXATTRIBI4SVPROC glVertexAttribI4sv;
extern PFNGLVERTEXATTRIBI4UBVPROC glVertexAttribI4ubv;
extern PFNGLVERTEXATTRIBI4USVPROC glVertexAttribI4usv;
extern PFNGLGETUNIFORMUIVPROC glGetUniformuiv;
extern PFNGLBINDFRAGDATALOCATIONPROC glBindFragDataLocation;
extern PFNGLGETFRAGDATALOCATIONPROC glGetFragDataLocation;
extern PFNGLUNIFORM1UIPROC glUniform1ui;
extern PFNGLUNIFORM2UIPROC glUniform2ui;
extern PFNGLUNIFORM3UIPROC glUniform3ui;
extern PFNGLUNIFORM4UIPROC glUniform4ui;
extern PFNGLUNIFORM1UIVPROC glUniform1uiv;
extern PFNGLUNIFORM2UIVPROC glUniform2uiv;
extern PFNGLUNIFORM3UIVPROC glUniform3uiv;
extern PFNGLUNIFORM4UIVPROC glUniform4uiv;
extern PFNGLTEXPARAMETERIIVPROC glTexParameterIiv;
extern PFNGLTEXPARAMETERIUIVPROC glTexParameterIuiv;
extern PFNGLGETTEXPARAMETERIIVPROC glGetTexParameterIiv;
extern PFNGLGETTEXPARAMETERIUIVPROC glGetTexParameterIuiv;
extern PFNGLCLEARBUFFERIVPROC glClearBufferiv;
extern PFNGLCLEARBUFFERUIVPROC glClearBufferuiv;
extern PFNGLCLEARBUFFERFVPROC glClearBufferfv;
extern PFNGLCLEARBUFFERFIPROC glClearBufferfi;
extern PFNGLGETSTRINGIPROC glGetStringi;
extern PFNGLISRENDERBUFFERPROC glIsRenderbuffer;
extern PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer;
extern PFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers;
extern PFNGLGENRENDERBUFFERSPROC glGenRenderbuffers;
extern PFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage;
extern PFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv;
extern PFNGLISFRAMEBUFFERPROC glIsFramebuffer;
extern PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
extern PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers;
extern PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
extern PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus;
extern PFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D;
extern PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D;
extern PFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D;
extern PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer;
extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv;
extern PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
extern PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer;
extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample;
extern PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer;
extern PFNGLMAPBUFFERRANGEPROC glMapBufferRange;
extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange;
extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
extern PFNGLISVERTEXARRAYPROC glIsVertexArray;
extern PFNGLDRAWARRAYSINSTANCEDPROC glDrawArraysInstanced;
extern PFNGLDRAWELEMENTSINSTANCEDPROC glDrawElementsInstanced;
extern PFNGLTEXBUFFERPROC glTexBuffer;
extern PFNGLPRIMITIVERESTARTINDEXPROC glPrimitiveRestartIndex;
extern PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData;
extern PFNGLGETUNIFORMINDICESPROC glGetUniformIndices;
extern PFNGLGETACTIVEUNIFORMSIVPROC glGetActiveUniformsiv;
extern PFNGLGETACTIVEUNIFORMNAMEPROC glGetActiveUniformName;
extern PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex;
extern PFNGLGETACTIVEUNIFORMBLOCKIVPROC glGetActiveUniformBlockiv;
extern PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glGetActiveUniformBlockName;
extern PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding;
extern PFNGLDRAWELEMENTSBASEVERTEXPROC glDrawElementsBaseVertex;
extern PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glDrawRangeElementsBaseVertex;
extern PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glDrawElementsInstancedBaseVertex;
extern PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glMultiDrawElementsBaseVertex;
extern PFNGLPROVOKINGVERTEXPROC glProvokingVertex;
extern PFNGLFENCESYNCPROC glFenceSync;
extern PFNGLISSYNCPROC glIsSync;
extern PFNGLDELETESYNCPROC glDeleteSync;
extern PFNGLCLIENTWAITSYNCPROC glClientWaitSync;
extern PFNGLWAITSYNCPROC glWaitSync;
extern PFNGLGETINTEGER64VPROC glGetInteger64v;
extern PFNGLGETSYNCIVPROC glGetSynciv;
extern PFNGLGETINTEGER64I_VPROC glGetInteger64i_v;
extern PFNGLGETBUFFERPARAMETERI64VPROC glGetBufferParameteri64v;
extern PFNGLFRAMEBUFFERTEXTUREPROC glFramebufferTexture;
extern PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample;
extern PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample;
extern PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv;
extern PFNGLSAMPLEMASKIPROC glSampleMaski;
extern PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glBindFragDataLocationIndexed;
extern PFNGLGETFRAGDATAINDEXPROC glGetFragDataIndex;
extern PFNGLGENSAMPLERSPROC glGenSamplers;
extern PFNGLDELETESAMPLERSPROC glDeleteSamplers;
extern PFNGLISSAMPLERPROC glIsSampler;
extern PFNGLBINDSAMPLERPROC glBindSampler;
extern PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri;
extern PFNGLSAMPLERPARAMETERIVPROC glSamplerParameteriv;
extern PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf;
extern PFNGLSAMPLERPARAMETERFVPROC glSamplerParameterfv;
extern PFNGLSAMPLERPARAMETERIIVPROC glSamplerParameterIiv;
extern PFNGLSAMPLERPARAMETERIUIVPROC glSamplerParameterIuiv;
extern PFNGLGETSAMPLERPARAMETERIVPROC glGetSamplerParameteriv;
extern PFNGLGETSAMPLERPARAMETERIIVPROC glGetSamplerParameterIiv;
extern PFNGLGETSAMPLERPARAMETERFVPROC glGetSamplerParameterfv;
extern PFNGLGETSAMPLERPARAMETERIUIVPROC glGetSamplerParameterIuiv;
extern PFNGLQUERYCOUNTERPROC glQueryCounter;
extern PFNGLGETQUERYOBJECTI64VPROC glGetQueryObjecti64v;
extern PFNGLGETQUERYOBJECTUI64VPROC glGetQueryObjectui64v;
extern PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor;
extern PFNGLVERTEXATTRIBP1UIPROC glVertexAttribP1ui;
extern PFNGLVERTEXATTRIBP1UIVPROC glVertexAttribP1uiv;
extern PFNGLVERTEXATTRIBP2UIPROC glVertexAttribP2ui;
extern PFNGLVERTEXATTRIBP2UIVPROC glVertexAttribP2uiv;
extern PFNGLVERTEXATTRIBP3UIPROC glVertexAttribP3ui;
extern PFNGLVERTEXATTRIBP3UIVPROC glVertexAttribP3uiv;
extern PFNGLVERTEXATTRIBP4UIPROC glVertexAttribP4ui;
extern PFNGLVERTEXATTRIBP4UIVPROC glVertexAttribP4uiv;
extern PFNGLMINSAMPLESHADINGPROC glMinSampleShading;
extern PFNGLBLENDEQUATIONIPROC glBlendEquationi;
extern PFNGLBLENDEQUATIONSEPARATEIPROC glBlendEquationSeparatei;
extern PFNGLBLENDFUNCIPROC glBlendFunci;
extern PFNGLBLENDFUNCSEPARATEIPROC glBlendFuncSeparatei;
extern PFNGLDRAWARRAYSINDIRECTPROC glDrawArraysIndirect;
extern PFNGLDRAWELEMENTSINDIRECTPROC glDrawElementsIndirect;
extern PFNGLUNIFORM1DPROC glUniform1d;
extern PFNGLUNIFORM2DPROC glUniform2d;
extern PFNGLUNIFORM3DPROC glUniform3d;
extern PFNGLUNIFORM4DPROC glUniform4d;
extern PFNGLUNIFORM1DVPROC glUniform1dv;
extern PFNGLUNIFORM2DVPROC glUniform2dv;
extern PFNGLUNIFORM3DVPROC glUniform3dv;
extern PFNGLUNIFORM4DVPROC glUniform4dv;
extern PFNGLUNIFORMMATRIX2DVPROC glUniformMatrix2dv;
extern PFNGLUNIFORMMATRIX3DVPROC glUniformMatrix3dv;
extern PFNGLUNIFORMMATRIX4DVPROC glUniformMatrix4dv;
extern PFNGLUNIFORMMATRIX2X3DVPROC glUniformMatrix2x3dv;
extern PFNGLUNIFORMMATRIX2X4DVPROC glUniformMatrix2x4dv;
extern PFNGLUNIFORMMATRIX3X2DVPROC glUniformMatrix3x2dv;
extern PFNGLUNIFORMMATRIX3X4DVPROC glUniformMatrix3x4dv;
extern PFNGLUNIFORMMATRIX4X2DVPROC glUniformMatrix4x2dv;
extern PFNGLUNIFORMMATRIX4X3DVPROC glUniformMatrix4x3dv;
extern PFNGLGETUNIFORMDVPROC glGetUniformdv;
extern PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glGetSubroutineUniformLocation;
extern PFNGLGETSUBROUTINEINDEXPROC glGetSubroutineIndex;
extern PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glGetActiveSubroutineUniformiv;
extern PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glGetActiveSubroutineUniformName;
extern PFNGLGETACTIVESUBROUTINENAMEPROC glGetActiveSubroutineName;
extern PFNGLUNIFORMSUBROUTINESUIVPROC glUniformSubroutinesuiv;
extern PFNGLGETUNIFORMSUBROUTINEUIVPROC glGetUniformSubroutineuiv;
extern PFNGLGETPROGRAMSTAGEIVPROC glGetProgramStageiv;
extern PFNGLPATCHPARAMETERIPROC glPatchParameteri;
extern PFNGLPATCHPARAMETERFVPROC glPatchParameterfv;
extern PFNGLBINDTRANSFORMFEEDBACKPROC glBindTransformFeedback;
extern PFNGLDELETETRANSFORMFEEDBACKSPROC glDeleteTransformFeedbacks;
extern PFNGLGENTRANSFORMFEEDBACKSPROC glGenTransformFeedbacks;
extern PFNGLISTRANSFORMFEEDBACKPROC glIsTransformFeedback;
extern PFNGLPAUSETRANSFORMFEEDBACKPROC glPauseTransformFeedback;
extern PFNGLRESUMETRANSFORMFEEDBACKPROC glResumeTransformFeedback;
extern PFNGLDRAWTRANSFORMFEEDBACKPROC glDrawTransformFeedback;
extern PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glDrawTransformFeedbackStream;
extern PFNGLBEGINQUERYINDEXEDPROC glBeginQueryIndexed;
extern PFNGLENDQUERYINDEXEDPROC glEndQueryIndexed;
extern PFNGLGETQUERYINDEXEDIVPROC glGetQueryIndexediv;
extern PFNGLRELEASESHADERCOMPILERPROC glReleaseShaderCompiler;
extern PFNGLSHADERBINARYPROC glShaderBinary;
extern PFNGLGETSHADERPRECISIONFORMATPROC glGetShaderPrecisionFormat;
extern PFNGLDEPTHRANGEFPROC glDepthRangef;
extern PFNGLCLEARDEPTHFPROC glClearDepthf;
extern PFNGLGETPROGRAMBINARYPROC glGetProgramBinary;
extern PFNGLPROGRAMBINARYPROC glProgramBinary;
extern PFNGLPROGRAMPARAMETERIPROC glProgramParameteri;
extern PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages;
extern PFNGLACTIVESHADERPROGRAMPROC glActiveShaderProgram;
extern PFNGLCREATESHADERPROGRAMVPROC glCreateShaderProgramv;
extern PFNGLBINDPROGRAMPIPELINEPROC glBindProgramPipeline;
extern PFNGLDELETEPROGRAMPIPELINESPROC glDeleteProgramPipelines;
extern PFNGLGENPROGRAMPIPELINESPROC glGenProgramPipelines;
extern PFNGLISPROGRAMPIPELINEPROC glIsProgramPipeline;
extern PFNGLGETPROGRAMPIPELINEIVPROC glGetProgramPipelineiv;
extern PFNGLPROGRAMUNIFORM1IPROC glProgramUniform1i;
extern PFNGLPROGRAMUNIFORM1IVPROC glProgramUniform1iv;
extern PFNGLPROGRAMUNIFORM1FPROC glProgramUniform1f;
extern PFNGLPROGRAMUNIFORM1FVPROC glProgramUniform1fv;
extern PFNGLPROGRAMUNIFORM1DPROC glProgramUniform1d;
extern PFNGLPROGRAMUNIFORM1DVPROC glProgramUniform1dv;
extern PFNGLPROGRAMUNIFORM1UIPROC glProgramUniform1ui;
extern PFNGLPROGRAMUNIFORM1UIVPROC glProgramUniform1uiv;
extern PFNGLPROGRAMUNIFORM2IPROC glProgramUniform2i;
extern PFNGLPROGRAMUNIFORM2IVPROC glProgramUniform2iv;
extern PFNGLPROGRAMUNIFORM2FPROC glProgramUniform2f;
extern PFNGLPROGRAMUNIFORM2FVPROC glProgramUniform2fv;
extern PFNGLPROGRAMUNIFORM2DPROC glProgramUniform2d;
extern PFNGLPROGRAMUNIFORM2DVPROC glProgramUniform2dv;
extern PFNGLPROGRAMUNIFORM2UIPROC glProgramUniform2ui;
extern PFNGLPROGRAMUNIFORM2UIVPROC glProgramUniform2uiv;
extern PFNGLPROGRAMUNIFORM3IPROC glProgramUniform3i;
extern PFNGLPROGRAMUNIFORM3IVPROC glProgramUniform3iv;
extern PFNGLPROGRAMUNIFORM3FPROC glProgramUniform3f;
extern PFNGLPROGRAMUNIFORM3FVPROC glProgramUniform3fv;
extern PFNGLPROGRAMUNIFORM3DPROC glProgramUniform3d;
extern PFNGLPROGRAMUNIFORM3DVPROC glProgramUniform3dv;
extern PFNGLPROGRAMUNIFORM3UIPROC glProgramUniform3ui;
extern PFNGLPROGRAMUNIFORM3UIVPROC glProgramUniform3uiv;
extern PFNGLPROGRAMUNIFORM4IPROC glProgramUniform4i;
extern PFNGLPROGRAMUNIFORM4IVPROC glProgramUniform4iv;
extern PFNGLPROGRAMUNIFORM4FPROC glProgramUniform4f;
extern PFNGLPROGRAMUNIFORM4FVPROC glProgramUniform4fv;
extern PFNGLPROGRAMUNIFORM4DPROC glProgramUniform4d;
extern PFNGLPROGRAMUNIFORM4DVPROC glProgramUniform4dv;
extern PFNGLPROGRAMUNIFORM4UIPROC glProgramUniform4ui;
extern PFNGLPROGRAMUNIFORM4UIVPROC glProgramUniform4uiv;
extern PFNGLPROGRAMUNIFORMMATRIX2FVPROC glProgramUniformMatrix2fv;
extern PFNGLPROGRAMUNIFORMMATRIX3FVPROC glProgramUniformMatrix3fv;
extern PFNGLPROGRAMUNIFORMMATRIX4FVPROC glProgramUniformMatrix4fv;
extern PFNGLPROGRAMUNIFORMMATRIX2DVPROC glProgramUniformMatrix2dv;
extern PFNGLPROGRAMUNIFORMMATRIX3DVPROC glProgramUniformMatrix3dv;
extern PFNGLPROGRAMUNIFORMMATRIX4DVPROC glProgramUniformMatrix4dv;
extern PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glProgramUniformMatrix2x3fv;
extern PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glProgramUniformMatrix3x2fv;
extern PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glProgramUniformMatrix2x4fv;
extern PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glProgramUniformMatrix4x2fv;
extern PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glProgramUniformMatrix3x4fv;
extern PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glProgramUniformMatrix4x3fv;
extern PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glProgramUniformMatrix2x3dv;
extern PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glProgramUniformMatrix3x2dv;
extern PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glProgramUniformMatrix2x4dv;
extern PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glProgramUniformMatrix4x2dv;
extern PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glProgramUniformMatrix3x4dv;
extern PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glProgramUniformMatrix4x3dv;
extern PFNGLVALIDATEPROGRAMPIPELINEPROC glValidateProgramPipeline;
extern PFNGLGETPROGRAMPIPELINEINFOLOGPROC glGetProgramPipelineInfoLog;
extern PFNGLVERTEXATTRIBL1DPROC glVertexAttribL1d;
extern PFNGLVERTEXATTRIBL2DPROC glVertexAttribL2d;
extern PFNGLVERTEXATTRIBL3DPROC glVertexAttribL3d;
extern PFNGLVERTEXATTRIBL4DPROC glVertexAttribL4d;
extern PFNGLVERTEXATTRIBL1DVPROC glVertexAttribL1dv;
extern PFNGLVERTEXATTRIBL2DVPROC glVertexAttribL2dv;
extern PFNGLVERTEXATTRIBL3DVPROC glVertexAttribL3dv;
extern PFNGLVERTEXATTRIBL4DVPROC glVertexAttribL4dv;
extern PFNGLVERTEXATTRIBLPOINTERPROC glVertexAttribLPointer;
extern PFNGLGETVERTEXATTRIBLDVPROC glGetVertexAttribLdv;
extern PFNGLVIEWPORTARRAYVPROC glViewportArrayv;
extern PFNGLVIEWPORTINDEXEDFPROC glViewportIndexedf;
extern PFNGLVIEWPORTINDEXEDFVPROC glViewportIndexedfv;
extern PFNGLSCISSORARRAYVPROC glScissorArrayv;
extern PFNGLSCISSORINDEXEDPROC glScissorIndexed;
extern PFNGLSCISSORINDEXEDVPROC glScissorIndexedv;
extern PFNGLDEPTHRANGEARRAYVPROC glDepthRangeArrayv;
extern PFNGLDEPTHRANGEINDEXEDPROC glDepthRangeIndexed;
extern PFNGLGETFLOATI_VPROC glGetFloati_v;
extern PFNGLGETDOUBLEI_VPROC glGetDoublei_v;
extern PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glDrawArraysInstancedBaseInstance;
extern PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glDrawElementsInstancedBaseInstance;
extern PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glDrawElementsInstancedBaseVertexBaseInstance;
extern PFNGLGETINTERNALFORMATIVPROC glGetInternalformativ;
extern PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glGetActiveAtomicCounterBufferiv;
extern PFNGLBINDIMAGETEXTUREPROC glBindImageTexture;
extern PFNGLMEMORYBARRIERPROC glMemoryBarrier;
extern PFNGLTEXSTORAGE1DPROC glTexStorage1D;
extern PFNGLTEXSTORAGE2DPROC glTexStorage2D;
extern PFNGLTEXSTORAGE3DPROC glTexStorage3D;
extern PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glDrawTransformFeedbackInstanced;
extern PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glDrawTransformFeedbackStreamInstanced;
extern PFNGLCLEARBUFFERDATAPROC glClearBufferData;
extern PFNGLCLEARBUFFERSUBDATAPROC glClearBufferSubData;
extern PFNGLDISPATCHCOMPUTEPROC glDispatchCompute;
extern PFNGLDISPATCHCOMPUTEINDIRECTPROC glDispatchComputeIndirect;
extern PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData;
extern PFNGLFRAMEBUFFERPARAMETERIPROC glFramebufferParameteri;
extern PFNGLGETFRAMEBUFFERPARAMETERIVPROC glGetFramebufferParameteriv;
extern PFNGLGETINTERNALFORMATI64VPROC glGetInternalformati64v;
extern PFNGLINVALIDATETEXSUBIMAGEPROC glInvalidateTexSubImage;
extern PFNGLINVALIDATETEXIMAGEPROC glInvalidateTexImage;
extern PFNGLINVALIDATEBUFFERSUBDATAPROC glInvalidateBufferSubData;
extern PFNGLINVALIDATEBUFFERDATAPROC glInvalidateBufferData;
extern PFNGLINVALIDATEFRAMEBUFFERPROC glInvalidateFramebuffer;
extern PFNGLINVALIDATESUBFRAMEBUFFERPROC glInvalidateSubFramebuffer;
extern PFNGLMULTIDRAWARRAYSINDIRECTPROC glMultiDrawArraysIndirect;
extern PFNGLMULTIDRAWELEMENTSINDIRECTPROC glMultiDrawElementsIndirect;
extern PFNGLGETPROGRAMINTERFACEIVPROC glGetProgramInterfaceiv;
extern PFNGLGETPROGRAMRESOURCEINDEXPROC glGetProgramResourceIndex;
extern PFNGLGETPROGRAMRESOURCENAMEPROC glGetProgramResourceName;
extern PFNGLGETPROGRAMRESOURCEIVPROC glGetProgramResourceiv;
extern PFNGLGETPROGRAMRESOURCELOCATIONPROC glGetProgramResourceLocation;
extern PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glGetProgramResourceLocationIndex;
extern PFNGLSHADERSTORAGEBLOCKBINDINGPROC glShaderStorageBlockBinding;
extern PFNGLTEXBUFFERRANGEPROC glTexBufferRange;
extern PFNGLTEXSTORAGE2DMULTISAMPLEPROC glTexStorage2DMultisample;
extern PFNGLTEXSTORAGE3DMULTISAMPLEPROC glTexStorage3DMultisample;
extern PFNGLTEXTUREVIEWPROC glTextureView;
extern PFNGLBINDVERTEXBUFFERPROC glBindVertexBuffer;
extern PFNGLVERTEXATTRIBFORMATPROC glVertexAttribFormat;
extern PFNGLVERTEXATTRIBIFORMATPROC glVertexAttribIFormat;
extern PFNGLVERTEXATTRIBLFORMATPROC glVertexAttribLFormat;
extern PFNGLVERTEXATTRIBBINDINGPROC glVertexAttribBinding;
extern PFNGLVERTEXBINDINGDIVISORPROC glVertexBindingDivisor;
extern PFNGLDEBUGMESSAGECONTROLPROC glDebugMessageControl;
extern PFNGLDEBUGMESSAGEINSERTPROC glDebugMessageInsert;
extern PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback;
extern PFNGLGETDEBUGMESSAGELOGPROC glGetDebugMessageLog;
extern PFNGLPUSHDEBUGGROUPPROC glPushDebugGroup;
extern PFNGLPOPDEBUGGROUPPROC glPopDebugGroup;
extern PFNGLOBJECTLABELPROC glObjectLabel;
extern PFNGLGETOBJECTLABELPROC glGetObjectLabel;
extern PFNGLOBJECTPTRLABELPROC glObjectPtrLabel;
extern PFNGLGETOBJECTPTRLABELPROC glGetObjectPtrLabel;
extern PFNGLBUFFERSTORAGEPROC glBufferStorage;
extern PFNGLCLEARTEXIMAGEPROC glClearTexImage;
extern PFNGLCLEARTEXSUBIMAGEPROC glClearTexSubImage;
extern PFNGLBINDBUFFERSBASEPROC glBindBuffersBase;
extern PFNGLBINDBUFFERSRANGEPROC glBindBuffersRange;
extern PFNGLBINDTEXTURESPROC glBindTextures;
extern PFNGLBINDSAMPLERSPROC glBindSamplers;
extern PFNGLBINDIMAGETEXTURESPROC glBindImageTextures;
extern PFNGLBINDVERTEXBUFFERSPROC glBindVertexBuffers;
extern PFNGLCLIPCONTROLPROC glClipControl;
extern PFNGLCREATETRANSFORMFEEDBACKSPROC glCreateTransformFeedbacks;
extern PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glTransformFeedbackBufferBase;
extern PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glTransformFeedbackBufferRange;
extern PFNGLGETTRANSFORMFEEDBACKIVPROC glGetTransformFeedbackiv;
extern PFNGLGETTRANSFORMFEEDBACKI_VPROC glGetTransformFeedbacki_v;
extern PFNGLGETTRANSFORMFEEDBACKI64_VPROC glGetTransformFeedbacki64_v;
extern PFNGLCREATEBUFFERSPROC glCreateBuffers;
extern PFNGLNAMEDBUFFERSTORAGEPROC glNamedBufferStorage;
extern PFNGLNAMEDBUFFERDATAPROC glNamedBufferData;
extern PFNGLNAMEDBUFFERSUBDATAPROC glNamedBufferSubData;
extern PFNGLCOPYNAMEDBUFFERSUBDATAPROC glCopyNamedBufferSubData;
extern PFNGLCLEARNAMEDBUFFERDATAPROC glClearNamedBufferData;
extern PFNGLCLEARNAMEDBUFFERSUBDATAPROC glClearNamedBufferSubData;
extern PFNGLMAPNAMEDBUFFERPROC glMapNamedBuffer;
extern PFNGLMAPNAMEDBUFFERRANGEPROC glMapNamedBufferRange;
extern PFNGLUNMAPNAMEDBUFFERPROC glUnmapNamedBuffer;
extern PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glFlushMappedNamedBufferRange;
extern PFNGLGETNAMEDBUFFERPARAMETERIVPROC glGetNamedBufferParameteriv;
extern PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glGetNamedBufferParameteri64v;
extern PFNGLGETNAMEDBUFFERPOINTERVPROC glGetNamedBufferPointerv;
extern PFNGLGETNAMEDBUFFERSUBDATAPROC glGetNamedBufferSubData;
extern PFNGLCREATEFRAMEBUFFERSPROC glCreateFramebuffers;
extern PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glNamedFramebufferRenderbuffer;
extern PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glNamedFramebufferParameteri;
extern PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glNamedFramebufferTexture;
extern PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glNamedFramebufferTextureLayer;
extern PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glNamedFramebufferDrawBuffer;
extern PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glNamedFramebufferDrawBuffers;
extern PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glNamedFramebufferReadBuffer;
extern PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glInvalidateNamedFramebufferData;
extern PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glInvalidateNamedFramebufferSubData;
extern PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glClearNamedFramebufferiv;
extern PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glClearNamedFramebufferuiv;
extern PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glClearNamedFramebufferfv;
extern PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glClearNamedFramebufferfi;
extern PFNGLBLITNAMEDFRAMEBUFFERPROC glBlitNamedFramebuffer;
extern PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glCheckNamedFramebufferStatus;
extern PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glGetNamedFramebufferParameteriv;
extern PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetNamedFramebufferAttachmentParameteriv;
extern PFNGLCREATERENDERBUFFERSPROC glCreateRenderbuffers;
extern PFNGLNAMEDRENDERBUFFERSTORAGEPROC glNamedRenderbufferStorage;
extern PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glNamedRenderbufferStorageMultisample;
extern PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glGetNamedRenderbufferParameteriv;
extern PFNGLCREATETEXTURESPROC glCreateTextures;
extern PFNGLTEXTUREBUFFERPROC glTextureBuffer;
extern PFNGLTEXTUREBUFFERRANGEPROC glTextureBufferRange;
extern PFNGLTEXTURESTORAGE1DPROC glTextureStorage1D;
extern PFNGLTEXTURESTORAGE2DPROC glTextureStorage2D;
extern PFNGLTEXTURESTORAGE3DPROC glTextureStorage3D;
extern PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glTextureStorage2DMultisample;
extern PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glTextureStorage3DMultisample;
extern PFNGLTEXTURESUBIMAGE1DPROC glTextureSubImage1D;
extern PFNGLTEXTURESUBIMAGE2DPROC glTextureSubImage2D;
extern PFNGLTEXTURESUBIMAGE3DPROC glTextureSubImage3D;
extern PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glCompressedTextureSubImage1D;
extern PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glCompressedTextureSubImage2D;
extern PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glCompressedTextureSubImage3D;
extern PFNGLCOPYTEXTURESUBIMAGE1DPROC glCopyTextureSubImage1D;
extern PFNGLCOPYTEXTURESUBIMAGE2DPROC glCopyTextureSubImage2D;
extern PFNGLCOPYTEXTURESUBIMAGE3DPROC glCopyTextureSubImage3D;
extern PFNGLTEXTUREPARAMETERFPROC glTextureParameterf;
extern PFNGLTEXTUREPARAMETERFVPROC glTextureParameterfv;
extern PFNGLTEXTUREPARAMETERIPROC glTextureParameteri;
extern PFNGLTEXTUREPARAMETERIIVPROC glTextureParameterIiv;
extern PFNGLTEXTUREPARAMETERIUIVPROC glTextureParameterIuiv;
extern PFNGLTEXTUREPARAMETERIVPROC glTextureParameteriv;
extern PFNGLGENERATETEXTUREMIPMAPPROC glGenerateTextureMipmap;
extern PFNGLBINDTEXTUREUNITPROC glBindTextureUnit;
extern PFNGLGETTEXTUREIMAGEPROC glGetTextureImage;
extern PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glGetCompressedTextureImage;
extern PFNGLGETTEXTURELEVELPARAMETERFVPROC glGetTextureLevelParameterfv;
extern PFNGLGETTEXTURELEVELPARAMETERIVPROC glGetTextureLevelParameteriv;
extern PFNGLGETTEXTUREPARAMETERFVPROC glGetTextureParameterfv;
extern PFNGLGETTEXTUREPARAMETERIIVPROC glGetTextureParameterIiv;
extern PFNGLGETTEXTUREPARAMETERIUIVPROC glGetTextureParameterIuiv;
extern PFNGLGETTEXTUREPARAMETERIVPROC glGetTextureParameteriv;
extern PFNGLCREATEVERTEXARRAYSPROC glCreateVertexArrays;
extern PFNGLDISABLEVERTEXARRAYATTRIBPROC glDisableVertexArrayAttrib;
extern PFNGLENABLEVERTEXARRAYATTRIBPROC glEnableVertexArrayAttrib;
extern PFNGLVERTEXARRAYELEMENTBUFFERPROC glVertexArrayElementBuffer;
extern PFNGLVERTEXARRAYVERTEXBUFFERPROC glVertexArrayVertexBuffer;
extern PFNGLVERTEXARRAYVERTEXBUFFERSPROC glVertexArrayVertexBuffers;
extern PFNGLVERTEXARRAYATTRIBBINDINGPROC glVertexArrayAttribBinding;
extern PFNGLVERTEXARRAYATTRIBFORMATPROC glVertexArrayAttribFormat;
extern PFNGLVERTEXARRAYATTRIBIFORMATPROC glVertexArrayAttribIFormat;
extern PFNGLVERTEXARRAYATTRIBLFORMATPROC glVertexArrayAttribLFormat;
extern PFNGLVERTEXARRAYBINDINGDIVISORPROC glVertexArrayBindingDivisor;
extern PFNGLGETVERTEXARRAYIVPROC glGetVertexArrayiv;
extern PFNGLGETVERTEXARRAYINDEXEDIVPROC glGetVertexArrayIndexediv;
extern PFNGLGETVERTEXARRAYINDEXED64IVPROC glGetVertexArrayIndexed64iv;
extern PFNGLCREATESAMPLERSPROC glCreateSamplers;
extern PFNGLCREATEPROGRAMPIPELINESPROC glCreateProgramPipelines;
extern PFNGLCREATEQUERIESPROC glCreateQueries;
extern PFNGLGETQUERYBUFFEROBJECTI64VPROC glGetQueryBufferObjecti64v;
extern PFNGLGETQUERYBUFFEROBJECTIVPROC glGetQueryBufferObjectiv;
extern PFNGLGETQUERYBUFFEROBJECTUI64VPROC glGetQueryBufferObjectui64v;
extern PFNGLGETQUERYBUFFEROBJECTUIVPROC glGetQueryBufferObjectuiv;
extern PFNGLMEMORYBARRIERBYREGIONPROC glMemoryBarrierByRegion;
extern PFNGLGETTEXTURESUBIMAGEPROC glGetTextureSubImage;
extern PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glGetCompressedTextureSubImage;
extern PFNGLGETGRAPHICSRESETSTATUSPROC glGetGraphicsResetStatus;
extern PFNGLGETNCOMPRESSEDTEXIMAGEPROC glGetnCompressedTexImage;
extern PFNGLGETNTEXIMAGEPROC glGetnTexImage;
extern PFNGLGETNUNIFORMDVPROC glGetnUniformdv;
extern PFNGLGETNUNIFORMFVPROC glGetnUniformfv;
extern PFNGLGETNUNIFORMIVPROC glGetnUniformiv;
extern PFNGLGETNUNIFORMUIVPROC glGetnUniformuiv;
extern PFNGLREADNPIXELSPROC glReadnPixels;
extern PFNGLTEXTUREBARRIERPROC glTextureBarrier;
}
#endif // CG_OPENGL_OPENGL_DEF_H_
|
ref2401/cg
|
src/cg/rnd/opengl/opengl_def.h
|
C
|
mit
| 37,453
|
require 'spec_helper'
require 'comment_extractor/extractor/clojure'
class CommentExtractor::Extractor
describe Clojure do
it_behaves_like 'extracting comments from', 'clojure.clj'
it_behaves_like 'detecting filename', 'file.clj'
end
end
|
alpaca-tc/comment_extractor
|
spec/comment_extractor/extractor/clojure_spec.rb
|
Ruby
|
mit
| 250
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>tortoise-hare-algorithm: Error with dependencies</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">dev / tortoise-hare-algorithm - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
tortoise-hare-algorithm
<small>
8.6.0
<span class="label label-warning">Error with dependencies</span>
</small>
</h1>
<p><em><script>document.write(moment("2021-11-06 06:49:18 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-06 06:49:18 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 3 Virtual package relying on a GMP lib system installation
coq dev Formal proof management system
dune 2.9.1 Fast, portable, and opinionated build system
ocaml 4.13.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.13.1 Official release 4.13.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.1 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/tortoise-hare-algorithm"
license: "Unknown"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/TortoiseHareAlgorithm"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [
"keyword: program verification"
"keyword: paths"
"keyword: cycle detection"
"keyword: graphs"
"keyword: graph theory"
"keyword: finite sets"
"keyword: Floyd"
"category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms"
"date: 2007-02"
]
authors: [ "Jean-Christophe Filliâtre" ]
bug-reports: "https://github.com/coq-contribs/tortoise-hare-algorithm/issues"
dev-repo: "git+https://github.com/coq-contribs/tortoise-hare-algorithm.git"
synopsis: "Tortoise and the hare algorithm"
description: """
Correctness proof of Floyd's cycle-finding algorithm, also known as
the "tortoise and the hare"-algorithm.
See http://en.wikipedia.org/wiki/Floyd's_cycle-finding_algorithm"""
flags: light-uninstall
url {
src:
"https://github.com/coq-contribs/tortoise-hare-algorithm/archive/v8.6.0.tar.gz"
checksum: "md5=be6227480086d7ee6297ff9d817ff394"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-tortoise-hare-algorithm.8.6.0 coq.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
[ERROR] Package conflict!
Sorry, no solution found: there seems to be a problem with your request.
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-tortoise-hare-algorithm.8.6.0</code></dd>
<dt>Return code</dt>
<dd>512</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- remove coq dev
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
While removing coq.dev: these files have been modified since installation:
- share/texmf/tex/latex/misc/coqdoc.sty
- man/man1/coqwc.1
- man/man1/coqtop.opt.1
- man/man1/coqtop.byte.1
- man/man1/coqtop.1
- man/man1/coqnative.1
- man/man1/coqdoc.1
- man/man1/coqdep.1
- man/man1/coqchk.1
- man/man1/coqc.1
- man/man1/coq_makefile.1
- man/man1/coq-tex.1
- lib/stublibs/dllcoqrun_stubs.so
- lib/coqide-server/protocol/xmlprotocol.mli
- lib/coqide-server/protocol/xmlprotocol.ml
- lib/coqide-server/protocol/xmlprotocol.cmx
- lib/coqide-server/protocol/xmlprotocol.cmti
- lib/coqide-server/protocol/xmlprotocol.cmt
- lib/coqide-server/protocol/xmlprotocol.cmi
- lib/coqide-server/protocol/xml_printer.mli
- lib/coqide-server/protocol/xml_printer.ml
- lib/coqide-server/protocol/xml_printer.cmx
- lib/coqide-server/protocol/xml_printer.cmti
- lib/coqide-server/protocol/xml_printer.cmt
- lib/coqide-server/protocol/xml_printer.cmi
- lib/coqide-server/protocol/xml_parser.mli
- lib/coqide-server/protocol/xml_parser.ml
- lib/coqide-server/protocol/xml_parser.cmx
- lib/coqide-server/protocol/xml_parser.cmti
- lib/coqide-server/protocol/xml_parser.cmt
- lib/coqide-server/protocol/xml_parser.cmi
- lib/coqide-server/protocol/xml_lexer.mli
- lib/coqide-server/protocol/xml_lexer.ml
- lib/coqide-server/protocol/xml_lexer.cmx
- lib/coqide-server/protocol/xml_lexer.cmti
- lib/coqide-server/protocol/xml_lexer.cmt
- lib/coqide-server/protocol/xml_lexer.cmi
- lib/coqide-server/protocol/serialize.mli
- lib/coqide-server/protocol/serialize.ml
- lib/coqide-server/protocol/serialize.cmx
- lib/coqide-server/protocol/serialize.cmti
- lib/coqide-server/protocol/serialize.cmt
- lib/coqide-server/protocol/serialize.cmi
- lib/coqide-server/protocol/richpp.mli
- lib/coqide-server/protocol/richpp.ml
- lib/coqide-server/protocol/richpp.cmx
- lib/coqide-server/protocol/richpp.cmti
- lib/coqide-server/protocol/richpp.cmt
- lib/coqide-server/protocol/richpp.cmi
- lib/coqide-server/protocol/protocol.cmxs
- lib/coqide-server/protocol/protocol.cmxa
- lib/coqide-server/protocol/protocol.cma
- lib/coqide-server/protocol/protocol.a
- lib/coqide-server/protocol/interface.ml
- lib/coqide-server/protocol/interface.cmx
- lib/coqide-server/protocol/interface.cmt
- lib/coqide-server/protocol/interface.cmi
- lib/coqide-server/opam
- lib/coqide-server/dune-package
- lib/coqide-server/core/document.mli
- lib/coqide-server/core/document.ml
- lib/coqide-server/core/document.cmx
- lib/coqide-server/core/document.cmti
- lib/coqide-server/core/document.cmt
- lib/coqide-server/core/document.cmi
- lib/coqide-server/core/core.cmxs
- lib/coqide-server/core/core.cmxa
- lib/coqide-server/core/core.cma
- lib/coqide-server/core/core.a
- lib/coqide-server/META
- lib/coq/user-contrib/Ltac2/String.vos
- lib/coq/user-contrib/Ltac2/String.vo
- lib/coq/user-contrib/Ltac2/String.v
- lib/coq/user-contrib/Ltac2/String.glob
- lib/coq/user-contrib/Ltac2/Std.vos
- lib/coq/user-contrib/Ltac2/Std.vo
- lib/coq/user-contrib/Ltac2/Std.v
- lib/coq/user-contrib/Ltac2/Std.glob
- lib/coq/user-contrib/Ltac2/Printf.vos
- lib/coq/user-contrib/Ltac2/Printf.vo
- lib/coq/user-contrib/Ltac2/Printf.v
- lib/coq/user-contrib/Ltac2/Printf.glob
- lib/coq/user-contrib/Ltac2/Pattern.vos
- lib/coq/user-contrib/Ltac2/Pattern.vo
- lib/coq/user-contrib/Ltac2/Pattern.v
- lib/coq/user-contrib/Ltac2/Pattern.glob
- lib/coq/user-contrib/Ltac2/Option.vos
- lib/coq/user-contrib/Ltac2/Option.vo
- lib/coq/user-contrib/Ltac2/Option.v
- lib/coq/user-contrib/Ltac2/Option.glob
- lib/coq/user-contrib/Ltac2/Notations.vos
- lib/coq/user-contrib/Ltac2/Notations.vo
- lib/coq/user-contrib/Ltac2/Notations.v
- lib/coq/user-contrib/Ltac2/Notations.glob
- lib/coq/user-contrib/Ltac2/Message.vos
- lib/coq/user-contrib/Ltac2/Message.vo
- lib/coq/user-contrib/Ltac2/Message.v
- lib/coq/user-contrib/Ltac2/Message.glob
- lib/coq/user-contrib/Ltac2/Ltac2.vos
- lib/coq/user-contrib/Ltac2/Ltac2.vo
- lib/coq/user-contrib/Ltac2/Ltac2.v
- lib/coq/user-contrib/Ltac2/Ltac2.glob
- lib/coq/user-contrib/Ltac2/Ltac1.vos
- lib/coq/user-contrib/Ltac2/Ltac1.vo
- lib/coq/user-contrib/Ltac2/Ltac1.v
- lib/coq/user-contrib/Ltac2/Ltac1.glob
- lib/coq/user-contrib/Ltac2/List.vos
- lib/coq/user-contrib/Ltac2/List.vo
- lib/coq/user-contrib/Ltac2/List.v
- lib/coq/user-contrib/Ltac2/List.glob
- lib/coq/user-contrib/Ltac2/Int.vos
- lib/coq/user-contrib/Ltac2/Int.vo
- lib/coq/user-contrib/Ltac2/Int.v
- lib/coq/user-contrib/Ltac2/Int.glob
- lib/coq/user-contrib/Ltac2/Init.vos
- lib/coq/user-contrib/Ltac2/Init.vo
- lib/coq/user-contrib/Ltac2/Init.v
- lib/coq/user-contrib/Ltac2/Init.glob
- lib/coq/user-contrib/Ltac2/Ind.vos
- lib/coq/user-contrib/Ltac2/Ind.vo
- lib/coq/user-contrib/Ltac2/Ind.v
- lib/coq/user-contrib/Ltac2/Ind.glob
- lib/coq/user-contrib/Ltac2/Ident.vos
- lib/coq/user-contrib/Ltac2/Ident.vo
- lib/coq/user-contrib/Ltac2/Ident.v
- lib/coq/user-contrib/Ltac2/Ident.glob
- lib/coq/user-contrib/Ltac2/Fresh.vos
- lib/coq/user-contrib/Ltac2/Fresh.vo
- lib/coq/user-contrib/Ltac2/Fresh.v
- lib/coq/user-contrib/Ltac2/Fresh.glob
- lib/coq/user-contrib/Ltac2/Env.vos
- lib/coq/user-contrib/Ltac2/Env.vo
- lib/coq/user-contrib/Ltac2/Env.v
- lib/coq/user-contrib/Ltac2/Env.glob
- lib/coq/user-contrib/Ltac2/Control.vos
- lib/coq/user-contrib/Ltac2/Control.vo
- lib/coq/user-contrib/Ltac2/Control.v
- lib/coq/user-contrib/Ltac2/Control.glob
- lib/coq/user-contrib/Ltac2/Constr.vos
- lib/coq/user-contrib/Ltac2/Constr.vo
- lib/coq/user-contrib/Ltac2/Constr.v
- lib/coq/user-contrib/Ltac2/Constr.glob
- lib/coq/user-contrib/Ltac2/Char.vos
- lib/coq/user-contrib/Ltac2/Char.vo
- lib/coq/user-contrib/Ltac2/Char.v
- lib/coq/user-contrib/Ltac2/Char.glob
- lib/coq/user-contrib/Ltac2/Bool.vos
- lib/coq/user-contrib/Ltac2/Bool.vo
- lib/coq/user-contrib/Ltac2/Bool.v
- lib/coq/user-contrib/Ltac2/Bool.glob
- lib/coq/user-contrib/Ltac2/Array.vos
- lib/coq/user-contrib/Ltac2/Array.vo
- lib/coq/user-contrib/Ltac2/Array.v
- lib/coq/user-contrib/Ltac2/Array.glob
- lib/coq/theories/ssrsearch/ssrsearch.vos
- lib/coq/theories/ssrsearch/ssrsearch.vo
- lib/coq/theories/ssrsearch/ssrsearch.v
- lib/coq/theories/ssrsearch/ssrsearch.glob
- lib/coq/theories/ssrmatching/ssrmatching.vos
- lib/coq/theories/ssrmatching/ssrmatching.vo
- lib/coq/theories/ssrmatching/ssrmatching.v
- lib/coq/theories/ssrmatching/ssrmatching.glob
- lib/coq/theories/ssr/ssrunder.vos
- lib/coq/theories/ssr/ssrunder.vo
- lib/coq/theories/ssr/ssrunder.v
- lib/coq/theories/ssr/ssrunder.glob
- lib/coq/theories/ssr/ssrsetoid.vos
- lib/coq/theories/ssr/ssrsetoid.vo
- lib/coq/theories/ssr/ssrsetoid.v
- lib/coq/theories/ssr/ssrsetoid.glob
- lib/coq/theories/ssr/ssrfun.vos
- lib/coq/theories/ssr/ssrfun.vo
- lib/coq/theories/ssr/ssrfun.v
- lib/coq/theories/ssr/ssrfun.glob
- lib/coq/theories/ssr/ssreflect.vos
- lib/coq/theories/ssr/ssreflect.vo
- lib/coq/theories/ssr/ssreflect.v
- lib/coq/theories/ssr/ssreflect.glob
- lib/coq/theories/ssr/ssrclasses.vos
- lib/coq/theories/ssr/ssrclasses.vo
- lib/coq/theories/ssr/ssrclasses.v
- lib/coq/theories/ssr/ssrclasses.glob
- lib/coq/theories/ssr/ssrbool.vos
- lib/coq/theories/ssr/ssrbool.vo
- lib/coq/theories/ssr/ssrbool.v
- lib/coq/theories/ssr/ssrbool.glob
- lib/coq/theories/setoid_ring/ZArithRing.vos
- lib/coq/theories/setoid_ring/ZArithRing.vo
- lib/coq/theories/setoid_ring/ZArithRing.v
- lib/coq/theories/setoid_ring/ZArithRing.glob
- lib/coq/theories/setoid_ring/Rings_Z.vos
- lib/coq/theories/setoid_ring/Rings_Z.vo
- lib/coq/theories/setoid_ring/Rings_Z.v
- lib/coq/theories/setoid_ring/Rings_Z.glob
- lib/coq/theories/setoid_ring/Rings_R.vos
- lib/coq/theories/setoid_ring/Rings_R.vo
- lib/coq/theories/setoid_ring/Rings_R.v
- lib/coq/theories/setoid_ring/Rings_R.glob
- lib/coq/theories/setoid_ring/Rings_Q.vos
- lib/coq/theories/setoid_ring/Rings_Q.vo
- lib/coq/theories/setoid_ring/Rings_Q.v
- lib/coq/theories/setoid_ring/Rings_Q.glob
- lib/coq/theories/setoid_ring/Ring_theory.vos
- lib/coq/theories/setoid_ring/Ring_theory.vo
- lib/coq/theories/setoid_ring/Ring_theory.v
- lib/coq/theories/setoid_ring/Ring_theory.glob
- lib/coq/theories/setoid_ring/Ring_tac.vos
- lib/coq/theories/setoid_ring/Ring_tac.vo
- lib/coq/theories/setoid_ring/Ring_tac.v
- lib/coq/theories/setoid_ring/Ring_tac.glob
- lib/coq/theories/setoid_ring/Ring_polynom.vos
- lib/coq/theories/setoid_ring/Ring_polynom.vo
- lib/coq/theories/setoid_ring/Ring_polynom.v
- lib/coq/theories/setoid_ring/Ring_polynom.glob
- lib/coq/theories/setoid_ring/Ring_base.vos
- lib/coq/theories/setoid_ring/Ring_base.vo
- lib/coq/theories/setoid_ring/Ring_base.v
- lib/coq/theories/setoid_ring/Ring_base.glob
- lib/coq/theories/setoid_ring/Ring.vos
- lib/coq/theories/setoid_ring/Ring.vo
- lib/coq/theories/setoid_ring/Ring.v
- lib/coq/theories/setoid_ring/Ring.glob
- lib/coq/theories/setoid_ring/RealField.vos
- lib/coq/theories/setoid_ring/RealField.vo
- lib/coq/theories/setoid_ring/RealField.v
- lib/coq/theories/setoid_ring/RealField.glob
- lib/coq/theories/setoid_ring/Ncring_tac.vos
- lib/coq/theories/setoid_ring/Ncring_tac.vo
- lib/coq/theories/setoid_ring/Ncring_tac.v
- lib/coq/theories/setoid_ring/Ncring_tac.glob
- lib/coq/theories/setoid_ring/Ncring_polynom.vos
- lib/coq/theories/setoid_ring/Ncring_polynom.vo
- lib/coq/theories/setoid_ring/Ncring_polynom.v
- lib/coq/theories/setoid_ring/Ncring_polynom.glob
- lib/coq/theories/setoid_ring/Ncring_initial.vos
- lib/coq/theor
[...] truncated
predicate.cmt
- lib/coq-core/clib/predicate.cmi
- lib/coq-core/clib/orderedType.mli
- lib/coq-core/clib/orderedType.ml
- lib/coq-core/clib/orderedType.cmx
- lib/coq-core/clib/orderedType.cmti
- lib/coq-core/clib/orderedType.cmt
- lib/coq-core/clib/orderedType.cmi
- lib/coq-core/clib/option.mli
- lib/coq-core/clib/option.ml
- lib/coq-core/clib/option.cmx
- lib/coq-core/clib/option.cmti
- lib/coq-core/clib/option.cmt
- lib/coq-core/clib/option.cmi
- lib/coq-core/clib/neList.mli
- lib/coq-core/clib/neList.ml
- lib/coq-core/clib/neList.cmx
- lib/coq-core/clib/neList.cmti
- lib/coq-core/clib/neList.cmt
- lib/coq-core/clib/neList.cmi
- lib/coq-core/clib/monad.mli
- lib/coq-core/clib/monad.ml
- lib/coq-core/clib/monad.cmx
- lib/coq-core/clib/monad.cmti
- lib/coq-core/clib/monad.cmt
- lib/coq-core/clib/monad.cmi
- lib/coq-core/clib/minisys.ml
- lib/coq-core/clib/minisys.cmx
- lib/coq-core/clib/minisys.cmt
- lib/coq-core/clib/minisys.cmi
- lib/coq-core/clib/int.mli
- lib/coq-core/clib/int.ml
- lib/coq-core/clib/int.cmx
- lib/coq-core/clib/int.cmti
- lib/coq-core/clib/int.cmt
- lib/coq-core/clib/int.cmi
- lib/coq-core/clib/iStream.mli
- lib/coq-core/clib/iStream.ml
- lib/coq-core/clib/iStream.cmx
- lib/coq-core/clib/iStream.cmti
- lib/coq-core/clib/iStream.cmt
- lib/coq-core/clib/iStream.cmi
- lib/coq-core/clib/heap.mli
- lib/coq-core/clib/heap.ml
- lib/coq-core/clib/heap.cmx
- lib/coq-core/clib/heap.cmti
- lib/coq-core/clib/heap.cmt
- lib/coq-core/clib/heap.cmi
- lib/coq-core/clib/hashset.mli
- lib/coq-core/clib/hashset.ml
- lib/coq-core/clib/hashset.cmx
- lib/coq-core/clib/hashset.cmti
- lib/coq-core/clib/hashset.cmt
- lib/coq-core/clib/hashset.cmi
- lib/coq-core/clib/hashcons.mli
- lib/coq-core/clib/hashcons.ml
- lib/coq-core/clib/hashcons.cmx
- lib/coq-core/clib/hashcons.cmti
- lib/coq-core/clib/hashcons.cmt
- lib/coq-core/clib/hashcons.cmi
- lib/coq-core/clib/hMap.mli
- lib/coq-core/clib/hMap.ml
- lib/coq-core/clib/hMap.cmx
- lib/coq-core/clib/hMap.cmti
- lib/coq-core/clib/hMap.cmt
- lib/coq-core/clib/hMap.cmi
- lib/coq-core/clib/exninfo.mli
- lib/coq-core/clib/exninfo.ml
- lib/coq-core/clib/exninfo.cmx
- lib/coq-core/clib/exninfo.cmti
- lib/coq-core/clib/exninfo.cmt
- lib/coq-core/clib/exninfo.cmi
- lib/coq-core/clib/dyn.mli
- lib/coq-core/clib/dyn.ml
- lib/coq-core/clib/dyn.cmx
- lib/coq-core/clib/dyn.cmti
- lib/coq-core/clib/dyn.cmt
- lib/coq-core/clib/dyn.cmi
- lib/coq-core/clib/diff2.mli
- lib/coq-core/clib/diff2.ml
- lib/coq-core/clib/diff2.cmx
- lib/coq-core/clib/diff2.cmti
- lib/coq-core/clib/diff2.cmt
- lib/coq-core/clib/diff2.cmi
- lib/coq-core/clib/clib.cmxs
- lib/coq-core/clib/clib.cmxa
- lib/coq-core/clib/clib.cma
- lib/coq-core/clib/clib.a
- lib/coq-core/clib/cUnix.mli
- lib/coq-core/clib/cUnix.ml
- lib/coq-core/clib/cUnix.cmx
- lib/coq-core/clib/cUnix.cmti
- lib/coq-core/clib/cUnix.cmt
- lib/coq-core/clib/cUnix.cmi
- lib/coq-core/clib/cThread.mli
- lib/coq-core/clib/cThread.ml
- lib/coq-core/clib/cThread.cmx
- lib/coq-core/clib/cThread.cmti
- lib/coq-core/clib/cThread.cmt
- lib/coq-core/clib/cThread.cmi
- lib/coq-core/clib/cString.mli
- lib/coq-core/clib/cString.ml
- lib/coq-core/clib/cString.cmx
- lib/coq-core/clib/cString.cmti
- lib/coq-core/clib/cString.cmt
- lib/coq-core/clib/cString.cmi
- lib/coq-core/clib/cSig.mli
- lib/coq-core/clib/cSig.cmti
- lib/coq-core/clib/cSig.cmi
- lib/coq-core/clib/cSet.mli
- lib/coq-core/clib/cSet.ml
- lib/coq-core/clib/cSet.cmx
- lib/coq-core/clib/cSet.cmti
- lib/coq-core/clib/cSet.cmt
- lib/coq-core/clib/cSet.cmi
- lib/coq-core/clib/cObj.mli
- lib/coq-core/clib/cObj.ml
- lib/coq-core/clib/cObj.cmx
- lib/coq-core/clib/cObj.cmti
- lib/coq-core/clib/cObj.cmt
- lib/coq-core/clib/cObj.cmi
- lib/coq-core/clib/cMap.mli
- lib/coq-core/clib/cMap.ml
- lib/coq-core/clib/cMap.cmx
- lib/coq-core/clib/cMap.cmti
- lib/coq-core/clib/cMap.cmt
- lib/coq-core/clib/cMap.cmi
- lib/coq-core/clib/cList.mli
- lib/coq-core/clib/cList.ml
- lib/coq-core/clib/cList.cmx
- lib/coq-core/clib/cList.cmti
- lib/coq-core/clib/cList.cmt
- lib/coq-core/clib/cList.cmi
- lib/coq-core/clib/cEphemeron.mli
- lib/coq-core/clib/cEphemeron.ml
- lib/coq-core/clib/cEphemeron.cmx
- lib/coq-core/clib/cEphemeron.cmti
- lib/coq-core/clib/cEphemeron.cmt
- lib/coq-core/clib/cEphemeron.cmi
- lib/coq-core/clib/cArray.mli
- lib/coq-core/clib/cArray.ml
- lib/coq-core/clib/cArray.cmx
- lib/coq-core/clib/cArray.cmti
- lib/coq-core/clib/cArray.cmt
- lib/coq-core/clib/cArray.cmi
- lib/coq-core/boot/util.ml
- lib/coq-core/boot/path.ml
- lib/coq-core/boot/env.mli
- lib/coq-core/boot/env.ml
- lib/coq-core/boot/boot__Util.cmx
- lib/coq-core/boot/boot__Util.cmt
- lib/coq-core/boot/boot__Util.cmi
- lib/coq-core/boot/boot__Path.cmx
- lib/coq-core/boot/boot__Path.cmt
- lib/coq-core/boot/boot__Path.cmi
- lib/coq-core/boot/boot__Env.cmx
- lib/coq-core/boot/boot__Env.cmti
- lib/coq-core/boot/boot__Env.cmt
- lib/coq-core/boot/boot__Env.cmi
- lib/coq-core/boot/boot.ml
- lib/coq-core/boot/boot.cmxs
- lib/coq-core/boot/boot.cmxa
- lib/coq-core/boot/boot.cmx
- lib/coq-core/boot/boot.cmt
- lib/coq-core/boot/boot.cmi
- lib/coq-core/boot/boot.cma
- lib/coq-core/boot/boot.a
- lib/coq-core/META
- doc/coqide-server/README.md
- doc/coqide-server/LICENSE
- doc/coq-core/README.md
- doc/coq-core/LICENSE
- bin/votour
- bin/ocamllibdep
- bin/csdpcert
- bin/coqworkmgr
- bin/coqwc
- bin/coqtop.opt
- bin/coqtop.byte
- bin/coqtop
- bin/coqtacticworker.opt
- bin/coqqueryworker.opt
- bin/coqproofworker.opt
- bin/coqpp
- bin/coqnative
- bin/coqidetop.opt
- bin/coqidetop.byte
- bin/coqdoc
- bin/coqdep
- bin/coqchk
- bin/coqc.byte
- bin/coqc
- bin/coq_makefile
- bin/coq-tex
Remove them anyway? [y/N] y
[NOTE] While removing coq.dev: not removing non-empty directories:
- share/texmf/tex/latex/misc
- lib/coqide-server/protocol
- lib/coqide-server/core
- lib/coq/user-contrib/Ltac2
- lib/coq/theories/ssrsearch
- lib/coq/theories/ssrmatching
- lib/coq/theories/setoid_ring
- lib/coq/theories/rtauto
- lib/coq/theories/omega
- lib/coq/theories/nsatz
- lib/coq/theories/micromega
- lib/coq/theories/funind
- lib/coq/theories/extraction
- lib/coq/theories/derive
- lib/coq/theories/btauto
- lib/coq/theories/ZArith
- lib/coq/theories/Wellfounded
- lib/coq/theories/Vectors
- lib/coq/theories/Unicode
- lib/coq/theories/Structures
- lib/coq/theories/Strings
- lib/coq/theories/Sorting
- lib/coq/theories/Sets
- lib/coq/theories/Setoids
- lib/coq/theories/Relations
- lib/coq/theories/Reals/Cauchy
- lib/coq/theories/Reals/Abstract
- lib/coq/theories/QArith
- lib/coq/theories/Program
- lib/coq/theories/PArith
- lib/coq/theories/Numbers/Natural/Peano
- lib/coq/theories/Numbers/Natural/Binary
- lib/coq/theories/Numbers/Natural/Abstract
- lib/coq/theories/Numbers/NatInt
- lib/coq/theories/Numbers/Integer/NatPairs
- lib/coq/theories/Numbers/Integer/Binary
- lib/coq/theories/Numbers/Integer/Abstract
- lib/coq/theories/Numbers/Cyclic/ZModulo
- lib/coq/theories/Numbers/Cyclic/Int63
- lib/coq/theories/Numbers/Cyclic/Int31
- lib/coq/theories/Numbers/Cyclic/Abstract
- lib/coq/theories/NArith
- lib/coq/theories/MSets
- lib/coq/theories/Logic
- lib/coq/theories/Lists
- lib/coq/theories/Init
- lib/coq/theories/Floats
- lib/coq/theories/FSets
- lib/coq/theories/Compat
- lib/coq/theories/Classes
- lib/coq/theories/Bool
- lib/coq/theories/Array
- lib/coq/theories/Arith
- lib/coq-core/vm
- lib/coq-core/vernac
- lib/coq-core/toplevel
- lib/coq-core/top_printers
- lib/coq-core/tools/coqdoc
- lib/coq-core/tactics
- lib/coq-core/sysinit
- lib/coq-core/stm
- lib/coq-core/proofs
- lib/coq-core/printing
- lib/coq-core/pretyping
- lib/coq-core/plugins/zify
- lib/coq-core/plugins/tutorial/p3
- lib/coq-core/plugins/tutorial/p2
- lib/coq-core/plugins/tutorial/p1
- lib/coq-core/plugins/tutorial/p0
- lib/coq-core/plugins/tauto
- lib/coq-core/plugins/ssrsearch
- lib/coq-core/plugins/ssrmatching
- lib/coq-core/plugins/ssreflect
- lib/coq-core/plugins/rtauto
- lib/coq-core/plugins/ring
- lib/coq-core/plugins/number_string_notation
- lib/coq-core/plugins/nsatz
- lib/coq-core/plugins/micromega
- lib/coq-core/plugins/ltac2
- lib/coq-core/plugins/funind
- lib/coq-core/plugins/firstorder
- lib/coq-core/plugins/extraction
- lib/coq-core/plugins/derive
- lib/coq-core/plugins/cc
- lib/coq-core/plugins/btauto
- lib/coq-core/parsing
- lib/coq-core/library
- lib/coq-core/kernel
- lib/coq-core/interp
- lib/coq-core/gramlib
- lib/coq-core/engine
- lib/coq-core/config
- lib/coq-core/clib
- lib/coq-core/boot
- doc/coqide-server
- doc/coq-core
-> removed coq.dev
Done.
# Run eval $(opam env) to update the current shell environment
opam: --unlock-base was removed in version 2.1 of the opam CLI, but version 2.1 has been requested. Use --update-invariant instead or set OPAMCLI environment variable to 2.0.
The middle of the output is truncated (maximum 20000 characters)
</pre></dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.13.1-2.1.0/extra-dev/dev/tortoise-hare-algorithm/8.6.0.html
|
HTML
|
mit
| 27,740
|
sealed trait Term
case class TmTrue(info: String) extends Term
case class TmFalse(info: String) extends Term
case class TmIf(info: String, term1: Term, term2: Term, term3: Term) extends Term
case class TmZero(info: String) extends Term
case class TmSucc(info: String, term: Term) extends Term
case class TmPred(info: String, term: Term) extends Term
case class TmIsZero(info: String, term: Term) extends Term
def isnumericval(t: Term): Boolean = t match {
case TmZero(_) => true
case TmSucc(_, t1) => isnumericval(t1)
case _ => false
}
def isval(t: Term): Boolean = t match {
case TmTrue(_) => true
case TmFalse(_) => true
case _ if(isnumericval(t)) => true
case _ => false
}
class NoRuleApplies extends Exception
val dummyinfo = "dummyinfo"
def eval1(t: Term): Term = t match {
case TmIf(_, TmTrue(_), t2, t3) => t2
case TmIf(_, TmFalse(_), t2, t3) => t3
case TmIf(fi, t1, t2, t3) => TmIf(fi, eval1(t1), t2, t3)
case TmSucc(fi, t1) => TmSucc(fi, eval1(t1))
case TmPred(_, TmZero(_)) => TmZero(dummyinfo)
case TmPred(_, TmSucc(_, nv1)) if (isnumericval(nv1)) => nv1
case TmPred(fi, t1) => TmPred(fi, eval1(t1))
case TmIsZero(_, TmZero(_)) => TmTrue(dummyinfo)
case TmIsZero(_, TmSucc(_, nv1)) if (isnumericval(nv1)) => TmFalse(dummyinfo)
case TmIsZero(fi, t1) => TmIsZero(fi, eval1(t1))
case _ => throw new NoRuleApplies()
}
def eval(t: Term): Term = try {
eval(eval1(t))
} catch {
case e: NoRuleApplies => t
}
//---- example ----
def evalAndPrintln(t: Term) {
println(s"eval ${t} =")
println(eval(t))
println()
}
evalAndPrintln(TmTrue("a"))
evalAndPrintln(TmSucc("a", TmPred("b", TmSucc("c", TmZero("d")))))
evalAndPrintln(TmIf("a", TmIsZero("b", TmPred("c", TmSucc("d", TmZero("e")))), TmZero("f"), TmSucc("g", TmZero("h"))))
|
backpaper0/sandbox
|
tapl/arith.scala
|
Scala
|
mit
| 1,791
|
var getDefaultViewController = function () {
var defaultView = getSetting('defaultView', 'top');
defaultView = defaultView.charAt(0).toUpperCase() + defaultView.slice(1);
return eval("Posts"+defaultView+"Controller");
};
// Controller for all posts lists
PostsListController = FastRender.RouteController.extend({
template: getTemplate('posts_list'),
subscriptions: function () {
// take the first segment of the path to get the view, unless it's '/' in which case the view default to 'top'
// note: most of the time this.params.slug will be empty
this._terms = {
view: this.view,
limit: this.params.limit || getSetting('postsPerPage', 10),
category: this.params.slug
};
if(Meteor.isClient) {
this._terms.query = Session.get('searchQuery');
}
this.postsListSub = coreSubscriptions.subscribe('postsList', this._terms);
this.postsListUsersSub = coreSubscriptions.subscribe('postsListUsers', this._terms);
},
data: function () {
this._terms = {
view: this.view,
limit: this.params.limit || getSetting('postsPerPage', 10),
category: this.params.slug
};
if(Meteor.isClient) {
this._terms.query = Session.get('searchQuery');
}
var parameters = getPostsParameters(this._terms),
postCount = Posts.find(parameters.find, parameters.options).count();
parameters.find.createdAt = { $lte: Session.get('listPopulatedAt') };
var posts = Posts.find(parameters.find, parameters.options);
// Incoming posts
parameters.find.createdAt = { $gt: Session.get('listPopulatedAt') };
var postsIncoming = Posts.find(parameters.find, parameters.options);
Session.set('postsLimit', this._terms.limit);
return {
incoming: postsIncoming,
postsList: posts,
postCount: postCount,
ready: this.postsListSub.ready
};
},
onAfterAction: function() {
Session.set('view', this.view);
}
});
PostsTopController = PostsListController.extend({
view: 'top'
});
PostsNewController = PostsListController.extend({
view: 'new'
});
PostsBestController = PostsListController.extend({
view: 'best'
});
PostsPendingController = PostsListController.extend({
view: 'pending'
});
// Controller for post digest
PostsDigestController = FastRender.RouteController.extend({
template: getTemplate('posts_digest'),
waitOn: function() {
// if day is set, use that. If not default to today
var currentDate = this.params.day ? new Date(this.params.year, this.params.month-1, this.params.day) : new Date(),
terms = {
view: 'digest',
after: moment(currentDate).startOf('day').toDate(),
before: moment(currentDate).endOf('day').toDate()
};
return [
coreSubscriptions.subscribe('postsList', terms),
coreSubscriptions.subscribe('postsListUsers', terms)
];
},
data: function() {
var currentDate = this.params.day ? new Date(this.params.year, this.params.month-1, this.params.day) : Session.get('today'),
terms = {
view: 'digest',
after: moment(currentDate).startOf('day').toDate(),
before: moment(currentDate).endOf('day').toDate()
},
parameters = getPostsParameters(terms);
Session.set('currentDate', currentDate);
parameters.find.createdAt = { $lte: Session.get('listPopulatedAt') };
var posts = Posts.find(parameters.find, parameters.options);
// Incoming posts
parameters.find.createdAt = { $gt: Session.get('listPopulatedAt') };
var postsIncoming = Posts.find(parameters.find, parameters.options);
return {
incoming: postsIncoming,
posts: posts
};
}
});
// Controller for post pages
PostPageController = FastRender.RouteController.extend({
template: getTemplate('post_page'),
waitOn: function() {
this.postSubscription = coreSubscriptions.subscribe('singlePost', this.params._id);
this.postUsersSubscription = coreSubscriptions.subscribe('postUsers', this.params._id);
this.commentSubscription = coreSubscriptions.subscribe('postComments', this.params._id);
},
post: function() {
return Posts.findOne(this.params._id);
},
onBeforeAction: function() {
if (! this.post()) {
if (this.postSubscription.ready()) {
this.render(getTemplate('not_found'));
} else {
this.render(getTemplate('loading'));
}
} else {
this.next();
}
},
onRun: function() {
var sessionId = Meteor.default_connection && Meteor.default_connection._lastSessionId ? Meteor.default_connection._lastSessionId : null;
Meteor.call('increasePostViews', this.params._id, sessionId);
},
data: function() {
return this.post();
}
});
Meteor.startup(function () {
Router.route('/resources', {
name: 'posts_default',
controller: getDefaultViewController()
});
Router.route('/top/:limit?', {
name: 'posts_top',
controller: PostsTopController
});
// New
Router.route('/new/:limit?', {
name: 'posts_new',
controller: PostsNewController
});
// Best
Router.route('/best/:limit?', {
name: 'posts_best',
controller: PostsBestController
});
// Pending
Router.route('/pending/:limit?', {
name: 'posts_pending',
controller: PostsPendingController
});
// TODO: enable /category/new, /category/best, etc. views
// Digest
Router.route('/digest/:year/:month/:day', {
name: 'posts_digest',
controller: PostsDigestController
});
Router.route('/digest', {
name: 'posts_digest_default',
controller: PostsDigestController
});
// Post Page
Router.route('/posts/:_id', {
name: 'post_page',
controller: PostPageController
});
Router.route('/posts/:_id/comment/:commentId', {
name: 'post_page_comment',
controller: PostPageController,
onAfterAction: function () {
// TODO: scroll to comment position
}
});
// Post Edit
Router.route('/posts/:_id/edit', {
name: 'post_edit',
template: getTemplate('post_edit'),
waitOn: function () {
return [
coreSubscriptions.subscribe('singlePost', this.params._id),
coreSubscriptions.subscribe('allUsersAdmin')
];
},
data: function() {
return {
postId: this.params._id,
post: Posts.findOne(this.params._id)
};
},
fastRender: true
});
// Post Submit
Router.route('/submit', {
name: 'post_submit',
template: getTemplate('post_submit'),
waitOn: function () {
return coreSubscriptions.subscribe('allUsersAdmin');
}
});
});
|
wrichman/tuleboxapp
|
lib/router/posts.js
|
JavaScript
|
mit
| 6,598
|
package com.arkcraft.mod.core.entity;
import com.arkcraft.mod.core.GlobalAdditions;
import com.arkcraft.mod.core.entity.passive.EntityDodo;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.Item;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityDodoEgg extends EntityThrowable
{
public EntityDodoEgg(World w)
{
super(w);
}
public EntityDodoEgg(World w, EntityLivingBase base)
{
super(w, base);
}
public EntityDodoEgg(World w, double x, double y, double z)
{
super(w, x, y, z);
}
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition pos)
{
if (pos.entityHit != null)
{
pos.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
}
if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0)
{
byte b0 = 1;
if (this.rand.nextInt(32) == 0)
{
b0 = 4;
}
for (int i = 0; i < b0; ++i)
{
EntityDodo entitydodo = new EntityDodo(this.worldObj);
entitydodo.setGrowingAge(-24000);
entitydodo.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
this.worldObj.spawnEntityInWorld(entitydodo);
}
}
@SuppressWarnings("unused")
double d0 = 0.08D;
for (int j = 0; j < 8; ++j)
{
// worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(GlobalAdditions.dodo_egg)});
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
}
|
tterrag1098/ARKCraft-Code
|
src/main/java/com/arkcraft/mod/core/entity/EntityDodoEgg.java
|
Java
|
mit
| 2,261
|
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for examples\css-bundle\</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../prettify.css">
<style>
body, html {
margin:0; padding: 0;
}
body {
font-family: Helvetica Neue, Helvetica,Arial;
font-size: 10pt;
}
div.header, div.footer {
background: #eee;
padding: 1em;
}
div.header {
z-index: 100;
position: fixed;
top: 0;
border-bottom: 1px solid #666;
width: 100%;
}
div.footer {
border-top: 1px solid #666;
}
div.body {
margin-top: 10em;
}
div.meta {
font-size: 90%;
text-align: center;
}
h1, h2, h3 {
font-weight: normal;
}
h1 {
font-size: 12pt;
}
h2 {
font-size: 10pt;
}
pre {
font-family: Consolas, Menlo, Monaco, monospace;
margin: 0;
padding: 0;
line-height: 14px;
font-size: 14px;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
div.path { font-size: 110%; }
div.path a:link, div.path a:visited { color: #000; }
table.coverage { border-collapse: collapse; margin:0; padding: 0 }
table.coverage td {
margin: 0;
padding: 0;
color: #111;
vertical-align: top;
}
table.coverage td.line-count {
width: 50px;
text-align: right;
padding-right: 5px;
}
table.coverage td.line-coverage {
color: #777 !important;
text-align: right;
border-left: 1px solid #666;
border-right: 1px solid #666;
}
table.coverage td.text {
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 40px;
}
table.coverage td span.cline-neutral {
background: #eee;
}
table.coverage td span.cline-yes {
background: #b5d592;
color: #999;
}
table.coverage td span.cline-no {
background: #fc8c84;
}
.cstat-yes { color: #111; }
.cstat-no { background: #fc8c84; color: #111; }
.fstat-no { background: #ffc520; color: #111 !important; }
.cbranch-no { background: yellow !important; color: #111; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
.missing-if-branch {
display: inline-block;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: black;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.entity, .metric { font-weight: bold; }
.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
.metric small { font-size: 80%; font-weight: normal; color: #666; }
div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
div.coverage-summary th.file { border-right: none !important; }
div.coverage-summary th.pic { border-left: none !important; text-align: right; }
div.coverage-summary th.pct { border-right: none !important; }
div.coverage-summary th.abs { border-left: none !important; text-align: right; }
div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; }
div.coverage-summary td.pic { min-width: 120px !important; }
div.coverage-summary a:link { text-decoration: none; color: #000; }
div.coverage-summary a:visited { text-decoration: none; color: #333; }
div.coverage-summary a:hover { text-decoration: underline; }
div.coverage-summary tfoot td { border-top: 1px solid #666; }
div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
}
div.coverage-summary .yui3-datatable-sort-indicator {
background: url("https://yui-s.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent;
}
div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator {
background-position: 0 -20px;
}
div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator {
background-position: 0 -10px;
}
.high { background: #b5d592 !important; }
.medium { background: #ffe87c !important; }
.low { background: #fc8c84 !important; }
span.cover-fill, span.cover-empty {
display:inline-block;
border:1px solid #444;
background: white;
height: 12px;
}
span.cover-fill {
background: #ccc;
border-right: 1px solid #444;
}
span.cover-empty {
background: white;
border-left: none;
}
span.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">examples\css-bundle\</span></h1>
<h2>
Statements: <span class="metric">100% <small>(2 / 2)</small></span>
Branches: <span class="metric">100% <small>(0 / 0)</small></span>
Functions: <span class="metric">100% <small>(0 / 0)</small></span>
Lines: <span class="metric">100% <small>(2 / 2)</small></span>
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
</h2>
<div class="path"><a href="../../index.html">All files</a> » examples\css-bundle\</div>
</div>
<div class="body">
<div class="coverage-summary">
<table>
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="webpack.config.js"><a href="webpack.config.js.html">webpack.config.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">(2 / 2)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0 / 0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0 / 0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">(2 / 2)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Aug 05 2014 08:06:14 GMT+0200 (Mitteleuropäische Sommerzeit)</div>
</div>
<script src="../../prettify.js"></script>
<script src="https://yui-s.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
<script>
YUI().use('datatable', function (Y) {
var formatters = {
pct: function (o) {
o.className += o.record.get('classes')[o.column.key];
try {
return o.value.toFixed(2) + '%';
} catch (ex) { return o.value + '%'; }
},
html: function (o) {
o.className += o.record.get('classes')[o.column.key];
return o.record.get(o.column.key + '_html');
}
},
defaultFormatter = function (o) {
o.className += o.record.get('classes')[o.column.key];
return o.value;
};
function getColumns(theadNode) {
var colNodes = theadNode.all('tr th'),
cols = [],
col;
colNodes.each(function (colNode) {
col = {
key: colNode.getAttribute('data-col'),
label: colNode.get('innerHTML') || ' ',
sortable: !colNode.getAttribute('data-nosort'),
className: colNode.getAttribute('class'),
type: colNode.getAttribute('data-type'),
allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html'
};
col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter;
cols.push(col);
});
return cols;
}
function getRowData(trNode, cols) {
var tdNodes = trNode.all('td'),
i,
row = { classes: {} },
node,
name;
for (i = 0; i < cols.length; i += 1) {
name = cols[i].key;
node = tdNodes.item(i);
row[name] = node.getAttribute('data-value') || node.get('innerHTML');
row[name + '_html'] = node.get('innerHTML');
row.classes[name] = node.getAttribute('class');
//Y.log('Name: ' + name + '; Value: ' + row[name]);
if (cols[i].type === 'number') { row[name] = row[name] * 1; }
}
//Y.log(row);
return row;
}
function getData(tbodyNode, cols) {
var data = [];
tbodyNode.all('tr').each(function (trNode) {
data.push(getRowData(trNode, cols));
});
return data;
}
function replaceTable(node) {
if (!node) { return; }
var cols = getColumns(node.one('thead')),
data = getData(node.one('tbody'), cols),
table,
parent = node.get('parentNode');
table = new Y.DataTable({
columns: cols,
data: data,
sortBy: 'file'
});
parent.set('innerHTML', '');
table.render(parent);
}
Y.on('domready', function () {
replaceTable(Y.one('div.coverage-summary table'));
if (typeof prettyPrint === 'function') {
prettyPrint();
}
});
});
</script>
</body>
</html>
|
paulshen/me
|
node_modules/webpack/coverage/lcov-report/examples/css-bundle/index.html
|
HTML
|
mit
| 12,707
|
---
layout: post
title: "linux下的yum使用技巧"
date: 2016-04-12 09:25:20 +0700
categories: [linux, yum]
---
经常会遇上一些linux系统允许你上外网,而一些是不允许的,这时我们可以从可以上外网的服务器上把yum下载的包拷贝过来,但是一般yum安装的包没有报错包文件,无法拷贝,为了解决这个问题,这里介绍一些小技巧。
# 安装一般依赖包方法:
- 如果linux系统有外网,直接yum install就可以安装,可以用yum list查看
- 如果没有外网,可以利用光盘搭建一个本地源,然后直接yum安装。
# 利用光盘配置本地源方法:
**1、挂载光盘**
mount /dev/cdrom /mnt
**2、删除/etc/yum.repos.d目录所有的repo文件**
保险起见,我们先备份一下/etc/yum.repos.d目录
cp -r /etc/yum.repos.d /etc/yum.reps.d.bak
rm -rf /etc/yum.repos.d/*
**3、创建新文件dvd.repo**
vim /etc/yum.repos.d/dvd.repo
//加入以下内容:
[dvd] name=install dvd
baseurl=file:///mnt
enabled=1 --是否生效1是0否
gpgcheck=0 --是否检查1检查0不检查
**4、 刷新 repos 生成缓存**
yum makecache
然后就可以使用yum命令安装你所需要的软件包了。如果不想使用本地yum源,需要删除掉这个/etc/yum.repos.d/dvd.repo文件,然后恢复原来的配置文件。
# 假如有两台linux,一台可以上网另外一台不能,可以利用yum在能上网的那台下到本地再传过去
有时,我们需要下载一个rpm包,只是下载下来,拷贝给其他机器使用。前面也介绍过yum安装rpm包的时候,首先得下载这个rpm包然后再去安装。
**所以使用yum完全可以做到只下载而不安装。**
## 安装 yum-downloadonly
yum install -y yum-plugin-downloadonly.noarch
注:如果你的CentOS是5.x版本,则需要安装yum-downloadonly.noarch这个包。
## 下载一个rpm包而不安装
yum install (包名) -y --downloadonly
这样虽然下载了,但是并没有保存到我们想要的目录下,它默认保存到了/var/cache/yum/后面还有好几层子目录,根据你系统的版本决定。
在这里,我要说下,并不是所有包都可以下载,因为已经安装过的包,是不能再安装的,所以就不能下载到。
那要是下载的话,需要使用
yum reinstall (包名) -y --downloadonly
## 下载到指定目录
yum install 包名 -y --downloadonly --downloaddir=/usr/local/src
# 使用yum时出现如下错:
another app is currently holding the yum lock;waiting for it to exit...
可以通过强制关掉yum进程:
rm -f /var/run/yum.pid
然后就可以使用yum了。
|
GalenGao/GalenGao.github.io
|
_posts/2016-04-12-linux yum skills.md
|
Markdown
|
mit
| 2,731
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WalkMatrix.Contracts;
using WalkMatrix.MatrixGenerator;
namespace WalkMatrix
{
public class Position : IPosition
{
private int row;
private int col;
public int Col
{
get
{
return this.col;
}
set
{
this.col = value;
}
}
public int Row
{
get
{
return this.row;
}
set
{
this.row = value;
}
}
public Position(int row, int col)
{
this.Row = row;
this.Col = col;
}
public IPosition getNeighbourPosition(Direction dir)
{
IPosition newPosition = new Position(this.Row, this.Col);
switch (dir)
{
case Direction.DownRight:
newPosition.Row++;
newPosition.Col++;
break;
case Direction.Down:
newPosition.Row++;
break;
case Direction.DownLeft:
newPosition.Row++;
newPosition.Col--;
break;
case Direction.Left:
newPosition.Col--;
break;
case Direction.UpLeft:
newPosition.Row--;
newPosition.Col--;
break;
case Direction.Up:
newPosition.Row--;
break;
case Direction.UpRight:
newPosition.Row--;
newPosition.Col++;
break;
case Direction.Right:
newPosition.Col++;
break;
default:
throw new ArgumentException("Invalid direction.");
}
return newPosition;
}
}
}
|
todorm85/TelerikAcademy
|
Courses/Programming/High Quality Code/Homework/13. Refactoring/MatrixWalk/Matrix/Position.cs
|
C#
|
mit
| 2,124
|
--TEST--
AMQPExchange publish with properties - ignore unsupported header values (NULL, object, resources)
--SKIPIF--
<?php if (!extension_loaded("amqp")) print "skip"; ?>
--FILE--
<?php
$cnn = new AMQPConnection();
$cnn->connect();
$ch = new AMQPChannel($cnn);
$ex = new AMQPExchange($ch);
$ex->setName("exchange-" . microtime(true));
$ex->setType(AMQP_EX_TYPE_FANOUT);
$ex->declareExchange();
$attrs = array(
'headers' => array(
'null' => null,
'object' => new stdClass(),
'resource' => fopen(__FILE__, 'r'),
),
);
echo $ex->publish('message', 'routing.key', AMQP_NOPARAM, $attrs) ? 'true' : 'false';
$ex->delete();
?>
--EXPECTF--
Warning: AMQPExchange::publish(): Ignoring field 'null' due to unsupported value type (null) in %s on line %d
Warning: AMQPExchange::publish(): Ignoring field 'object' due to unsupported value type (object) in %s on line %d
Warning: AMQPExchange::publish(): Ignoring field 'resource' due to unsupported value type (resource) in %s on line %d
true
|
cmorenokkatoo/kkatooapp
|
amqp-1.8.0beta2/tests/amqpexchange_publish_with_properties_ignore_unsupported_header_values.phpt
|
PHP
|
mit
| 1,026
|
local io_write = io.write
local yield = coroutine.yield
local timer
if jit.os == 'Windows' then
local ffi = require'ffi'
ffi.cdef[[
bool QueryPerformanceCounter(int64_t *lpPerformanceCount);
bool QueryPerformanceFrequency(int64_t *lpFrequency);
]]
local i64ptr = ffi.new'int64_t[1]'
assert(ffi.C.QueryPerformanceFrequency(i64ptr))
local freq = tonumber(i64ptr[0])
timer = function()
assert(ffi.C.QueryPerformanceCounter(i64ptr))
return tonumber(i64ptr[0]) / freq
end
end
local cr = coroutine.wrap(function(i)
while true do
io_write(i, '\n')
i = yield()
end
end)
io.output'file.tmp'
local test = function()
local t0 = timer()
for i=1,1E6 do
cr(i)
end
print("coroutine:", timer() - t0)
local t0 = timer()
for i=1,1E6 do
io_write(i)
end
print("loop:", timer() - t0)
end
test()
test()
|
radioflash/ljusb
|
crtest.lua
|
Lua
|
mit
| 852
|
package org.superboot.config;
import com.google.common.collect.Lists;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.superboot.base.BaseConstants;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.List;
/**
* <b> Api文档配置中心 </b>
* <p>
* 功能描述:配置API接口后,可用直接在地址后 添加:/swagger-ui.html 访问接口
* </p>
*/
@Configuration
@EnableSwagger2
public class Swagger2Config {
@Bean
public Docket createRestApi() {// 创建API基本信息
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
//添加全局属性
.globalOperationParameters(addGlobalOperationParameters())
.select()
// 扫描该包下的所有需要在Swagger中展示的API,@ApiIgnore注解标注的除外
.apis(RequestHandlerSelectors.basePackage(BaseConstants.CONTROLLER_BASE_PATH))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
// 创建API的基本信息,这些信息会在Swagger UI中进行显示
return new ApiInfoBuilder()
// API 标题
.title("接口文档服务")
// API描述
.description("默认接口调用需要使用TOKEN,请传入TOKEN后进行接口验证")
.contact(new Contact("SuperBoot", "http://www.superboot.org", "7040210@gmail.com"))
// 版本号
.version("1.0-SNAPSHOT")
.build();
}
/**
* 定义全局属性
*
* @return
*/
private List<Parameter> addGlobalOperationParameters() {
List<Parameter> parameters = Lists.newArrayList();
//添加Token字段
parameters.add(new ParameterBuilder()
//定义属性名
.name(BaseConstants.TOKEN_KEY)
//定义描述
.description("TOKEN")
//定义数据类型
.modelRef(new ModelRef("string"))
//定义位置
.parameterType("header")
.required(false)
.build());
//添加第三方接入字段
parameters.add(new ParameterBuilder()
//定义属性名
.name(BaseConstants.OTHER_TOKEN_KEY)
//定义描述
.description("第三方接入TOKEN")
//定义数据类型
.modelRef(new ModelRef("string"))
//定义位置
.parameterType("header")
.required(false)
.build());
//添加数据加密密钥字段
parameters.add(new ParameterBuilder()
//定义属性名
.name(BaseConstants.SECRET_KEY)
//定义描述
.description("数据加密密钥")
//定义数据类型
.modelRef(new ModelRef("string"))
//定义位置
.parameterType("header")
.required(false)
.build());
return parameters;
}
}
|
7040210/SuperBoot
|
super-boot-global/src/main/java/org/superboot/config/Swagger2Config.java
|
Java
|
mit
| 3,832
|
'use strict';
const Gitlab = require('gitlab');
const async = require('async');
const utils = require('./utils');
const moment = require('moment');
class GitLabWrapper {
constructor(config, notifier) {
this.config = config;
this.client = null;
this.projects = {};
this.users = {};
this.currentUserId = -1;
this.notifier = notifier;
}
init(callback) {
var config = this.config;
var state = createState(config);
if(!config.hasServerInfo()) {
state.error = "Gitlab URL and Token are mandatory.";
callback(state);
return;
}
this.client = createClient(config);
async.parallel([
this.loadCurrentUser.bind(this),
this.loadProjectsList.bind(this)], (err) => {
if(err) {
state.error = err;
callback(state);
}
else
this.sync(callback, state);
});
}
onUpdateConfig(callback) {
this.init(callback);
}
sync(callback, state) {
state = state || createState(this.config);
async.parallel([
this.loadMergeRequests.bind(this, true)
], (error, results) => {
if(error)
state.error = error;
updateState(state, this.projects, this.users, this.currentUserId);
callback(state);
});
}
onUpdateProjects(callback) {
var watchProjects = this.config.getWatchProjects();
for(let projectId in this.projects) {
let project = this.projects[projectId];
project.isWatching = watchProjects.indexOf(parseInt(projectId)) >= 0;
project.mergeRequests = [];
}
this.sync(callback);
}
onTimeoutSync(callback) {
let operations = [];
let state = createState(this.config);
operations.push(this.loadMergeRequests.bind(this, false));
async.parallel(operations, (err) => {
if(err)
state.error = err;
updateState(state, this.projects, this.users, this.currentUserId);
callback(state);
});
}
getUserId(id, userInfo) {
if(!this.users[id]) {
this.users[id] = {
id: id,
username: userInfo["username"],
email: userInfo["email"],
name: userInfo["name"]
};
}
return id;
}
/* async operations */
loadMergeRequests(skipChanges, callback) {
var watchProjects = this.config.getWatchProjects().filter(pid => !!this.projects[pid]);
let _this = this;
async.map(watchProjects, (projectId, cb) => {
_this.client.projects.merge_requests.list(projectId, (mergeRequests) => {
let project = this.projects[projectId];
if(!mergeRequests) {
cb(`Cannot load merge requests for '${utils.getProjectFullName(project)}'`);
return;
}
let oldMergeRequests = {};
let changes = [];
for(let i = 0, mr; mr = project.mergeRequests[i]; i++)
oldMergeRequests[mr.id] = mr;
project.mergeRequests = [];
for(let i = 0, mergeRequest; mergeRequest = mergeRequests[i]; i++) {
let author = mergeRequest["author"];
let assignee = mergeRequest["assignee"];
let guid = project.id + "_" + mergeRequest["id"];
let mr = {
id: mergeRequest["id"],
iid: mergeRequest["iid"],
guid: guid,
createdAt: mergeRequest["created_at"],
updatedAt: mergeRequest["updated_at"],
description: mergeRequest["description"],
targetBranch: mergeRequest["target_branch"],
sourceBranch: mergeRequest["source_branch"],
targetProjectId: mergeRequest["target_project_id"],
sourceProjectId: mergeRequest["source_project_id"],
title: mergeRequest["title"],
state: mergeRequest["state"],
author: _this.getUserId(author["id"], author),
assignee: assignee ? _this.getUserId(assignee["id"], assignee) : -1
};
project.mergeRequests.push(mr);
if(!skipChanges)
changes.push({source: oldMergeRequests[mr.id], target: mr});
}
cb(null, changes);
});
}, (err, results) => {
let changes = [];
for(let i = 0, pResults; pResults = results[i]; i++)
changes = changes.concat(pResults);
if(changes.length)
this.notifier.onMergeRequestChanges(changes, this.currentUserId, this.users, this.projects);
callback(err);
});
}
loadCurrentUser(callback) {
this.currentUserId = -1;
let _this = this;
this.client.users.current(function(result) {
if (result) {
_this.currentUserId = result["id"];
_this.getUserId(result["id"], result);
callback();
}
else
callback();
});
}
loadProjectsList(callback) {
this.projects = {};
var watchProjects = this.config.getWatchProjects();
let _this = this;
this.client.projects.all((result) => {
if(typeof result === 'string' || result instanceof String) {
callback(result);
}
else {
for(let i = 0, project; project = result[i]; i++) {
let projectId = project["id"];
_this.projects[projectId] = {
id: projectId,
description: project["description"],
public: project["public"],
webUrl: project["web_url"],
name: project["name"],
namespace: {
id: project["namespace"]["id"],
name: project["namespace"]["name"],
},
star_count: project["star_count"],
mergeRequests: [],
isWatching: watchProjects.indexOf(projectId) > -1,
isAccessible: true
};
}
callback();
}
//}
});
}
}
function updateState(state, projects, users, currentUserId) {
state.projects = [];
state.users = users;
state.userId = currentUserId;
for(let projectId in projects)
state.projects.push(projects[projectId]);
}
function createClient(config) {
var serverInfo = config.getServerInfo();
return new Gitlab({
url: serverInfo.url,
token: serverInfo.token
});
}
function createState(config) {
var serverInfo = config.getServerInfo();
var updateTimeout = config.getUpdateTimeout();
return {
gitlabUrl: serverInfo.url,
gitlabToken: serverInfo.token,
updateTimeout: updateTimeout,
projects: [],
users: {},
error: "",
userId: -1
};
}
module.exports = GitLabWrapper;
|
romanresh/gitlab-center
|
src/core/client.js
|
JavaScript
|
mit
| 7,856
|
# Adapted from a version by MJ Berends @approximatelylinear
VERSION=1
BUILD_DATE=$(shell date +%Y%m%dT%H%M)
export VERSION
export BUILD_DATE
all: build up
ensure_perms:
@echo "Ensuring that shell scripts are executable on the host, since host perms will override container perms"
chmod +x ./wait-for-it.sh
build: ensure_perms
@echo "Building the containers..."
VERSION=$(VERSION) BUILD_DATE=$(BUILD_DATE) docker-compose -f docker-compose.yml build
up:
@echo "Composing the containers..."
docker-compose -f docker-compose.yml up
down:
@echo "Removing compose constructs"
docker-compose -f docker-compose.yml down
down_clean:
@echo "Removing compose constructs and images"
docker-compose -f docker-compose.yml down --rmi all
test:
@echo "Runs tests on container"
docker exec -it sanctuary_web rspec
.PHONY: all
|
CZagrobelny/new_sanctuary_asylum
|
Makefile
|
Makefile
|
mit
| 831
|
require 'uri'
require 'zlib'
require 'logger'
require 'eventmachine'
require 'beefcake'
require 'nokogiri'
require 'json'
%w(protobuf protocol errors store router connection cluster compressor binary_json).each do |file|
require File.join(File.dirname(__FILE__), 'em-voldemort', file)
end
|
rapportive-oss/em-voldemort
|
lib/em-voldemort.rb
|
Ruby
|
mit
| 292
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/as-mag-inside-10.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Arts and Sciences Magazine</title>
<link href="global.css" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style1 {font-weight: bold}
-->
</style>
<!-- InstanceEndEditable -->
</head>
<body>
<p class="skip style1"><a href="#main-content-wrap">Skip to Main Content</a></p>
<div id="top-div-outer">
<div id="top-div-inner">
<div id="search-box">
<form style="float:right; " action="http://www.krieger.jhu.edu/magazine/results.html" id="cse-search-box">
<input type="hidden" name="cx" value="016683031895928592670:ggxiugnw7b4" />
<input type="hidden" name="cof" value="FORID:11" />
<input name="q" type="text" size="20" />
<input style="height:18px; font-size:9px; padding-bottom:1px; " type="submit" name="sa" value="Search" />
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
</div>
<!-- SEARCH AND UNIVERSAL NAV DIV -->
<div id="top-div-nav">
<ul>
<li><a href="http://krieger.jhu.edu/magazine/contact.htm" target="_blank">Contact</a> </li>
<li><a href="http://krieger.jhu.edu/magazine/pastissues.htm" target="_blank">Archives</a></li>
<li><a href="http://krieger.jhu.edu" target="_blank">Zanvyl Krieger School of Arts and Sciences</a></li>
</ul>
</div>
</div>
</div>
<!-- JHU AND HEADER DIV -->
<div id="header-outer">
<div id="header-inner">
<a class="img-lnk-no-border" href="http://www.jhu.edu"><img src="../sp09/img/jh-logo.gif" alt="Johns Hopkins University" width="248" height="30" /></a><a class="img-lnk-no-border" href="index.html"><img src="../sp09/img/mh-main.gif" alt="Arts and Sciences Magazine" width="871" height="86" /></a> </div>
</div>
<!-- SITE NAVIGATION DIV -->
<div id="topNavigationWrapper">
<div id="topNavigation">
<ul>
<li><a href="contents.html">Spring 2011 contents</a></li>
<li><a href="f1.html">Features</a></li>
<li><a href="n1.html">News</a></li>
<li><a href="i1.html">Insights</a></li>
<li><a href="a1.html">Alumni</a></li>
<li><a href="view.html">Dean's Column</a></li>
<li><a href="en.html">Editors' Note</a></li>
</ul>
</div>
</div>
<!-- BEGIN MAIN CONTENT AREA -->
<div id="content-outer">
<div id="content-inner"><!-- InstanceBeginEditable name="EditRegion2" -->
<div id="left-content">
<p class="breadcrumb"><strong>Alumni </strong>| <a href="a2.html">Next story</a> ></p>
<h1>A Champion for Young Americans </h1>
<p class="byline">By Christine Grillo</p>
<p>"Why should I care?" </p>
<p>That's the question that <strong>Paula Boggs '81</strong> wants to answer, right after delivering the message that young Americans ages 16 to 24 are the most unemployed group in the United States. </p>
<p>A member of the newly established White House Council for Community Solutions (<a href="http://www.serve.gov/council_home.asp">www.serve.gov/council_home.asp</a>), Boggs is one of 26 leaders from business, academic, and philanthropic sectors who have been tapped by the Obama administration to find solutions for what some are calling a "burning platform" problem. The official U.S. unemployment rate is 9.4 percent, but young people are harder hit, with a rate closer to 10.7 percent. "Beyond that, there's another set of young Americans who are underemployed," says Boggs, who is executive vice president and general counsel of Starbucks Coffee Company.</p>
<p>The council focuses primarily on the plight of young Americans, too many of whom are undereducated, underprepared, underemployed, or out of work. "Even for our young people who receive their high school diploma, there's too often a gap between skill sets and jobs available," says Boggs. "As a council, our twin goals are to move the needle for them in education and employment." The biggest areas of opportunity: technology, health services, and financial services, says Boggs, a member of the council's communications group.</p>
<p><img src="img/a1-a.jpg" alt="" width="605" height="358" /></p>
<p>Using town halls and various media, she and her colleagues intend to help America care about its young people who are out of work. "Our job is to come up with creative messaging around the idea of, 'What's in it for me?'" she says. "What's in it for all of us includes a drop in crime, a reduction of welfare rolls, and so much more. We can make that business case and support it with data." </p>
<p>As an executive within Starbucks, she makes another case for why business and industry should care: "We have an ongoing need for talent within this age group, in a significant way.... We have a mandate for growth. A company like Starbucks very much cares about youth leadership and supports me in my work with this council." In some ways, she says, this kind of community involvement is "unabashedly self-serving."</p>
<p>But Starbucks is not the only heavy-hitter represented on the council. Serving with Boggs are the president and chief executive officer of eBay, as well as the president of the Gap Foundation. "Corporate America is showing up in a big way," says Boggs. Other members include leaders such as the president of Tulane University, the president of the Rockefeller Foundation, and singer Jon Bon Jovi. ("He came to the first meeting fully prepared and equipped with a three-piece suit," Boggs reports.)</p>
<p>The council was established by executive order, and it has a two-year period of duration. Already, the members have begun to identify programs that offer lessons. One such program in Nashville focuses on helping young mothers who have child care issues that interfere with their ability to work. A disproportionate number of unemployed young Americans are women who were working at age 18 but out of work by age 25: "One of the most significant reasons for that is motherhood," says Boggs. "We want to figure out creative ways to honor that choice while also giving young mothers the tools to continue to grow in their careers, stay in the workforce, and acquire new skills."</p>
<p>Other programs, like one in Baltimore, help teach young people life skills, such as what to wear and how to interact in job interviews. "We see this at Starbucks all the time," she says. "Too many young people do not have the role model that enables them to put their best foot forward in a job interview." </p>
<p>The bottom line for Boggs is getting out the council's message. A long-serving member of the Johns Hopkins University Board of Trustees, as well as the American Red Cross Board of Governors, and the Advisory Council for KEXP FM (an NPR affiliate), her reach is wide. In Washington, D.C., she's known on both sides of the aisle as someone who started her career in public service first as a military officer in the Pentagon and then as a federal prosecutor in Seattle. </p>
<p>"It doesn't really matter that much whether it's Democrats or Republicans in the White House; the Hopkins connection in D.C. endures," she says. With her working group colleagues, she'll develop communication programs and campaigns, reaching out to Fortune 500 companies and individual citizens. "There are as many ways to express support as there are Fortune 500 companies," she says. "We worry about falling behind other nations' economies. ... Our nation can do better in cracking the code on these problems."" </p>
<p> </p>
<p> </p>
<p></p>
</div>
<!-- InstanceEndEditable -->
<!-- RIGHT COLUMN CONTENT -->
<!-- InstanceBeginEditable name="EditRegion3" -->
<div id="right-content">
<p class="bold-blue-larger"> </p>
<p class="bold-blue-larger"> </p>
<p class="bold-blue-larger"><img src="img/a1-b.jpg" width="226" height="313" /></p>
<p class="bold-blue-larger"> </p>
<span class="bold-blue-larger">“Too many young people do <br />
not have the role model that enables them to put their <br />
best foot forward in a job interview.” <br />
<br />
—Paula Boggs ’81 </span>
<p class="bold-blue"> </p>
</div>
<!-- InstanceEndEditable --><br clear="all" />
<!-- Clears the main-content columns -->
</div>
</div>
</div>
<!-- BEGIN FOOTER -->
<div id="footer-outer">
<div id="footer-inner">
<p><a href="http://www.jhu.edu">© The Johns Hopkins University,</a> <a href="http://krieger.jhu.edu/">Zanvyl Krieger School of Arts and Sciences</a></p>
</div>
</div>
<!-- END FOOTER -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-2497774-18");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
<!-- InstanceEnd --></html>
|
ksascomm/fanzinedev
|
web/sp11/a1.html
|
HTML
|
mit
| 9,624
|
require "spec_helper"
module Raygun
module Breadcrumbs
describe Store do
let(:subject) { Store }
after { subject.clear }
describe "#initialize" do
before do
expect(subject.stored).to eq(nil)
subject.initialize
end
it "creates the store on the current Thread" do
expect(subject.stored).to eq([])
end
it "does not effect other threads" do
Thread.new do
expect(subject.stored).to eq(nil)
end.join
end
end
describe "#any?" do
it "returns true if any breadcrumbs have been logged" do
subject.initialize
subject.record(message: "test")
expect(subject.any?).to eq(true)
end
it "returns false if none have been logged" do
subject.initialize
expect(subject.any?).to eq(false)
end
it "returns false if the store is uninitialized" do
expect(subject.any?).to eq(false)
end
end
describe "#clear" do
before do
subject.initialize
end
it "resets the store back to nil" do
subject.clear
expect(subject.stored).to eq(nil)
end
end
describe "#should_record?" do
it "returns false when the log level is above the breadcrumbs level" do
allow(Raygun.configuration).to receive(:breadcrumb_level).and_return(:error)
crumb = Breadcrumb.new
crumb.level = :warning
expect(subject.send(:should_record?, crumb)).to eq(false)
end
end
describe "#take_until_size" do
before do
subject.initialize
end
it "takes the most recent breadcrumbs until the size limit is reached" do
subject.record(message: '1' * 100)
subject.record(message: '2' * 100)
subject.record(message: '3' * 100)
crumbs = subject.take_until_size(500)
expect(crumbs.length).to eq(2)
expect(crumbs[0].message).to eq('2' * 100)
expect(crumbs[1].message).to eq('3' * 100)
end
it "does not crash with no recorded breadcrumbs" do
crumbs = subject.take_until_size(500)
expect(crumbs).to eq([])
end
end
context "adding a breadcrumb" do
class Foo
include ::Raygun::Breadcrumbs
def bar
record_breadcrumb(message: "test")
end
end
before do
subject.clear
subject.initialize
end
it "gets stored" do
subject.record(message: "test")
expect(subject.stored.length).to eq(1)
expect(subject.stored[0].message).to eq("test")
end
it "automatically sets the class name" do
Foo.new.bar
bc = subject.stored[0]
expect(bc.class_name).to eq("Raygun::Breadcrumbs::Foo")
end
it "automatically sets the method name" do
Foo.new.bar
bc = subject.stored[0]
expect(bc.method_name).to eq("bar")
end
it "does not set the method name if it is already set" do
subject.record(message: 'test', method_name: "foo")
expect(subject.stored[0].method_name).to eq("foo")
end
it "automatically sets the timestamp" do
Timecop.freeze do
Foo.new.bar
bc = subject.stored[0]
expect(bc.timestamp).to eq(Time.now.utc.to_i)
end
end
it "does not set the timestamp if it is already set" do
time = Time.now.utc
Timecop.freeze do
subject.record(message: 'test', timestamp: time)
expect(subject.stored[0].timestamp).to_not eq(Time.now.utc)
end
end
it "sets the log level to :info if one is not supplied" do
Foo.new.bar
expect(subject.stored[0].level).to eq(:info)
end
it "does not record the breadcrumb if should_record? is false" do
expect(subject).to receive(:should_record?).and_return(false)
Foo.new.bar
expect(subject.stored.length).to eq(0)
end
end
end
end
end
|
MindscapeHQ/raygun4ruby
|
spec/raygun/breadcrumbs/store_spec.rb
|
Ruby
|
mit
| 4,256
|
<html><body>
<h4>Windows 10 x64 (18363.900)</h4><br>
<h2>_ETW_BUFFER_STATE</h2>
<font face="arial"> EtwBufferStateFree = 0n0<br>
EtwBufferStateGeneralLogging = 0n1<br>
EtwBufferStateCSwitch = 0n2<br>
EtwBufferStateFlush = 0n3<br>
EtwBufferStatePendingCompression = 0n4<br>
EtwBufferStateCompressed = 0n5<br>
EtwBufferStatePlaceholder = 0n6<br>
EtwBufferStateMaximum = 0n7<br>
</font></body></html>
|
epikcraw/ggool
|
public/Windows 10 x64 (18363.900)/_ETW_BUFFER_STATE.html
|
HTML
|
mit
| 431
|
using UnityEngine;
using System.Collections;
public class Destroyer : MonoBehaviour {
void OnTriggerEnter2D(Collider2D col)
{
//destroyers are located in the borders of the screen
//if something collides with them, the'll destroy it
string tag = col.gameObject.tag;
if(tag == "Bird" || tag == "Pig" || tag == "Brick")
{
Destroy(col.gameObject);
}
}
}
|
dgkanatsios/AngryBirdsClone
|
Assets/Scripts/Destroyer.cs
|
C#
|
mit
| 429
|
require 'test_helper'
require 'picture_frame/stencil'
class StencilTest < Minitest::Test
def setup
@corner_stencil = PictureFrame::Stencil.new(
"abcde\n" +
"12@45\n" +
"qrstu\n" +
"vwxyz\n"
)
end
def test_position
assert_equal [1, 2], @corner_stencil.position('@')
end
def test_slice_from
pp = [1, 2]
assert_slice_equal ['c'], @corner_stencil.slice_from(pp, :t)
assert_slice_equal ['45'], @corner_stencil.slice_from(pp, :r)
assert_slice_equal ['s', 'x'], @corner_stencil.slice_from(pp, :b)
assert_slice_equal ['12'], @corner_stencil.slice_from(pp, :l)
assert_slice_equal ['de'], @corner_stencil.slice_from(pp, :tr)
assert_slice_equal ['tu', 'yz'], @corner_stencil.slice_from(pp, :br)
assert_slice_equal ['qr', 'vw'], @corner_stencil.slice_from(pp, :bl)
assert_slice_equal ['ab'], @corner_stencil.slice_from(pp, :tl)
end
def assert_slice_equal(expected, actual_slice)
assert_equal expected, actual_slice.send(:raster)
end
end
|
mschuerig/picture_frame
|
test/stencil_test.rb
|
Ruby
|
mit
| 1,064
|
using System;
using System.Collections.Generic;
namespace LinqToCompute.Utilities
{
internal static class TypeSystem
{
internal static Type GetElementType(Type seqType)
{
Type ienum = FindIEnumerable(seqType);
return ienum?.GetGenericArguments()[0] ?? seqType;
}
private static Type FindIEnumerable(Type seqType)
{
if (seqType == null || seqType == typeof(string))
return null;
if (seqType.IsArray)
return typeof(IEnumerable<>).MakeGenericType(seqType.GetElementType());
if (seqType.IsGenericType)
{
foreach (Type arg in seqType.GetGenericArguments())
{
Type ienum = typeof(IEnumerable<>).MakeGenericType(arg);
if (ienum.IsAssignableFrom(seqType))
{
return ienum;
}
}
}
Type[] ifaces = seqType.GetInterfaces();
if (ifaces != null && ifaces.Length > 0)
{
foreach (Type iface in ifaces)
{
Type ienum = FindIEnumerable(iface);
if (ienum != null) return ienum;
}
}
if (seqType.BaseType != null && seqType.BaseType != typeof(object))
{
return FindIEnumerable(seqType.BaseType);
}
return null;
}
}
}
|
discosultan/LinqToCompute
|
Src/Utilities/TypeSystem.cs
|
C#
|
mit
| 1,532
|
const gulp = require('gulp');
const size = require('gulp-size');
const sass = require('gulp-sass');
const plumber = require('gulp-plumber');
const cleanCss = require('gulp-clean-css');
const sourcemaps = require('gulp-sourcemaps');
const autoprefixer = require('gulp-autoprefixer');
/**
* Copy app.css to dist/ without any minification
*/
gulp.task('styles:dev', ['styles:scss'], () => {
gulp.src('app/styles/app.css')
.pipe(gulp.dest('dist/css/'));
});
/**
* Miniy app.css (which was created in the styles:scss task). Copy the result to dist/.
*/
gulp.task('styles:prod', ['styles:scss'], () => {
gulp.src('app/styles/app.css')
.pipe(size({
showFiles: true,
title: 'size of initial css'
}))
.pipe(cleanCss({processImport: false}))
.pipe(size({
showFiles: true,
title: 'size of css after minify'
}))
.pipe(gulp.dest('dist/css/'));
});
/**
* Compile app.scss into a CSS file. This is a synchronous task (using the "return a stream"
* paradigm) so that it will finish before "styles:dev" or "styles:prod" attempt to copy the
* generated CSS.
*/
gulp.task('styles:scss', () => {
return gulp.src('app/styles/app.scss')
.pipe(size({
showFiles: true,
title: 'initial scss files'
}))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(sass({
errLogToConsole: true
}))
.pipe(sourcemaps.write())
.pipe(size({
showFiles: true,
title: 'compiled css files with sourcemaps'
}))
.pipe(gulp.dest('app/styles/'));
});
/**
* Watch for changes to our SCSS files. If an SCSS file changes, run the 'styles:dev' task again.
*/
gulp.task('styles:watch', () => {
gulp.watch('app/styles/**/*.scss', ['styles:dev']);
});
|
Ludachrispeed/common-tasks
|
styles.js
|
JavaScript
|
mit
| 1,806
|
# frozen_string_literal: true
# Copyright the Linux Foundation and the
# OpenSSF Best Practices badge contributors
# SPDX-License-Identifier: MIT
module BadgeStaticHelper
end
|
coreinfrastructure/best-practices-badge
|
app/helpers/badge_static_helper.rb
|
Ruby
|
mit
| 177
|
verify_devpi_server() {
server_root=$1
version=$2
data_dir=${3:-$server_root/data}
sudo -u devpi test -x "$server_root/bin/devpi-server"
output=$("$server_root/bin/devpi-server" --version)
test $? -eq 0
test -z "$version" -o "$output" = "$version"
test -e "$data_dir/.event_serial"
test -e "$data_dir/.secret"
test -e "$data_dir/.sqlite"
}
verify_user() {
user_name=$1
user_home=$2
user_shell=${3:-/bin/false}
IFS=: userdata=($(getent passwd $user_name))
test ${userdata[2]} -lt 1000
test ${userdata[5]} = $user_home
test ${userdata[6]} = $user_shell
}
verify_virtualenv() {
test -d "$1"
test -x "$1/bin/python"
}
# Many installations of sudo do no permit root to run commands with a
# non-login group specified. Call this function to ensure that root
# has the appropriate privilege assigned to "sudo -g"
ensure_root_can_group_sudo() {
if ! test -d /etc/sudoers.d
then
mkdir /etc/sudoers.d
chown root /etc/sudoers.d
chgrp root /etc/sudoers.d
chmod 0750 /etc/sudoers.d
fi
if ! grep -q 'root *ALL=(ALL:ALL) *ALL' /etc/sudoers /etc/sudoers.d/*
then
echo 'root ALL=(ALL:ALL) ALL' > /etc/sudoers.d/root
fi
}
|
dave-shawley/devpi-cookbook
|
test/integration/lwrp/bats/test_helpers.bash
|
Shell
|
mit
| 1,147
|
package main
import (
"fmt"
"net/http"
"strings"
)
type formField struct {
Present bool
Value string
}
func (f formField) UpdatePresent(p bool) formField {
f.Present = p
return f
}
func checkField(key string, r *http.Request) formField {
var f formField
f.Value = r.FormValue(key)
if len(f.Value) != 0 {
f.Present = true
} else {
f.Present = false
}
return f
}
type pageDataMin struct {
TableCreated bool
Title string
Heading string
}
func newPageDataMin(title, heading string) pageDataMin {
return pageDataMin{tableCreated, title, heading}
}
type pageData struct {
pageDataMin
Recs [][]string
Finfo map[string]formField
}
func updatePageData(p *pageData, title, heading string) {
p.pageDataMin = newPageDataMin(title, heading)
}
func root(w http.ResponseWriter, r *http.Request) {
pgData := newPageDataMin("Home Page", "Welcome to the CURD Server")
tmpl.ExecuteTemplate(w, "index.gohtml", pgData)
}
func existingTable(w http.ResponseWriter, r *http.Request) bool {
if !tableCreated {
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
return false
}
return tableCreated
}
func createTable(w http.ResponseWriter, r *http.Request) {
if tableCreated {
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
return
}
// Call the Creation function
err := dbCreateTable()
if err == nil {
tableCreated = true
pgData := newPageDataMin("Table Creation", "Table Successfully Created !")
tmpl.ExecuteTemplate(w, "index.gohtml", pgData)
} else if strings.Contains(err.Error(), "Error 1050") {
tableCreated = true
pgData := newPageDataMin("Table Creation", "Table Already Exists !")
tmpl.ExecuteTemplate(w, "index.gohtml", pgData)
} else {
check(err)
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
}
}
func add(w http.ResponseWriter, r *http.Request) {
if !existingTable(w, r) {
return
}
pgData := newPageDataMin("Add Records", "New Record")
err := dbAddRecord(r)
if err == nil {
pgData.Heading = " Record Created Successfully"
}
tmpl.ExecuteTemplate(w, "add.gohtml", pgData)
}
func readAll(w http.ResponseWriter, r *http.Request) {
if !existingTable(w, r) {
return
}
var pgData pageData
var err error
// Actually Read all data
pgData.Recs, err = dbReadAll(r)
if err == nil {
updatePageData(&pgData, "Reading All Records", "All Records")
tmpl.ExecuteTemplate(w, "readall.gohtml", pgData)
} else {
check(err)
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
}
}
func findRecord(w http.ResponseWriter, r *http.Request) {
if !existingTable(w, r) {
return
}
var err error
var pgData pageData
wasFind := r.FormValue("submit") == "Find it"
if wasFind {
pgData, err = dbSearch(r)
}
if err != nil {
check(err)
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
}
updatePageData(&pgData, "Find Records", "Finding Records of Interest")
tmpl.ExecuteTemplate(w, "find.gohtml", pgData)
}
func updateRecord(w http.ResponseWriter, r *http.Request) {
if !existingTable(w, r) {
return
}
var err error
var pgData pageData
wasGet := r.FormValue("submit") == "Get"
//wasUpdate := r.FormValue("submit") == "Update"
// Execute the Update
n, pgData, err := dbUpdateRecord(r)
updatePageData(&pgData, "Record Update", "Updating Records")
if err != nil {
pgData.Heading += " -" + err.Error()
} else {
if n > 0 {
if n > 1 {
pgData.Heading += fmt.Sprintf("- Found %d records", n)
} else {
if wasGet {
pgData.Heading += "- Found one"
} else {
pgData.Heading += "- Updated Record"
}
}
} else {
pgData.Heading = "Updating Records - Nothing Found"
}
}
tmpl.ExecuteTemplate(w, "update.gohtml", pgData)
}
func deleteRecord(w http.ResponseWriter, r *http.Request) {
if !existingTable(w, r) {
return
}
var err error
var pgData pageData
wasGet := r.FormValue("submit") == "Get"
pgData, err = dbDeleteRecord(r)
updatePageData(&pgData, "Record Deletion", "Delete Record")
if err != nil {
pgData.Heading += " -" + err.Error()
} else {
if wasGet {
pgData.Heading += " - Found one"
} else {
pgData.Heading += " - Successful"
}
}
tmpl.ExecuteTemplate(w, "delete.gohtml", pgData)
}
func dropTable(w http.ResponseWriter, r *http.Request) {
if !existingTable(w, r) {
return
}
// Call Drop Table
err := dbDropTable()
if err == nil {
tableCreated = false
pgData := newPageDataMin("Remove Table", "Table Deleted Succesfully !")
tmpl.ExecuteTemplate(w, "index.gohtml", pgData)
} else {
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
}
}
|
boseji/GoPlayground
|
005_DbFunda/01_Mysql/03_simple-CURD-server/pages.go
|
GO
|
mit
| 4,561
|
#if !defined(UNICSTRING_API_C_UTILS_HPP)
#define UNICSTRING_API_C_UTILS_HPP
// This is an internal helper utilities for C API.
#include <UniCString/C/UniCTypes.h>
#include <Core/Exception.hpp>
#include <Core/String.hpp>
namespace UniCString
{
namespace API
{
namespace Utils
{
inline void CreateUniCErrorTFromException(const UniCString::Core::Exception& e, UniCErrorT* ucError)
{
if (ucError != NULLPTR)
*ucError = reinterpret_cast<UniCErrorT>(new UniCString::Core::Exception(e));
return;
}
inline void CreateUniCErrorTFromString(const char* message, UniCErrorT* ucError)
{
if (ucError != NULLPTR)
*ucError = reinterpret_cast<UniCErrorT>(new UniCString::Core::Exception(message));
return;
}
#define UC_BEGIN_TRY_BLOCK() \
UniCErrorT returnError = NULLPTR; \
try {
#define UC_END_TRY_BLOCK() \
} \
catch (UniCString::Core::Exception& e) { \
UniCString::API::Utils::CreateUniCErrorTFromException(e, &returnError); \
} \
catch (std::exception& e) { \
UniCString::API::Utils::CreateUniCErrorTFromString(e.what(), &returnError); \
} \
catch (...) { \
UniCString::API::Utils::CreateUniCErrorTFromString("Unknown Error.", &returnError); \
} \
return (returnError);
// dereferencing helpers
#define GET_EXCEPTION_PTR(ucError) ((UniCString::Core::Exception*) ucError)
#define GET_EXCEPTION_REF(ucError) ((UniCString::Core::Exception&) *(GET_EXCEPTION_PTR(ucError)))
#define GET_STRING_PTR(ucString) ((UniCString::Core::String*) ucString)
#define GET_STRING_REF(ucString) ((UniCString::Core::String&) *(GET_STRING_PTR(ucString)))
#define GET_CORE_STRING_ENCODING(ucEncoding) ((UniCString::Core::String::Encoding) ucEncoding)
} // namespace Utils
} // namespace API
} // namespace UniCString
#endif // UNICSTRING_API_C_UTILS_HPP
|
vycasas/unicstring
|
API/UniCString/C/APIUtils.hpp
|
C++
|
mit
| 1,862
|
import React, { Component } from 'react';
import axios from 'axios';
import { Router, Link } from 'react-router';
import { Button } from 'react-bootstrap';
export default class trueMenu extends Component {
constructor(props) {
super();
this.state = {
displayCreateBoard: false,
displayJoin: false,
name: '',
placeholder: 'Join a room',
userId: 0,
list: [],
isValid: true
};
this.handleName = this.handleName.bind(this);
this.handleJoination = this.handleJoination.bind(this);
}
handleJoination(e) {
e.preventDefault();
if(this.state.name === ''){
this.setState({placeholder: "Please enter a room name", isValid: false})
return;
} else if (this.state.name.indexOf(' ') !== -1){
this.setState({placeholder: "Room names can not contain spaces", name: '', isValid: false})
return;
}else if (/[^a-zA-Z0-9\-\/]/.test(this.state.name)) {
this.setState({placeholder: "Special characters are not allowed", name: '', isValid: false})
return;
}
socket.emit('create board', {name: this.state.name});
window.location.assign('/#/code')
}
handleName(event) {
window.roomName = event.target.value;
this.setState({
name: event.target.value
});
}
render() {
const logoStyle = {
'marginTop': '14%'
}
const imageSize = {
width: '400px'
}
return (
<div className="center-roomselect" id="createroom">
<form style={logoStyle} className="animated fadeInUp" onSubmit={this.handleJoination}>
<img style={imageSize} src="./media/codeout.png" />
<br />
<input
placeholder={this.state.placeholder}
value={this.state.name}
onChange={(e) => this.handleName(e)}
className={!this.state.isValid ? 'animated shake search-style' : 'search-style'}
/>
<p>
<button className="btn btn-primary button-spacing"
onClick={this.handleJoination}>Enter Room
</button>
</p>
</form>
</div>
)
};
};
|
gdomorski/CodeOut
|
client2/src/components/rooms/menu_createRoom.js
|
JavaScript
|
mit
| 2,093
|
<?php
$inventoryCatagory_data=$this->DataModel->getInventoryItemCatagoryId();
?>
<div class="grid-container">
<div class="container">
<div class="form-group">
<input type="search" class="form-control" name="search" placeholder="Search" data-action="grid_search" data-search-id="inventoryCatagory_data">
</div>
</div>
<div class="row" id="inventoryCatagory_data">
<?php
foreach ($inventoryCatagory_data as $inventoryCatagory) {
echo '<a class="col-md-4 col-lg-3 btn btn-default grid-btn" data-btn-type="task-result" data-view="#inventoryCatagoryViewModal">';
echo 'ID:<i data-send="true" data-name="id">'.$inventoryCatagory->catagory_id.'</i>';
echo '<span>Catagory Name : '.$inventoryCatagory->catagory_name.'</span>';
echo '<span>Charges : '.$inventoryCatagory->stiching_charge.'</span>';
echo '</a>';
}
?>
</div>
</div>
|
ninexinnovation/transcended
|
application/views/tasks/inventoryCatagoryView.php
|
PHP
|
mit
| 859
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<A name=1></a><hr>
<A name=2></a><hr>
<A name=3></a>30344<br>
X<br>
December 29, 2014<br>
Alice D. Webber<br>
Engineering Technician<br>
<hr>
<A name=4></a>30344<br>
NOTIFY NDIC INSPECTOR SAMUEL SKURUPEY AT 701-770-1981 WITH SPUD & TD INFO.<br>
X<br>
December 29, 2014<br>
Alice D. Webber<br>
Engineering Technician<br>
<hr>
<A name=5></a>December 29, 2014<br>
Becky Barnes<br>
Regulatory Compliance Specialist<br>
CONTINENTAL RESOURCES, INC.<br>
P.O. Box 268870<br>
Oklahoma City, Ok 73126<br>
RE:<br>
HORIZONTAL WELL<br>
HOLSTEIN FEDERAL 12-25H<br>
NESE Section 25-153N-94W<br>
McKenzie County<br>
Well File # 30344<br>
Dear Becky:<br>
Pursuant to Commission Order No. 24888, approval to drill the above captioned well is hereby given. The approval is granted on the<br>
condition that all portions of the well bore not isolated by cement, be no closer than the </span><span class="ft3">50' </span><span class="ft1">setback from the north boundary, </span><span class="ft3">200' </span><span class="ft1">setback<br>
from the south boundary and </span><span class="ft3">500' </span><span class="ft1">setback from the east & west boundaries within the 2560 acre spacing unit consisting of Sections 13, 24,<br>
25 & 36 T153N R94W. </span><span class="ft3">Tool error is not required pursuant to order.<br>
PERMIT STIPULATIONS: Effective June 1, 2014, a covered leak-proof container (with placard) for filter sock disposal must<br>
be maintained on the well site beginning when the well is spud, and must remain on-site during clean-out, completion, and<br>
flow-back whenever filtration operations are conducted. Due to drainage adjacent to the well site, a dike is required<br>
surrounding the entire location. Two horizontal wells shall be drilled and completed in each "1280" in the standup 2560-acre<br>
spacing unit described as Sections 13, 24, 25, and 36 T153N R94W within 12 months of each other. If this condition is not met,<br>
the Commission shall schedule the matter for hearing to consider the appropriate spacing unit size. The number of wells in<br>
each "1280" in the standup 2560-acre spacing unit described as Sections 13, 24, 25, and 36, T153N R94W shall ultimately be<br>
equal, in no longer than a twelve-month period. If this condition is not met, the Commission shall schedule the matter for<br>
hearing to consider the appropriate spacing unit size. Two horizontal wells shall be drilled and completed in the standup 1280-<br>
acre spacing unit described as Sections 13 and 24 T153N R94W prior to completing any horizontal well in the standup 2560-acre<br>
spacing unit described as Sections 13, 24, 25, and 36 T153N R94W. CONTINENTAL RESOURCES must contact NDIC Field<br>
Inspector Samuel Skurupey at 701-770-1981 prior to location construction.<br>
Drilling pit<br>
NDAC 43-02-03-19.4 states that "a pit may be utilized to bury drill cuttings and solids generated during well drilling and completion<br>
operations, providing the pit can be constructed, used and reclaimed in a manner that will prevent pollution of the land surface and<br>
freshwaters. Reserve and circulation of mud system through earthen pits are prohibited. All pits shall be inspected by an authorized<br>
representative of the director prior to lining and use. Drill cuttings and solids must be stabilized in a manner approved by the director<br>
prior to placement in a cuttings pit."<br>
Form 1 Changes & Hard Lines<br>
Any changes, shortening of casing point or lengthening at Total Depth must have prior approval by the NDIC. The proposed directional<br>
plan is at a legal location. Based on the azimuth of the proposed lateral the maximum legal coordinate from the well head is: 13160'N.<br>
Location Construction Commencement (Three Day Waiting Period)<br>
Operators shall not commence operations on a drill site until the 3rd business day following publication of the approved drilling permit<br>
on the NDIC - OGD Daily Activity Report. If circumstances require operations to commence before the 3rd business day following<br>
publication on the Daily Activity Report, the waiting period may be waived by the Director. Application for a waiver must be by sworn<br>
affidavit providing the information necessary to evaluate the extenuating circumstances, the factors of NDAC 43-02-03-16.2 (1), (a)-(f), and<br>
any other information that would allow the Director to conclude that in the event another owner seeks revocation of the drilling permit,<br>
the applicant should retain the permit.<br>
Permit Fee & Notification<br>
Payment was received in the amount of $100 via credit card .The permit fee has been received. It is requested that notification be given<br>
immediately upon the spudding of the well. This information should be relayed to the Oil & Gas Division, Bismarck, via telephone. The<br>
following information must be included: Well name, legal location, permit number, drilling contractor, company representative, date and<br>
time of spudding. Office hours are 8:00 a.m. to 12:00 p.m. and 1:00 p.m. to 5:00 p.m. Central Time. Our telephone number is (701) 328-<br>
8020, leave a message if after hours or on the weekend.<br>
<hr>
<A name=6></a>Becky Barnes<br>
December 29, 2014<br>
Page 2<br>
Survey Requirements for Horizontal, Horizontal Re-entry, and Directional Wells<br>
NDAC Section 43-02-03-25 (Deviation Tests and Directional Surveys) states in part (that) the survey contractor shall file a certified copy<br>
of all surveys with the director free of charge within thirty days of completion. Surveys must be submitted as one electronic copy, or in a<br>
form approved by the director. However, the director may require the directional survey to be filed immediately after completion if the<br>
survey is needed to conduct the operation of the director's office in a timely manner. Certified surveys must be submitted via email in one<br>
adobe document, with a certification cover page to </span><span class="ft2">certsurvey@nd.gov</span><span class="ft0">.<br>
Survey points shall be of such frequency to accurately determine the entire location of the well bore.<br>
Specifically, the Horizontal and Directional well survey frequency is 100 feet in the vertical, 30 feet in the curve (or when sliding) and 90<br>
feet in the lateral.<br>
Surface casing cement<br>
Tail cement utilized on surface casing must have a minimum compressive strength of 500 psi within 12 hours, and tail cement<br>
utilized on production casing must have a minimum compressive strength of 500 psi before drilling the plug or initiating tests.<br>
Logs NDAC Section 43-02-03-31 requires the running of (1) a suite of open hole logs from which formation tops and porosity zones<br>
can be determined, (2) a Gamma Ray Log run from total depth to ground level elevation of the well bore, and (3) a log from which the<br>
presence and quality of cement can be determined (Standard CBL or Ultrasonic cement evaluation log) in every well in which production<br>
or intermediate casing has been set, this log must be run prior to completing the well. All logs run must be submitted free of charge, as<br>
one digital TIFF (tagged image file format) copy and one digital LAS (log ASCII) formatted copy. Digital logs may be submitted on a<br>
standard CD, DVD, or attached to an email sent to </span><span class="ft2">digitallogs@nd.gov<br>
Thank you for your cooperation.<br>
Sincerely,<br>
Alice Webber<br>
Engineering Tech<br>
<hr>
<A name=7></a>INDUSTRIAL COMMISSION OF NORTH DAKOTA<br>
OIL AND GAS DIVISION<br>
600 EAST BOULEVARD DEPT 405<br>
BISMARCK, ND 58505-0840<br>
SFN 54269 (08-2005)<br>
PLEASE READ INSTRUCTIONS BEFORE FILLING OUT FORM.<br>
PLEASE SUBMIT THE ORIGINAL AND ONE COPY.<br>
Type of Work<br>
Type of Well<br>
Approximate Date Work Will Start<br>
Confidential Status<br>
New Location<br>
Oil & Gas<br>
12 / 1 / 2014<br>
No<br>
Operator<br>
Telephone Number<br>
CONTINENTAL RESOURCES, INC.<br>
405-234-9000<br>
Address<br>
City<br>
State<br>
Zip Code<br>
P.O. Box 268870<br>
Oklahoma City<br>
Ok<br>
73126<br>
Notice has been provided to the owner of any<br>
This well is not located within five hundred<br>
permanently occupied dwelling within 1,320 feet.<br>
feet of an occupied dwelling.<br>
enter data for additional laterals on page 2)<br>
Well Name<br>
Well Number<br>
HOLSTEIN FEDERAL<br>
12-25H<br>
Surface Footages<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
2629 </span><span class="ft0">FL<br>
S<br>
1115 </span><span class="ft0">F </span><span class="ft6">E<br>
L<br>
NESE<br>
25<br>
153<br>
94<br>
McKenzie<br>
Longstring Casing Point Footages<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
2258 </span><span class="ft0">F </span><span class="ft6">N </span><span class="ft0">L<br>
915 </span><span class="ft0">F </span><span class="ft6">E<br>
L<br>
SENE<br>
25<br>
153<br>
94<br>
McKenzie<br>
Longstring Casing Point Coordinates From Well Head<br>
Azimuth<br>
Longstring Total Depth<br>
392 N </span><span class="ft0">From WH<br>
200 E </span><span class="ft0">From WH<br>
27<br>
10957 </span><span class="ft0">Feet MD<br>
10706 </span><span class="ft0">Feet TVD<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
51 </span><span class="ft0">F </span><span class="ft6">N<br>
LF<br>
660<br>
E<br>
L<br>
NENE<br>
13<br>
153<br>
94<br>
McKenzie<br>
Bottom Hole Coordinates From Well Head<br>
KOP Lateral 1<br>
Azimuth Lateral 1<br>
Estimated Total Depth Lateral 1<br>
13159 N </span><span class="ft0">From WH<br>
455 E </span><span class="ft0">From WH<br>
10265 </span><span class="ft0">Feet MD<br>
0<br>
23768 </span><span class="ft0">Feet MD<br>
10711 </span><span class="ft0">Feet TVD<br>
Latitude of Well Head<br>
Longitude of Well Head<br>
NAD Reference<br>
Description of<br>
(Subject to NDIC Approval)<br>
48<br>
02<br>
42.87<br>
-102<br>
42<br>
11.97<br>
NAD83<br>
Spacing Unit:<br>
Secs 13, 24, 25 & 36 T153N R94W<br>
Ground Elevation<br>
Acres in Spacing/Drilling Unit<br>
Spacing/Drilling Unit Setback Requirement<br>
Industrial Commission Order<br>
2136 </span><span class="ft0">Feet Above S.L.<br>
2560<br>
200 </span><span class="ft8">Feet N/S<br>
500<br>
Feet<br>
Feet E/W<br>
24888<br>
North Line of Spacing/Drilling Unit<br>
South Line of Spacing/Drilling Unit<br>
East Line of Spacing/Drilling Unit<br>
West Line of Spacing/Drilling Unit<br>
5282 </span><span class="ft0">Feet<br>
5276 </span><span class="ft0">Feet<br>
21123 </span><span class="ft0">Feet<br>
21119 </span><span class="ft0">Feet<br>
Objective Horizons<br>
Pierre Shale Top<br>
Bakken<br>
1954<br>
Proposed<br>
Size<br>
Weight<br>
Depth<br>
Cement Volume<br>
Surface Casing<br>
9<br>
5/8<br>
36 </span><span class="ft0">Lb./Ft. </span><span class="ft6">2050<br>
Feet<br>
773<br>
Sacks<br>
Proposed<br>
Size<br>
Weight(s)<br>
Longstring Total Depth<br>
Cement Volume<br>
Cement Top<br>
Top Dakota Sand<br>
Longstring Casing<br>
732<br>
Lb./Ft.<br>
10957 </span><span class="ft0">Feet MD<br>
10706 </span><span class="ft0">Feet TVD<br>
918<br>
Sacks<br>
0<br>
Feet<br>
4741<br>
Feet<br>
Base of Last<br>
Last<br>
Salt (If<br>
Charles </span><span class="ft0">Applicable)<br>
Salt (If Applicable)<br>
9083 </span><span class="ft0">Feet<br>
Proposed Logs<br>
CBL/GR from deepest depth obtainable to ground level.<br>
Drilling Mud Type (Vertical Hole - Below Surface Casing)<br>
Drilling Mud Type (Lateral)<br>
Invert<br>
Brine<br>
Survey Type in Vertical Portion of Well<br>
Survey Frequency: Build Section<br>
Survey Frequency: Lateral<br>
Survey Contractor<br>
MWD </span><span class="ft0">Every 100 Feet<br>
30 </span><span class="ft0">Feet<br>
90 </span><span class="ft0">Feet<br>
Leam Drilling Systems<br>
proposed mud/cementing plan,<br>
directional plot/plan, $100 fee.<br>
<hr>
<A name=8></a>Page 2<br>
SFN 54269 (08-2005)<br>
Lateral 2<br>
KOP Lateral 2<br>
Azimuth Lateral 2<br>
Estimated Total Depth Lateral 2<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
F<br>
L<br>
Lateral 3<br>
KOP Lateral 3<br>
Azimuth Lateral 3<br>
Estimated Total Depth Lateral 3<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
F<br>
L<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
F<br>
L<br>
FL<br>
Lateral 4<br>
KOP Lateral 4<br>
Azimuth Lateral 4<br>
Estimated Total Depth Lateral 4<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Lateral 5<br>
KOP Lateral 5<br>
Azimuth Lateral 5<br>
Estimated Total Depth Lateral 5<br>
KOP Coordinates From Well Head<br>
Feet MD<br>
Feet MD<br>
Feet TVD<br>
From WH<br>
From WH<br>
Formation Entry Point Coordinates From Well Head<br>
Bottom Hole Coordinates From Well Head<br>
From WH<br>
From WH<br>
From WH<br>
From WH<br>
KOP Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Bottom Hole Footages From Nearest Section Line<br>
Qtr-Qtr<br>
Section<br>
Township<br>
Range<br>
County<br>
FL<br>
FL<br>
Date<br>
I hereby swear or affirm the information provided is true, complete and correct as determined from all available records.<br>
10 / 23 / 2014<br>
Signature<br>
Printed Name<br>
Title<br>
ePermit<br>
Becky Barnes<br>
Regulatory Compliance Specialist<br>
Email Address(es)<br>
Permit and File Number<br>
API Number<br>
Date Approved<br>
30344<br>
053<br>
06622<br>
12 / 29 / 2014<br>
Field<br>
By<br>
ELM TREE<br>
Alice Webber<br>
Pool<br>
Permit Type<br>
Title<br>
BAKKEN<br>
DEVELOPMENT<br>
Engineering Tech<br>
<hr>
<A name=9></a><hr>
<A name=10></a>April 9, 2014<br>
RE:<br>
Filter Socks and Other Filter Media<br>
Leakproof Container Required<br>
Oil and Gas Wells<br>
Dear Operator,<br>
North Dakota Administrative Code Section 43-02-03-19.2 states in part that all waste material associated with<br>
exploration or production of oil and gas must be properly disposed of in an authorized facility in accord with all<br>
applicable local, state, and federal laws and regulations.<br>
Filtration systems are commonly used during oil and gas operations in North Dakota. The Commission is very<br>
concerned about the proper disposal of used filters (including filter socks) used by the oil and gas industry.<br>
Effective June 1, 2014, a container must be maintained on each well drilled in North Dakota beginning when the<br>
well is spud and must remain on-site during clean-out, completion, and flow-back whenever filtration operations<br>
are conducted. The on-site container must be used to store filters until they can be properly disposed of in an<br>
authorized facility. Such containers must be:<br>
leakproof to prevent any fluids from escaping the container<br>
covered to prevent precipitation from entering the container<br>
placard to indicate only filters are to be placed in the container<br>
If the operator will not utilize a filtration system, a waiver to the container requirement will be considered, but<br>
only upon the operator submitting a Sundry Notice (Form 4) justifying their request.<br>
As previously stated in our March 13, 2014 letter, North Dakota Administrative Code Section 33-20-02.1-01<br>
states in part that every person who transports solid waste (which includes oil and gas exploration and production<br>
wastes) is required to have a valid permit issued by the North Dakota Department of Health, Division of Waste<br>
Management. Please contact the Division of Waste Management at (701) 328-5166 with any questions on the<br>
solid waste program. Note oil and gas exploration and production wastes include produced water, drilling mud,<br>
invert mud, tank bottom sediment, pipe scale, filters, and fly ash.<br>
Thank you for your cooperation.<br>
Sincerely,<br>
Bruce E. Hicks<br>
Assistant Director<br>
<hr>
<A name=11></a><hr>
<A name=12></a><hr>
<A name=13></a><hr>
<A name=14></a><hr>
<A name=15></a><hr>
<A name=16></a><hr>
<A name=17></a><hr>
<A name=18></a><hr>
<A name=19></a>To:<br>
Todd Holweger, NDIC<br>
From: </span><span class="ft4">Shawn Svob<br>
Date: </span><span class="ft4">4/11/2012<br>
Re:<br>
Continental Resources standard CCL, CBL, 4-1/2" liner running and testing procedures<br>
Continental Resources' standard practice for running the cement bond log and casing<br>
caliper log is to run both logs immediately after coming out of the hole after TD, prior to running<br>
the 4-1/2" liner, to the deepest depth obtainable; however, if there are well control concerns that<br>
require us to run the liner sooner, only the CBL will be run and the CCL will be run after setting<br>
the liner.<br>
Based on the CCL results, we determine the actual API minimum burst allowance for the 7"<br>
casing. If the downgraded API burst pressure is below our minimum required frac pressures, we<br>
will run a 4-1/2" frac string; if severe wear or holes are found in the casing, we will run a 5"<br>
cemented, to surface, tie back string.<br>
The CBL log is run in order to determine the top of cement, as required by the NDIC.<br>
Our current 4-1/2" liner program for a 1280 unit is 30, evenly spaced, stages with 29 swellable<br>
packers. The liner shoe is set approximately 180 feet off bottom. The shoe stage below the last<br>
packer has 2 joints, a double valved float, one joint, and a ported guide shoe appx 130 ft. The<br>
liner is run using a running tool on the end of 4" DP. The 7" packer/hanger is set about 40 ft<br>
above KOP between two casing collars but conditions occasionally occur that require setting<br>
higher, either through unexpected failure or in order to isolate casing wear close to KOP.<br>
Recently we have tried 40 stage liners and the trend to explore the optimum stage count will<br>
continue.. Once the liner is at depth, a ball is dropped through the DP, the ball is pressured up<br>
against the setting tool to approximately 2500 psi, and the 7" packer/hanger is set.<br>
A push pull test is done to confirm the hanger has set. Then, a 4500 psi pressure test is<br>
completed on the back side of the 4" DP to confirm the packer has set. The setting tool is then<br>
backed off and the 4" DP/running tool is laid down.<br>
Immediately after the rotary rig has been moved off the well location, the 7" csg and liner<br>
packer/ hanger are tested to the frac pressure. The testers will rig up and test the tubing head to<br>
5000 psi. Next a test plug will be run and set, using wire line, in the top of the 7" packer/hanger.<br>
Testers will pressure up to our frac pressure, typically 8500 psi, to confirm the 7" is ready for<br>
completion.<br>
Shawn Svob<br>
Drilling Operations Coordinator<br>
302 N. Independence<br>
P. O. Box 1032<br>
Enid, Oklahoma 73702<br>
(580) 233-8955<br>
<hr>
<A name=20></a><hr>
<A name=21></a><hr>
<A name=22></a><hr>
<A name=23></a><hr>
<A name=24></a><hr>
<A name=25></a><hr>
<A name=26></a><hr>
<A name=27></a><hr>
<A name=28></a><hr>
<A name=29></a><hr>
<A name=30></a><hr>
<A name=31></a><hr>
<A name=32></a><hr>
<A name=33></a><hr>
<A name=34></a><hr>
<A name=35></a><hr>
<A name="outline"></a><h1>Document Outline</h1>
<ul><li>Form 4
<li>4-OH log waiver
<li>4 - FSW
<ul><li>4 - SOD 90 Days
<li>Form 1
</ul></ul><hr>
</BODY>
</HTML>
|
datamade/elpc_bakken
|
html/pdf/W30344.pdfs.html
|
HTML
|
mit
| 20,471
|
package br.com.pattern.structural.facade;
public class Quadrado implements Forma {
@Override
public void desenha() {
System.out.println("+---------+");
System.out.println("| |");
System.out.println("| |");
System.out.println("| |");
System.out.println("+---------+");
}
}
|
Arivaldo/patterns
|
pattern/src/main/java/br/com/pattern/structural/facade/Quadrado.java
|
Java
|
mit
| 313
|
package io.github.oliviercailloux.javaee_inject_produces_servlets.model;
import java.io.Serializable;
/**
* Class needs to be serializable in order to be useable in the session scope.
*
* @author olivier
*
*/
public class User implements Serializable {
private String name;
public User() {
name = "";
}
/**
* Returns the user name.
*
* @return not <code>null</code>.
*/
public String getName() {
return name;
}
/**
* Sets the user name.
*
* @param name
* <code>null</code> strings are converted to empty strings.
*/
public void setName(String name) {
this.name = name == null ? "" : name;
}
}
|
oliviercailloux/samples
|
JavaEE-Inject-Produces-Servlets/src/main/java/io/github/oliviercailloux/javaee_inject_produces_servlets/model/User.java
|
Java
|
mit
| 649
|
<?php
$titre="Blog | SiteduSavoir.com";
include("../includes/session.php");
include("../includes/identifiants.php");
include("../includes/debut.php");
include("../includes/menu.php");
?>
<ul class="fildariane">
<li><a href="../index.php">Accueil</a></li>
<li><a href="./index.php">Blog</a></li>
</ul>
<div class="page">
<h2 class="titre" > Listes des Articles </h2>
<?php
$managerContenu = new ManagerContenu($bdd);
$page = (!empty($_GET['page']))?$_GET['page']:1;
$articles_par_page = 20 ;
$nombres_articles = $managerContenu->totalDeContenu('article');
$nbre_pages = ceil($nombres_articles / $articles_par_page);
?>
<p class="page">
<?php paginationListe($page ,$nbre_pages, 'index.php'); ?>
</p>
<?php
if($id)
echo '<p class="nouveau-sujet"><img src="../images/icones/new.png"/><a href="../contenus/debutercontenu.php">Ecrire un article </a></p>';
$premierarticle = ($page - 1) * $articles_par_page ;
$infosArticles = $managerContenu->tousLesContenus('article',$premierarticle);
if(!empty($infosArticles))
{
foreach ($infosArticles as $infosArticle)
{
$article = new Contenu($infosArticle);
$managerCategorie = new ManagerCategorie($bdd);
$infosCategorie = $managerCategorie->infosCategorie($article->cat());
$categorie = new Categorie($infosCategorie);
echo
'<div class="tutos">
<div class="banniere">
<img style="width:300px; height: 225px ;" src="../contenus/bannieres/'.$article->banniere().'" alt="banniere"/>
</div>
<div class="tutos-infos">
<h3 class="titre-tuto"><a href="lire.php?article='.$article->id().'">'.htmlspecialchars($article->titre()).'</a></h3>';
$managerAuteur = new ManagerAuteur($bdd);
$infosAuteurs = $managerAuteur->tousLesAuteurs($article->id());
foreach ($infosAuteurs as $infosAuteur)
{
$auteur = new Auteur($infosAuteur);
echo '<span class="auteur-tuto"><a href="../forum/voirprofil.php?m='.$auteur->membre().'">'.$auteur->pseudo().'</a></span>';
}
echo '<span class="cat-tuto">'.$categorie->nom().'</span>
</div>
</div>';
}
}
else
{
echo '<p> Il n y \' a aucun articles actuelement Sur le site
<p>';
}
?>
<p class="pagination">
<?php paginationListe($page ,$nbre_pages, 'index.php'); ?>
</p>
</div>
<?php include "../includes/footer.php"; ?>
|
malnuxstarck/SiteDuSavoir
|
blog/index.php
|
PHP
|
mit
| 2,551
|
import hashlib
import hmac
import json
import requests
class GitHubResponse:
"""Wrapper for GET request response from GitHub"""
def __init__(self, response):
self.response = response
@property
def is_ok(self):
"""Check if request has been successful
:return: if it was OK
:rtype: bool
"""
return self.response.status_code < 300
@property
def data(self):
"""Response data as dict/list
:return: data of response
:rtype: dict|list
"""
return self.response.json()
@property
def url(self):
"""URL of the request leading to this response
:return: URL origin
:rtype: str
"""
return self.response.url
@property
def links(self):
"""Response header links
:return: URL origin
:rtype: dict
"""
return self.response.links
@property
def is_first_page(self):
"""Check if this is the first page of data
:return: if it is the first page of data
:rtype: bool
"""
return 'first' not in self.links
@property
def is_last_page(self):
"""Check if this is the last page of data
:return: if it is the last page of data
:rtype: bool
"""
return 'last' not in self.links
@property
def is_only_page(self):
"""Check if this is the only page of data
:return: if it is the only page page of data
:rtype: bool
"""
return self.is_first_page and self.is_last_page
@property
def total_pages(self):
"""Number of pages
:return: number of pages
:rtype: int
"""
if 'last' not in self.links:
return self.actual_page
return self.parse_page_number(self.links['last']['url'])
@property
def actual_page(self):
"""Actual page number
:return: actual page number
:rtype: int
"""
return self.parse_page_number(self.url)
@staticmethod
def parse_page_number(url):
"""Parse page number from GitHub GET URL
:param url: URL used for GET request
:type url: str
:return: page number
:rtype: int
"""
if '?' not in url:
return 1
params = url.split('?')[1].split('=')
params = {k: v for k, v in zip(params[0::2], params[1::2])}
if 'page' not in params:
return 1
return int(params['page'])
class GitHubAPI:
"""Simple GitHub API communication wrapper
It provides simple way for getting the basic GitHub API
resources and special methods for working with webhooks.
.. todo:: handle if GitHub is out of service, custom errors,
better abstraction, work with extensions
"""
#: URL to GitHub API
API_URL = 'https://api.github.com'
#: URL for OAuth request at GitHub
AUTH_URL = 'https://github.com/login/oauth/authorize?scope={}&client_id={}'
#: URL for OAuth token at GitHub
TOKEN_URL = 'https://github.com/login/oauth/access_token'
#: Scopes for OAuth request
SCOPES = ['user', 'repo', 'admin:repo_hook']
#: Required webhooks to be registered
WEBHOOKS = ['push', 'release', 'repository']
#: Controller for incoming webhook events
WEBHOOK_CONTROLLER = 'webhooks.gh_webhook'
#: URL for checking connections within GitHub
CONNECTIONS_URL = 'https://github.com/settings/connections/applications/{}'
def __init__(self, client_id, client_secret, webhooks_secret,
session=None, token=None):
self.client_id = client_id
self.client_secret = client_secret
self.webhooks_secret = webhooks_secret
self.session = session or requests.Session()
self.token = token
self.scope = []
def _get_headers(self):
"""Prepare auth header fields (empty if no token provided)
:return: Headers for the request
:rtype: dict
"""
if self.token is None:
return {}
return {
'Authorization': 'token {}'.format(self.token),
'Accept': 'application/vnd.github.mercy-preview+json'
}
def get_auth_url(self):
"""Create OAuth request URL
:return: OAuth request URL
:rtype: str
"""
return self.AUTH_URL.format(' '.join(self.SCOPES), self.client_id)
def login(self, session_code):
"""Authorize via OAuth with given session code
:param session_code: The session code for OAuth
:type session_code: str
:return: If the auth procedure was successful
:rtype: bool
.. todo:: check granted scope vs GH_SCOPES
"""
response = self.session.post(
self.TOKEN_URL,
headers={
'Accept': 'application/json'
},
data={
'client_id': self.client_id,
'client_secret': self.client_secret,
'code': session_code,
}
)
if response.status_code != 200:
return False
data = response.json()
self.token = data['access_token']
self.scope = [x for x in data['scope'].split(',')]
return True
def get(self, what, page=0):
"""Perform GET request on GitHub API
:param what: URI of requested resource
:type what: str
:param page: Number of requested page
:type page: int
:return: Response from the GitHub
:rtype: ``repocribro.github.GitHubResponse``
"""
uri = self.API_URL + what
if page > 0:
uri += '?page={}'.format(page)
return GitHubResponse(self.session.get(
uri,
headers=self._get_headers()
))
def webhook_get(self, full_name, hook_id):
"""Perform GET request for repo's webhook
:param full_name: Full name of repository that contains the hook
:type full_name: str
:param hook_id: GitHub ID of hook to be get
:type hook_id: int
:return: Data of the webhook
:rtype: ``repocribro.github.GitHubResponse``
"""
return self.get('/repos/{}/hooks/{}'.format(full_name, hook_id))
def webhooks_get(self, full_name):
"""GET all webhooks of the repository
:param full_name: Full name of repository
:type full_name: str
:return: List of returned webhooks
:rtype: ``repocribro.github.GitHubResponse``
"""
return self.get('/repos/{}/hooks'.format(full_name))
def webhook_create(self, full_name, hook_url, events=None):
"""Create new webhook for specified repository
:param full_name: Full name of the repository
:type full_name: str
:param hook_url: URL where the webhook data will be sent
:type hook_url: str
:param events: List of requested events for that webhook
:type events: list of str
:return: The created webhook data
:rtype: dict or None
"""
if events is None:
events = self.WEBHOOKS
data = {
'name': 'web',
'active': True,
'events': events,
'config': {
'url': hook_url,
'content_type': 'json',
'secret': self.webhooks_secret
}
}
response = self.session.post(
self.API_URL + '/repos/{}/hooks'.format(full_name),
data=json.dumps(data),
headers=self._get_headers()
)
if response.status_code == 201:
return response.json()
return None
def webhook_tests(self, full_name, hook_id):
"""Perform test request for repo's webhook
:param full_name: Full name of repository that contains the hook
:type full_name: str
:param hook_id: GitHub ID of hook to be tested
:type hook_id: int
:return: If request was successful
:rtype: bool
"""
response = self.session.delete(
self.API_URL + '/repos/{}/hooks/{}/tests'.format(
full_name, hook_id
),
headers=self._get_headers()
)
return response.status_code == 204
def webhook_delete(self, full_name, hook_id):
"""Perform DELETE request for repo's webhook
:param full_name: Full name of repository that contains the hook
:type full_name: str
:param hook_id: GitHub ID of hook to be deleted
:type hook_id: int
:return: If request was successful
:rtype: bool
"""
response = self.session.delete(
self.API_URL + '/repos/{}/hooks/{}'.format(
full_name, hook_id
),
headers=self._get_headers()
)
return response.status_code == 204
def webhook_verify_signature(self, data, signature):
"""Verify the content with signature
:param data: Request data to be verified
:param signature: The signature of data
:type signature: str
:return: If the content is verified
:rtype: bool
"""
h = hmac.new(
self.webhooks_secret.encode('utf-8'),
data,
hashlib.sha1
)
return hmac.compare_digest(h.hexdigest(), signature)
@property
def app_connections_link(self):
return self.CONNECTIONS_URL.format(self.client_id)
|
MarekSuchanek/repocribro
|
repocribro/github.py
|
Python
|
mit
| 9,565
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package kroki.app.action;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.io.File;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import kroki.app.KrokiMockupToolApp;
import kroki.app.utils.ImageResource;
import kroki.app.utils.SaveUtil;
import kroki.app.utils.StringResource;
import kroki.profil.subsystem.BussinesSubsystem;
/**
*
* @author Vladan Marsenić (vladan.marsenic@gmail.com)
*/
public class OpenProjectAction extends AbstractAction {
public OpenProjectAction() {
ImageIcon smallIcon = new ImageIcon(ImageResource.getImageResource("action.openProject.smallIcon"));
ImageIcon largeIcon = new ImageIcon(ImageResource.getImageResource("action.openProject.largeIcon"));
putValue(SMALL_ICON, smallIcon);
putValue(LARGE_ICON_KEY, largeIcon);
putValue(NAME, StringResource.getStringResource("action.openProject.name"));
putValue(SHORT_DESCRIPTION, StringResource.getStringResource("action.openProject.description"));
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK + KeyEvent.SHIFT_DOWN_MASK));
}
public void actionPerformed(ActionEvent e) {
JFileChooser jfc = new JFileChooser();
FileFilter filter = new FileNameExtensionFilter("KROKI files", "kroki");
jfc.setAcceptAllFileFilterUsed(false);
jfc.setFileFilter(filter);
int retValue = jfc.showOpenDialog(KrokiMockupToolApp.getInstance().getKrokiMockupToolFrame());
if (retValue == JFileChooser.APPROVE_OPTION) {
File file = jfc.getSelectedFile();
System.out.println("opening from file: " + file.getAbsolutePath());
BussinesSubsystem bussinesSubsystem = (BussinesSubsystem) SaveUtil.loadGZipObject(file);
bussinesSubsystem.setFile(file);
if(bussinesSubsystem != null) {
BussinesSubsystem pr = KrokiMockupToolApp.getInstance().findProject(file);
if(pr != null) {
System.out.println("Postoji");
}else {
KrokiMockupToolApp.getInstance().getWorkspace().addPackage(bussinesSubsystem);
KrokiMockupToolApp.getInstance().getKrokiMockupToolFrame().getTree().updateUI();
}
}else {
JOptionPane.showMessageDialog(KrokiMockupToolApp.getInstance().getKrokiMockupToolFrame(), "Opening failed.");
}
} else {
System.out.println("opening canceled: ");
}
}
}
|
VladimirRadojcic/Master
|
KrokiMockupTool/src/kroki/app/action/OpenProjectAction.java
|
Java
|
mit
| 2,824
|
/* eslint-disable no-param-reassign */
import Vue from 'vue';
export default {
namespaced: true,
state: {
cache: null,
},
mutations: {
setCache(state, value) {
state.cache = value;
},
},
actions: {
get({ state, commit }, cache = true) {
if (cache && state.cache) {
return new Promise((resolve) => {
resolve(state.cache);
});
}
return Vue.http.get('api/server/self-update').then(
response => response.body,
(response) => {
if (response.status === 501) {
return {
current_version: null,
latest_version: null,
channel: 'dev',
supported: false,
error: null,
};
}
throw response;
},
).then((result) => {
commit('setCache', result);
return result;
});
},
async latest() {
const response = await Vue.http.get('https://download.contao.org/contao-manager/stable/contao-manager.version');
return response.body.version;
},
},
};
|
contao/package-manager
|
src/store/server/selfUpdate.js
|
JavaScript
|
mit
| 1,389
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_SBrick_iOS_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_SBrick_iOS_ExampleVersionString[];
|
BarakRL/SBrick-iOS
|
Example/Pods/Target Support Files/Pods-SBrick-iOS_Example/Pods-SBrick-iOS_Example-umbrella.h
|
C
|
mit
| 338
|
# frozen_string_literal: true
class X509CertificateRevokeWorker
include ApplicationWorker
feature_category :source_code_management
idempotent!
def perform(certificate_id)
return unless certificate_id
X509Certificate.find_by_id(certificate_id).try do |certificate|
X509CertificateRevokeService.new.execute(certificate)
end
end
end
|
mmkassem/gitlabhq
|
app/workers/x509_certificate_revoke_worker.rb
|
Ruby
|
mit
| 363
|
$(function () {
$('.imageUploadMultiple').each(function (index, item) {
var $item = $(item);
var $group = $item.closest('.form-group');
var $innerGroup = $item.find('.form-group');
var $errors = $item.find('.errors');
var $input = $item.find('.imageValue');
var flow = new Flow({
target: $item.data('target'),
testChunks: false,
chunkSize: 1024 * 1024 * 1024,
query: {
_token: $item.data('token')
}
});
var updateValue = function () {
var values = [];
$item.find('img[data-value]').each(function () {
values.push($(this).data('value'));
});
$input.val(values.join(','));
};
flow.assignBrowse($item.find('.imageBrowse'));
flow.on('filesSubmitted', function (file) {
flow.upload();
});
flow.on('fileSuccess', function (file, message) {
flow.removeFile(file);
$errors.html('');
$group.removeClass('has-error');
var result = $.parseJSON(message);
var template = $($('#thumbnail_template').html());
template.find('img').attr('src', result.url).attr('data-value', result.value);
$innerGroup.append(template);
updateValue();
});
flow.on('fileError', function (file, message) {
flow.removeFile(file);
var response = $.parseJSON(message);
var errors = '';
$.each(response, function (index, error) {
errors += '<p class="help-block">' + error + '</p>'
});
$errors.html(errors);
$group.addClass('has-error');
});
$item.on('click', '.imageRemove', function (e) {
e.preventDefault();
$(this).closest('.imageThumbnail').remove();
updateValue();
});
$innerGroup.sortable({
onUpdate: function () {
updateValue();
}
});
});
});
|
Malezha/SleepingOwlAdmin
|
resources/assets/js/form/image/initMultiple.js
|
JavaScript
|
mit
| 2,108
|
export class App {
constructor (router) {
this.router = router;
}
configureRouter (config, router) {
this.router = router;
config.map([
{ name: 'orders', route: ['', 'orders'], moduleId: 'modules/orders/index', nav: true, title: "Orders" }
, { name: 'order', route: 'order/:name', moduleId: 'modules/order/index' }
]);
}
}
|
sbxtien/aurelia-test
|
src/app.js
|
JavaScript
|
mit
| 400
|
#include <iostream>
#include <fstream>
#include <seqan/basic.h>
#include <seqan/index.h>
#include <seqan/seq_io.h>
#include <seqan/sequence.h>
#include <seqan/file.h>
#include <seqan/score.h>
#include <seqan/seeds.h>
#include <seqan/align.h>
using namespace seqan;
bool readFASTA(char const * path, CharString &id, Dna5String &seq){
std::fstream in(path, std::ios::binary | std::ios::in);
RecordReader<std::fstream, SinglePass<> > reader(in);
if (readRecord(id, seq, reader, Fasta()) == 0){
return true;
}
else{
return false;
}
}
std::string get_file_contents(const char* filepath){
std::ifstream in(filepath, std::ios::in | std::ios::binary);
if (in){
std::string contents;
in.seekg(0, std::ios::end);
int fileLength = in.tellg();
contents.resize(fileLength);
in.seekg(0, std::ios::beg);
in.read(&contents[0], contents.size());
in.close();
return(contents);
}
throw(errno);
}
bool writeSeedPositions(std::vector< std::pair<unsigned, unsigned> > &array1, std::vector< std::pair<unsigned, unsigned> > &array2, const char* filepath){
std::ifstream FileTest(filepath);
if(!FileTest){
return false;
}
FileTest.close();
std::string s;
s = get_file_contents(filepath);
std::string pattern1 = ("Database positions: ");
std::string pattern2 = ("Query positions: ");
std::pair<unsigned, unsigned> startEnd;
std::vector<std::string> patternContainer;
patternContainer.push_back(pattern1);
patternContainer.push_back(pattern2);
for (unsigned j = 0; j < patternContainer.size(); ++j){
unsigned found = s.find(patternContainer[j]);
while (found!=std::string::npos){
std::string temp1 = "";
std::string temp2 = "";
int i = 0;
while (s[found + patternContainer[j].length() + i] != '.'){
temp1 += s[found + patternContainer[j].length() + i];
++i;
}
i += 2;
while(s[found + patternContainer[j].length() + i] != '\n'){
temp2 += s[found + patternContainer[j].length() + i];
++i;
}
std::stringstream as(temp1);
std::stringstream bs(temp2);
int a;
int b;
as >> a;
bs >> b;
startEnd = std::make_pair(a, b);
if (j == 0){
array1.push_back(startEnd);
}
else{
array2.push_back(startEnd);
}
++found;
found = s.find(patternContainer[j], found);
}
}
return true;
}
int main(int argc, char const ** argv){
CharString idOne;
Dna5String seqOne;
CharString idTwo;
Dna5String seqTwo;
std::vector< std::pair<unsigned, unsigned> > seedsPosSeq1;
std::vector< std::pair<unsigned, unsigned> > seedsPosSeq2;
if (!readFASTA(argv[1], idOne, seqOne)){
std::cerr << "error: unable to read first sequence";
return 1;
}
if (!readFASTA(argv[2], idTwo, seqTwo)){
std::cerr << "error: unable to read second sequence";
return 1;
}
if (!writeSeedPositions(seedsPosSeq1, seedsPosSeq2, argv[3])){
std::cerr << "error: STELLAR output file not found";
return 1;
}
typedef Seed<Simple> SSeed;
typedef SeedSet<Simple> SSeedSet;
SSeedSet seedSet;
for (unsigned i = 0; i < seedsPosSeq1.size(); ++i){
std::cout << "Seq1 " << seedsPosSeq1[i].first << '\t' << seedsPosSeq1[i].second << std::endl;
std::cout << "Seq2 " << seedsPosSeq2[i].first << '\t' << seedsPosSeq2[i].second << std::endl;
}
for (unsigned i = 0; i < seedsPosSeq1.size(); ++i){
SSeed seed(seedsPosSeq1[i].first, seedsPosSeq2[i].first, seedsPosSeq1[i].second, seedsPosSeq2[i].second);
std::cout << seed;
addSeed(seedSet, seed, Single());
std::cout << "Front: " << beginPositionH(front(seedSet));
std::cout << std::endl << "back: " << beginPositionH(back(seedSet));
std::cout << std::endl;
}
/*typedef Iterator<SSeedSet >::Type SetIterator;
for (SetIterator it = begin(seedSet); it != end(seedSet); ++it){
std::cout << *it;
std::cout << std::endl;
}
*/
seqan::String<SSeed> seedChain;
chainSeedsGlobally(seedChain, seedSet, seqan::SparseChaining());
DnaString window1 = infix(seqOne, endPositionH(seedChain[0]), beginPositionH(seedChain[1]));
DnaString window2 = infix(seqTwo, endPositionV(seedChain[0]), beginPositionV(seedChain[1]));
std::cout << "window1: " << window1 << std::endl;
std::cout << "window2: " << window2 << std::endl;
//typedef Index<DnaString, IndexQGram<GappedShape<HardwiredShape<1, 2> > > > index("");
std::cout << "length(seedChain): " << length(seedChain) << std::endl;
std::cout << "seedChain[0]: " << seqan::beginPositionH(seedChain[0]) << std::endl;
std::cout << "seedChain[1]: " << seedChain[1] << std::endl;
std::cout << "seedChain[2]: " << seedChain[2] << std::endl;
/*std::cout << "test2" << std::endl;
Align<Dna5String, ArrayGaps> alignment;
resize(seqan::rows(alignment), 2);
Score<int, Simple> scoringFunction(2, -1, -2);
seqan::assignSource(seqan::row(alignment, 0), seqOne);
seqan::assignSource(seqan::row(alignment, 1), seqTwo);
int result = bandedChainAlignment(alignment, seedChain, scoringFunction, 2);
std::cout << "Score: " << result << std::endl;
std::cout << alignment << std::endl;
*/
/*std::cout << idOne << std::endl << seqOne << std::endl;
std::cout << idTwo << std::endl << seqTwo << std::endl;
for (unsigned i = 0; i < seedsPosSeq1.size(); ++i){
cout << "Seq1 " << seedsPosSeq1[i].first << '\t' << seedsPosSeq1[i].second << endl;
cout << "Seq2 " << seedsPosSeq2[i].first << '\t' << seedsPosSeq2[i].second << endl;
}
*/
return 0;
}
|
bkahlert/seqan-research
|
raw/pmsb13/pmsb13-data-20130530/sources/130wu1dgzoqmxyu2/2013-04-28T18-18-26.953+0200/sandbox/my_sandbox/apps/lagan_neu/lagan_neu.cpp
|
C++
|
mit
| 5,364
|
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { Router, hashHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import routes from './routes';
import configureStore from './store/configureStore';
import '../resources/fonts/fonts.global.css';
import './app.global.css';
const store = configureStore();
const history = syncHistoryWithStore(hashHistory, store);
render(
<Provider store={store}>
<Router history={history} routes={routes} />
</Provider>,
document.getElementById('root')
);
|
zackhall/ack-chat
|
app/index.js
|
JavaScript
|
mit
| 599
|
# [uiTable](http://berndwessels.github.io/angular-ui-table)
A faster and better AngularJS data grid.
***
## Examples
See uiTable in action here [http://berndwessels.github.io/angular-ui-table](http://berndwessels.github.io/angular-ui-table).
## Usage
### 1. Install It
uiTable is available through Bower, so this is by far the easiest way to
obtain it. Just run:
```sh
$ bower install --save-dev ui-table
```
This will download the latest version of uiTable and install it into your
Bower directory (defaults to components). Boom!
### 2. Incorporate It
Now you have to add the script file to your application. You can, of course,
just add a script tag. If you're using ngBoilerplate or any of its derivatives,
simply add it to the `vendor.js` array of your `Gruntfile.js`:
```js
vendor: {
js: [
// ...
'vendor/ui-table/ui-table.min.js',
// ...
]
},
```
However you get it there, as soon as it's in your build path, you need to tell
your app module to depend on it:
```js
angular.module( 'myApp', [ 'uiTable', /* other deps */ ] );
```
Also be sure to include the stylesheet. In ngBoilerplate, simply import
`ui-table.less` into your `main.less` file.
Now you're ready to go! Sweet.
### 3. Use It
## Motivation
Almost every enterprise application needs a data grid. Unfortunately AngularJS is very slow and so far the only available grid I knew of was ngGrid. It looks good at first sight, but it has horrible performance. In the corporate world there are still many clients out there running on slow machines and old browsers on which ngGrid is just too slow.
The ui-table component is designed to address the performance issues of AngularJS but still offering all the features you can expect from a data grid. It offers modes for slower hardware and is strictly designed to please the user.
## Contributing
Contributions are encouraged! There is a lot to be done.
Missing and new features have to be added. Bugs have to be fixed (if there are any;). And there is always a way to sqeeze more performance out of it.
## Shameless Self-Promotion
Like uiTable? Star this repository to let me know! If this got you particulary
tickled, you can even follow me on [GitHub](http://github.com/berndwessels),
[Twitter](http://twitter.com/berndwessels),
[Google+](http://gplus.to/berndwessels), or
[LinkedIn](http://linkedin.com/in/berndwessels).
Enjoy.
|
BerndWessels/angular-ui-table
|
README.md
|
Markdown
|
mit
| 2,386
|
<html>
<head>
<title>资源与账</title>
<meta charset="utf-8">
<link rel="stylesheet" href="github-markdown.css">
<style>
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
</style>
</head>
<body>
<article class="markdown-body">
<h2>简介</h2>
<p>现在我们已经知道,管理软件首要管理的是资源,那么企业通常有哪些资源呢?</p>
<p>最常见的就是钱,比如你可以说这个企业现在有1,000,000人民币,其中200,000万的现金以及800,000万的银行存款。还有一种常见的是物料,例如A仓库里面有10,000瓶X牌可乐成品,还有20吨的X牌可乐原浆,这些资源我们可以使用数量来衡量他的量。</p>
<p>有些种类的资源具有时间的敏感性,例如加工机床,我们在评估这个资源时,不仅关心它有几台机床,还关心这些机床在今天能够提供多少小时的加工服务。</p>
<p>在软件设计中,我们使用账来记录这些资源的变动情况,并通过此信息查询到某个时间点这些资源的量。下面我们将逐一介绍帐处理的各个要素。</p>
<h2>账的要素</h2>
<h3>数量</h3>
<p>数量是评估资源的基础,在发生变动时,我们使用数量描述变动的量,例如卖了3瓶X牌可乐,这里的3就是数量。在查询某个时间点的资源的量时,也使用数量,例如当前我的库存有100瓶X牌可乐。数量是一个数字,因此他是可以计算的,例如我可以将这个月的所有销售的X牌可乐的数量进行累加,得到这个月的销售数量。</p>
<p>但是,不是数量之间都可以计算的,这个计算是有前提的,例如你不能将3瓶的瓶装X牌可乐与散装的1吨原料进行累加,也不能将100元人民币与200美元进行累加。</p>
<h3>单位</h3>
<p>数量一定与单位关联,你必须说3<em>瓶</em>可乐,或者100<em>元</em>人民币,或者3.25<em>千克</em>的猪肉。因此,变动信息除包含数量外,还应该包含单位。但在实践中,我们将单位与具体的资源主体强关联,意思是我们在X牌可乐这个物料资源中,明确指明唯一单位是<em>瓶</em>,在X牌可乐原浆中明确指明单位是<em>吨</em>,人民币这个资源的唯一单位就是<em>元</em>。这样我们就不必在任何单据或账中指明单位了。</p>
<p>那么如果存在12瓶组合的箱包装呢?同样基于设计的便利,我们会建议建立另外一个物料<em>12瓶组合装X牌可乐</em>,其唯一的单位是箱。当然他们存在一定的转换关系,这个在后续的文章中会讨论。</p>
<blockquote><p>问题:现实中人民币有元、角和分,我们需要建立3笔不同的记录吗?毛里塔尼亚的货币单位不是十进制,而是规定1乌吉亚等于5考姆斯,那么需要建立两笔记录吗?</p></blockquote>
<h3>精度</h3>
<p>在记录资源变动的数量时,我们还会限制精度,例如X牌可乐,我们无论如何都只允许整数,不会卖2.5瓶可乐。但是猪肉我们却可以卖3.25千克,他的精度是2位。在实践中,精度同样与特定的资源项关联,这样当销售X牌可乐时,自然就限定了只能是整数。</p>
<p>有些软件,会设计精度与不同的活动也有关,例如在财务统计中,人民币可能会精确到小数4位,但在销售活动中,销售金额就只能到分,甚至大宗交易到元,但这不影响最终帐的帐的精度,他们使用需要小于或等于最小记账精度,但我个人认为把事情复杂化了。</p>
<h3>主资料和规格</h3>
<p>发生变动的资源既是主资料,例如:<em>X牌可乐</em>,<em>X牌可乐原浆</em>,<em>人民币</em>,这些都是主资料。他起到识别资源变动时键的作用。</p>
<p>但很多复杂的需求中,主资料还需要加上规格来作为键,例如鞋是包含尺码的,X牌跑鞋 38码,这时才能在采购接收和出货时控制不同尺码的数量。下面罗列了常见的规格:</p>
<ul>
<li>尺码:常见在鞋、服装这些商品应用中;</li>
<li>颜色:范围很广,例如服装,大家电,汽车都有颜色的区分;</li>
<li>工艺:常见于五金材料,零配件等,某些商品完全通用,但他们制作的工艺和材质不同,造成售价不同;</li>
<li>批次:在医药、食品行业使用最多,即使同一商品,同一工艺,可能只是生产的时间或锅炉不同,定义了不同的批次,用于追溯生产,如果某个批次的商品出现问题,同一批次的商品可能需要追回;</li>
</ul>
<p>在这些案例中,你也许注意到,商品可能没有任何规格,例如<em>人民币</em>,也可能只有一个,例如<em>X牌跑鞋 38码</em>,也可能包含多个规格,例如<em>X牌羊毛外套 L码 红色</em>;</p>
<h3>变动方向</h3>
<p>当我们采购一批商品入库时,这个仓库的商品资源是增加的,而当我们销售出库时,仓库的商品资源是减少。如果这个商品又被退回时,库存还是增加,这个商品如果已经损害,需要报废,资源再次减少。</p>
<p>所以发生增加或减少,可以是很多种活动造成,依据职责单一原则,一般将变动方向与发生的活动分开处理,而变动方向使用正负号来表示,比如采购接收就是+3,出货是-3,销售退货,记+3,报废记-3。</p>
<p>至于变动的种类(采购入库、销售出库、销售退回或报废等),属于辅助性信息,用于帮助创建各种报表,不在我们讨论的要素之列。</p>
<p>财务系统中,使用借贷来描述变动方向,但他在不同的科目下其表示的增加和减少是不同的,所以我倾向于内部使用统一的概念处理。</p>
<h3>日期</h3>
<p>账还需要记录资源变动发生的时间点,这对于统计很有用,例如你可以统计: 某天12点整X牌可乐当时仓库有多少瓶,同样的你也可以统计当前还有多少瓶。还可以统计上个月x牌可乐采购接收、销售、退回或报废了多少。</p>
<h3>实际发生和预期发生</h3>
<p>在记录资源的变动时,除了已经发生的变动,我们还可以记录未来可能的变动。例如仓库现在有1000瓶X牌可乐,我已经向供应商预定了2000瓶,明天到货,那么当客户向我预定后天送3500瓶可乐时,我就知道还缺货500瓶而不是2500瓶。</p>
<p>另外一个好处是,你可以获取一个清单,告诉你最近几天你需要督促供应商供应的清单,同时,也告诉自己准备哪些商品发送给客户。</p>
<p>对于未来预期的减少,某些需求需要锁定机制,这超出了当前文章的范围,之后讨论。</p>
<h3>位置</h3>
<p>资源需要存放在某个位置,常见的概念就是仓库,一个企业可能多个仓库,这个时候我需要知道X牌可乐是放在哪个仓库。</p>
<p>有些企业还需要精细到库位,知道商品到底放在哪个位置,一般采用库、架、层、位,但对于账来说就是一个Id,在变动时必须指明。</p>
<p>对于组织内的资源移动,通常记出库组织资源的减少,入库组织资源的增加,如果还存在在途的管理,相当于移动的过程再增加<em>在途仓库</em>这个位置。</p>
<p><em>位置</em>在软件设计上,还涉及安全的处理,某个位置的资源必然有保管人,例如A仓库的出库员不能将B仓库的商品报废了,或者两个不同的事业部,他们的出纳不能拿对方的钱。</p>
<h3>来源</h3>
<p>账的变化不能是平白无故的,必然是因为某个企业的活动造成的,所以在帐上要体现发生变动的活动来源,用来追溯来源。</p>
<p>可能你会问,库存盘点时,发现真实库存与账面库存不符时,真的平白无故减少资源的,这种情况其实还是<em>盘亏</em>这个活动造成。</p>
<h3>货主</h3>
<p>在京东有第三方卖家,会将货物存放到京东的仓库,在销售后由京东代为发货,对于京东来说,他的系统在管理库存时,就需要区分仓库里面同样一种商品,可能是自己的,也可能是第三方卖家的,也就是说存货的这些商品是有货主的。<p>
<h2>表结构的设计</h2>
<p>在了解这些需求之后,我们开始设计表结构,注意,这里及其以后文章的设计都是基于当前的知识进度,不作为最终ERP设计的成果,在后面的章节中很可能还会变动,另外本表设计可能使用弹性域等高级设计。</p>
<h3>库存流水账表</h3>
<p>首先定义流水账表,也称为日志表,交易表,用于记录资源的所有变动,不同资源类型将定义不同的表,例如库存的定义库存流水账表,而财务的定义财务流水账表,会员积分的也定义一张新表。<p>
<p>注意<em>帐</em>这类的表,其数据永远不会让用户直接录入,他们都是在业务单据(活动)生效时插入的,这有利于屏蔽业务单据复杂的业务设计,仅仅关注库存资源的变动。</p>
<table>
<tr>INV.MaterialTransactions 库存流水账表(范例) </tr>
<tr>
<th>字段名</th>
<th>类型</th>
<th>说明</th>
</tr>
<tr>
<th>MaterialTransactionId</th>
<th>int</th>
<th>表的无意义主键。</th>
</tr>
<tr>
<th>TransactionDate</th>
<th>datetime</th>
<th>交易发生的具体时间或预计未来发生的时间。</th>
</tr>
<tr>
<th>IsVirtual</th>
<th>bool</th>
<th>false表示交易是真实发生的,true表示未来预期发生的,</th>
</tr>
<tr>
<th>TransactionSource_TypeId</th>
<th>int</th>
<th>交易引证的来源类型编号,指向SYS.Elements。</th>
</tr>
<tr>
<th>TransactionSource_Id</th>
<th>int</th>
<th>交易引证的来源编号,例如采购单的明细编号。</th>
</tr>
<tr>
<th>TransactionObjectId</th>
<th>int</th>
<th>交易对象的弹性域对象编号,指向交易对象表,最终描述物料、尺码等信息。</th>
</tr>
<tr>
<th>LocatorId</th>
<th>int</th>
<th>交易对象存放的位置编号,指向存放位置的弹性域。</th>
</tr>
<tr>
<th>OwnerId</th>
<th>int</th>
<th>交易对象的所有者,指向所有者的弹性域。</th>
</tr>
<tr>
<th>Qua</th>
<th>decimal</th>
<th>交易发生的数量,正数是增加,负数是减少。可以包含小数。</th>
</tr>
</table>
<p>表的每行主要记录了:什么<em>时候</em>,什么<em>活动</em>造成什么<em>东西</em>从什么<em>地方</em>增加或减少了<em>多少</em>。</p>
<h3>来源类型表</h3>
<p>辅助性的表还包括:</p>
<table>
<tr>SYS.Elements 来源类型表(范例) </tr>
<tr>
<th>字段名</th>
<th>类型</th>
<th>说明</th>
</tr>
<tr>
<th>ElementId</th>
<th>int</th>
<th>类型的无意义主键</th>
</tr>
<tr>
<th>ElementName</th>
<th>string</th>
<th>元素唯一名称,也可以理解是表名称,例如来源是销售订单明细表,此值为:SalesOrderItems</th>
</tr>
<tr>
<th>Caption</th>
<th>string</th>
<th>元素的本地化名称,例如来源是销售订单明细表,此值为:销售订单明细表</th>
</tr>
</table>
<h3>交易对象表</h3>
<table>
<tr>INV.TransactionObject 交易对象(范例) </tr>
<tr>
<th>字段名</th>
<th>类型</th>
<th>说明</th>
</tr>
<tr>
<th>TransactionObjectId</th>
<th>int</th>
<th>交易对象的无意义主键</th>
</tr>
<tr>
<th>Code</th>
<th>string</th>
<th>交易对象的完整编码,他是弹性域组合后的代码。</th>
</tr>
<tr>
<th>Caption</th>
<th>string</th>
<th>交易对象的完整显示名称,他是弹性域组合后的名称。</th>
</tr>
<tr>
<th>UnitId</th>
<th>int</th>
<th>交易对象的定义组织编号</th>
</tr>
<tr>
<th>ItemId</th>
<th>int</th>
<th>指向物料对象。</th>
</tr>
<tr>
<th>SizeId</th>
<th>int</th>
<th>这里是一个示例,依据实施时的弹性域设置动态出现。</th>
</tr>
</table>
</article>
</body>
</html>
|
MyErpSoft/System.ERP.Documents
|
zh-chs/02 Resources and Sheet.html
|
HTML
|
mit
| 14,210
|
<?php
/**
* @xmlNamespace http://schema.intuit.com/finance/v3
* @xmlType SalesTransaction
* @xmlName IPPSalesReceipt
* @var IPPSalesReceipt
* @xmlDefinition SalesReceipt Transaction entity
*/
class IPPSalesReceipt
extends IPPSalesTransaction {
/**
* Initializes this object, optionally with pre-defined property values
*
* Initializes this object and it's property members, using the dictionary
* of key/value pairs passed as an optional argument.
*
* @param dictionary $keyValInitializers key/value pairs to be populated into object's properties
* @param boolean $verbose specifies whether object should echo warnings
*/
public function __construct($keyValInitializers=array(), $verbose=FALSE)
{
foreach($keyValInitializers as $initPropName => $initPropVal)
{
if (property_exists('IPPSalesReceipt',$initPropName))
{
$this->{$initPropName} = $initPropVal;
}
else
{
if ($verbose)
echo "Property does not exist ($initPropName) in class (".get_class($this).")";
}
}
}
/**
* @Definition Extension entity for SalesReceipt
* @xmlType element
* @xmlNamespace http://schema.intuit.com/finance/v3
* @xmlMinOccurs 0
* @xmlMaxOccurs 1
* @xmlName SalesReceiptEx
* @var com\intuit\schema\finance\v3\IPPIntuitAnyType
*/
public $SalesReceiptEx;
} // end class IPPSalesReceipt
|
emoxie/quickbooks-sdk
|
src/Data/IPPSalesReceipt.php
|
PHP
|
mit
| 1,695
|
# doublycircular
Doubly Circular linked list with iterator and array-like interface
[](https://travis-ci.org/rampantmonkey/node-doublycircular) [](https://www.npmjs.org/package/doublycircular) [](http://opensource.org/licenses/MIT)
## Properties
- `DoublyCircular.length`
- `DoublyCircular.prototype`
## Methods
### Mutator methods
- `DoublyCircular.prototype.pop()` remove last item added to the list
- `DoublyCircular.prototype.push()` add new item to the list
- `DoublyCircular.prototype.reverse()` swap next and previous for each item
- `DoublyCircular.prototype.shift()` remove item from beginning of list
- `DoublyCircular.prototype.unshift()` insert item at beginning of list
### Accessor methods
- `DoublyCircular.prototype.concat()` merge two doubly circular lists into a new one
- `DoublyCircular.prototype.join()` return a string containing all of the items in the list with an optional separator
- `DoublyCircular.prototype.toArray()` return an array containing all of the items in the list
### Iteration methods
- `DoublyCircular.prototype.every()` check if `callback` is true for every item
- `DoublyCircular.prototype.filter()` create new list with only the items for which `callback` is true
- `DoublyCircular.prototype.find()` return the first item in the list after `current` for which `callback` is true
- `DoublyCircular.prototype.forEach()` invoke `callback` function for each item in the list
- `DoublyCircular.prototype.forEachCCW()` same as `forEach()` but opposite iteration direction
- `DoublyCircular.prototype.include()` return `true` if any item in the list threequals (`===`) the parameter
- `DoublyCircular.prototype.map()` create a new list with each item's data containing the result of the callback
- `DoublyCircular.prototype.reduce()` apply `callback` against accumulator and each value in the list
- `DoublyCircular.prototype.reduceCCW()` same as `reduce()` but opposite iteration direction
- `DoublyCircular.prototype.some()` check if `callback` is true for any item
## Contributing
Make sure that the test suite passes after your changes.
You should also have tests that cover the new functionality or demonstrate the bug fix.
The test suite is written on top of [mocha](https://github.com/visionmedia/mocha).
To run the test suite just type `make`.
This will download all of the dependencies (if not already installed) and run the tests.
## License
_This software - © Casey Robinson 2014 - is released under the MIT license._
You can find a copy in [LICENSE.txt](LICENSE.txt) or at [opensource.org](http://opensource.org/licenses/MIT).
|
rampantmonkey/node-doublycircular
|
README.md
|
Markdown
|
mit
| 2,855
|
@echo off
call %LOCAL_SETUP%
call %LOCAL%\etc\fstab.bat
call logging.bat PCðN®µÜµ½
taskkill /f /im explorer.exe & start explorer
REM RC_INIT
set FOLD=%LOCAL%\sched\rc.init
if exist %FOLD% (
CD /d %FOLD%\
for /f "usebackq" %%i in (`dir /b /a-d`) do (
call start cmd /c "%%i"
call wait 3
)
)
REM RC_INIT2
set FOLD=%LOCAL%\sched\rc.init2
if exist %FOLD% (
CD /d %FOLD%\
for /f "usebackq" %%i in (`dir /b /a-d`) do (
call start cmd /c "%%i"
call wait 3
)
)
call wait 3
cd /d C:
if exist %LOCAL%\sched\rc.init2 REN %LOCAL%\sched\rc.init2 _rc.init2
|
kunst1080/BatLibrary
|
bin/Startup.bat
|
Batchfile
|
mit
| 598
|
---
layout: post
title: Trying out Ruby [‘and’, ’on’] Rails
tags: ruby rails
---
# Ruby
I joined [Altizon Systems](http://altizon.com) in August and we have our backend primarily in Ruby on Rails. In the first week, I setup the environment and before directly going to rails framework I started looking for “Getting started with Ruby” guides.
Soon I realised the popularity of ruby is not overrated. Ruby is a beautiful language indeed, also one other thing I liked is that, it has much similarity with python. Since my first two task of [GSoC](http://sitaramshelke.me/gsoc16) were in Python, I have had a pretty good hands on it.
These includes features like dynamic typing, exception handling, and object oriented nature. Ruby specifically enhances object orientated nature by allowing builtin method overriding and having syntax like
3.times
where ‘3’ is an instance of Numeric class with value 3.
Although everything I liked, one thing that bothered me is the optional functional brackets.
So in ruby, consider a function brr with two integer arguments a and b. I can call the function as
value = brr 2 4
This is fine but if brr has no arguments and defined somewhere else then
value = brr
Seems to make me confuse and look for brr as a variable inside my file. I know this is not a very serious problem, but as a beginner it took me sometime to figure out these new things which I have not seen before.
# Rails
I could only spend a little time on core ruby and turned to what actually we use; the popular Ruby on Rails framework. I have tried my hands at MVC frameworks before, in Golang to be specific and I really enjoyed it.
At that time I always wondered people saying that, ruby on rails has a very short development time and no doubt I experienced it very soon. The various command line utilities that rails comes with are awesome. This really shortens the building of Models and Controllers. Basically gives you a head start by generating simple code, which you can make complex by adding your specific requirements. Nice!
But mind that autogenerated code always comes with some hidden logics that are very hard to find inside the code. Especially when you are a beginner like me, you come from other language backgrounds and codebase is large — there are 10+ models and even more controllers. Simple things such as a `has many` rule in rails which is used to associate a relationship among two models will automatically insert a `ParentModelName_id` field inside child model. This is perfectly right but I didn’t know these things and it took some time for me to figure this out.
Now it’s been a month and I am happy with ruby and/on rails experience. All these opinions are personal and no language wars intended.
This journey has just started and let me know if have any suggestions for me.
That's all folks.
|
sitaramshelke/sitaramshelke.github.io
|
_posts/2016-09-05-trying-ruby-and-or-rails.md
|
Markdown
|
mit
| 2,935
|
---
layout: post
title: Location Location Location Matters... sort of
---
'Location, Location, Location.' It's a real estate platitude. Some consider location the greatest influence on home prices. But is it true?

In Ames, Iowa, location is one of many predictors of price, but it's not the most important predictor.
For sure, different neighborhoods command different prices. Just look at the box plot of Ames prices by neighborhood. Homes sell in some areas in excess of $500,000, while others cannot crack the $200,000 threshold. This is strong evidence that location matters above all else.

Nevertheless, there are strong, if not stronger influences on home prices in Ames, at least between 2006 - 2010.
The overall quality of a home has a strong linear relationship with home prices as demonstrated by the box plots below. As the quality of a home rises, so does it price.

The square footage of a home also has a strong upward influence on home prices.

In fact, the above ground square footage of a home is the greatest predictor when compared to all other variables.
If we run a regression analysis on the Ames data set, we see that the largest coefficients-- that is the five biggest influences on price-- are the above ground square footage; a single pricey neighborhood; the year built; the overall quality of a home; and another pricey neighborhood. Every other location is subordinate to these five variables.

So, yes, location does matter, but when predicting homes in Ames, the size, quality and age of a home matter too. In fact, one can predict with fair accuracy the the price of a home based on the above variables, though inclusion of every neighborhood increases the accuracy of that model by roughly 10 percent.
|
MisterCoffey/MisterCoffey.github.io
|
_posts/2017-02-16-AmesHousingI.md
|
Markdown
|
mit
| 2,016
|
---
title: Hobbiton Tours
listing-type: attractions
island: north
region: waikato
destination: Waikato
order: a
image-path: hobbiton-tours.jpg
image-alt: Hobbiton Tours
refer-url: http://www.hobbitontours.com/
---
Offers informative and entertaining tours of the Lord of the Rings and The Hobbit's Hobbiton filming location on private farmland near Matamata.
|
NZescape/nzescape.github.io
|
_listings/north/waikato/hobbiton-tours.md
|
Markdown
|
mit
| 360
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Maze Generator - HTML5 / Javasript Maze Generating Algorithm Fun</title>
<link rel="stylesheet" href="../css/normalize.css" />
<link rel="stylesheet" href="../css/foundation.css" />
<style>
body {
overflow: hidden;
}
.row-header .columns {
font-size: 20px;
}
.row-header h1 {
font-size: 1em;
}
.row-header h2, .row.ad h2 {
font-size: 0.8em;
}
.row-options .columns .row .columns label {
font-size: 10px;
}
.row-options .columns {
font-size: 14px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#maze-io {
line-height: 7px;
}
#maze-io input {
margin-bottom: 0;
}
h1 {
margin-bottom: 0em;
}
#maze-container {
position: relative;
width: 100%;
overflow: auto;
}
.maze {
margin: 0 auto;
}
.cell {
border: 1px solid rgba( 0, 0, 0, 0.25 );
float: left;
box-sizing: border-box;
}
.visited {
background-color: rgba( 225, 217, 186, 0.5);
}
.complete {
background-color: rgba( 225, 179, 23, 0.5 );
border-color: #000000;
}
.start {
background-color: #5da423;
}
.finish {
background-color: #c60f13;
}
.for-print {
visibility: hidden;
display: none;
}
.print-mode {
overflow: auto;
}
.print-mode .for-print {
visibility: visible;
display: inline;
}
.print-mode .for-screen {
visibility: hidden;
display: none;
}
.print-mode .complete {
background-color: #ffffff;
}
.print-mode .start, .print-mode .finish {
background-color: #cccccc;
}
.print-mode .mc-row {
width: 100%;
max-width: 100%;
}
.print-mode .mc-row .columns {
padding: 0;
}
.print-mode #maze-container {
height: auto;
}
.s {
border-bottom-color: rgba( 0,0,0,0 );
}
.n {
border-top-color: rgba( 0,0,0,0 );
}
.e {
border-right-color: rgba( 0,0,0,0 );
}
.w {
border-left-color: rgba( 0,0,0,0 );
}
.distance-0 {
background-color: rgba( 255, 0, 0, 0.0 );
}
.distance-1 {
background-color: rgba( 255, 0, 0, 0.1 );
}
.distance-2 {
background-color: rgba( 255, 0, 0, 0.2 );
}
.distance-3 {
background-color: rgba( 255, 0, 0, 0.3 );
}
.distance-4 {
background-color: rgba( 255, 0, 0, 0.4 );
}
.distance-5 {
background-color: rgba( 255, 0, 0, 0.5 );
}
.distance-6 {
background-color: rgba( 255, 0, 0, 0.6 );
}
.distance-7 {
background-color: rgba( 255, 0, 0, 0.7 );
}
.distance-8 {
background-color: rgba( 255, 0, 0, 0.8 );
}
.distance-9 {
background-color: rgba( 255, 0, 0, 0.9 );
}
.distance-10 {
background-color: rgba( 255, 0, 0, 1 );
}
#updates {
position: fixed;
top: 20px;
right: -530px;
width: 600px;
padding: 0.5em;
max-height: 500px;
}
#updates .large-9 {
max-height: 480px;
overflow: auto;
}
#updates h1 {
cursor: pointer;
}
.ad {
margin-top: 20px;
}
.ad > div > div {
margin: 0 auto;
width: 468px;
}
</style>
<script src="lib.js" type="text/javascript"></script>
<script src="maze.js" type="text/javascript"></script>
<script src="demo.js" type="text/javascript"></script>
</head>
<body>
<div class="row row-header">
<div class="12-large columns">
<h1>Maze Generator</h1>
<h2>An HTML5 / JavaScript maze generation engine and algorithm</h2>
</div>
</div>
<div class="row row-options for-screen">
<div class="large-12 columns">
<div class="row">
<div id="maze-draw" class="large-12 columns maze-input">
<ul class="large-block-grid-4">
<li>
<label for="grid-width">Maze Width (in cells)</label>
<input type="text" id="grid-width" value="40" />
</li>
<li>
<label for="grid-height">Maze Height (in cells)</label>
<input type="text" id="grid-height" value="20" />
</li>
<li>
<label for="cell-size">Cell Size (in px)</label>
<input type="text" id="cell-size" value="20" />
</li>
<li>
<label for="maze-style">
Style Modifier (0: Winding to 100: Dead Ends)
</label>
<input type="text" id="maze-style" value="50" />
</li>
</ul>
</div>
<div id="maze-io" class="large-12 columns maze-input">
<input type="text" id="maze-savestring" /><br />
<a class="button tiny secondary" id="save-maze">Get Maze String</a>
<a class="button tiny secondary" id="load-maze">Load Maze String</a>
</div>
</div>
<div class="row row-buttons">
<div class="large-12 columns">
<div class="left">
<a class="button tiny secondary" id="io-button">Import / Export Maze</a>
<a class="button tiny secondary" id="toggle-heatmap">Toggle Heat Map View</a>
Zoom: <a class="button tiny secondary" id="zoom-out">-</a>
<a class="button tiny secondary" id="zoom-in">+</a>
<a class="button tiny secondary" id="enter-printmode">Enter Printer-Friend Mode</a>
</div>
<a class="button round tiny right" id="generate">Generate!</a>
</div>
</div>
</div>
</div>
<div class="row mc-row">
<div class="large-12 columns">
<div id="maze-container">
<div class="maze">
</div>
</div>
</div>
</div>
<div class="row ad">
<div class="large-12 columns">
<div class="center">
<h2 class="for-print">http://www.before-reality.net/maze<br /><a class="button tiny secondary" id="exit-printmode">Exit Printer-Friend Mode</a></h2>
</div>
</div>
</div>
<div class="panel for-screen" id="updates">
<div class="row">
<div class="large-3 columns" id="qmark">
<h1>?</h1>
</div>
<div class="large-9 columns">
<h3>About</h3>
<p>
This maze generator and the accompanying algorithm was inspired by a slide show by Jamis Buck
called "<a href="http://www.jamisbuck.org/presentations/rubyconf2011/index.html">Algorithm is Not a Four Letter Word</a>." It is a great read that goes over
what mazes are, various ways of generating mazes and the importance of working with algorithms. You can learn more about what I learned while making this
generator and algorithm over at this blog post: <a href="http://www.brandonheyer.com/2013/04/24/maze-generating-algorithms-fun-with-html-and-javascript">Maze Generating Algorithms: Fun with HTML and JavaScript</a>
</p>
<p>
To use the generator simply click 'generate' and a default maze will start popping up. You can set the width and height of the maze (within bounds based off of the cell size you select).
If you make some changes, clicking 'generate' will clear the existing maze and start up another. If you'd like to play with the complexity of the maze, use the style modifier.
Low numbers will result in long passages, high numbers will result in a lot of dead-ends. If you use a mid-range number you'll get a little of both. Once the maze is done generating,
the start will be marked green and the furthest spaces from the start will be marked red.
</p>
<p>
Have fun and enjoy! If you have any questions or suggestions, be sure to check out <a href="http://www.brandonheyer.com/2013/04/24/maze-generating-algorithms-fun-with-html-and-javascript">the blog post</a> and leave a comment! I'll post updates below as they roll in.
</p>
<h3>Updates</h3>
<h4>Sunday, May 12, 2013</h4>
<p>Removed size limits and added scrolling if maze gets too large. Added zooming and save/load functionality. Copy and paste the generated string to share created mazes! Added 'printer-friendly' mode.</p>
<h4>Wednesday, April 24, 2013</h4>
<p>Added "heat map" view which is a great way to visualize the distance from start of individual cells. It also helps illustrate the differences introduced with the style modifier.</p>
<h4>Tuesday, April 23, 2013</h4>
<p>Launched! Use the input fields to tweak how the maze is generated. More cool features to come as time progresses!</p>
</div>
</div>
</div>
</body>
</html>
|
brandonheyer/mazejs
|
demo/index.html
|
HTML
|
mit
| 8,781
|
function solve(input){
let result=input.toString();
let sum=0;
let count=0;
while(input>=1){
sum+=input%10;
count++;
input=Math.floor(input/10);
}
while(sum/count<=5){
sum+=9;
count++;
result+='9';
}
console.log(result)
}
solve(101);
|
mitaka00/SoftUni
|
JS Core/JS Fundamentals/Functions-Exercises/05.Modify Average.js
|
JavaScript
|
mit
| 317
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HotelsSystem.Data")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HotelsSystem.Data")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9987b1a9-f159-4bfe-b9b9-1a5340913e0f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
hrist0stoichev/HotelsSystem
|
Source/Data/HotelsSystem.Data/Properties/AssemblyInfo.cs
|
C#
|
mit
| 1,410
|
import Zip from 'adm-zip';
/**
* @param {Type}
* @return {Type}
*/
export default function (filePath) {
let courseZip = new Zip(filePath);
let courseFileScanner = {
getZipObject: () => {
return courseZip;
},
getCourseFiles: () => {
return courseZip.getEntries().filter(courseFileScanner._isCourseFile).map(courseFileScanner._getCourseFileId);
},
_isCourseFile: (file) => {
return file.entryName.match(/^(?=.*\bcsfiles\/home_dir\b)(?!.*\b.xml\b).*$/ig);
},
_getCourseFileId: (file) => {
let fileName = file.entryName;
let startIndex = fileName.lastIndexOf('xid-') + 4;
let endIndex = fileName.indexOf('_', startIndex);
file.courseFileId = fileName.substring(startIndex, endIndex);
return file;
},
getDatFiles: () => {
return courseZip.getEntries().filter(courseFileScanner._isDatFile);
},
_isDatFile: (file) => {
return file.entryName.match(/^(?=.*res)(?=.*\b\.dat\b).*$/g);
}
};
return courseFileScanner;
}
|
collectively-made/course-file-scanner
|
src/index.js
|
JavaScript
|
mit
| 1,035
|
import os
def Dir_toStdName(path):
if not (path[-1]=="/" or path[-1] == "//"):
path=path+"/"
return path
def Dir_getFiles(path):
path=Dir_toStdName(path)
allfiles=[]
files=os.listdir(path)
for f in files:
abs_path = path + f
if os.path.isdir(abs_path):
sub_files=Dir_getFiles(abs_path)
sub_files=[ f+'/'+i for i in sub_files ]
allfiles.extend(sub_files)
else:
allfiles.append(f)
return allfiles
class Dir:
def __init__(self,dir_name):
self.m_dir=Dir_toStdName(dir_name)
def listDir(self):
return os.listdir(self.m_dir)
def listFiles(self):
return Dir_getFiles(self.m_dir)
if __name__ == "__main__":
d=Dir("../../")
print d.listFiles()
|
FSource/Faeris
|
tool/binpy/libpy/files/Dir.py
|
Python
|
mit
| 703
|
using System.Collections.Generic;
namespace aed.org.mt.Models
{
public class HomeIndexModel
{
public IEnumerable<AEDEntity> AEDs { get; set; }
}
}
|
cdemi/aed.org.mt
|
src/aed.org.mt/Models/HomeIndexModel.cs
|
C#
|
mit
| 171
|
# TV Organizer
Manage episodes of various tv shows
Goal is to completely manage all episodes from tv series, rename them, find informations, etc.
Final objective is to integrate it into more complex system.
|
ghivert/Student-Projects
|
Miscellaneous/Various Scala/tv-organizer/README.md
|
Markdown
|
mit
| 213
|
# Phusion Server Tools
A collection of server administration tools that we use. Everything is written in Ruby and designed to work with Debian. These scripts may work with other operating systems or distributions as well, but it's not tested. [Read documentation with table of contents.](http://phusion.github.com/phusion-server-tools/)
Install with:
git clone https://github.com/phusion/phusion-server-tools.git /tools
It's not necessary to install to /tools, you can install to anywhere, but this document assumes that you have installed to /tools.
Each tool has its own prerequities, but here are some common prerequities:
* Ruby (obviously)
* `pv` - `apt-get install pv`. Not required but very useful; allows display of progress bars.
Some tools require additional configuration through `config.yml`, which must be located in the same directory as the tool or in `/etc/phusion-server-tools.yml`. Please see `config.yml.example` for an example.
## Cryptographic verification
We do not release source tarballs for Juvia. Users are expected to get the source code from Github.
From time to time, we create Git tags for milestones. These milestones are signed with the [Phusion Software Signing key](http://www.phusion.nl/about/gpg). After importing this key you can verify Git tags as follows:
git tag --verify milestone-2013-03-11
## Backup
Tip: looking to backup files other than MySQL dumps? Use the `rotate-files` tool.
### backup-mysql - Rotated, compressed, encrypted MySQL dumps
A script which backs up all MySQL databases to `/var/backups/mysql`. By default at most 10 backups are kept, but this can be configured. All backups are compressed with gzip and can optionally be encrypted. The backup directory is denied all world access.
It uses `mysql` to obtain a list of databases and `mysqldump` to dump the database contents. If you want to run this script unattended you should therefore set the right login information in `~/.my.cnf`, sections `[mysql]` and `[mysqldump]`.
Encryption can be configured through the 'encrypt' option in config.yml.
Make it run daily at 12:00 AM and 0:00 AM in cron:
0 0,12 * * * /tools/silence-unless-failed /tools/backup-mysql
### backup-postgresql - Rotated, compressed, encrypted PostgreSQL dumps
A script which backs up all PostgreSQL databases to `/var/backups/postgresql`. By default at most 10 backups are kept, but this can be configured. All backups are compressed with gzip and can optionally be encrypted. The backup directory is denied all world access.
It uses `psql` to obtain a list of databases and `pg_dump` to dump the database contents. If you want to run this script unattended you should therefore set the right login information relevant environment variables such as PGUSER.
Encryption can be configured through the 'encrypt' option in config.yml.
Make it run daily at 12:00 AM and 0:00 AM in cron:
0 0,12 * * * /tools/silence-unless-failed /tools/backup-postgresql
## Monitoring and alerting
### monitor-cpu - Monitors CPU usage and send email on suspicious activity
A daemon which measures the total CPU usage and per-core CPU usage every minute, and sends an email if the average total usage or the average per-core usage over a period of time equals or exceeds a threshold.
Config options:
* total_threshold: The total CPU usage threshold (0-100) to check against.
* per_core_threshold: The per-core CPU usage threshold (0-100) to check against.
* interval: The interval, in minutes, over which the average is calculated.
* to, from, subject: Configuration for the email alert.
You should run monitor-cpu with daemon tools:
mkdir -p /etc/service/monitor-cpu
cat <<EOF > /etc/service/monitor-cpu/run.tmp
#!/bin/bash
exec setuidgid daemon /tools/run --syslog /tools/monitor-cpu
EOF
chmod +x /etc/service/monitor-cpu/run.tmp
mv /etc/service/monitor-cpu/run.tmp /etc/service/monitor-cpu/run
### notify-if-queue-becomes-large - Monitor RabbitMQ queue sizes
This script monitors all RabbitMQ queues on the localhost RabbitMQ installation and sends an email if one of them contain more messages than a defined threshold. You can configure the settings in `config.yml`.
Run it every 15 minutes in cron:
0,15,30,45 * * * * /tools/notify-if-queue-becomes-large
### check-web-apps - Checks web applications' health
This script sends HTTP requests to all listed web applications and checks whether the response contains a certain substring. If not, an email is sent.
Run it every 10 minutes in cron:
0,10,20,30,40,50 * * * * /tools/check-web-apps
## File management
### permit and deny - Easily set fine-grained permissions using ACLs
`permit` recursively gives a user access to a directory by using ACLs. The default ACL is modified too so that any new files created in that directory or in subdirectories inherit the ACL rules that allow access for the given user.
`deny` recursively removes all ACLs for a given user on a directory, including default ACLs.
The standard `setfacl` tool is too hard to use and sometimes does stupid things such as unexpectedly making files executable. These scripts are simple and work as expected.
# Recursively give web server read-only access to /webapps/foo.
/tools/permit www-data /webapps/foo
# Recursively give user 'deploy' read-write access to /webapps/bar.
/tools/permit deploy /webapps/bar --read-write
# Recursively remove all ACLs for user 'joe' on /secrets/area66.
/tools/deny joe /secrets/area66
You need the `getfacl` and `setfacl` commands:
apt-get install acl
You must also make sure your filesystem is mounted with ACL support, e.g.:
mount -o remount,acl /
Don't forget to update /etc/fstab too.
### add-line
Adds a line to the given file if it doesn't already include it.
/tools/add-line foo.log "hello world"
# Same effect:
/tools/add-line foo.log hello world
### remove-line
Removes the first instance of a line from the given file. Does nothing if the file doesn't include that line.
/tools/remove-line foo.log "hello world"
# Same effect:
/tools/remove-line foo.log hello world
### set-section
Sets the content of a named section inside a text file while preserving all other text. Contents are read from stdin. A section looks like this:
###### BEGIN #{section_name} ######
some text
###### END #{section_name} ######
If the section doesn't exist, then it will be created.
$ cat foo.txt
hello world
$ echo hamburger | /tools/set-section foo.txt "mcdonalds menu"
$ cat foo.txt
hello world
##### BEGIN mcdonalds menu #####
hamburger
##### END mcdonalds menu #####
If the section already exists then its contents will be updated.
# Using above foo.txt.
$ echo french fries | /tools/set-section foo.txt "mcdonalds menu"
$ cat foo.txt
hello world
##### BEGIN mcdonalds menu #####
french fries
##### END mcdonalds menu #####
If the content is empty then the section will be removed if it exists.
# Using above foo.txt
$ echo | /tools/set-section foo.txt "mcdonalds menu"
$ cat foo.txt
hello world
### truncate
Truncates all given files to 0 bytes.
### rotate-files
Allows you to use the common pattern of creating a new file, while deleting files that are too old. The most common use case for this tool is to store a backup file while deleting older backups.
The usage is as follows:
rotate-files <INPUT> <OUTPUT PREFIX> [OUTPUT SUFFIX] [OPTIONS]
Suppose you have used some tool to create a database dump at `/tmp/backup.tar.gz`. If you run the following command...
rotate-files /tmp/backup.tar.gz /backups/backup- .tar.gz
...then it will create the file `/backups/backup-<TIMESTAMP>.tar.gz`. It will also delete old backup files matching this same pattern.
Old file deletion works by keeping only the most recent 50 files. This way, running `rotate-files` on an old directory won't result in all old backups to be deleted. You can customize the number of files to keep with the `--max` parameter.
Recency is determined through the timestamp in the filename, not the file timestamp metadata.
## RabbitMQ
### display-queue - Display statistics for local RabbitMQ queues
This tool displays statistics for RabbitMQ queues in a more friendly formatter than `rabbitmqctl list_queues`. The meanings of the columns are as follows:
* Messages - Total number of messages in the queue. Equal to `Ready + Unack`.
* Ready - Number of messages in the queue not yet consumed.
* Unack - Number of messages in the queue that have been consumed, but not yet acknowledged.
* Consumers - Number of consumers subscribed to this queue.
* Memory - The amount of memory that RabbitMQ is using for this queue.
### watch-queue - Display changes in local RabbitMQ queues
`watch-queue` combines the `watch` tool with `display-queue`. It continuously displays the latest queue statistics and highlights changes.
### purge-queue - Remove all messages from a local RabbitMQ queue
`purge-queue` removes all messages from given given RabbitMQ queue. It connects to a RabbitMQ server on localhost on the default port. Note that consumed-but-unacknowledged messages in the queue cannot be removed.
purge-queue <QUEUE NAME HERE>
### notify-if-queue-becomes-large - Monitor RabbitMQ queue sizes
See the related documentation under "Monitoring and alerting".
## Security
### confine-to-rsync
To be used in combination with SSH for confining an account to only rsync access. Very useful for locking down automated backup users.
Consider two hypothetical servers, `backup.org` and `production.org`. Once in a while backup.org runs an automated `rsync` command, copying data from production.org to its local disk. Backup.org's SSH key is installed on production.org. If someone hacks into backup.org we don't want it to be able to login to production.org or do anything else that might cause damage, so we need to make sure that backup.org can only rsync from production.org, and only for certain directories.
`confine-to-rsync` is to be installed into production.org's `authorized_keys` file as execution command:
command="/tools/confine-to-rsync /directory1 /directory2",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-dss AAAAB3Nza(...rest of backup.org's key here...)
`confine-to-rsync` checks whether the client is trying to execute rsync in server mode, and if so, whether the rsync is only being run on either /directory1 or /directory2. If not it will abort with an error.
## Other
### silcence-unless-failed
Runs the given command but only print its output (both STDOUT and STDERR) if its exit code is non-zero. The script's own exit code is the same as the command's exit code.
/tools/silence-unless-failed my-command arg1 arg2 --arg3
### timestamp
Runs the given command, and prepends timestamps to all its output. This will cause stdout and stderr to be merged and to be printed to stdout.
/tools/timestamp my-command arg1 arg2 --arg3
### run
This tool allows running a command in various ways. Supported features:
* Running the command with a different name (`argv[0]` value). Specify `--program-name NAME` to use this feature.
* Sending a copy of the output to a log file. Specify `--log-file FILENAME` to use this feature. It will overwrite the log file by default; specify `--append` to append to the file instead.
* Sending a copy of the output to syslog. Specify `--syslog` to use this feature. `run` will use the command's program name as the syslog program name. `--program-name` is respected.
* Sending the output to [pv](http://www.ivarch.com/programs/pv.shtml). You can combine this with `--log-file` and `--syslog`.
* Printing the exit code of the command to a status file once the command exits. Specify `--status-file FILENAME` to use this feature.
* Holding a lock file while the command is running. If the lock file already exists, then `run` will abort with an error. Otherwise, it will create the lock file, write the command's PID to the file and delete the file after the command has finished.
* Sending an email after the command has finished. Specify `--email-to EMAILS` to use this feature. It should be a comma-separated list of addresses.
`run` always exhibits the following properties:
* It redirects stdin to /dev/null.
* It exits with the same exit code as the command, unlike bash which exits with the exit code of the last command in the pipeline.
* stdout and stderr are both combined into a single stream. If you specify `--log-file`, `--syslog` or `--pv` then both stdout and stderr will be redirected to the pipeline.
* All signals are forwarded to the command process.
### syslog-tee
This is like `tee`, but writes to syslog instead of a file. Accepts the same arguments as the `logger` command.
### udp-to-syslog
Forwards all incoming data on a UDP port to syslog. For each message, the source address is also noted. Originally written to be used in combination with Linux's netconsole.
See `./udp-to-syslog --help` for options.
### gc-git-repos
Garbage collects all git repositories defined in `config.yml`. For convenience, the list of repositories to garbage collect can be a glob, e.g. `/u/apps/**/*.git`.
In order to preserve file permissions, the `git gc` command is run as the owner of the repository directory by invoking `su`. Therefore this tool must be run as root, or it must be run as the owner of all given git repositories.
Make it run every Sunday at 0:00 AM in cron with low I/O priority:
0 0 * * sun /tools/silence-unless-failed ionice -n 7 /tools/gc-git-repos
|
phusion/phusion-server-tools
|
README.md
|
Markdown
|
mit
| 13,701
|
# 首次试
~ 此目录收集, 入门时,编程的各种冲突
## 进展
- 150924 大妈创建
- 20151017
- 为了完成任务"关联自己的Github仓库OMOOC2py和Gitbook",按照gitbook的官方说明GitHub Integration这一章节来进行设置。设置完了以后,点进gitbook看,效果不并像其他学员那样有大妈设置好整齐划一的结构。是我哪里弄错了嘛?反反复复检查了很多遍,都不知道自己哪里设置错了。但是进入book的编辑模式,又能看到大妈设置的默认模板。但就在刚刚随便改了下默认模板,点保存,再看这本书的所有的结构都有了。(图片待补,现在要去看头脑特工队压压惊)
安装disqus插件是参考的以下连接
https://zoejane.gitbooks.io/zoe-py-tutorial/content/gitbook-comment.html
# 翻译
|
zengyumi/OMOOC2py
|
1sTry/README.md
|
Markdown
|
mit
| 843
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.