size
int64
31
1.04M
ext
stringclasses
257 values
lang
stringclasses
87 values
max_stars_repo_name
stringlengths
4
116
max_stars_repo_licenses
sequencelengths
1
10
max_stars_count
float64
1
191k
max_issues_repo_name
stringlengths
4
116
max_issues_repo_licenses
sequencelengths
1
10
max_issues_count
float64
1
98.3k
max_forks_repo_name
stringlengths
4
136
max_forks_repo_licenses
sequencelengths
1
10
max_forks_count
float64
1
105k
text
stringlengths
31
1.04M
avg_line_length
float64
1.36
127k
max_line_length
int64
1
764k
alphanum_fraction
float64
0
1
code_readability
float64
0.8
0.99
token_len
int64
33
686k
240
css
CSS
KamyaJain/TODOLIST
[ "MIT" ]
null
KamyaJain/TODOLIST
[ "MIT" ]
null
KamyaJain/TODOLIST
[ "MIT" ]
null
* { padding: 0; margin: 0; } body { width: 100vw; min-height: 100vh; margin-left: 40%; margin-top: 10%; background: linear-gradient(#F00000, #DC281E); font-family: sans-serif; border-width: 5px; }
14.117647
49
0.5625
0.849167
131
286
ado
Stata
xonoer/tssc
[ "MIT" ]
1
xonoer/tssc
[ "MIT" ]
null
xonoer/tssc
[ "MIT" ]
1
program _cauchyden, eclass version 12.0 args dvar mu sigma lambda q confirm name `dvar' confirm number `mu' confirm number `sigma' if `sigma' <= 0{ di as error "Parameter sigma must be positive" } gen _cauchyden_`dvar' = 1/(`sigma'*_pi*(((`dvar'-`mu')/`sigma')^2 + 1)) end
19.066667
71
0.667832
0.831404
125
175
als
Alloy
Kaixi26/org.alloytools.alloy
[ "Apache-2.0" ]
null
Kaixi26/org.alloytools.alloy
[ "Apache-2.0" ]
null
Kaixi26/org.alloytools.alloy
[ "Apache-2.0" ]
null
open main pred id7FKKveHYfzNL35ydc_prop9 { always Protected not in Trash } pred __repair { id7FKKveHYfzNL35ydc_prop9 } check __repair { id7FKKveHYfzNL35ydc_prop9 <=> prop9o }
29.166667
55
0.817143
0.8325
84
928
glsl
GLSL
baturinsky/glide
[ "MIT" ]
3
baturinsky/glide
[ "MIT" ]
null
baturinsky/glide
[ "MIT" ]
null
#version 300 es precision highp float; precision mediump sampler3D; in vec2 v_texCoord; uniform mat4 u_raycastProjection; uniform vec3 u_toSun; layout(location=0) out vec4 outColor; layout(location=1) out vec3 outNormal; vec3 skyColor(vec3 ray){ vec3 color = (ray + 1.) * (dot(ray, u_toSun)>0.999?10.:1.); float aVer = degrees(atan(ray.x, ray.y)); float aHor = degrees(atan(ray.z, length(ray.xy))); color *= mod(aVer, 10.) < 0.1?1.5:1.; color *= mod(aHor, 10.) < 0.1?1.5:1.; color *= mod(aVer, 5.) < 0.1?1.5:1.; color *= mod(aHor, 5.) < 0.1?1.5:1.; color *= mod(aVer, .5) < 0.05?1.5:1.; color *= mod(aHor, .5) < 0.05?1.5:1.; return color; } void main() { vec4 screenPos = vec4(v_texCoord.x * 2. - 1., v_texCoord.y * 2. - 1., 0., 1.); vec3 ray = normalize((u_raycastProjection * screenPos).xyz); outColor = vec4(skyColor(ray), 1.) * 0.3; outNormal = vec3(0.); gl_FragDepth = 0.999999; }
26.514286
80
0.622845
0.834528
454
980
lua
Lua
499453466/Lua-Other
[ "Unlicense" ]
2
Eduardo-Silla/Lua-Other
[ "Unlicense" ]
null
Eduardo-Silla/Lua-Other
[ "Unlicense" ]
3
--[[ Darkshore -- Murkdeep.lua This script was written and is protected by the GPL v2. This script was released by MikeBeck of the BLUA Scripting Project. Please give proper accredidations when re-releasing or sharing this script with others in the emulation community. ~~End of License Agreement -- MikeBeck, December, 04th, 2008. ]] function Murkdeep_OnCombat(Unit, Event) Unit:RegisterEvent("Murkdeep_Net", 10000, 0) Unit:RegisterEvent("Murkdeep_SunderArmor", 6000, 0) end function Murkdeep_Net(pUnit, Event) pUnit:FullCastSpellOnTarget(6533, pUnit:GetMainTank()) end function Murkdeep_SunderArmor(pUnit, Event) pUnit:FullCastSpellOnTarget(11971, pUnit:GetMainTank()) end function Murkdeep_OnLeaveCombat(Unit, Event) Unit:RemoveEvents() end function Murkdeep_OnDied(Unit, Event) Unit:RemoveEvents() end RegisterUnitEvent(10323, 1, "Murkdeep_OnCombat") RegisterUnitEvent(10323, 2, "Murkdeep_OnLeaveCombat") RegisterUnitEvent(10323, 4, "Murkdeep_OnDied")
26.486486
58
0.790816
0.933181
388
618
cpp
C++
wwmoo7/IRbaby-firmware
[ "MIT" ]
38
wwmoo7/IRbaby-firmware
[ "MIT" ]
6
wwmoo7/IRbaby-firmware
[ "MIT" ]
15
// ArduinoJson - arduinojson.org // Copyright Benoit Blanchon 2014-2020 // MIT License #include <ArduinoJson.h> #include <stdint.h> #include <catch.hpp> TEST_CASE("JsonVariant::add()") { DynamicJsonDocument doc(4096); JsonVariant var = doc.to<JsonVariant>(); SECTION("integer") { var.add(42); REQUIRE(var.as<std::string>() == "[42]"); } SECTION("const char*") { var.add("hello"); REQUIRE(var.as<std::string>() == "[\"hello\"]"); } SECTION("std::string") { var.add(std::string("hello")); REQUIRE(var.as<std::string>() == "[\"hello\"]"); } }
19.935484
53
0.571197
0.807358
257
503
sv
SystemVerilog
vogelpi/opentitan
[ "Apache-2.0" ]
1,375
vogelpi/opentitan
[ "Apache-2.0" ]
7,045
vogelpi/opentitan
[ "Apache-2.0" ]
428
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 package entropy_src_test_pkg; // dep packages import uvm_pkg::*; import cip_base_pkg::*; import entropy_src_env_pkg::*; // macro includes `include "uvm_macros.svh" `include "dv_macros.svh" // package sources `include "entropy_src_base_test.sv" `include "entropy_src_smoke_test.sv" `include "entropy_src_rng_test.sv" endpackage
23.952381
75
0.745527
0.801489
184
1,552
lean
Lean
alreadydone/mathlib
[ "Apache-2.0" ]
1
alreadydone/mathlib
[ "Apache-2.0" ]
null
alreadydone/mathlib
[ "Apache-2.0" ]
null
/- Copyright (c) 2017 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Patrick Massot, Scott Morrison, Mario Carneiro -/ import category_theory.concrete_category.unbundled_hom import topology.continuous_map import topology.opens open category_theory open topological_space universe u /-- The category of topological spaces and continuous maps. -/ def Top : Type (u+1) := bundled topological_space namespace Top instance bundled_hom : bundled_hom @continuous_map := ⟨@continuous_map.to_fun, @continuous_map.id, @continuous_map.comp, @continuous_map.coe_inj⟩ attribute [derive [has_coe_to_sort, large_category, concrete_category]] Top instance topological_space_unbundled (x : Top) : topological_space x := x.str @[simp] lemma id_app (X : Top.{u}) (x : X) : (𝟙 X : X → X) x = x := rfl @[simp] lemma comp_app {X Y Z : Top.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : (f ≫ g : X → Z) x = g (f x) := rfl /-- Construct a bundled `Top` from the underlying type and the typeclass. -/ def of (X : Type u) [topological_space X] : Top := ⟨X⟩ instance (X : Top) : topological_space X := X.str instance : inhabited Top := ⟨Top.of empty⟩ /-- The discrete topology on any type. -/ def discrete : Type u ⥤ Top.{u} := { obj := λ X, ⟨X, ⊥⟩, map := λ X Y f, { to_fun := f, continuous_to_fun := continuous_bot } } /-- The trivial topology on any type. -/ def trivial : Type u ⥤ Top.{u} := { obj := λ X, ⟨X, ⊤⟩, map := λ X Y f, { to_fun := f, continuous_to_fun := continuous_top } } end Top
30.431373
91
0.68299
0.826202
606
8,397
erl
Erlang
NicoK/otp
[ "Apache-2.0" ]
2
NicoK/otp
[ "Apache-2.0" ]
null
NicoK/otp
[ "Apache-2.0" ]
1
%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2009-2013. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed to in writing, software %% distributed under the License is distributed on an "AS IS" BASIS, %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. %% %% %CopyrightEnd% %%%------------------------------------------------------------------- %%% File : wx_basic_SUITE.erl %%% Author : Dan Gudmundsson <dan.gudmundsson@ericsson.com> %%% Description : Basic SUITE, some simple tests to show that the basics %%% are working. %%% Created : 3 Nov 2008 by Dan Gudmundsson <dan.gudmundsson@ericsson.com> %%%------------------------------------------------------------------- -module(wx_xtra_SUITE). -export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). -include("wx_test_lib.hrl"). %% Initialization functions. init_per_suite(Config) -> wx_test_lib:init_per_suite(Config). end_per_suite(Config) -> wx_test_lib:end_per_suite(Config). init_per_testcase(Func,Config) -> wx_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [destroy_app, multiple_add_in_sizer, app_dies, menu_item_debug]. groups() -> []. init_per_group(_GroupName, Config) -> Config. end_per_group(_GroupName, Config) -> Config. %% The test cases %% Verify that everything is handled on the queue first %% before wx:destroy is called. destroy_app(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); destroy_app(_Config) -> %% This is timing releated but we test a couple of times wx_test_lib:flush(), ?m(ok, destroy_app_test(15)). destroy_app_test(N) when N > 0 -> Wx = ?mr(wx_ref, wx:new()), Frame = wxFrame:new(Wx, 1, "Destroy"), ?m(ok, wxFrame:destroy(Frame)), receive Msg -> Msg after 150 -> wx:destroy(), destroy_app_test(N-1) end; destroy_app_test(_) -> receive Msg -> Msg after 1000 -> ok end. %% This should work, and does but not when run automaticly on windows %% for some strange reason (it just hangs), run it last. app_dies(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); app_dies(_Config) -> Tester = fun(Die0) -> Die = (Die0*2) + ?LINE, Wx = wx:new(), oops(Die,?LINE), Frame = wxFrame:new(Wx, 1, ?MODULE_STRING ++ integer_to_list(?LINE)), oops(Die,?LINE), wxFrame:createStatusBar(Frame, []), oops(Die,?LINE), Win=wxWindow:new(Frame, ?wxID_ANY), oops(Die,?LINE), _Pen = wxPen:new({0,0,0}, [{width, 3}]), oops(Die,?LINE), _Font = wxFont:new(10, ?wxSWISS, ?wxNORMAL, ?wxNORMAL,[]), oops(Die,?LINE), wxWindow:connect(Win, key_up), oops(Die,?LINE), wxWindow:connect(Win, key_up, [{callback, fun(_,_) -> callback end}]), oops(Die,?LINE), wxFrame:show(Frame), oops(Die,?LINE), timer:sleep(100), %% Let the window be shown before DC can be created DC0 = wxClientDC:new(Win), oops(Die,?LINE), DC = wxBufferedDC:new(DC0), oops(Die,?LINE), _Size = wxWindow:getSize(Win), oops(Die,?LINE), %% redraw(DC, Size, G), wxBufferedDC:destroy(DC), oops(Die,?LINE), wxClientDC:destroy(DC0), oops(last,?LINE) end, process_flag(trap_exit,true), app_dies2(Tester, 1), ok. app_dies2(Test, N) -> spawn_link(fun() -> Test(N) end), receive {'EXIT', _, {oops, Server, What}} -> Ref = erlang:monitor(process, Server), receive {'DOWN', Ref, _, _, _} -> ok end, timer:sleep(100), What =/= last andalso app_dies2(Test, N+1) end. oops(Die, Line) when (Die =:= last) orelse (Die =< Line) -> timer:sleep(200), ?log(" Exits at line ~p~n",[Line]), Server = element(3, wx:get_env()), exit({oops, Server, Die}); oops(_,_) -> ok. %% This have happend often enough that I have special code to handle %% this user error (i.e. using the a window twice in an sizer). multiple_add_in_sizer(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); multiple_add_in_sizer(Config) -> Wx = wx:new(), Frame = wxFrame:new(Wx, -1, "Button Fix"), wxFrame:connect(Frame, close_window), FramePanel = wxPanel:new(Frame), Sizer = wxBoxSizer:new(?wxVERTICAL), wxPanel:setSizer(FramePanel, Sizer), wxSizer:setSizeHints(Sizer, Frame), Panel = wxPanel:new(FramePanel), Button = wxButton:new(Panel, -1, [{label, "Centre Me!"}]), PanelSizer = wxBoxSizer:new(?wxVERTICAL), %%%%%%%%%%% THIS CALL CRASHES BEAM AT DESTROY TIME %%%%%%%%%%%%% wxPanel:setSizer(Panel, PanelSizer), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ButtonSizer = wxBoxSizer:new(?wxVERTICAL), SizerFlags = wxSizerFlags:new(), wxSizerFlags:align(SizerFlags, ?wxALIGN_CENTRE), wxSizer:add(ButtonSizer, Button, SizerFlags), %% no tricks wxSizerFlags:expand(SizerFlags), % wxSizer:add(PanelSizer, ButtonSizer, SizerFlags), %% PanelSizer is added to a size twice wxSizer:add(Sizer, PanelSizer, SizerFlags), wxFrame:setSize(Frame, 400, 300), io:format("Panel ~p PSizer ~p ~n",[Panel, PanelSizer]), %% io:format("F wxWindow:show(Frame), wx_test_lib:wx_destroy(Frame, Config). menu_item_debug(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); menu_item_debug(Config) -> %% Debugging a menu entry problem %% Run it with: lists:map(fun(_) -> [{0,{ok,_,_}}] = wxt:t() end, lists:seq(1,50)), ok. Wx = wx:new(), wx:debug(trace), Frame = wxFrame:new(Wx, -1, "Button Fix"), wxFrame:connect(Frame, close_window), wxPanel:new(Frame), MenuBar = create_menus(Frame), wxWindow:show(Frame), N = wxMenuBar:getMenuCount(MenuBar), io:format("No of menus ~p~n",[N]), [io:format("Menu ~p ~p~n",[Id, wxMenuBar:getLabelTop(MenuBar, Id)]) || Id <- lists:seq(0, N-1)], wx_test_lib:wx_destroy(Frame,Config). create_menus(Frame) -> MenuBar = ?mt(wxMenuBar, wxMenuBar:new()), File = ?mt(wxMenu, wxMenu:new([])), Help = ?mt(wxMenu, wxMenu:new([])), ?mt(wxMenuItem, wxMenu:append(Help, ?wxID_ABOUT, "&About", [])), ?mt(wxMenuItem, wxMenu:append(Help, ?wxID_HELP, "&Help", [])), ?mt(wxMenuItem, wxMenu:append(File, ?wxID_EXIT, "Exit", [])), T1 = ?mt(wxMenu, wxMenu:new([])), [wxMenuItem:getId(wxMenu:append(T1, Id, integer_to_list(Id), [])) || Id <- lists:seq(100, 120)], T2 = ?mt(wxMenu, wxMenu:new([])), [wxMenuItem:getId(wxMenu:append(T2, Id, integer_to_list(Id), [])) || Id <- lists:seq(200, 220)], T3 = ?mt(wxMenu, wxMenu:new([])), [wxMenuItem:getId(wxMenu:append(T3, Id, integer_to_list(Id), [])) || Id <- lists:seq(300, 320)], T4 = ?mt(wxMenu, wxMenu:new([])), [wxMenuItem:getId(wxMenu:append(T4, Id, integer_to_list(Id), [])) || Id <- lists:seq(400, 420)], T5 = ?mt(wxMenu, wxMenu:new([])), [wxMenuItem:getId(wxMenu:append(T5, Id, integer_to_list(Id), [])) || Id <- lists:seq(500, 520)], T6 = ?mt(wxMenu, wxMenu:new([])), [wxMenuItem:getId(wxMenu:append(T6, Id, integer_to_list(Id), [])) || Id <- lists:seq(600, 620)], ?m(ok,wxFrame:connect(Frame, command_menu_selected)), ?m(true, wxMenuBar:insert(MenuBar, 0,File, "&File")), ?m(true, wxMenuBar:insert(MenuBar, 1,Help, "&Help")), ?m(true, wxMenuBar:insert(MenuBar, 2,T1, "T1")), ?m(true, wxMenuBar:insert(MenuBar, 3,T2, "T2")), ?m(true, wxMenuBar:insert(MenuBar, 4,T3, "T3")), ?m(true, wxMenuBar:insert(MenuBar, 5,T4, "T4")), ?m(true, wxMenuBar:insert(MenuBar, 6,T5, "T5")), ?m(true, wxMenuBar:insert(MenuBar, 7,T6, "T6")), ?m(ok, wxFrame:setMenuBar(Frame,MenuBar)), MenuBar.
33.722892
91
0.621293
0.836005
3,283
1,924
php
PHP
net-square-designs/net-square-errnd
[ "MIT" ]
null
net-square-designs/net-square-errnd
[ "MIT" ]
null
net-square-designs/net-square-errnd
[ "MIT" ]
null
<?php use Illuminate\Http\Request; /* |-------------------------------------------------------------------------- | API Routes |-------------------------------------------------------------------------- | | Here is where you can register API routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | is assigned the "api" middleware group. Enjoy building your API! | */ // Route::middleware('auth:api')->get('/user', function (Request $request) { // return $request->user(); // }); // Route::group(['middleware' => 'guest:api'], function () { Route::post('login', 'Auth\LoginController@login')->name('login'); Route::post('register', 'Auth\RegisterController@register')->name('register'); // Route::post('check-availability', 'Auth\RegisterController@checkAvailability'); Route::post('verify', 'Auth\RegisterController@verifyUser')->name('verify'); // Route::post('password/email', 'Auth\ForgotPasswordController@sendResetPassword')->name('get-reset-token'); Route::post('password/reset', 'Auth\ResetPasswordController@recover')->name('reset'); Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request'); // }); Route::group(['middleware' => ['jwt.auth']], function () { Route::get('logout', 'Auth\LoginController@logout'); Route::get('test', function () { return response()->json(['foo' => 'bar']); }); }); Route::group(['middleware' => 'jwt.refresh'], function () { Route::get('refresh', [ 'middleware' => 'jwt.refresh', function () { return response()->json([ "status" => 200, "data" => [], "response" => [ 'message' => 'By accessing this endpoint, you can refresh your access token at each request. Check out this response headers!', ], ]); }, ]); });
37.72549
147
0.573285
0.859945
500
4,947
vhdl
VHDL
JGrycel/zynq-examples
[ "MIT" ]
1
JGrycel/zynq-examples
[ "MIT" ]
null
JGrycel/zynq-examples
[ "MIT" ]
1
-- Copyright 1986-2017 Xilinx, Inc. All Rights Reserved. -- -------------------------------------------------------------------------------- -- Tool Version: Vivado v.2017.4 (win64) Build 2086221 Fri Dec 15 20:55:39 MST 2017 -- Date : Fri Feb 23 02:56:21 2018 -- Host : JakePC running 64-bit major release (build 9200) -- Command : write_vhdl -force -mode synth_stub -rename_top design_1_auto_pc_0 -prefix -- design_1_auto_pc_0_ design_1_auto_pc_0_stub.vhdl -- Design : design_1_auto_pc_0 -- Purpose : Stub declaration of top-level module interface -- Device : xc7z010clg400-1 -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity design_1_auto_pc_0 is Port ( aclk : in STD_LOGIC; aresetn : in STD_LOGIC; s_axi_awid : in STD_LOGIC_VECTOR ( 11 downto 0 ); s_axi_awaddr : in STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_awlen : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_awsize : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_awburst : in STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_awlock : in STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_awcache : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_awprot : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_awqos : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_awvalid : in STD_LOGIC; s_axi_awready : out STD_LOGIC; s_axi_wid : in STD_LOGIC_VECTOR ( 11 downto 0 ); s_axi_wdata : in STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_wstrb : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_wlast : in STD_LOGIC; s_axi_wvalid : in STD_LOGIC; s_axi_wready : out STD_LOGIC; s_axi_bid : out STD_LOGIC_VECTOR ( 11 downto 0 ); s_axi_bresp : out STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_bvalid : out STD_LOGIC; s_axi_bready : in STD_LOGIC; s_axi_arid : in STD_LOGIC_VECTOR ( 11 downto 0 ); s_axi_araddr : in STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_arlen : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_arsize : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_arburst : in STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_arlock : in STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_arcache : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_arprot : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_arqos : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_arvalid : in STD_LOGIC; s_axi_arready : out STD_LOGIC; s_axi_rid : out STD_LOGIC_VECTOR ( 11 downto 0 ); s_axi_rdata : out STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_rresp : out STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_rlast : out STD_LOGIC; s_axi_rvalid : out STD_LOGIC; s_axi_rready : in STD_LOGIC; m_axi_awaddr : out STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_awprot : out STD_LOGIC_VECTOR ( 2 downto 0 ); m_axi_awvalid : out STD_LOGIC; m_axi_awready : in STD_LOGIC; m_axi_wdata : out STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_wstrb : out STD_LOGIC_VECTOR ( 3 downto 0 ); m_axi_wvalid : out STD_LOGIC; m_axi_wready : in STD_LOGIC; m_axi_bresp : in STD_LOGIC_VECTOR ( 1 downto 0 ); m_axi_bvalid : in STD_LOGIC; m_axi_bready : out STD_LOGIC; m_axi_araddr : out STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_arprot : out STD_LOGIC_VECTOR ( 2 downto 0 ); m_axi_arvalid : out STD_LOGIC; m_axi_arready : in STD_LOGIC; m_axi_rdata : in STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_rresp : in STD_LOGIC_VECTOR ( 1 downto 0 ); m_axi_rvalid : in STD_LOGIC; m_axi_rready : out STD_LOGIC ); end design_1_auto_pc_0; architecture stub of design_1_auto_pc_0 is attribute syn_black_box : boolean; attribute black_box_pad_pin : string; attribute syn_black_box of stub : architecture is true; attribute black_box_pad_pin of stub : architecture is "aclk,aresetn,s_axi_awid[11:0],s_axi_awaddr[31:0],s_axi_awlen[3:0],s_axi_awsize[2:0],s_axi_awburst[1:0],s_axi_awlock[1:0],s_axi_awcache[3:0],s_axi_awprot[2:0],s_axi_awqos[3:0],s_axi_awvalid,s_axi_awready,s_axi_wid[11:0],s_axi_wdata[31:0],s_axi_wstrb[3:0],s_axi_wlast,s_axi_wvalid,s_axi_wready,s_axi_bid[11:0],s_axi_bresp[1:0],s_axi_bvalid,s_axi_bready,s_axi_arid[11:0],s_axi_araddr[31:0],s_axi_arlen[3:0],s_axi_arsize[2:0],s_axi_arburst[1:0],s_axi_arlock[1:0],s_axi_arcache[3:0],s_axi_arprot[2:0],s_axi_arqos[3:0],s_axi_arvalid,s_axi_arready,s_axi_rid[11:0],s_axi_rdata[31:0],s_axi_rresp[1:0],s_axi_rlast,s_axi_rvalid,s_axi_rready,m_axi_awaddr[31:0],m_axi_awprot[2:0],m_axi_awvalid,m_axi_awready,m_axi_wdata[31:0],m_axi_wstrb[3:0],m_axi_wvalid,m_axi_wready,m_axi_bresp[1:0],m_axi_bvalid,m_axi_bready,m_axi_araddr[31:0],m_axi_arprot[2:0],m_axi_arvalid,m_axi_arready,m_axi_rdata[31:0],m_axi_rresp[1:0],m_axi_rvalid,m_axi_rready"; attribute X_CORE_INFO : string; attribute X_CORE_INFO of stub : architecture is "axi_protocol_converter_v2_1_15_axi_protocol_converter,Vivado 2017.4"; begin end;
55.58427
982
0.695169
0.845209
2,431
654
el
Emacs Lisp
bensonlew/emacs
[ "BSD-2-Clause-FreeBSD" ]
null
bensonlew/emacs
[ "BSD-2-Clause-FreeBSD" ]
null
bensonlew/emacs
[ "BSD-2-Clause-FreeBSD" ]
null
;;; smex-autoloads.el --- automatically extracted autoloads ;; ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) ;;;### (autoloads nil "smex" "smex.el" (22995 1673 403273 9000)) ;;; Generated autoloads from smex.el (autoload 'smex "smex" "\ \(fn)" t nil) (autoload 'smex-major-mode-commands "smex" "\ Like `smex', but limited to commands that are relevant to the active major mode. \(fn)" t nil) (autoload 'smex-initialize "smex" "\ \(fn)" t nil) ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t ;; End: ;;; smex-autoloads.el ends here
20.4375
92
0.657492
0.864566
277
1,112
py
Python
TheImaginaryOne/movies-py
[ "MIT" ]
null
TheImaginaryOne/movies-py
[ "MIT" ]
null
TheImaginaryOne/movies-py
[ "MIT" ]
null
from domainmodel.movie import Movie from domainmodel.review import Review import pytest def test_basic(): # https://ruinmyweek.com/lists/funny-one-star-movie-reviews/4/ movie = Movie("The Jungle Book", 2010) review_text = "It's a film not a book very disappointed" rating = 1 review = Review(movie, review_text, rating) review2 = Review(movie, review_text, rating) # different timestamp review3 = Review(movie, review_text, rating) # different timestamp review3.timestamp = review.timestamp assert review.__repr__() == f"<Review <Movie The Jungle Book, 2010>, {review_text}, 1, {review.timestamp}>" assert review.review_text == review_text assert review.rating == rating # equality assert review2 != review assert review == review3 def test_rating_range(): movie = Movie("Shrek", 2010) review_text = "Shrek good" review = Review(movie, review_text, 11) assert review.rating is None review = Review(movie, review_text, 0) assert review.rating is None review = Review(movie, review_text, 3) assert review.rating == 3
31.771429
111
0.70054
0.908013
358
191
sbt
Scala
envisia/sbt-systemjs
[ "Apache-2.0" ]
null
envisia/sbt-systemjs
[ "Apache-2.0" ]
null
envisia/sbt-systemjs
[ "Apache-2.0" ]
null
import SystemJsKeys._ import WebJs._ lazy val root = (project in file(".")).enablePlugins(SbtWeb) pipelineStages := Seq(systemjs) // JsEngineKeys.engineType := JsEngineKeys.EngineType.Node
23.875
60
0.769634
0.876818
65
1,773
mpl
Maple
vmchale/hakaru
[ "BSD-3-Clause" ]
327
vmchale/hakaru
[ "BSD-3-Clause" ]
155
vmchale/hakaru
[ "BSD-3-Clause" ]
38
# Domain types which are registered/unregistered with TypeTools. # Note that the types have to be quoted (additionally to the quote one would # normally place on certain types) to work properly local DomBoundVar_type := proc(nm) local ixs := [indices(Domain:-ExtBound, nolist)], vs; ormap(i->type(nm,Domain:-ExtBound[i]:-VarType), ixs); end proc; local DomBoundRange_type := proc(nm) local ixs := [indices(Domain:-ExtBound, nolist)], vs; ormap(i->type(nm,Domain:-ExtBound[i]:-RangeType), ixs); end proc; local DomainTypes := table( # Domain bounds [(DomBoundVar = 'thismodule:-DomBoundVar_type') ,(DomBoundRange = 'thismodule:-DomBoundRange_type') ,(DomBoundBinder = ''DInto(DomBoundVar, DomBoundRange, DomBoundKind)'' ) ,(DomBoundKind = 'And(name, satisfies(nm->assigned(Domain:-ExtBound[nm])))' ) ,(DomBound = ''And(specfunc(DBound) ,{anyfunc(list(DomBoundBinder)) ,anyfunc(list(DomBoundBinder),DomCtx) ,anyfunc(list(DomBoundBinder),DomCtx,table) })'' ) # Domain shape ,(DomConstrain = 'specfunc(relation, `DConstrain`)' ) ,(DomSum = 'specfunc(DomShape, `DSum`)' ) ,(DomSplit = ''DSplit(Partition(DomShape))'' ) ,(DomInto = ''Or(DInto(DomBoundVar, DomBoundRange, DomShape) ,DInto(DomBoundVar, DomShape) )'' ) ,(DomShape = 'Or( DomConstrain, DomSum, DomSplit, DomInto )' ) # Domain ,(DomCtx = ''t_kb'') ,(HDomain = ''DOMAIN(DomBound, DomShape)'' ) # Maybe domain ,(DomNoSol = ''Not(freeof(`DNoSol`))'' ) ,(HDomain_mb = ''Or(HDomain, DOMAIN(DomBound, DomNoSol))'' ) ] );
46.657895
86
0.592781
0.823502
588
2,037
thrift
Thrift
gengmao/pinot
[ "Apache-2.0" ]
1,275
jiangrongbo/pinot
[ "Apache-2.0" ]
2,639
jiangrongbo/pinot
[ "Apache-2.0" ]
438
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace java org.apache.pinot.common.request struct DataSource { 1: optional string tableName; } struct PinotQuery { 1: optional i32 version; 2: optional DataSource dataSource; 3: optional list<Expression> selectList; 4: optional Expression filterExpression; 5: optional list<Expression> groupByList; 6: optional list<Expression> orderByList; 7: optional Expression havingExpression; 8: optional i32 limit = 10; 9: optional i32 offset = 0; 10: optional map<string, string> debugOptions; 11: optional map<string, string> queryOptions; 12: optional bool explain; } enum ExpressionType { LITERAL, IDENTIFIER, FUNCTION } struct Expression { 1: required ExpressionType type; 2: optional Function functionCall; 3: optional Literal literal; 4: optional Identifier identifier; } struct Identifier { 1: required string name; } union Literal { 1: optional bool boolValue; 2: optional byte byteValue; 3: optional i16 shortValue; 4: optional i32 intValue; 5: optional i64 longValue; 6: optional double doubleValue; 7: optional string stringValue; 8: optional binary binaryValue; } struct Function { 1: required string operator; 2: optional list<Expression> operands; }
28.291667
63
0.747177
0.84743
567
92
idr
Idris
idream-build/idream
[ "BSD-3-Clause" ]
14
idream-build/idream
[ "BSD-3-Clause" ]
6
idream-build/idream
[ "BSD-3-Clause" ]
2
module Testlib2 import Testlib1 export val2 : String val2 = val1 ++ "Have a great day!\n"
11.5
36
0.717391
0.841429
35
419
go
Go
thomasf/yeelight
[ "MIT" ]
12
thomasf/yeelight
[ "MIT" ]
1
thomasf/yeelight
[ "MIT" ]
2
package yeel import "fmt" type IllegalArgumentError struct { field string value string supported string } func (e IllegalArgumentError) Error() string { return fmt.Sprintf("%s %q %s", e.field, e.value, e.supported) } func newIntError(field string, value int, supported string) error { return IllegalArgumentError{ field: field, value: fmt.Sprintf("%d", value), supported: supported, } }
19.045455
67
0.699284
0.888
131
153
applescript
AppleScript
looking-for-a-job/applescript-examples
[ "Unlicense" ]
1
looking-for-a-job/applescript-examples
[ "Unlicense" ]
null
looking-for-a-job/applescript-examples
[ "Unlicense" ]
null
#!/usr/bin.osascript try do shell script "ps -ax | grep Growl | grep -v grep" on error # not found, raise error do shell script "open -a Growl" end try
25.5
53
0.699346
0.849048
56
1,159
md
Markdown
katallaxie/mesos-master
[ "MIT" ]
null
katallaxie/mesos-master
[ "MIT" ]
null
katallaxie/mesos-master
[ "MIT" ]
null
[![Build Status](https://travis-ci.org/axelspringer/mesos-master.svg?branch=master)](https://travis-ci.org/axelspringer/mesos-master) [![Docker Stars](https://img.shields.io/docker/stars/axelspringer/mesos-master.svg)](https://hub.docker.com/r/axelspringer/mesos-master/) [![Docker Pulls](https://img.shields.io/docker/pulls/axelspringer/mesos-master.svg)](https://hub.docker.com/r/axelspringer/mesos/) # mesos-master Mesos http://mesos.apache.org/ # use [![](https://badge.imagelayers.io/axelspringer/mesos-master:1.4.0.svg)](https://imagelayers.io/?images=axelspringer/mesos-master:1.4.0) > all mesos arguments are accessible via `MESOS_*` environment variables ``` # You can use docker run -d \ -e EC2_INSTANCE=true -e MESOS_QUORUM=2 \ -e MESOS_ZK=zk://node-1:2181,node-2:2181,node-3:2181/mesos \ --name mesos-master --net host --restart always axelspringer/mesos-master:1.4.0 ``` Set environment variable `SECRET` to enable framework and slave authentication. Set environment variable `EC2_INSTANCE=true` to use the EC2 metadata service as to set the `MESOS_ADVERTISE_IP` variable to the local ip of the EC2 instance. # License [MIT](/LICENSE)
39.965517
402
0.754098
0.846446
461
246
st
Smalltalk
pdebruic/Highcharts
[ "MIT" ]
null
pdebruic/Highcharts
[ "MIT" ]
null
pdebruic/Highcharts
[ "MIT" ]
null
as yet unclassified testStyle | component stream | component := HighstockCredits new. component style: 'test'. stream := WriteStream on: String new. component javascriptContentOn: stream. self assert: stream contents = '{"style":"test"}'
22.363636
50
0.739837
0.87
73
927
applescript
AppleScript
WattageGuy/edgerouter-vpn-switch
[ "MIT" ]
1
WattageGuy/edgerouter-vpn-switch
[ "MIT" ]
null
WattageGuy/edgerouter-vpn-switch
[ "MIT" ]
null
tell application "Terminal" activate set currentTab to do script ("ssh user@192.168.1.1") do script ("configure") in currentTab -- Turning off rules that otherwise allows vpn connections do script ("set firewall name WAN_LOCAL rule 40 disable") in currentTab do script ("set firewall name WAN_LOCAL rule 50 disable") in currentTab do script ("set firewall name WAN_LOCAL rule 60 disable") in currentTab do script ("set firewall name WAN_LOCAL rule 70 disable") in currentTab do script ("commit") in currentTab do script ("save") in currentTab -- Make edgerouter disconnect vpn user do script ("clear vpn remote-access user <username>") in currentTab do script ("exit") in currentTab -- Trying to close connection 10 times. Lag etc can make it run slower then expected and therefore 10 tries try repeat 10 times delay 10 do script ("exit") in currentTab end repeat end try end tell
42.136364
109
0.738943
0.860909
296
852
agda
Agda
oisdk/agda-playground
[ "MIT" ]
6
oisdk/agda-playground
[ "MIT" ]
null
oisdk/agda-playground
[ "MIT" ]
1
{-# OPTIONS --cubical --safe --guardedness #-} module Data.PolyP.Derivations.Levels where open import Data.PolyP open import Level open import Data.PolyP.Types open import Data.Sum open import Data.Sigma open import Data.Unit open import Data.Fin open import Data.Nat open import Data.Vec open import Function open import Literals.Number open import Data.Fin.Literals open import Data.Nat.Literals levels : ⟦ FOREST ⟧ ~ A → ⟦ LEVELS ⟧ ~ A levels t = go t []′ where go : ⟦ FOREST ⟧ ~ A → ⟦ LEVELS ⟧ ~ A → ⟦ LEVELS ⟧ ~ A go = cata λ xs zs → cata (λ { (inl _ ) → zs ; (inr (inl _ , qs ) ) → qs ; (inr (inr (x , xs) , []′ ) ) → (x ∷′ []′ ) ∷′ xs []′ ; (inr (inr (x , xs) , q ∷′ qs ) ) → (x ∷′ q ) ∷′ xs qs }) xs
28.4
79
0.521127
0.850957
378
509
lisp
Common Lisp
robsumners/acl2
[ "BSD-3-Clause" ]
null
robsumners/acl2
[ "BSD-3-Clause" ]
null
robsumners/acl2
[ "BSD-3-Clause" ]
null
; A lightweight book about the built-in function member-symbol-name ; ; Copyright (C) 2022 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: Eric Smith (eric.smith@kestrel.edu) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (defthm not-member-symbol-name-when-not-consp (implies (not (consp l)) (not (member-symbol-name str l))) :hints (("Goal" :in-theory (enable member-symbol-name))))
29.941176
80
0.583497
0.837204
203
1,793
thrift
Thrift
donsbot/hsthrift
[ "BSD-3-Clause" ]
null
donsbot/hsthrift
[ "BSD-3-Clause" ]
null
donsbot/hsthrift
[ "BSD-3-Clause" ]
null
// THIS FILE IS COPIED FROM FBTHRIFT, DO NOT MODIFY ITS CONTENTS DIRECTLY // generated-by : fbcode/common/hs/thrift/exactprint/tests/sync-fbthrift-tests.sh // source: thrift/compiler/test/fixtures/* // @generated /* * Copyright (c) Facebook, Inc. and its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace android test.fixtures.basic namespace java test.fixtures.basic namespace java.swift test.fixtures.basic enum MyEnum { MyValue1 = 0, MyValue2 = 1, } struct MyStruct { 1: i64 MyIntField; 2: string MyStringField; # use the type before it is defined. Thrift should be able to handle this 3: MyDataItem MyDataField; 4: MyEnum myEnum; 5: bool oneway; 6: bool readonly; 7: bool idempotent; } struct MyDataItem {} union MyUnion { 1: MyEnum myEnum; 2: MyStruct myStruct; 3: MyDataItem myDataItem; } service MyService { void ping(); string getRandomData(); void sink(1: i64 sink); void putDataById(1: i64 id, 2: string data); readonly bool hasDataById(1: i64 id); readonly string getDataById(1: i64 id); idempotent void deleteDataById(1: i64 id); oneway void lobDataById(1: i64 id, 2: string data); } service DbMixedStackArguments { binary getDataByKey0(1: string key); binary getDataByKey1(1: string key); }
27.584615
81
0.730619
0.819535
584
1,191
r
R
SD2E/omics_tools
[ "MIT" ]
2
SD2E/omics_tools
[ "MIT" ]
null
SD2E/omics_tools
[ "MIT" ]
null
suppressMessages(library(edgeR)) options(scipen=999) x <- read.delim('/data/./edgeR_matfile.csv', sep=',', stringsAsFactors=TRUE) x$strain <- factor(x$strain) x$cuminic_acid <- factor(x$cuminic_acid) x$iptg <- factor(x$iptg) x$timepoint <- factor(x$timepoint) x$vanillic_acid <- factor(x$vanillic_acid) x$xylose <- factor(x$xylose) drops <- c('strain', 'cuminic_acid', 'iptg', 'timepoint', 'vanillic_acid', 'xylose') counts <- x[, !(names(x) %in% drops)] t_cts <- t(counts) t_cts[is.na(t_cts)] <- 0 #colnames(t_cts) <- x$filename group <- factor(c(1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 8, 7, 1, 2, 3, 4, 5, 6, 8, 7, 1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 11, 12, 12, 12, 12, 9, 13, 14, 15, 15, 15, 15, 9, 13, 14, 11)) y <- DGEList(counts=t_cts, group=group) y <- calcNormFactors(y) design <- model.matrix(~0 + group) keep <- rowSums(cpm(y[, c(7, 15, 23, 31, 3, 10, 18, 26)]) >1) >= 8 y <- y[keep, ,] y <- estimateDisp(y, design) fit <- glmQLFit(y, design) qlf <- glmQLFTest(fit, contrast=c(0,0,-1,0,0,0,1,0,0,0,0,0,0,0,0)) tab <- topTags(qlf, n=Inf) write.table(tab, file="Bacillussubtilis168Marburg_False_False_0_False_False-vs-Bacillussubtilis168Marburg_True_False_5_False_False.txt")
32.189189
180
0.649034
0.803727
689
2,417
jsp
Java Server Pages
1224500506/NCME-Web
[ "Apache-2.0" ]
null
1224500506/NCME-Web
[ "Apache-2.0" ]
null
1224500506/NCME-Web
[ "Apache-2.0" ]
null
<%@ page language="java" pageEncoding="UTF-8"%> <%@ page contentType="text/html;charset=utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head lang="en"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=0,maximum-scale=1.0,user-scalable=yes" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="robots" content="index,follow"> <meta name="apple-mobile-web-app-title" content="中国继续医学教育网"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="keyword" content=""> <meta name="description" content=""> <title>中国继续医学教育网</title> <%@include file="/commons/taglibs.jsp"%> <script src="${ctx}/qiantai_page/js/jquery-1.11.1.min.js"></script> <script src="${ctx}/qiantai_page/js/jquery.mobile.custom.min.js"></script> <script src="${ctx}/qiantai_page/js/jquery.bxslider.js"></script> <script src="${ctx}/qiantai_page/js/iconfont.js"></script> <script src="${ctx}/qiantai_page/js/main.min.js"></script> <link href="${ctx}/qiantai_page/css/animate.min.css" rel="stylesheet"> <link href="${ctx}/qiantai_page/css/jquery.bxslider.css" rel="stylesheet"> <link href="${ctx}/qiantai_page/css/global.css" rel="stylesheet"> </head> <body onload="init();"> <form name="caseList" id = "caseList" action="${ctx}/liveList.do" method="post"> <div class="container"> <%@include file="/qiantai_page/top2.jsp"%> <ul class="bread_crumbs"> <li>您的位置:</li> <li><a href="${ctx}/first.do">首页</a> <i class="fa fa-angle-right"></i></li> <li><a href="#">${cvsetName}&nbsp;</a><i class="fa fa-angle-right"></i></li> <li><a href="#">${className}</a></li> </ul> <div class="filter_cont"> </div> <div class="content top_border"> <ul class="item_list"> <iframe id="video" width="1200" height="600" src="" frameborder=”0”></iframe> </ul> </div> <%@include file="/qiantai_page/bottom.jsp"%> </div> <script type="text/javascript"> var basepath ='${ctx}'; //alert('${signK}'); var url ="${ZBUrl}?nickname=${nickname}&token=${token}&k=${signK}&uid=${uid}"; function init() { document.getElementById("video").src=url; } </script> </form> </body> </html>
42.403509
121
0.635085
0.851241
915
868
vb
Visual Basic
BharathVishal/VB-.NET-OOAD-Projects
[ "Apache-2.0" ]
null
BharathVishal/VB-.NET-OOAD-Projects
[ "Apache-2.0" ]
null
BharathVishal/VB-.NET-OOAD-Projects
[ "Apache-2.0" ]
null
Public Class Form3 Dim con As System.Data.OleDb.OleDbConnection Dim cmd As System.Data.OleDb.OleDbCommand Dim dr As System.Data.OleDb.OleDbDataReader Dim sqlstr As String Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Form4.Show() Me.Hide() End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Me.Close() Form1.Show() End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click MsgBox("Current call passed on to other operator,clik ok to continue") End Sub Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Form5.Show() End Sub End Class
29.931034
85
0.705069
0.80821
269
9,770
lua
Lua
gbprod/substitute.nvim
[ "WTFPL" ]
64
gbprod/substitute.nvim
[ "WTFPL" ]
6
gbprod/substitute.nvim
[ "WTFPL" ]
null
local utils = require("substitute.utils") local function execute_keys(feedkeys) local keys = vim.api.nvim_replace_termcodes(feedkeys, true, false, true) vim.api.nvim_feedkeys(keys, "x", false) end local function create_test_buffer() local buf = vim.api.nvim_create_buf(false, true) vim.api.nvim_command("buffer " .. buf) vim.api.nvim_buf_set_lines(0, 0, -1, true, { "Lorem ipsum dolor sit amet,", "consectetur adipiscing elit.", "Nulla malesuada lacus at ornare accumsan.", }) end describe("Get regions in operatorfunc", function() before_each(create_test_buffer) it("should select word", function() local region _G.callback = function() region = utils.get_regions(vim.fn.visualmode()) end vim.o.operatorfunc = "v:lua.callback" execute_keys("g@iw") assert.are.same({ { start_row = 1, start_col = 0, end_row = 1, end_col = 4 } }, region) end) it("should select to end of the line", function() local region _G.callback = function() region = utils.get_regions(vim.fn.visualmode()) end execute_keys("2w") vim.o.operatorfunc = "v:lua.callback" execute_keys("g@$") assert.are.same({ { start_row = 1, start_col = 12, end_row = 1, end_col = 26 } }, region) end) it("should select many lines", function() local region _G.callback = function() region = utils.get_regions(vim.fn.visualmode()) end execute_keys("2w") vim.o.operatorfunc = "v:lua.callback" execute_keys("g@5w") assert.are.same({ { start_row = 1, start_col = 12, end_row = 2, end_col = 11 } }, region) end) it("should select to end of file", function() local region _G.callback = function() region = utils.get_regions(vim.fn.visualmode()) end execute_keys("w") vim.o.operatorfunc = "v:lua.callback" execute_keys("g@G") assert.are.same({ { start_row = 1, start_col = 6, end_row = 3, end_col = 6 } }, region) end) end) describe("Get regions in visual mode", function() before_each(create_test_buffer) it("should select word", function() execute_keys("ve<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 0, end_row = 1, end_col = 4 } }, region) end) it("should select to end of the line", function() execute_keys("2w") execute_keys("v$<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 12, end_row = 1, end_col = 26 } }, region) end) it("should select many lines", function() execute_keys("2w") execute_keys("v5w<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 12, end_row = 2, end_col = 12 } }, region) end) it("should select to end of file", function() execute_keys("w") execute_keys("vG<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 6, end_row = 3, end_col = 6 } }, region) end) end) describe("Get regions in VISUAL mode", function() before_each(create_test_buffer) it("should select line", function() execute_keys("w") execute_keys("V<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 0, end_row = 1, end_col = 26 } }, region) end) it("should select multiple lines", function() execute_keys("wj") execute_keys("Vj<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 2, start_col = 0, end_row = 3, end_col = 40 } }, region) end) end) describe("Get regions in CTRL-V mode", function() before_each(create_test_buffer) it("should select word", function() execute_keys("<c-v>w<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 0, end_row = 1, end_col = 6 } }, region) end) it("should select on 2 lines", function() execute_keys("<c-v>wj<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 0, end_row = 1, end_col = 6 }, { start_row = 2, start_col = 0, end_row = 2, end_col = 6 }, }, region) end) it("should select to the end of lines", function() execute_keys("wj") execute_keys("<c-v>j$<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 2, start_col = 6, end_row = 2, end_col = 27 }, { start_row = 3, start_col = 6, end_row = 3, end_col = 40 }, }, region) end) it("should select from the beginning of lines", function() execute_keys("<c-v>jjl<esc>") local region = utils.get_regions(vim.fn.visualmode()) assert.are.same({ { start_row = 1, start_col = 0, end_row = 1, end_col = 1 }, { start_row = 2, start_col = 0, end_row = 2, end_col = 1 }, { start_row = 3, start_col = 0, end_row = 3, end_col = 1 }, }, region) end) end) describe("Get text", function() before_each(create_test_buffer) it("should get one word at the beginning", function() local text = utils.get_text({ { start_row = 1, start_col = 0, end_row = 1, end_col = 4 } }) assert.are.same({ "Lorem" }, text) end) it("should get one word", function() local text = utils.get_text({ { start_row = 1, start_col = 6, end_row = 1, end_col = 10 } }) assert.are.same({ "ipsum" }, text) end) it("should get one word at the end", function() local text = utils.get_text({ { start_row = 2, start_col = 23, end_row = 2, end_col = 27 } }) assert.are.same({ "elit." }, text) end) it("should get text on 2 lines", function() local text = utils.get_text({ { start_row = 1, start_col = 6, end_row = 2, end_col = 21 } }) assert.are.same({ "ipsum dolor sit amet,", "consectetur adipiscing" }, text) end) it("should get text on 2 regions", function() local text = utils.get_text({ { start_row = 1, start_col = 6, end_row = 1, end_col = 10 }, { start_row = 2, start_col = 23, end_row = 2, end_col = 27 }, }) assert.are.same({ "ipsum", "elit." }, text) end) end) describe("Compare regions", function() before_each(create_test_buffer) it("Should return < if before", function() local cmp = utils.compare_regions( { { start_row = 0, start_col = 0, end_row = 1, end_col = 5, } }, { { start_row = 2, start_col = 0, end_row = 3, end_col = 5, } } ) assert.are.equal("<", cmp) cmp = utils.compare_regions( { { start_row = 0, start_col = 0, end_row = 1, end_col = 5, } }, { { start_row = 1, start_col = 6, end_row = 3, end_col = 5, } } ) assert.are.equal("<", cmp) end) it("Should return > if after", function() local cmp = utils.compare_regions( { { start_row = 2, start_col = 0, end_row = 3, end_col = 5, } }, { { start_row = 0, start_col = 0, end_row = 1, end_col = 5, } } ) assert.are.equal(">", cmp) cmp = utils.compare_regions( { { start_row = 1, start_col = 6, end_row = 3, end_col = 5, } }, { { start_row = 0, start_col = 0, end_row = 1, end_col = 5, } } ) assert.are.equal(">", cmp) end) it("Should return [ if origin includes target", function() local cmp = utils.compare_regions( { { start_row = 0, start_col = 0, end_row = 3, end_col = 6, } }, { { start_row = 2, start_col = 0, end_row = 2, end_col = 5, } } ) assert.are.equal("[", cmp) cmp = utils.compare_regions( { { start_row = 0, start_col = 6, end_row = 2, end_col = 4, } }, { { start_row = 0, start_col = 7, end_row = 2, end_col = 3, } } ) assert.are.equal("[", cmp) end) it("Should return ] if target includes origin", function() local cmp = utils.compare_regions( { { start_row = 2, start_col = 0, end_row = 2, end_col = 5, } }, { { start_row = 0, start_col = 0, end_row = 3, end_col = 6, } } ) assert.are.equal("]", cmp) cmp = utils.compare_regions( { { start_row = 0, start_col = 7, end_row = 2, end_col = 3, } }, { { start_row = 0, start_col = 6, end_row = 2, end_col = 4, } } ) assert.are.equal("]", cmp) end) it("Should return = if overlap", function() local cmp = utils.compare_regions( { { start_row = 1, start_col = 0, end_row = 3, end_col = 5, } }, { { start_row = 2, start_col = 0, end_row = 4, end_col = 5, } } ) assert.are.equal("=", cmp) cmp = utils.compare_regions( { { start_row = 2, start_col = 0, end_row = 2, end_col = 2, } }, { { start_row = 2, start_col = 1, end_row = 2, end_col = 3, } } ) assert.are.equal("=", cmp) cmp = utils.compare_regions( { { start_row = 2, start_col = 1, end_row = 2, end_col = 3, } }, { { start_row = 2, start_col = 0, end_row = 2, end_col = 2, } } ) assert.are.equal("=", cmp) end) end)
23.887531
97
0.558444
0.839088
3,815
3,681
ads
Ada
vidkidz/crossbridge
[ "MIT" ]
1
vidkidz/crossbridge
[ "MIT" ]
null
vidkidz/crossbridge
[ "MIT" ]
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 2 6 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 26 package System.Pack_26 is pragma Preelaborate; Bits : constant := 26; type Bits_26 is mod 2 ** Bits; for Bits_26'Size use Bits; function Get_26 (Arr : System.Address; N : Natural) return Bits_26; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_26 (Arr : System.Address; N : Natural; E : Bits_26); -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. function GetU_26 (Arr : System.Address; N : Natural) return Bits_26; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. This version -- is used when Arr may represent an unaligned address. procedure SetU_26 (Arr : System.Address; N : Natural; E : Bits_26); -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. This version -- is used when Arr may represent an unaligned address end System.Pack_26;
58.428571
78
0.499593
0.814026
895
165
lisp
Common Lisp
alpsark/RRT-Rapidly-Exploring-Random-Tree-algorithm
[ "MIT" ]
2
alpsark/ROS-RRT-Rapidly-Exploring-Random-Tree-algorithm
[ "MIT" ]
null
alpsark/ROS-RRT-Rapidly-Exploring-Random-Tree-algorithm
[ "MIT" ]
null
(cl:in-package vrep_common-srv) (cl:export '(HANDLE-VAL HANDLE PROPERTYVALUE-VAL PROPERTYVALUE RESULT-VAL RESULT ))
20.625
31
0.557576
0.812857
54
2,906
scala
Scala
ScalablyTyped/SlinkyTyped
[ "MIT" ]
14
oyvindberg/SlinkyTyped
[ "MIT" ]
1
oyvindberg/SlinkyTyped
[ "MIT" ]
4
package typingsSlinky.openlayers.mod.olx.source import typingsSlinky.openlayers.mod.Tile import typingsSlinky.openlayers.mod.TileLoadFunctionType import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} @js.native trait BingMapsOptions extends StObject { var cacheSize: js.UndefOr[Double] = js.native var culture: js.UndefOr[String] = js.native var imagerySet: String = js.native var key: String = js.native var maxZoom: js.UndefOr[Double] = js.native var reprojectionErrorThreshold: js.UndefOr[Double] = js.native var tileLoadFunction: js.UndefOr[TileLoadFunctionType] = js.native var wrapX: js.UndefOr[Boolean] = js.native } object BingMapsOptions { @scala.inline def apply(imagerySet: String, key: String): BingMapsOptions = { val __obj = js.Dynamic.literal(imagerySet = imagerySet.asInstanceOf[js.Any], key = key.asInstanceOf[js.Any]) __obj.asInstanceOf[BingMapsOptions] } @scala.inline implicit class BingMapsOptionsMutableBuilder[Self <: BingMapsOptions] (val x: Self) extends AnyVal { @scala.inline def setCacheSize(value: Double): Self = StObject.set(x, "cacheSize", value.asInstanceOf[js.Any]) @scala.inline def setCacheSizeUndefined: Self = StObject.set(x, "cacheSize", js.undefined) @scala.inline def setCulture(value: String): Self = StObject.set(x, "culture", value.asInstanceOf[js.Any]) @scala.inline def setCultureUndefined: Self = StObject.set(x, "culture", js.undefined) @scala.inline def setImagerySet(value: String): Self = StObject.set(x, "imagerySet", value.asInstanceOf[js.Any]) @scala.inline def setKey(value: String): Self = StObject.set(x, "key", value.asInstanceOf[js.Any]) @scala.inline def setMaxZoom(value: Double): Self = StObject.set(x, "maxZoom", value.asInstanceOf[js.Any]) @scala.inline def setMaxZoomUndefined: Self = StObject.set(x, "maxZoom", js.undefined) @scala.inline def setReprojectionErrorThreshold(value: Double): Self = StObject.set(x, "reprojectionErrorThreshold", value.asInstanceOf[js.Any]) @scala.inline def setReprojectionErrorThresholdUndefined: Self = StObject.set(x, "reprojectionErrorThreshold", js.undefined) @scala.inline def setTileLoadFunction(value: (/* tile */ Tile, /* url */ String) => Unit): Self = StObject.set(x, "tileLoadFunction", js.Any.fromFunction2(value)) @scala.inline def setTileLoadFunctionUndefined: Self = StObject.set(x, "tileLoadFunction", js.undefined) @scala.inline def setWrapX(value: Boolean): Self = StObject.set(x, "wrapX", value.asInstanceOf[js.Any]) @scala.inline def setWrapXUndefined: Self = StObject.set(x, "wrapX", js.undefined) } }
35.012048
152
0.714384
0.885852
1,015
747
asm
Assembly
karttu/loda
[ "Apache-2.0" ]
null
karttu/loda
[ "Apache-2.0" ]
null
karttu/loda
[ "Apache-2.0" ]
null
; A220465: Reverse reluctant sequence of reverse reluctant sequence A004736. ; 1,2,1,1,2,1,3,1,2,1,2,3,1,2,1,1,2,3,1,2,1,4,1,2,3,1,2,1,3,4,1,2,3,1,2,1,2,3,4,1,2,3,1,2,1,1,2,3,4,1,2,3,1,2,1,5,1,2,3,4,1,2,3,1,2,1,4,5,1,2,3,4,1,2,3,1,2,1,3,4,5,1,2,3,4,1,2,3,1,2,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,6,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,5,6,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,4,5,6,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,3,4,5,6,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,2,3,4,5,6,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,1,2,3,4,5,6,1,2,3,4,5,1,2,3,4,1,2,3,1,2,1,7,1,2,3,4,5,6,1,2,3,4,5,1,2,3,4,1,2,3 cal $0,25676 ; Exponent of 8 (value of i) in n-th number of form 8^i*9^j. cal $0,25669 ; Exponent of 7 (value of i) in n-th number of form 7^i*8^j. mov $1,$0 add $1,1
93.375
501
0.564926
0.800403
618
3,111
cu
Cuda
PsychoLogicAu/GPUSteer
[ "MIT" ]
null
PsychoLogicAu/GPUSteer
[ "MIT" ]
null
PsychoLogicAu/GPUSteer
[ "MIT" ]
null
#include "SteerForCohesionCUDA.cuh" extern "C" { __host__ void SteerForCohesionKernelBindTextures( float4 const* pdBPosition, uint const numB ); __host__ void SteerForCohesionKernelUnindTextures( void ); __global__ void SteerForCohesionCUDAKernel( float4 const* pdPosition, float4 const* pdDirection, float4 * pdSteering, size_t const numA, uint const* pdKNNIndices, size_t const k, uint const numB, float const minDistance, float const maxDistance, float const cosMaxAngle, float const fWeight, uint * pdAppliedKernels, uint const doNotApplyWith ); } using namespace OpenSteer; SteerForCohesionCUDA::SteerForCohesionCUDA( AgentGroup * pAgentGroup, KNNData * pKNNData, AgentGroup * pOtherGroup, float const minDistance, float const maxDistance, float const cosMaxAngle, float const fWeight, uint const doNotApplyWith ) : AbstractCUDAKernel( pAgentGroup, fWeight, doNotApplyWith ), m_pOtherGroup( pOtherGroup ), m_pKNNData( pKNNData ), m_fCosMaxAngle( cosMaxAngle ), m_fMinDistance( minDistance ), m_fMaxDistance( maxDistance ) { // Nothing to do. } void SteerForCohesionCUDA::init( void ) { // Nothing to do. } void SteerForCohesionCUDA::run( void ) { dim3 grid = gridDim(); dim3 block = blockDim(); // Gather the required device pointers. float4 const* pdAPosition = m_pAgentGroupData->pdPosition(); float4 const* pdADirection = m_pAgentGroupData->pdDirection(); float4 * pdASteering = m_pAgentGroupData->pdSteering(); uint const& numA = getNumAgents(); uint const* pdKNNIndices = m_pKNNData->pdKNNIndices(); uint const& k = m_pKNNData->k(); float4 const* pdBPosition = m_pOtherGroup->pdPosition(); uint const& numB = m_pOtherGroup->Size(); uint * pdAppliedKernels = m_pAgentGroupData->pdAppliedKernels(); size_t const shMemSize = THREADSPERBLOCK * k * sizeof(uint); // Bind the textures. SteerForCohesionKernelBindTextures( pdBPosition, numB ); SteerForCohesionCUDAKernel<<< grid, block, shMemSize >>>( // Agent data. pdAPosition, pdADirection, pdASteering, numA, // KNN data. pdKNNIndices, k, // Other group data. numB, // Flocking data. m_fMinDistance, m_fMaxDistance, m_fCosMaxAngle, m_fWeight, pdAppliedKernels, m_doNotApplyWith ); cutilCheckMsg( "SteerForCohesionCUDAKernel failed" ); //CUDA_SAFE_CALL( cudaThreadSynchronize() ); // Unbind the textures. SteerForCohesionKernelUnindTextures(); } void SteerForCohesionCUDA::close( void ) { // Agent group data may have changed. m_pAgentGroup->SetSyncHost(); }
29.628571
240
0.611379
0.863895
1,517
2,628
cs
C#
pinguicodes/Ryujinx
[ "Unlicense" ]
null
pinguicodes/Ryujinx
[ "Unlicense" ]
null
pinguicodes/Ryujinx
[ "Unlicense" ]
null
using ChocolArm64.Memory; using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.Logging; using Ryujinx.HLE.Utilities; using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; namespace Ryujinx.HLE.HOS.Services.Acc { class IProfile : IpcService { private Dictionary<int, ServiceProcessRequest> m_Commands; public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; private UserProfile Profile; private Stream ProfilePictureStream; public IProfile(UserProfile Profile) { m_Commands = new Dictionary<int, ServiceProcessRequest>() { { 0, Get }, { 1, GetBase }, { 10, GetImageSize }, { 11, LoadImage }, }; this.Profile = Profile; ProfilePictureStream = Assembly.GetCallingAssembly().GetManifestResourceStream("Ryujinx.HLE.Ryujinx_icon.jpg"); } public long Get(ServiceCtx Context) { Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); long Position = Context.Request.ReceiveBuff[0].Position; AMemoryHelper.FillWithZeros(Context.Memory, Position, 0x80); Context.Memory.WriteInt32(Position, 0); Context.Memory.WriteInt32(Position + 4, 1); Context.Memory.WriteInt64(Position + 8, 1); return GetBase(Context); } public long GetBase(ServiceCtx Context) { Profile.Uuid.Write(Context.ResponseData); Context.ResponseData.Write(Profile.LastModifiedTimestamp); byte[] Username = StringUtils.GetFixedLengthBytes(Profile.Name, 0x20, Encoding.UTF8); Context.ResponseData.Write(Username); return 0; } private long LoadImage(ServiceCtx Context) { long BufferPosition = Context.Request.ReceiveBuff[0].Position; long BufferLen = Context.Request.ReceiveBuff[0].Size; byte[] ProfilePictureData = new byte[BufferLen]; ProfilePictureStream.Read(ProfilePictureData, 0, ProfilePictureData.Length); Context.Memory.WriteBytes(BufferPosition, ProfilePictureData); Context.ResponseData.Write(ProfilePictureStream.Length); return 0; } private long GetImageSize(ServiceCtx Context) { Context.ResponseData.Write(ProfilePictureStream.Length); return 0; } } }
29.2
123
0.626712
0.806161
737
259
asm
Assembly
ChanJLee/easy-asm
[ "Apache-2.0" ]
null
ChanJLee/easy-asm
[ "Apache-2.0" ]
null
ChanJLee/easy-asm
[ "Apache-2.0" ]
null
assume cs:code stack segment db 16 dump(0) stack ends code segment mov ax, 4200h int 21h start: mov ax, 16 mov sp, ax mov ax, stack mov ss, ax mov ax, 0 push ax ret code ends end start
12.95
21
0.525097
0.8075
95
17,659
go
Go
lagerenas/cadence
[ "MIT" ]
null
lagerenas/cadence
[ "MIT" ]
null
lagerenas/cadence
[ "MIT" ]
null
// Copyright (c) 2017 Uber Technologies, Inc. // // 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 frontend import ( "context" "go.uber.org/yarpc" "github.com/uber/cadence/.gen/go/shared" "github.com/uber/cadence/common/backoff" ) var _ Client = (*retryableClient)(nil) type retryableClient struct { client Client policy backoff.RetryPolicy isRetryable backoff.IsRetryable } // NewRetryableClient creates a new instance of Client with retry policy func NewRetryableClient(client Client, policy backoff.RetryPolicy, isRetryable backoff.IsRetryable) Client { return &retryableClient{ client: client, policy: policy, isRetryable: isRetryable, } } func (c *retryableClient) DeprecateDomain( ctx context.Context, request *shared.DeprecateDomainRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.DeprecateDomain(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) DescribeDomain( ctx context.Context, request *shared.DescribeDomainRequest, opts ...yarpc.CallOption, ) (*shared.DescribeDomainResponse, error) { var resp *shared.DescribeDomainResponse op := func() error { var err error resp, err = c.client.DescribeDomain(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) DescribeTaskList( ctx context.Context, request *shared.DescribeTaskListRequest, opts ...yarpc.CallOption, ) (*shared.DescribeTaskListResponse, error) { var resp *shared.DescribeTaskListResponse op := func() error { var err error resp, err = c.client.DescribeTaskList(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) DescribeWorkflowExecution( ctx context.Context, request *shared.DescribeWorkflowExecutionRequest, opts ...yarpc.CallOption, ) (*shared.DescribeWorkflowExecutionResponse, error) { var resp *shared.DescribeWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.DescribeWorkflowExecution(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) GetWorkflowExecutionHistory( ctx context.Context, request *shared.GetWorkflowExecutionHistoryRequest, opts ...yarpc.CallOption, ) (*shared.GetWorkflowExecutionHistoryResponse, error) { var resp *shared.GetWorkflowExecutionHistoryResponse op := func() error { var err error resp, err = c.client.GetWorkflowExecutionHistory(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) GetWorkflowExecutionRawHistory( ctx context.Context, request *shared.GetWorkflowExecutionRawHistoryRequest, opts ...yarpc.CallOption, ) (*shared.GetWorkflowExecutionRawHistoryResponse, error) { var resp *shared.GetWorkflowExecutionRawHistoryResponse op := func() error { var err error resp, err = c.client.GetWorkflowExecutionRawHistory(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) PollForWorkflowExecutionRawHistory( ctx context.Context, request *shared.PollForWorkflowExecutionRawHistoryRequest, opts ...yarpc.CallOption, ) (*shared.PollForWorkflowExecutionRawHistoryResponse, error) { var resp *shared.PollForWorkflowExecutionRawHistoryResponse op := func() error { var err error resp, err = c.client.PollForWorkflowExecutionRawHistory(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ListArchivedWorkflowExecutions( ctx context.Context, request *shared.ListArchivedWorkflowExecutionsRequest, opts ...yarpc.CallOption, ) (*shared.ListArchivedWorkflowExecutionsResponse, error) { var resp *shared.ListArchivedWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListArchivedWorkflowExecutions(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ListClosedWorkflowExecutions( ctx context.Context, request *shared.ListClosedWorkflowExecutionsRequest, opts ...yarpc.CallOption, ) (*shared.ListClosedWorkflowExecutionsResponse, error) { var resp *shared.ListClosedWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListClosedWorkflowExecutions(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ListDomains( ctx context.Context, request *shared.ListDomainsRequest, opts ...yarpc.CallOption, ) (*shared.ListDomainsResponse, error) { var resp *shared.ListDomainsResponse op := func() error { var err error resp, err = c.client.ListDomains(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ListOpenWorkflowExecutions( ctx context.Context, request *shared.ListOpenWorkflowExecutionsRequest, opts ...yarpc.CallOption, ) (*shared.ListOpenWorkflowExecutionsResponse, error) { var resp *shared.ListOpenWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListOpenWorkflowExecutions(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ListWorkflowExecutions( ctx context.Context, request *shared.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, ) (*shared.ListWorkflowExecutionsResponse, error) { var resp *shared.ListWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ListWorkflowExecutions(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ScanWorkflowExecutions( ctx context.Context, request *shared.ListWorkflowExecutionsRequest, opts ...yarpc.CallOption, ) (*shared.ListWorkflowExecutionsResponse, error) { var resp *shared.ListWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.ScanWorkflowExecutions(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) CountWorkflowExecutions( ctx context.Context, request *shared.CountWorkflowExecutionsRequest, opts ...yarpc.CallOption, ) (*shared.CountWorkflowExecutionsResponse, error) { var resp *shared.CountWorkflowExecutionsResponse op := func() error { var err error resp, err = c.client.CountWorkflowExecutions(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) GetSearchAttributes( ctx context.Context, opts ...yarpc.CallOption, ) (*shared.GetSearchAttributesResponse, error) { var resp *shared.GetSearchAttributesResponse op := func() error { var err error resp, err = c.client.GetSearchAttributes(ctx, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) PollForActivityTask( ctx context.Context, request *shared.PollForActivityTaskRequest, opts ...yarpc.CallOption, ) (*shared.PollForActivityTaskResponse, error) { var resp *shared.PollForActivityTaskResponse op := func() error { var err error resp, err = c.client.PollForActivityTask(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) PollForDecisionTask( ctx context.Context, request *shared.PollForDecisionTaskRequest, opts ...yarpc.CallOption, ) (*shared.PollForDecisionTaskResponse, error) { var resp *shared.PollForDecisionTaskResponse op := func() error { var err error resp, err = c.client.PollForDecisionTask(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) QueryWorkflow( ctx context.Context, request *shared.QueryWorkflowRequest, opts ...yarpc.CallOption, ) (*shared.QueryWorkflowResponse, error) { var resp *shared.QueryWorkflowResponse op := func() error { var err error resp, err = c.client.QueryWorkflow(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) RecordActivityTaskHeartbeat( ctx context.Context, request *shared.RecordActivityTaskHeartbeatRequest, opts ...yarpc.CallOption, ) (*shared.RecordActivityTaskHeartbeatResponse, error) { var resp *shared.RecordActivityTaskHeartbeatResponse op := func() error { var err error resp, err = c.client.RecordActivityTaskHeartbeat(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) RecordActivityTaskHeartbeatByID( ctx context.Context, request *shared.RecordActivityTaskHeartbeatByIDRequest, opts ...yarpc.CallOption, ) (*shared.RecordActivityTaskHeartbeatResponse, error) { var resp *shared.RecordActivityTaskHeartbeatResponse op := func() error { var err error resp, err = c.client.RecordActivityTaskHeartbeatByID(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) RegisterDomain( ctx context.Context, request *shared.RegisterDomainRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RegisterDomain(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RequestCancelWorkflowExecution( ctx context.Context, request *shared.RequestCancelWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RequestCancelWorkflowExecution(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) ResetStickyTaskList( ctx context.Context, request *shared.ResetStickyTaskListRequest, opts ...yarpc.CallOption, ) (*shared.ResetStickyTaskListResponse, error) { var resp *shared.ResetStickyTaskListResponse op := func() error { var err error resp, err = c.client.ResetStickyTaskList(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ResetWorkflowExecution( ctx context.Context, request *shared.ResetWorkflowExecutionRequest, opts ...yarpc.CallOption, ) (*shared.ResetWorkflowExecutionResponse, error) { var resp *shared.ResetWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.ResetWorkflowExecution(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) RespondActivityTaskCanceled( ctx context.Context, request *shared.RespondActivityTaskCanceledRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondActivityTaskCanceled(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RespondActivityTaskCanceledByID( ctx context.Context, request *shared.RespondActivityTaskCanceledByIDRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondActivityTaskCanceledByID(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RespondActivityTaskCompleted( ctx context.Context, request *shared.RespondActivityTaskCompletedRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondActivityTaskCompleted(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RespondActivityTaskCompletedByID( ctx context.Context, request *shared.RespondActivityTaskCompletedByIDRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondActivityTaskCompletedByID(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RespondActivityTaskFailed( ctx context.Context, request *shared.RespondActivityTaskFailedRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondActivityTaskFailed(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RespondActivityTaskFailedByID( ctx context.Context, request *shared.RespondActivityTaskFailedByIDRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondActivityTaskFailedByID(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RespondDecisionTaskCompleted( ctx context.Context, request *shared.RespondDecisionTaskCompletedRequest, opts ...yarpc.CallOption, ) (*shared.RespondDecisionTaskCompletedResponse, error) { var resp *shared.RespondDecisionTaskCompletedResponse op := func() error { var err error resp, err = c.client.RespondDecisionTaskCompleted(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) RespondDecisionTaskFailed( ctx context.Context, request *shared.RespondDecisionTaskFailedRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondDecisionTaskFailed(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) RespondQueryTaskCompleted( ctx context.Context, request *shared.RespondQueryTaskCompletedRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.RespondQueryTaskCompleted(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) SignalWithStartWorkflowExecution( ctx context.Context, request *shared.SignalWithStartWorkflowExecutionRequest, opts ...yarpc.CallOption, ) (*shared.StartWorkflowExecutionResponse, error) { var resp *shared.StartWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.SignalWithStartWorkflowExecution(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) SignalWorkflowExecution( ctx context.Context, request *shared.SignalWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.SignalWorkflowExecution(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) StartWorkflowExecution( ctx context.Context, request *shared.StartWorkflowExecutionRequest, opts ...yarpc.CallOption, ) (*shared.StartWorkflowExecutionResponse, error) { var resp *shared.StartWorkflowExecutionResponse op := func() error { var err error resp, err = c.client.StartWorkflowExecution(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) TerminateWorkflowExecution( ctx context.Context, request *shared.TerminateWorkflowExecutionRequest, opts ...yarpc.CallOption, ) error { op := func() error { return c.client.TerminateWorkflowExecution(ctx, request, opts...) } return backoff.Retry(op, c.policy, c.isRetryable) } func (c *retryableClient) UpdateDomain( ctx context.Context, request *shared.UpdateDomainRequest, opts ...yarpc.CallOption, ) (*shared.UpdateDomainResponse, error) { var resp *shared.UpdateDomainResponse op := func() error { var err error resp, err = c.client.UpdateDomain(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) GetClusterInfo( ctx context.Context, opts ...yarpc.CallOption, ) (*shared.ClusterInfo, error) { var resp *shared.ClusterInfo op := func() error { var err error resp, err = c.client.GetClusterInfo(ctx, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err } func (c *retryableClient) ListTaskListPartitions( ctx context.Context, request *shared.ListTaskListPartitionsRequest, opts ...yarpc.CallOption, ) (*shared.ListTaskListPartitionsResponse, error) { var resp *shared.ListTaskListPartitionsResponse op := func() error { var err error resp, err = c.client.ListTaskListPartitions(ctx, request, opts...) return err } err := backoff.Retry(op, c.policy, c.isRetryable) return resp, err }
27.941456
108
0.752761
0.937148
5,804
821
lua
Lua
RebelliousKiwi04/deepcore
[ "MIT" ]
3
RebelliousKiwi04/deepcore
[ "MIT" ]
3
RebelliousKiwi04/deepcore
[ "MIT" ]
2
require("deepcore/std/class") require("deepcore/statemachine/dsl/transition-effect-builders/PlanetTransferBuilder") require("deepcore/statemachine/dsl/transition-effect-builders/SetTechLevelBuilder") require("deepcore/statemachine/dsl/transition-effect-builders/SpawnHeroBuilder") ---@class TransitionEffectBuilderFactory TransitionEffectBuilderFactory = class() function TransitionEffectBuilderFactory:new(plugin_ctx) self.ctx = plugin_ctx end ---@vararg string function TransitionEffectBuilderFactory:transfer_planets(...) return PlanetTransferBuilder(unpack(arg)) end function TransitionEffectBuilderFactory:set_tech_level(level) return SetTechLevelBuilder(level) end function TransitionEffectBuilderFactory:spawn_hero(hero) return SpawnHeroBuilder(hero) end return TransitionEffectBuilderFactory
31.576923
85
0.845311
0.810601
234
1,301
t
Perl
madhavmurthy93/roadrunner
[ "Apache-2.0" ]
5
dchandran/evolvenetworks
[ "BSD-3-Clause" ]
8
dchandran/evolvenetworks
[ "BSD-3-Clause" ]
7
use Test::More; BEGIN { plan tests => 21 }; use LibSBML; use strict; ######################### SKIP : { skip("CompartmentVolumeRule is obsolete",21); # creation w/o arguments my $cvr = new LibSBML::CompartmentVolumeRule(); ok($cvr->getTypeCode() == $LibSBML::SBML_COMPARTMENT_VOLUME_RULE); ok($cvr->getType() == $LibSBML::RULE_TYPE_SCALAR); ok($cvr->getMetaId(), ''); ok($cvr->getNotes(), ''); ok($cvr->getAnnotation(), ''); ok($cvr->isSetFormula(), 0); ok($cvr->getFormula(), ''); ok($cvr->isSetCompartment(), 0); ok($cvr->getCompartment(), ''); # creation w/ arguments # note: the order of arguments differs between the c++ and c interface !!! $cvr = new LibSBML::CompartmentVolumeRule('nucleus', 'v + 1', $LibSBML::RULE_TYPE_RATE); ok($cvr->getTypeCode() == $LibSBML::SBML_COMPARTMENT_VOLUME_RULE); ok($cvr->getType() == $LibSBML::RULE_TYPE_RATE); ok($cvr->getMetaId(), ''); ok($cvr->getNotes(), ''); ok($cvr->getAnnotation(), ''); ok($cvr->isSetFormula(), 1); ok($cvr->getFormula(), 'v + 1'); ok($cvr->isSetCompartment(), 1); ok($cvr->getCompartment(), 'nucleus'); # set/get field compartment $cvr->setCompartment('cell'); ok($cvr->isSetCompartment(), 1); ok($cvr->getCompartment(), 'cell'); $cvr->setCompartment($cvr->getCompartment()); ok($cvr->getCompartment(), 'cell'); }
27.680851
74
0.645657
0.863168
532
4,563
rmd
RMarkdown
rajamukherji/wrapl-apps
[ "MIT" ]
null
rajamukherji/wrapl-apps
[ "MIT" ]
null
rajamukherji/wrapl-apps
[ "MIT" ]
null
\IMP Fmt.LaTeX.iTeX; \IMP Fmt.Xml; \IMP IO.Buffer; \IMP IO.Terminal USE Out; \IMP Std.String; \IMP Util.Base64; \IMP Gir.Cairo; \DEF math(text) out:write(iTeX.ToMathML('${text:map("$", "\\")}$')); \METH begin(=math) push(Buffer.New()); \METH end(=math) ( VAR buffer <- pop(); out:write(iTeX.ToMathML('$${buffer:rest:map("$", "\\")}$$')); ); \DEF draw(width, height, callback) ( VAR surface <- Cairo.Surface.ImageSurfaceCreate(Cairo.Format.Argb32, width, height); VAR cairo <- Cairo.Cairo.Create(surface); callback(cairo); VAR buffer <- Buffer.New(); surface:write_to_png_stream(<buffer, data, length> ( buffer:write(data, length); RET Cairo.Status.Success; ), buffer); out:write('<img width="{width}" height="{height}" src="data:image/png;base64,{Base64.Encode(buffer:rest)}"/>'); ); \DEF id(text) ( VAR xml <- Xml.LoadString(iTeX.ToMathML('${text:map("$", "\\")}$')); VAR id <- '$ID{ids:size}$'; ids:insert(id, xml); out:write(id); ); \DEF head() (); \METH begin(=head) push(Buffer.New() \ $:write("<head>")); \METH end(=head) ( VAR buffer <- pop(); buffer:write('</head>'); VAR xml <- Xml.Load(buffer); EVERY document:head:append(xml:content:values); ); \begin(head); <title>Rabs Technical Overview</title> \end(head); # About ## About Wrapl is a high level, dynamically typed interpreted programming language. Here's some new inline maths: \math("f(x) = \\int_{a}^{b} \\left(\\frac{x^2 + 10}{5}\\right)^4 dx");. ## Features * Object-oriented: Every value in Wrapl is an object with a type which is known at runtime. The types form a hierarchy with multiple inheritence. * Multiple-dispatch: Method dispatch in Wrapl depend on the types and values of all of their arguments. * Pass-by-reference: Wrapl allows variables to be passed by reference to other functions. * Functional closures: Functions in Wrapl are first-class objects which may passed to other functions or stored in variables. Functions can both read and write variables declared in surrounding scopes. * Goal-directed: Every expression in Wrapl can produce 0, 1, or more values. An expression which can produce more than 1 value may be resumed to produce its next value. For some sample Wrapl code, `check` out the [samples pages](samples.html). ## Sample ``` wrapl MOD MarkdownTest; IMP IO.Terminal USE Out; IMP Markdown.Parser; DEF Print(args*) ( Out:write(args:length); EVERY Out:writes(' <{1 SKIP args:values}>'); Out:write("\;n"); ); VAR parser <- Parser.New(NIL); parser:enter_block <- Print; parser:leave_block <- Print; parser:enter_span <- Print; parser:leave_span <- Print; parser:text <- Print; parser:write(>>EOI ## Header &amp; Stuff * A * B * C --- ~~~ this is a test int main() { } ~~~ EOI); END MarkdownTest. ``` ### Also ``` wrapl IMP IO.File; WITH file <- File.Open("Render.wrapl", File.Flag.Read + File.Flag.Text) DO file:copy(out); ``` ### Images This should be an image: \draw(256, 256; cairo) ( cairo:rectangle(0.0, 0.0, 256.0, 256.0); cairo:set_source_rgba(1.0, 0.0, 0.0, 1.0); cairo:stroke; ); Inline code looks like this `Out:write("Hello world");`. ### Header code: `MOD Test; \id("x^2");:test; END Test.` ### Maths \math("x^2 + 1"); ``` wrapl VAR \id("x_1"); <- 200; ``` This is an equation, hopefully: \math("$int_{a}^{b} $left($frac{x^2 + 10}{5}$right)^4 dx");. And this should be a block equation: \begin(math); A $coloneqq $begin{bmatrix} x_{11} & x_{12} & x_{13} & $dots & x_{1n} $$ x_{21} & x_{22} & x_{23} & $dots & x_{2n} $$ x_{21} & x_{22} & x_{23} & $dots & x_{2n} $$ x_{21} & x_{22} & x_{23} & $dots & x_{2n} $$ $vdots & $vdots & $vdots & $ddots & $vdots $$ x_{d1} & x_{d2} & x_{d3} & $dots & x_{dn} $end{bmatrix} \end(math); ## Status * The main [module loader](/tools/riva.html) is fully functional. * The [Wrapl module](/doc/Wrapl/Loader.html) has been implemented. * A number of [basic libraries](/doc.html#libraries) have been written. * An [interactive interpreter](/tools/wrapl.html) exists for test Wrapl code. * A Wrapl based [preprocessor](/tools/wrpp.html) has been written in Wrapl and is used to generate this website. * A [linker](/tools/rlink.html) has been written to generate [Riva](/tools/riva.html) binary modules from object files. ## Contact For any questions or comments regarding Wrapl, you can use the [mailing list](https://lists.sourceforge.net/lists/listinfo/wrapl-discussion) or send an email me directly at _rajamukherji AT gmail.com_. You can visit the project website [here](\write("http://test");) or [here](http://test).
29.25
201
0.669297
0.88257
1,732
614
md
Markdown
citelao/winrt-api
[ "CC-BY-4.0", "MIT" ]
199
citelao/winrt-api
[ "CC-BY-4.0", "MIT" ]
2,093
citelao/winrt-api
[ "CC-BY-4.0", "MIT" ]
620
--- -api-id: T:Windows.Devices.SmartCards.SmartCardCryptogramStorageKeyAlgorithm -api-type: winrt enum --- <!-- Enumeration syntax public enum Windows.Devices.SmartCards.SmartCardCryptogramStorageKeyAlgorithm : int --> # SmartCardCryptogramStorageKeyAlgorithm ## -description Defines cryptogram storage key algorithms. ## -enum-fields ### -field None:0 The storage key is not encrypted. ### -field Rsa2048:1 The storage key is encrypted by RSA-2048. ## -remarks ## -examples ## -see-also [Create an NFC Smart Card app (applies to Windows 10 Mobile only)](/windows/uwp/devices-sensors/host-card-emulation)
21.172414
116
0.763844
0.846807
208
3,164
rmd
RMarkdown
avs20/Data-analyst-NanoDegree
[ "MIT" ]
null
avs20/Data-analyst-NanoDegree
[ "MIT" ]
null
avs20/Data-analyst-NanoDegree
[ "MIT" ]
4
Lesson 4 ======================================================== *** ### Scatterplots and Perceived Audience Size Notes: *** ### Scatterplots Notes: ```{r Scatterplots} ``` *** #### What are some things that you notice right away? Response: *** ### ggplot Syntax Notes: ```{r ggplot Syntax} ``` *** ### Overplotting Notes: ```{r Overplotting} ``` #### What do you notice in the plot? Response: *** ### Coord_trans() Notes: ```{r Coord_trans()} ``` #### Look up the documentation for coord_trans() and add a layer to the plot that transforms friend_count using the square root function. Create your plot! ```{r} ``` #### What do you notice? *** ### Alpha and Jitter Notes: ```{r Alpha and Jitter} ``` *** ### Overplotting and Domain Knowledge Notes: *** ### Conditional Means Notes: ```{r Conditional Means} ``` Create your plot! ```{r Conditional Means Plot} ``` *** ### Overlaying Summaries with Raw Data Notes: ```{r Overlaying Summaries with Raw Data} ``` #### What are some of your observations of the plot? Response: *** ### Moira: Histogram Summary and Scatterplot See the Instructor Notes of this video to download Moira's paper on perceived audience size and to see the final plot. Notes: *** ### Correlation Notes: ```{r Correlation} ``` Look up the documentation for the cor.test function. What's the correlation between age and friend count? Round to three decimal places. Response: *** ### Correlation on Subsets Notes: ```{r Correlation on Subsets} with( , cor.test(age, friend_count)) ``` *** ### Correlation Methods Notes: *** ## Create Scatterplots Notes: ```{r} ``` *** ### Strong Correlations Notes: ```{r Strong Correlations} ``` What's the correlation betwen the two variables? Include the top 5% of values for the variable in the calculation and round to 3 decimal places. ```{r Correlation Calcuation} ``` Response: *** ### Moira on Correlation Notes: *** ### More Caution with Correlation Notes: ```{r More Caution With Correlation} install.packages('alr3') library(alr3) ``` Create your plot! ```{r Temp vs Month} ``` *** ### Noisy Scatterplots a. Take a guess for the correlation coefficient for the scatterplot. b. What is the actual correlation of the two variables? (Round to the thousandths place) ```{r Noisy Scatterplots} ``` *** ### Making Sense of Data Notes: ```{r Making Sense of Data} ``` *** ### A New Perspective What do you notice? Response: Watch the solution video and check out the Instructor Notes! Notes: *** ### Understanding Noise: Age to Age Months Notes: ```{r Understanding Noise: Age to Age Months} ``` *** ### Age with Months Means ```{r Age with Months Means} ``` Programming Assignment ```{r Programming Assignment} ``` *** ### Noise in Conditional Means ```{r Noise in Conditional Means} ``` *** ### Smoothing Conditional Means Notes: ```{r Smoothing Conditional Means} ``` *** ### Which Plot to Choose? Notes: *** ### Analyzing Two Variables Reflection: *** Click **KnitHTML** to see all of your hard work and to have an html page of this lesson, your answers, and your notes!
11.762082
155
0.649178
0.84104
1,109
4,786
jl
Julia
floforsthuber/2022_01_comext.jl
[ "MIT" ]
null
floforsthuber/2022_01_comext.jl
[ "MIT" ]
null
floforsthuber/2022_01_comext.jl
[ "MIT" ]
null
# ------------------------------------------------------------------------------------------------------------------------------------------------------------- # Unit prices # ------------------------------------------------------------------------------------------------------------------------------------------------------------- # compute UNIT_PRICE transform!(df, [:VALUE_IN_EUROS, :QUANTITY_IN_KG] => ByRow((v,q) -> v/q) => :UNIT_PRICE) # compute UNIT_PRICE_CHANGE cols_grouping = ["DECLARANT_ISO", "PARTNER_ISO", "PRODUCT_NC", "FLOW"] gdf = groupby(df, cols_grouping) df = transform(gdf, :UNIT_PRICE => pct_change => :UNIT_PRICE_CHANGE) # compute MOM_PRICE_CHANGE cols_grouping = ["DECLARANT_ISO", "PARTNER_ISO", "PRODUCT_NC", "FLOW"] gdf = groupby(df, cols_grouping) df = transform(gdf, [:PERIOD, :UNIT_PRICE] => mom_change => :MOM) # export data df_export = subset(df, :PERIOD => ByRow( x-> string(x) == year*sub_month)) CSV.write(dir_io * "clean/" * "df_prices_" * year * sub_month * ".csv", df_export) # ------------------------------------------------------------------------------------------------------------------------------------------------------------- # Share of Belgium # ------------------------------------------------------------------------------------------------------------------------------------------------------------- # compute EU_WORLD (EU imports/exports to the entire world) cols_grouping = ["PRODUCT_NC", "FLOW", "PERIOD"] prod_class_other = ["PRODUCT_SITC", "PRODUCT_CPA2002", "PRODUCT_CPA2008", "PRODUCT_CPA2_1", "PRODUCT_BEC", "PRODUCT_BEC5"] cols_grouping = [cols_grouping; prod_class_other] gdf = groupby(df, cols_grouping) df_sum_EU_WORLD = combine(gdf, [:VALUE_IN_EUROS, :QUANTITY_IN_KG] .=> (x -> sum(skipmissing(x))), renamecols=false) df_sum_EU_WORLD.TRADE_TYPE .= "total" # compute EU_EXTRA and EU_INTRA (EU imports/exports to extra/intra EU countries) cols_grouping = ["TRADE_TYPE", "PRODUCT_NC", "FLOW", "PERIOD"] cols_grouping = [cols_grouping; prod_class_other] gdf = groupby(df, cols_grouping) df_sum_EU_EXTRA_INTRA = combine(gdf, [:VALUE_IN_EUROS, :QUANTITY_IN_KG] .=> (x -> sum(skipmissing(x))), renamecols=false) # compute BE_WORLD (BE imports/exports to the entire world) df_BE = subset(df, :DECLARANT_ISO => ByRow(x -> x == "BE")) cols_grouping = ["PRODUCT_NC", "FLOW", "PERIOD"] cols_grouping = [cols_grouping; prod_class_other] gdf = groupby(df_BE, cols_grouping) df_sum_BE_WORLD = combine(gdf, [:VALUE_IN_EUROS, :QUANTITY_IN_KG] .=> (x -> sum(skipmissing(x))), renamecols=false) df_sum_BE_WORLD.TRADE_TYPE .= "total" # compute BE_EXTRA and BE_INTRA (BE imports/exports to extra/intra EU countries) cols_grouping = ["TRADE_TYPE", "PRODUCT_NC", "FLOW", "PERIOD"] cols_grouping = [cols_grouping; prod_class_other] gdf = groupby(df_BE, cols_grouping) df_sum_BE_EXTRA_INTRA = combine(gdf, [:VALUE_IN_EUROS, :QUANTITY_IN_KG] .=> (x -> sum(skipmissing(x))), renamecols=false) # merge tables df_sum_EU = vcat(df_sum_EU_EXTRA_INTRA, df_sum_EU_WORLD) df_sum_BE = vcat(df_sum_BE_EXTRA_INTRA, df_sum_BE_WORLD) # join, rename and compute shares in percentages (?) cols_join = ["TRADE_TYPE", "PRODUCT_NC", "FLOW", "PERIOD"] cols_join = [cols_join; prod_class_other] df_join = leftjoin(df_sum_EU, df_sum_BE, on=cols_join, makeunique=true) rename!(df_join, ["VALUE_IN_EUROS", "QUANTITY_IN_KG", "VALUE_IN_EUROS_1", "QUANTITY_IN_KG_1"] .=> ["VALUE_EU", "QUANITY_EU", "VALUE_BE", "QUANITY_BE"]) df_join.VALUE_SHARE = df_join.VALUE_BE ./ df_join.VALUE_EU .* 100 df_join.QUANTITY_SHARE = df_join.QUANITY_BE ./ df_join.QUANITY_EU .* 100 # possibly need to sort before grouping, seems that grouping sorts incorrectly sometimes? sort!(df_join, [:PRODUCT_NC, :FLOW, :TRADE_TYPE, :PERIOD]) # dont understand why I need the sorting here? otherwise some MOM are not taken? # compute SHARE_CHANGE cols_grouping = ["TRADE_TYPE", "PRODUCT_NC", "FLOW"] gdf = groupby(df_join, cols_grouping) df_share_BE = transform(gdf, [:VALUE_SHARE, :QUANTITY_SHARE] .=> pct_change .=> [:VALUE_SHARE_CHANGE, :QUANTITY_SHARE_CHANGE]) # compute MOM_CHANGE cols_grouping = ["TRADE_TYPE", "PRODUCT_NC", "FLOW"] gdf = groupby(df_share_BE, cols_grouping) df_share_BE = transform(gdf, [:PERIOD, :VALUE_SHARE] => mom_change => :MOM_VALUE, [:PERIOD, :QUANTITY_SHARE] => mom_change => :MOM_QUANTITY) # export data df_export = subset(df_share_BE, :PERIOD => ByRow( x-> string(x) == year*sub_month)) CSV.write(dir_io * "clean/" * "df_share_BE_" * year * sub_month * ".csv", df_export) # -------------------------------------------------------------------------------------------------------------------------------------------------------------
53.775281
160
0.598412
0.815707
1,774
947
csh
Tcsh
wsvincent/djangoforbeginners_32
[ "MIT" ]
5
wsvincent/djangoforbeginners_32
[ "MIT" ]
null
wsvincent/djangoforbeginners_32
[ "MIT" ]
null
# This file must be used with "source bin/activate.csh" *from csh*. # You cannot run it directly. # Created by Davide Di Blasi <davidedb@gmail.com>. # Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com> alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' # Unset irrelevant variables. deactivate nondestructive setenv VIRTUAL_ENV "/Users/wsv/Desktop/10_12_21_dfb/ch10-bootstrap/.venv" set _OLD_VIRTUAL_PATH="$PATH" setenv PATH "$VIRTUAL_ENV/bin:$PATH" set _OLD_VIRTUAL_PROMPT="$prompt" if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then set prompt = "(.venv) $prompt" setenv VIRTUAL_ENV_PROMPT "(.venv) " endif alias pydoc python -m pydoc rehash
35.074074
324
0.75396
0.821591
397
217
als
Alloy
Kaixi26/org.alloytools.alloy
[ "Apache-2.0" ]
null
Kaixi26/org.alloytools.alloy
[ "Apache-2.0" ]
null
Kaixi26/org.alloytools.alloy
[ "Apache-2.0" ]
null
open main pred idmZbJmPW6aFRYmzNzp_prop12 { eventually always some f:File | f not in Trash implies f in Trash' } pred __repair { idmZbJmPW6aFRYmzNzp_prop12 } check __repair { idmZbJmPW6aFRYmzNzp_prop12 <=> prop12o }
36.166667
68
0.797235
0.82
113
5,038
groovy
Groovy
sharmajiii/so
[ "Apache-2.0" ]
16
sharmajiii/so
[ "Apache-2.0" ]
4
sharmajiii/so
[ "Apache-2.0" ]
22
package org.onap.so.bpmn.infrastructure.scripts import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.junit.Before import org.junit.Test import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mockito import org.onap.so.bpmn.common.scripts.MsoGroovyTest import static org.junit.Assert.assertEquals import static org.junit.Assert.assertNotNull import static org.mockito.ArgumentMatchers.eq import static org.mockito.Mockito.times import static org.mockito.Mockito.when class ActivateSliceServiceTest extends MsoGroovyTest { @Before void init() throws IOException { super.init("ActivateSliceService") } @Captor static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class) @Test void testPreProcessRequest() { String req = """ { "globalSubscriberId": "5GCustomer", "serviceType": "5G", "operationId": "test123" } """ when(mockExecution.getVariable("bpmnRequest")).thenReturn(req) when(mockExecution.getVariable("mso-request-id")).thenReturn("54321") when(mockExecution.getVariable("serviceInstanceId")).thenReturn("12345") when(mockExecution.getVariable("operationType")).thenReturn("activation") ActivateSliceService service = new ActivateSliceService() service.preProcessRequest(mockExecution) Mockito.verify(mockExecution, times(7)).setVariable(captor.capture(), captor.capture()) } @Test void testPrepareInitOperationStatus() { when(mockExecution.getVariable("serviceInstanceId")).thenReturn("12345") when(mockExecution.getVariable("operationId")).thenReturn("54321") when(mockExecution.getVariable("globalSubscriberId")).thenReturn("11111") ActivateSliceService service = new ActivateSliceService() service.prepareInitServiceOperationStatus(mockExecution) Mockito.verify(mockExecution, times(1)).setVariable(eq("updateOperationStatus"), captor.capture()) String res = captor.getValue() assertNotNull(res) } @Test void testSendSyncResponse() { when(mockExecution.getVariable("operationId")).thenReturn("123456") when(mockExecution.getVariable("serviceInstanceId")).thenReturn("12345") ActivateSliceService service = new ActivateSliceService() service.sendSyncResponse(mockExecution) Mockito.verify(mockExecution, times(1)).setVariable(eq("sentSyncResponse"), captor.capture()) def updateVolumeGroupRequest = captor.getValue() assertEquals(updateVolumeGroupRequest, true) } private static getExpectPayload = { String type, String result, String progress, String operationContent -> String expect = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://org.onap.so/requestsdb"> <soapenv:Header/> <soapenv:Body> <ns:${type} xmlns:ns="http://org.onap.so/requestsdb"> <serviceId>12345</serviceId> <operationId>54321</operationId> <operationType>activate</operationType> <userId>11111</userId> <result>${result}</result> <operationContent>${operationContent}</operationContent> <progress>${progress}</progress> <reason></reason> </ns:${type}> </soapenv:Body> </soapenv:Envelope> """ return expect } @Test void testPrepareCompleteStatus() { when(mockExecution.getVariable("serviceInstanceId")).thenReturn("12345") when(mockExecution.getVariable("operationId")).thenReturn("54321") when(mockExecution.getVariable("operationType")).thenReturn("activate") when(mockExecution.getVariable("operationContent")) .thenReturn("slice service activate operation finished") when(mockExecution.getVariable("globalSubscriberId")).thenReturn("11111") when(mockExecution.getVariable("operationStatus")) .thenReturn("deactivated") ActivateSliceService service = new ActivateSliceService() service.prepareCompletionRequest(mockExecution) Mockito.verify(mockExecution, times(1)).setVariable(eq("updateOperationStatus"), captor.capture()) String res = captor.getValue() String expect = getExpectPayload("updateServiceOperationStatus", "finished", "100", "slice service activate operation finished") assertEquals(expect.replaceAll("\\s+", ""), res.replaceAll("\\s+", "")) } }
42.336134
111
0.63557
0.807154
1,327
669
frag
GLSL
dermotte/cg-lecture-2021
[ "Apache-2.0" ]
null
dermotte/cg-lecture-2021
[ "Apache-2.0" ]
null
dermotte/cg-lecture-2021
[ "Apache-2.0" ]
null
#ifdef GL_ES precision mediump float; #endif // Phong Fragment shader varying vec4 vertColor; varying vec3 vertNormal; varying vec3 vertLightDir; void main() { float amb = 0.2; // vec3 reflectionDir = normalize(-reflect(-vertLightDir,vertNormal)); vec3 reflectionDir = 2.0 * dot(-vertLightDir, vertNormal) * vertNormal + vertLightDir; // that's actually a reflection! vec4 spec = 0.2 * vec4(1.0, 1.0, 1.0, 1.0) * pow(max(dot(reflectionDir,-vertLightDir),0.0), 75.0) ; float diff = max(0.0, dot(vertLightDir, vertNormal)) * (1.0-amb); gl_FragColor = vec4(diff, diff, diff, 1.0-amb) * vertColor + spec + vec4(amb, amb, amb, amb) * vertColor ; }
30.409091
121
0.684604
0.820036
268
17,114
el
Emacs Lisp
AlohaWorld/emacs
[ "Artistic-2.0" ]
null
AlohaWorld/emacs
[ "Artistic-2.0" ]
null
AlohaWorld/emacs
[ "Artistic-2.0" ]
null
;;; w3m-autoloads.el --- automatically extracted autoloads ;; ;;; Code: (add-to-list 'load-path (or (file-name-directory #$) (car load-path))) ;;;### (autoloads nil "bookmark-w3m" "bookmark-w3m.el" (21819 36157 ;;;;;; 0 0)) ;;; Generated autoloads from bookmark-w3m.el (autoload 'bookmark-w3m-bookmark-jump "bookmark-w3m" "\ Default bookmark handler for w3m buffers. \(fn BOOKMARK)" nil nil) ;;;*** ;;;### (autoloads nil "mime-w3m" "mime-w3m.el" (21819 36157 0 0)) ;;; Generated autoloads from mime-w3m.el (autoload 'mime-w3m-preview-text/html "mime-w3m" "\ \(fn ENTITY SITUATION)" nil nil) ;;;*** ;;;### (autoloads nil "w3m" "w3m.el" (21819 36159 0 0)) ;;; Generated autoloads from w3m.el (autoload 'w3m-retrieve "w3m" "\ Retrieve web contents pointed to by URL. It will put the retrieved contents into the current buffer. If HANDLER is nil, this function will retrieve web contents, return the content type of the retrieved data, and then come to an end. This behavior is what is called a synchronous operation. You have to specify HANDLER in order to make this function show its real ability, which is called an asynchronous operation. If HANDLER is a function, this function will come to an end in no time. In this case, contents will be retrieved by the asynchronous process after a while. And after finishing retrieving contents successfully, HANDLER will be called on the buffer where this function starts. The content type of the retrieved data will be passed to HANDLER as a string argument. NO-UNCOMPRESS specifies whether this function should not uncompress contents. NO-CACHE specifies whether this function should not use cached contents. POST-DATA and REFERER will be sent to the web server with a request. \(fn URL &optional NO-UNCOMPRESS NO-CACHE POST-DATA REFERER HANDLER)" nil nil) (autoload 'w3m-download "w3m" "\ Download contents of URL to a file named FILENAME. NO-CHACHE (which the prefix argument gives when called interactively) specifies not using the cached data. \(fn &optional URL FILENAME NO-CACHE HANDLER POST-DATA)" t nil) (autoload 'w3m-goto-url "w3m" "\ Visit World Wide Web pages. This is the primitive function of `w3m'. If the second argument RELOAD is non-nil, reload a content of URL. Except that if it is 'redisplay, re-display the page without reloading. The third argument CHARSET specifies a charset to be used for decoding a content. The fourth argument POST-DATA should be a string or a cons cell. If it is a string, it makes this function request a body as if the content-type is \"x-www-form-urlencoded\". If it is a cons cell, the car of a cell is used as the content-type and the cdr of a cell is used as the body. If the fifth argument REFERER is specified, it is used for a Referer: field for this request. The remaining HANDLER, ELEMENT[1], NO-POPUP, and SAVE-POS[2] are for the internal operations of emacs-w3m. You can also use \"quicksearch\" url schemes such as \"gg:emacs\" which would search for the term \"emacs\" with the Google search engine. See the `w3m-search' function and the variable `w3m-uri-replace-alist'. Notes for the developers: \[1] ELEMENT is a history element which has already been registered in the `w3m-history-flat' variable. It is corresponding to URL to be retrieved at this time, not for the url of the current page. \[2] SAVE-POS leads this function to save the current emacs-w3m window configuration; i.e. to run `w3m-history-store-position'. `w3m-history-store-position' should be called in a w3m-mode buffer, so this will be convenient if a command that calls this function may be invoked in other than a w3m-mode buffer. \(fn URL &optional RELOAD CHARSET POST-DATA REFERER HANDLER ELEMENT NO-POPUP SAVE-POS)" t nil) (autoload 'w3m-goto-url-new-session "w3m" "\ Visit World Wide Web pages in a new session. If you invoke this command in the emacs-w3m buffer, the new session will be created by copying the current session. Otherwise, the new session will start afresh. \(fn URL &optional RELOAD CHARSET POST-DATA REFERER)" t nil) (autoload 'w3m-gohome "w3m" "\ Go to the Home page. \(fn)" t nil) (autoload 'w3m-create-empty-session "w3m" "\ Create an empty page as a new session and visit it. \(fn)" t nil) (autoload 'w3m "w3m" "\ Visit World Wide Web pages using the external w3m command. When you invoke this command interactively for the first time, it will visit a page which is pointed to by a string like url around the cursor position or the home page specified by the `w3m-home-page' variable, but you will be prompted for a URL if `w3m-quick-start' is nil (default t) or `w3m-home-page' is nil. The variables `w3m-pop-up-windows' and `w3m-pop-up-frames' control whether this command should pop to a window or a frame up for the session. When emacs-w3m sessions have already been opened, this command will pop to the existing window or frame up, but if `w3m-quick-start' is nil, (default t), you will be prompted for a URL (which defaults to `popup' meaning to pop to an existing emacs-w3m buffer up). In addition, if the prefix argument is given or you enter the empty string for the prompt, this command will visit a url at the point, or the home page the `w3m-home-page' variable specifies, or the \"about:\" page. You can also run this command in the batch mode as follows: emacs -f w3m http://emacs-w3m.namazu.org/ & In that case, or if this command is called non-interactively, the variables `w3m-pop-up-windows' and `w3m-pop-up-frames' will be ignored \(treated as nil) and it will run emacs-w3m at the current (or the initial) window. If the optional NEW-SESSION is non-nil, this function makes a new emacs-w3m buffer. Besides that, it also makes a new emacs-w3m buffer if `w3m-make-new-session' is non-nil and a user specifies a url string. The optional INTERACTIVE-P is for the internal use; it is mainly used to check whether Emacs 22 or later calls this function as an interactive command in the batch mode. \(fn &optional URL NEW-SESSION INTERACTIVE-P)" t nil) (autoload 'w3m-browse-url "w3m" "\ Ask emacs-w3m to browse URL. NEW-SESSION specifies whether to create a new emacs-w3m session. URL defaults to the string looking like a url around the cursor position. Pop to a window or a frame up according to `w3m-pop-up-windows' and `w3m-pop-up-frames'. \(fn URL &optional NEW-SESSION)" t nil) (autoload 'w3m-find-file "w3m" "\ Function used to open FILE whose name is expressed in ordinary format. The file name will be converted into the file: scheme. \(fn FILE)" t nil) (autoload 'w3m-region "w3m" "\ Render the region of the current buffer between START and END. URL specifies the address where the contents come from. It can be omitted or nil when the address is not identified. CHARSET is used for decoding the contents. If it is nil, this function attempts to parse the meta tag to extract the charset. \(fn START END &optional URL CHARSET)" t nil) (autoload 'w3m-buffer "w3m" "\ Render the current buffer. See `w3m-region' for the optional arguments. \(fn &optional URL CHARSET)" t nil) ;;;*** ;;;### (autoloads nil "w3m-antenna" "w3m-antenna.el" (21819 36159 ;;;;;; 0 0)) ;;; Generated autoloads from w3m-antenna.el (autoload 'w3m-about-antenna "w3m-antenna" "\ \(fn URL &optional NO-DECODE NO-CACHE POST-DATA REFERER HANDLER)" nil nil) (autoload 'w3m-antenna "w3m-antenna" "\ Report changes of WEB sites, which is specified in `w3m-antenna-sites'. \(fn &optional NO-CACHE)" t nil) ;;;*** ;;;### (autoloads nil "w3m-bookmark" "w3m-bookmark.el" (21819 36159 ;;;;;; 0 0)) ;;; Generated autoloads from w3m-bookmark.el (autoload 'w3m-bookmark-add-this-url "w3m-bookmark" "\ Add link under cursor to bookmark. \(fn)" t nil) (autoload 'w3m-bookmark-add-current-url "w3m-bookmark" "\ Add a url of the current page to the bookmark. With prefix, ask for a new url instead of the present one. \(fn &optional ARG)" t nil) (autoload 'w3m-bookmark-add-all-urls "w3m-bookmark" "\ Add urls of all pages being visited to the bookmark. \(fn)" t nil) (autoload 'w3m-bookmark-add-current-url-group "w3m-bookmark" "\ Add link of the group of current urls to the bookmark. \(fn)" t nil) (autoload 'w3m-bookmark-view "w3m-bookmark" "\ Display the bookmark. \(fn &optional RELOAD)" t nil) (autoload 'w3m-bookmark-view-new-session "w3m-bookmark" "\ Display the bookmark on a new session. \(fn &optional RELOAD)" t nil) (autoload 'w3m-about-bookmark "w3m-bookmark" "\ \(fn &rest ARGS)" nil nil) (autoload 'w3m-setup-bookmark-menu "w3m-bookmark" "\ Setup w3m bookmark items in menubar. \(fn)" nil nil) ;;;*** ;;;### (autoloads nil "w3m-cookie" "w3m-cookie.el" (21819 36157 0 ;;;;;; 0)) ;;; Generated autoloads from w3m-cookie.el (autoload 'w3m-cookie-shutdown "w3m-cookie" "\ Save cookies, and reset cookies' data. \(fn)" t nil) (autoload 'w3m-cookie-set "w3m-cookie" "\ Register cookies which correspond to URL. BEG and END should be an HTTP response header region on current buffer. \(fn URL BEG END)" nil nil) (autoload 'w3m-cookie-get "w3m-cookie" "\ Get a cookie field string which corresponds to the URL. \(fn URL)" nil nil) (autoload 'w3m-cookie "w3m-cookie" "\ Display cookies and enable you to manage them. \(fn &optional NO-CACHE)" t nil) (autoload 'w3m-about-cookie "w3m-cookie" "\ Make the html contents to display and to enable you to manage cookies. \(fn URL &optional NO-DECODE NO-CACHE POST-DATA &rest ARGS)" nil nil) ;;;*** ;;;### (autoloads nil "w3m-dtree" "w3m-dtree.el" (21819 36159 0 0)) ;;; Generated autoloads from w3m-dtree.el (autoload 'w3m-about-dtree "w3m-dtree" "\ \(fn URL &optional NODECODE ALLFILES &rest ARGS)" nil nil) (autoload 'w3m-dtree "w3m-dtree" "\ Display directory tree on local file system. If called with 'prefix argument', display all directorys and files. \(fn ALLFILES PATH)" t nil) ;;;*** ;;;### (autoloads nil "w3m-fb" "w3m-fb.el" (21819 36157 0 0)) ;;; Generated autoloads from w3m-fb.el (defvar w3m-fb-mode nil "\ Non-nil if W3m-Fb mode is enabled. See the command `w3m-fb-mode' for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `w3m-fb-mode'.") (custom-autoload 'w3m-fb-mode "w3m-fb" nil) (autoload 'w3m-fb-mode "w3m-fb" "\ Toggle W3M Frame Buffer mode. This allows frame-local lists of buffers (tabs). \(fn &optional ARG)" t nil) ;;;*** ;;;### (autoloads nil "w3m-filter" "w3m-filter.el" (21819 36157 0 ;;;;;; 0)) ;;; Generated autoloads from w3m-filter.el (autoload 'w3m-filter "w3m-filter" "\ Apply filtering rule of URL against a content in this buffer. \(fn URL)" nil nil) ;;;*** ;;;### (autoloads nil "w3m-form" "w3m-form.el" (21819 36159 0 0)) ;;; Generated autoloads from w3m-form.el (autoload 'w3m-fontify-forms "w3m-form" "\ Process half-dumped data and fontify forms in this buffer. \(fn)" nil nil) ;;;*** ;;;### (autoloads nil "w3m-lnum" "w3m-lnum.el" (21819 36159 0 0)) ;;; Generated autoloads from w3m-lnum.el (autoload 'w3m-lnum-mode "w3m-lnum" "\ Minor mode to extend point commands by using Conkeror style number selection. With prefix ARG 0 disable battery included point functions, otherwise enable them. With no prefix ARG - toggle. \(fn &optional ARG)" t nil) (autoload 'w3m-lnum-goto "w3m-lnum" "\ Turn on link, image and form numbers and ask for one to go to. 0 corresponds to location url. \(fn)" t nil) (autoload 'w3m-lnum-follow "w3m-lnum" "\ Turn on link numbers, ask for one and execute appropriate action on it. If link - visit it, when button - press, when input - activate it, If image - toggle it. With prefix ARG visit link in new session or don't move over field/button/image on activation/push/toggle. With `-' ARG, for link image - go to it and toggle it, if link, visit in background. With -4 ARG, for link image - toggle it. With double prefix ARG, prompt for url to visit. With triple prefix ARG, prompt for url to visit in new session. \(fn ARG)" t nil) (autoload 'w3m-lnum-universal "w3m-lnum" "\ Turn on link numbers, ask for one and offer actions over it depending on selection type. Actions may be selected either by hitting corresponding key, pressing <return> over the action line or left clicking. \(fn)" t nil) (autoload 'w3m-lnum-toggle-inline-image "w3m-lnum" "\ If image at point, toggle it. Otherwise turn on link numbers and toggle selected image. With prefix ARG open url under image in new session. If no such url, move over image and toggle it. \(fn &optional ARG)" t nil) (autoload 'w3m-lnum-view-image "w3m-lnum" "\ Display the image under point in the external viewer. If no image at poing, turn on image numbers and display selected. The viewer is defined in `w3m-content-type-alist' for every type of an image. \(fn)" t nil) (autoload 'w3m-lnum-save-image "w3m-lnum" "\ Save the image under point to a file. If no image at poing, turn on image numbers and save selected. The default name will be the original name of the image. \(fn)" t nil) (autoload 'w3m-lnum-external-view-this-url "w3m-lnum" "\ Launch the external browser and display the link at point. If no link at point, turn on link numbers and open selected externally. \(fn)" t nil) (autoload 'w3m-lnum-edit-this-url "w3m-lnum" "\ Edit the page linked from the anchor under the cursor. If no such, turn on link numbers and edit selected. \(fn)" t nil) (autoload 'w3m-lnum-print-this-url "w3m-lnum" "\ Display the url under point in the echo area and put it into `kill-ring'. If no url under point, activate numbering and select one. \(fn)" t nil) (autoload 'w3m-lnum-download-this-url "w3m-lnum" "\ Download the file or the page pointed to by the link under point. If no point, activate numbering and select andchor to download. \(fn)" t nil) (autoload 'w3m-lnum-bookmark-add-this-url "w3m-lnum" "\ Add link under cursor to bookmarks. If no link under point, activate numbering and ask for one. \(fn)" t nil) ;;;*** ;;;### (autoloads nil "w3m-namazu" "w3m-namazu.el" (21819 36159 0 ;;;;;; 0)) ;;; Generated autoloads from w3m-namazu.el (autoload 'w3m-about-namazu "w3m-namazu" "\ \(fn URL &optional NO-DECODE NO-CACHE &rest ARGS)" nil nil) (autoload 'w3m-namazu "w3m-namazu" "\ Search indexed files with Namazu. \(fn INDEX QUERY &optional RELOAD)" t nil) ;;;*** ;;;### (autoloads nil "w3m-perldoc" "w3m-perldoc.el" (21819 36157 ;;;;;; 0 0)) ;;; Generated autoloads from w3m-perldoc.el (autoload 'w3m-about-perldoc "w3m-perldoc" "\ \(fn URL &optional NO-DECODE NO-CACHE &rest ARGS)" nil nil) (autoload 'w3m-perldoc "w3m-perldoc" "\ View Perl documents. \(fn DOCNAME)" t nil) ;;;*** ;;;### (autoloads nil "w3m-search" "w3m-search.el" (21819 36157 0 ;;;;;; 0)) ;;; Generated autoloads from w3m-search.el (autoload 'w3m-search "w3m-search" "\ Search QUERY using SEARCH-ENGINE. When called interactively with a prefix argument, you can choose one of the search engines defined in `w3m-search-engine-alist'. Otherwise use `w3m-search-default-engine'. If Transient Mark mode, use the region as an initial string of query and deactivate the mark. \(fn SEARCH-ENGINE QUERY)" t nil) (autoload 'w3m-search-new-session "w3m-search" "\ Like `w3m-search', but do the search in a new session. \(fn SEARCH-ENGINE QUERY)" t nil) (autoload 'w3m-search-uri-replace "w3m-search" "\ Generate query string for ENGINE from URI matched by last search. \(fn URI ENGINE)" nil nil) ;;;*** ;;;### (autoloads nil "w3m-session" "w3m-session.el" (21819 36159 ;;;;;; 0 0)) ;;; Generated autoloads from w3m-session.el (autoload 'w3m-session-save "w3m-session" "\ Save list of displayed session. \(fn)" t nil) (autoload 'w3m-session-crash-recovery-remove "w3m-session" "\ Remove crash recovery session set. \(fn)" nil nil) (autoload 'w3m-session-select "w3m-session" "\ Select session from session list. \(fn)" t nil) (autoload 'w3m-setup-session-menu "w3m-session" "\ Setup w3m session items in menubar. \(fn)" nil nil) (autoload 'w3m-session-last-autosave-session "w3m-session" "\ \(fn)" nil nil) (autoload 'w3m-session-last-crashed-session "w3m-session" "\ \(fn)" nil nil) ;;;*** ;;;### (autoloads nil "w3m-symbol" "w3m-symbol.el" (21819 36159 0 ;;;;;; 0)) ;;; Generated autoloads from w3m-symbol.el (autoload 'w3m-replace-symbol "w3m-symbol" "\ \(fn)" nil nil) ;;;*** ;;;### (autoloads nil "w3m-weather" "w3m-weather.el" (21819 36159 ;;;;;; 0 0)) ;;; Generated autoloads from w3m-weather.el (autoload 'w3m-weather "w3m-weather" "\ Display weather report. \(fn AREA)" t nil) (autoload 'w3m-about-weather "w3m-weather" "\ \(fn URL NO-DECODE NO-CACHE POST-DATA REFERER HANDLER)" nil nil) ;;;*** ;;;### (autoloads nil nil ("w3m-bug.el" "w3m-ccl.el" "w3m-ems.el" ;;;;;; "w3m-favicon.el" "w3m-hist.el" "w3m-image.el" "w3m-mail.el" ;;;;;; "w3m-pkg.el" "w3m-proc.el" "w3m-rss.el" "w3m-save.el" "w3m-tabmenu.el" ;;;;;; "w3m-ucs.el" "w3m-util.el" "w3mhack.el") (21819 36160 39000 ;;;;;; 0)) ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t ;; End: ;;; w3m-autoloads.el ends here
30.451957
94
0.719177
0.809351
6,489
28,412
jsp
Java Server Pages
wefine/mybatis-attendance
[ "MIT" ]
null
wefine/mybatis-attendance
[ "MIT" ]
null
wefine/mybatis-attendance
[ "MIT" ]
null
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <c:set value="${pageContext.request.contextPath}" scope="page" var="ctx"></c:set> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'main.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" /> <link rel="stylesheet" href="${ctx}/css/zTreeStyle.css" type="text/css"> <script type="text/javascript" src="${ctx}/js/jquery.min.js"></script> <script type="text/javascript" src="${ctx}/js/jquery.ztree.core.js"></script> <script type="text/javascript" src="${ctx}/js/bootstrap.js"></script> <script type="text/javascript" src="${ctx}/js/jquery.validate.js"></script> <style type="text/css"> .thistop { padding-left: 15px; padding-top: 9px; } .table_hover tr:HOVER { background-color: rgba(98, 168, 209, 0.11); } .thisdate { font-size: 15px; width: 130px; font-weight: 800; height: 11px; } .trClass { background: rgba(98, 168, 209, 0.11); } #tbodyStaff tr td { text-align: center; vertical-align: middle; } </style> <SCRIPT type="text/javascript"> var BanZuID; var ZhiDuID; var setting = { view : { selectedMulti : false //是否允许多选 }, data : { simpleData : { enable : true } }, callback : { //zTree节点的点击事件 onClick : onClick } }; var setting1 = { view : { selectedMulti : false //是否允许多选 }, data : { simpleData : { enable : true } }, callback : { //zTree节点的点击事件 onClick : onclickinsert } }; //点击某个节点 然后将该节点的名称赋值值文本框 function onClick(e, treeId, treeNode) { getChildNodes(treeNode); $("#txtDepartmentid").val(treeNode.id); var zTree = $.fn.zTree.getZTreeObj("treeDemo"); //获得选中的节点 var nodes = zTree.getSelectedNodes(), v = ""; //根据id排序 nodes.sort(function compare(a, b) { return a.id - b.id; }); for ( var i = 0, l = nodes.length; i < l; i++) { v += nodes[i].name + ","; } //将选中节点的名称显示在文本框内 if (v.length > 0) v = v.substring(0, v.length - 1); var cityObj = $("#Department"); cityObj.attr("value", v); //隐藏zTree hideMenu(); return false; } var departmentNodes = []; //获取子节点 function getChildNodes(treeNode) { var childNodes = $.fn.zTree.getZTreeObj("treeDemo").transformToArray( treeNode); var nodes = new Array(); for (i = 0; i < childNodes.length; i++) { nodes[i] = childNodes[i].id; } departmentNodes = nodes;//.join(",") //查询部门职务 selectOpsition(); } //显示树 function showMenu() { var cityObj = $("#Department"); var cityOffset = $("#Department").offset(); $("#menuContent").css({ left : cityOffset.left + "px", top : "82px" }).slideDown("fast"); } //隐藏树 function hideMenu() { $("#menuContent").fadeOut("fast"); // $("body").unbind("mousedown", onBodyDown); } $(document) .ready( function() { $("#menuContent").hide(); /* 身份验证 */ jQuery.validator.addMethod("isIdCardNo", function( value, element) { return this.optional(element) || idCardNoUtil.checkIdCardNo(value); }, "请正确输入您的身份证号码"); $("#menuContent1").hide(); $("#myModal").modal("hide");//隐藏模态框 bangdingDepartment();//查询部门下拉树 bangdingOpsitionType();//查询职位状态 bangdingGroupCbo(); selectAllStaff();//查询所有员工 bangdingSystemCbo(); fromYanZhen(); //图片变更 $("#upimg") .change( function() { var $file = $(this); var fileObj = $file[0]; var windowURL = window.URL || window.webkitURL; var dataURL; var $img = $("#image-view");//<img>标签 //当图片名称为空时,照片不显示。 if (document .getElementById('upimg').value .trim() == "") { //document.getElementById('tr_userpicture').style.display = 'none'; } if (fileObj && fileObj.files && fileObj.files[0]) { dataURL = windowURL .createObjectURL(fileObj.files[0]); //允许上传的图片格式 var newPreview = document .getElementById("upimg").value; var regext = /\.jpg$|\.gif$|\.jpeg$|\.png$|\.bmp$/gi; if (!regext.test(newPreview)) { newPreview == ""; alert("选择的照片格式不正确,请重新选择!"); $(fileObj) .after( $(fileObj) .clone( $(fileObj))); $(fileObj).remove(); return false; } $img.attr("src", dataURL); } else { dataURL = $file.val(); var imgObj = document .getElementById("image-view"); imgObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)"; imgObj.filters .item("DXImageTransform.Microsoft.AlphaImageLoader").src = dataURL; } }); }); //点击新增员工按钮是触发 function insertStaff() { qingkongbiaodan();//先清空form数据 $("label[class='error']").remove(); $("#thistr").show(); $("#lizhi").hide(); $("#myModal").modal("show"); $("#tladd_edit")[0].innerHTML = "新增员工"; } /** 表单提交验证**/ function fromYanZhen() { $("#form").validate({ rules : { staffname : { required : true }, staffnumber : { required : true }, password : { required : true, minlength : 3 }, topassword : { required : true, minlength : 3, equalTo : "#topassword" }, loginnumber : { required : true }, idcar : { required : true }, cardnumber : { required : true }, dateofentry : { required : true }, username : { required : true }, systemid : { required : true }, staffpositionid : { required : true }, email : { required : true, email : true }, idcar : { required : true, isIdCardNo : true } }, messages : { staffname : { required : "*请输员工姓名" }, staffnumber : { required : "*请输员工编号" }, password : { required : "*请输入密码", minlength : "*密码不能小于3个字符" }, topassword : { required : "*请输入确认密码", minlength : "*密码不能小于3个字符", equalTo : "*请再次输入相同的值" }, loginnumber : { required : "*请输入登记号码" }, idcar : { required : "*请输入身份证号码" }, cardnumber : { required : "*请输入卡片号码" }, dateofentry : { required : "*请选择入职日期" }, username : { required : "*请输入用户名" }, systemid : { required : "*请选择考勤制度" }, staffpositionid : { required : "*请选择员工职务" }, email : { required : "*请输入邮箱", email : "*请输入正确的邮箱格式" } } }); } //新增员工 function submitForm() { var formData = new FormData($("#form")[0]); if ($("#tladd_edit")[0].innerHTML.trim() == "新增员工") { if ($("#form").valid()) { $.ajax({ url : "${ctx}/staff/insertStaff.do", type : 'POST', data : formData, async : false, cache : false, scriptCharset : "utf-8", contentType : false, processData : false, dataType : "json", success : function(data) { if (data == "1") { alert("新增成功"); selectAllStaff(); $("#myModal").modal("hide"); } else { alert("新增失败"); } }, error : function(data) { } }); } } else { if ($("#form").valid()) { if ("" + BanZuID != $("#cboGroup").val()) { ajax("${ctx}/staff/deleteRecordByStaffid.do?staffid=" + $("#staffid").val()); } if(""+ZhiDuID!=$("#cboSystem").val()){ ajax("${ctx}/staff/updateStaffSystem.do?staffid="+ $("#staffid").val()+"&systemid="+$("#cboSystem").val()); } $.ajax({ url : "${ctx}/staff/updateStaff.do", type : 'POST', data : formData, async : false, cache : false, scriptCharset : "utf-8", contentType : false, processData : false, dataType : 'HTML', success : function(data) { if (data == "1") { alert("修改成功"); selectAllStaff(); $("#myModal").modal("hide"); } else { alert("修改失败"); } }, error : function(data) { } }); } } } //查询部门绑定下拉树、 function bangdingDepartment() { var zNode = []; $.ajax({ async : false,//同步异步 type : 'post', url : '${ctx}/staff/selectDepartment.do', dataType : "json", scriptCharset : "utf-8", success : function(data) { for ( var i = 0; i < data.length; i++) { zNode.push({ id : data[i].departmentid, pId : data[i].fatherid, name : data[i].name, open : true }); } $.fn.zTree.init($("#treeDemo"), setting, zNode); $.fn.zTree.init($("#Ztree"), setting1, zNode); }, }); } //根据部门id查询部门职务 function selectOpsition() { $.ajax({ async : false,//同步异步 type : 'post', url : '${ctx}/staff/selectOpsition.do' + "?departmentids=" + departmentNodes, dataType : "json", scriptCharset : "utf-8", success : function(data) { $("#cboPositonid").empty(); $("#cboPositonid").append( "<option selected='selected' value='0'>全部</option>"); for ( var i = 0; i < data.length; i++) { var html = "<option value='"+data[i].positionid+"'>" + data[i].position.name + "</option>"; $("#cboPositonid").append(html); } }, }); } /** 查询考勤制度绑定下拉框 **/ function bangdingSystemCbo() { var data = ajax("${ctx}/SetSystem/selectSystems.do"); for ( var i = 0; i < data.length; i++) { var html = "<option value='"+data[i].systemid+"'>" + data[i].systemname + "</option>"; $("#cboSystem").append(html); } } /** 查询班组绑定下拉框 **/ function bangdingGroupCbo() { $("#cboGroupid").append("<option value='0'>所有班组</option>"); var data = ajax("${ctx}/setDeparment/selectByAttributeGatherId.do?attributeGatherId=7"); for ( var i = 0; i < data.length; i++) { var html = "<option value='"+data[i].attributegatherchildid+"'>" + data[i].name + "</option>"; $("#cboGroupid").append(html); $("#cboGroup").append(html); } } //绑定职位转态下拉框 function bangdingOpsitionType() { $ .ajax({ async : false,//同步异步 type : 'post', url : '${ctx}/setDeparment/selectByAttributeGatherId.do' + "?attributeGatherId=1", dataType : "json", scriptCharset : "utf-8", success : function(data) { $("#cboPositionTypeid").empty(); $("#cboPositionTypeid") .append( "<option selected='selected' value='0'>所有状态</option>"); for ( var i = 0; i < data.length; i++) { var html = "<option value='"+data[i].attributegatherchildid+"'>" + data[i].name + "</option>"; $("#cboPositionTypeid").append(html); $("#updatePositiontypeid").append(html); } }, }); } //模糊查询员工信息 function selectAllStaff() { $ .ajax({ async : false,//同步异步 type : 'post', url : "${ctx}/staff/selectAllStaff.do?departmentids=" + departmentNodes, data : { positionid : $("#cboPositonid").val() == null ? 0 : $( "#cboPositonid").val(), typeid : $("#cboPositionTypeid").val() == null ? 0 : $( "#cboPositionTypeid").val(), number : $("#txtNumber").val(), name : $("#txtName").val(), groupid : $("#cboGroupid").val(), }, dataType : "json", scriptCharset : "utf-8", success : function(data) { $('#tbodyStaff').empty(); for ( var i = 0; i < data.length; i++) { var xingbie = data[i].sex == 0 ? "女" : "男"; var html = "<tr onclick='onclickStaffRow(this)'><td><a href='javascript:deleteStaff(" + data[i].staffid + ")'>【删除】</a><a href='javascript:updateStaff(" + data[i].staffid + ")'>【编辑】</a></td>" + "<td><a><img style='width:50px;height:38px' src='/pic/"+data[i].headimage+"'></a></td>" + "<td>" + data[i].positiontype.name + "</td>" + "<td>" + data[i].staffPosition.department.name + "</td>" + "<td>" + data[i].staffPosition.position.name + "</td>" + "<td>" + data[i].system.systemname + "</td>" + "<td>" + data[i].groupname.name + "</td>" + "<td>" + data[i].staffname + "</td>" + "<td>" + xingbie + "</td>" + "<td>" + data[i].staffnumber + "</td>" + "<td>" + data[i].loginnumber + "</td>" + "<td>" + data[i].dateofentry + "</td>" + "<td>" + data[i].leavedate + "</td>" + "<td>" + data[i].idcar + "</td>" + "<td>" + data[i].email + "</td>" + "<td>" + data[i].cardnumber + "</td>" + "<td>" + data[i].remark + "</td></tr>"; $('#tbodyStaff').append(html); } }, }); } /* 点击行改变样式 */ function onclickStaffRow(tr) { $("#tbodyStaff tr").removeClass("trClass"); $(tr).addClass("trClass"); } //新增操作下拉树加载 function tianchujigou(event) { var cityObj = $("#gouzuojigou"); var cityOffset = $("#gouzuojigou").offset(); $("#menuContent1").css({ offsetLeft : event.offsetLeft, offsetTop : event.offsetTop }).slideDown("fast"); } //点击新增员工工作机构下拉树时触发 function onclickinsert(e, treeId, treeNode) { dianjibangding(treeNode); } //点击下拉树绑定职务下拉 function dianjibangding(treeNode) { $("#gouzuojigouid").val(treeNode.id); $("#gouzuojigou").val(treeNode.name); $("#menuContent1").fadeOut("fast"); //获取部门职务 $.ajax({ async : false,//同步异步 type : 'post', url : '${ctx}/setDeparment/selectOpsition.do' + "?departmentid=" + treeNode.id, dataType : "json", scriptCharset : "utf-8", success : function(data) { $("#cboStaffpositionid").empty(); for ( var i = 0; i < data.length; i++) { var html = "<option value='"+data[i].staffpositionid+"'>" + data[i].position.name + "</option>"; $("#cboStaffpositionid").append(html); } }, }); } //修改员工信息 function updateStaff(staffid) { $("label[class='error']").remove(); $.ajax({ async : false,//同步异步 type : 'post', url : "${ctx}/staff/selectByStaffid.do?staffid=" + staffid, dataType : "json", scriptCharset : "utf-8", success : function(data) { qingkongbiaodan();//先清空form数据 $("#thistr").hide(); $("#tladd_edit")[0].innerHTML = "修改人员信息"; $("#myModal").modal("show"); $("#lizhi").show(); var tree = $.fn.zTree.getZTreeObj("Ztree"); var node = tree.getNodeByParam("id", data[0].staffPosition.departmentid); tree.selectNode(node, true); dianjibangding(node); $("#staffid").val(data[0].staffid); $("#cboStaffpositionid").val(data[0].staffpositionid); $("#staffname").val(data[0].staffname); $("#staffnumber").val(data[0].staffnumber); data[0].sex == 1 ? $("#boy")[0].checked = true : $("#girl")[0].checked = true; $("#loginnumber").val(data[0].loginnumber); $("#idcar").val(data[0].idcar); $("#email").val(data[0].email); $("#carnumber").val(data[0].cardnumber); $("#dateofentry").val(data[0].dateofentry); $("#remark").val(data[0].remark); $("#image-view")[0].src = "/pic/" + data[0].headimage; $("#updatePositiontypeid").val(data[0].positiontypeid); $("#leavedate").val(data[0].leavedate); $("#cboGroup").val(data[0].groupid); BanZuID = data[0].groupid; ZhiDuID= data[0].systemid; $("#cboSystem").val(data[0].systemid); }, }); } //清空form表单 function qingkongbiaodan() { $("#form")[0].reset(); $("#cboStaffpositionid").empty(); $("#image-view")[0].src = ""; } //删除员工信息 function deleteStaff(staffid) { if (confirm("删除之后无法恢复此数据,你确定要删除此数据吗?")) { $.ajax({ async : false,//同步异步 type : 'post', url : "${ctx}/staff/deleteStaff.do?id=" + staffid, dataType : "json", scriptCharset : "utf-8", success : function(data) { if (data == "1") { alert("删除成功!"); selectAllStaff(); } else { alert("删除失败!"); } }, }); } } /** 封装的ajax **/ function ajax(url) { var mydata; $.ajax({ async : false, type : 'post', url : url, contentType : 'application/json', dataType : "json", scriptCharset : "utf-8", success : function(data) { mydata = data; } }); return mydata; } </SCRIPT> <body style="text-align: center"> <div></div> <div class="breadcrumbs" id="breadcrumbs"> <ul class="breadcrumb"> <li><i class="icon-home home-icon"></i> <a href="#">首页</a> </li> <li><a href="#">人事管理</a> </li> <li class="active">人员录入</li> </ul> </div> <div class="content_wrap"> <div class="zTreeDemoBackground left" style="margin: 10px; font-size: 15px;"> <table> <tr> <td>所属机构:</td> <td><input id="Department" readonly="readonly" type="text" onblur="hideMenu()" onclick="showMenu()" style="width:115px" class="form-control"> <input type="hidden" id="txtDepartmentid"> </td> <td>职务:</td> <td><select id="cboPositonid" style="width: 95px;"> </select></td> <td>状态:</td> <td><select id="cboPositionTypeid" style="width: 95px;"> </select></td> <td>班组:</td> <td><select id="cboGroupid" style="width: 95px;"></select></td> <td><input id="txtNumber" placeholder="人员编号" type="text" style="width: 100px;" class="form-control"></td> <td><input id="txtName" placeholder="姓名" type="text" style="width: 100px;" class="form-control"></td> <td> <button type="button" onclick="selectAllStaff()" class="btn btn-info btn-sm" style="font-size:14px;margin-right: 5px;"> 查询 <i class="icon-search icon-on-right bigger-120"></i> </button></td> <td> <button type="button" onclick="insertStaff()" class="btn btn-info btn-sm" style="font-size:14px"> 新 增 <i class="icon-plus-sign icon-on-right bigger-120"></i> </button></td> </tr> </table> </div> </div> <div id="menuContent" class="menuContent" style="displayx: none; position: absolute;z-index: 99;background-color: #f9f9f9;min-height: 200px;"> <ul id="treeDemo" class="ztree" style="margin-top: 0; width: 110px;"> </ul> </div> <div> <fieldset> <legend style="margin-bottom: 5px;"></legend> <div class="table-responsive" style="position:relative;max-height:500px;min-height: 490px;overflow-x: scroll;max-width: 1158px;"> <table id="sample-table-2" style="border: 2px solid #dddddd;width: 1500px;" class="table table-bordered table_hover"> <thead> <tr> <th style="text-align: center; width: 104px;">操作</th> <th style="text-align: center;">头像</th> <th style="text-align: center;">状态</th> <th style="text-align: center;">机构</th> <th style="text-align: center;">职务</th> <th style="text-align: center;">考勤制度</th> <th style="text-align: center;">班组</th> <th style="text-align: center;">姓名</th> <th style="text-align: center;">性别</th> <th style="text-align: center;">员工编号</th> <th style="text-align: center;">登记号码</th> <th style="text-align: center;">入职日期</th> <th style="text-align: center;">离职日期</th> <th style="text-align: center;">身份证号码</th> <th style="text-align: center;">电子邮件</th> <th style="text-align: center;">卡片号码</th> <th style="text-align: center;min-width: 145px;">备注</th> </tr> </thead> <tbody id="tbodyStaff"> </tbody> </table> </div> </fieldset> </div> <div style="width:inherit;left: 426px;top: 5%;" class="modal hide fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 id="tladd_edit" style="text-align:center" class="modal-title">新增人员</h4> </div> <div class="modal-body" style=" max-height: 495px;"> <div class="row"> <div class="col-xs-12"> <div class="widget-box"> <div class="widget-body"> <%-- action="${ctx}/staff/insertStaff.do" --%> <form id="form" enctype="multipart/form-data" accept-charset="UTF-8"> <fieldset> <%-- <input type="hidden" name="id" value="${employee.id}"/> --%> <table class="table table-bordered" style="border: 1px solid #dddddd"> <tr> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>工作机构</div> </td> <td><input id="gouzuojigou" style="margin-bottom: 0px;" readonly="readonly" onclick="tianchujigou(this)" type="text" class="form-control"> <input type="hidden" id="gouzuojigouid"> <input type="hidden" name="staffid" id="staffid"> <div id="menuContent1" class="menuContent" style="displayx: none; position: absolute;z-index: 99;background-color: #f9f9f9;min-height: 200px;"> <ul id="Ztree" class="ztree" style="margin-top: 0; width: 200px;"> </ul> </div></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>职务</div></td> <td><select name="staffpositionid" id="cboStaffpositionid" class="col-lg-12 col-xs-12 col-sm-12"> </select></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>选择照片</div> </td> <td> <!-- <input type="hidden" name="headImg"/> --> <input name="file_img" type="file" id="upimg" class="form-control search-query"></td> </tr> <tr> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>员工姓名</div> </td> <td><input id="staffname" name="staffname" type="text" class="form-control"></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>员工编号</div> </td> <td><input id="staffnumber" name="staffnumber" type="text" class="form-control"></td> <td rowspan="4" style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>照片预览</div> </td> <td rowspan="4"> <div id="show"> <div id="item" style="height:216px;width:265px;border:1px solid #bbb;"> <img name="img" id="image-view" style="height:216px; width:265px" /> </div> </div></td> </tr> <tr> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>性别</div> <div style="font-size: 17px;" align='right'></div></td> <td><label> <input id="boy" name="sex" type="radio" class="ace" value="1"> <span class="lbl">男</span> </label> &nbsp;&nbsp;&nbsp; <label> <input id="girl" name="sex" type="radio" class="ace" value="0"> <span class="lbl">女</span> </label></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>登记号码</div></td> <td><input id="loginnumber" name="loginnumber" type="text" class="form-control"></td> </tr> <tr> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>身份证号</div> </td> <td><input id="idcar" name="idcar" type="text" class="form-control"></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>电子邮件</div></td> <td><input id="email" name="email" type="text" class="form-control"></td> </tr> <tr> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>卡片号码</div> </td> <td><input id="carnumber" name="cardnumber" type="text" class="form-control"></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>入职日期</div></td> <td><input id="dateofentry" name="dateofentry" type="date" class="form-control"></td> </tr> <tr id="lizhi"> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>状态</div> </td> <td><select name="positiontypeid" id="updatePositiontypeid" class="col-lg-12 col-xs-12 col-sm-12"> </select></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>离职日期</div></td> <td><input id="leavedate" name="leavedate" type="date" class="form-control"></td> </tr> <tr> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>班组</div> </td> <td><select name="groupid" id="cboGroup" class="col-lg-12 col-xs-12 col-sm-12"> </select></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>考勤制度</div></td> <td><select name="systemid" id="cboSystem" class="col-lg-12 col-xs-12 col-sm-12"> </select></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>备注</div></td> <td colspan=""><input style="width: 258px;" id="remark" name="remark" type="text" class="form-control"> </td> </tr> <tr id="thistr"> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>账号</div></td> <td><input name="username" type="text" class="form-control"></td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>密码</div></td> <td><input type="password" name="password" class="form-control"> </td> <td style="background-color: #ebf3fb;"> <div style="font-size: 17px;" align='right'>确认密码</div></td> <td><input type="password" name="topassword" id="topassword" class="form-control"> </td> </tr> </table> </fieldset> <div class="form-actions center"> <button type="button" onclick="submitForm()" class="btn btn-sm btn-success"> 保 存 <i class="icon-check icon-on-right bigger-110"></i> </button> <button type="reset" class="btn btn-sm btn-warning" onclick="qingkongbiaodan()"> 重置 <i class="icon-undo icon-on-right bigger-110"></i> </button> <button onclick="containerChange('<%=path%>/employeeController/listPage.do')" type="button" class="btn btn-sm btn-info"> 返 回 <i class="icon-reply icon-on-right bigger-110"></i> </button> </div> </form> </div> </div> </div> </div> </div> </div> </div> </div> </body> </html>
29.503634
115
0.527418
0.883531
14,804
258
css
CSS
yunus433/UAAPP-API
[ "MIT" ]
null
yunus433/UAAPP-API
[ "MIT" ]
null
yunus433/UAAPP-API
[ "MIT" ]
null
.welcome-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } .welcome-text { width: 400px; font-weight: 500; font-size: 16px; line-height: 22px; color: rgb(1, 1, 1); text-align: center; }
16.125
26
0.635659
0.812857
125
447
glsl
GLSL
PiangGG/HazelEngine
[ "Apache-2.0" ]
1
PiangGG/HazelEngine
[ "Apache-2.0" ]
null
PiangGG/HazelEngine
[ "Apache-2.0" ]
null
// Flat Color Shader #type vertex #version 330 core layout(location = 0) in vec3 a_Position; uniform mat4 u_ViewProjection; uniform mat4 u_Transform; out vec3 v_Position; void main() { v_Position=a_Position; gl_Position = u_ViewProjection * u_Transform * vec4(a_Position,1.0); } #type fragment #version 330 core layout(location = 0) out vec4 color; in vec3 v_Position; uniform vec3 u_Color; void main() { color = vec4(u_Color,1.0f); }
21.285714
69
0.742729
0.882381
180
489
js
JavaScript
moatwork/serverless-cognitive
[ "MIT" ]
null
moatwork/serverless-cognitive
[ "MIT" ]
null
moatwork/serverless-cognitive
[ "MIT" ]
null
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. /** * Generate SasIPRange format string. For example: * * "8.8.8.8" or "1.1.1.1-255.255.255.255" * * @export * @param {SasIPRange} ipRange A range of IP addresses. * @returns {string} string representation of the IP range. */ export function ipRangeToString(ipRange) { return ipRange.end ? ipRange.start + "-" + ipRange.end : ipRange.start; } //# sourceMappingURL=SasIPRange.js.map
32.6
75
0.703476
0.827215
169
732
idr
Idris
roycrippen/scratch
[ "BSD-3-Clause" ]
null
roycrippen/scratch
[ "BSD-3-Clause" ]
null
roycrippen/scratch
[ "BSD-3-Clause" ]
null
module Test.Utils import Test.Unit import Demo.Utils %access export partial testDemoSquareInt : IO Bool testDemoSquareInt = genericTest (Just "testDemoSquareInt") [demoSquare 5, demoSquare 12, demoSquare (-1)] [25, 144, 1] (==) partial testDemoSquareDouble : IO Bool testDemoSquareDouble = genericTest (Just "testDemoSquareDouble") [demoSquare 5.0, demoSquare 12.0, demoSquare (-1.0)] [25.0, 144.0, 1.0] (==) partial testDemoQuad : IO Bool testDemoQuad = genericTest (Just "testDemoQuad") (demoQuad 5) 625 (==) partial runTest : IO () runTest = do putStrLn "Testing Utils" putStrLn infoLine NonReporting.runTests [ testDemoSquareInt , testDemoSquareDouble , testDemoQuad ]
17.023256
54
0.703552
0.822941
317
469
asm
Assembly
ckrause/loda-programs
[ "Apache-2.0" ]
11
ckrause/loda-programs
[ "Apache-2.0" ]
9
ckrause/loda-programs
[ "Apache-2.0" ]
3
; A077901: Expansion of (1-x)^(-1)/(1+x-x^2-2*x^3). ; Submitted by Christian Krause ; 1,0,2,1,2,4,1,8,2,9,10,4,25,0,34,17,18,68,-15,120,2,89,154,-60,393,-144,418,225,-94,1156,-799,1768,-254,425,2858,-2940,6649,-3872,4642,4785,-7886,21956,-20271,26456,-2814,-11271,61370,-78268,117097,-72624,33186,128385,-240446,435204 add $0,1 mov $2,3 mov $4,6 lpb $0 sub $0,1 sub $3,$1 add $4,$1 mov $1,$3 mov $3,$2 mov $2,$4 mov $4,$3 lpe mov $0,$2 sub $0,3 div $0,3
23.45
234
0.618337
0.865175
360
943
adp
Tcl
iuri/tutortronics
[ "Info-ZIP", "ImageMagick" ]
null
iuri/tutortronics
[ "Info-ZIP", "ImageMagick" ]
null
iuri/tutortronics
[ "Info-ZIP", "ImageMagick" ]
null
<!-- packages/intranet-sysconfig/sector/index.adp --> <!-- @author Frank Bergmann (frank.bergmann@project-open.com) --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <master src="master"> <property name="doc(title)">@page_title;literal@</property> <h2>License Agreement</h2> <p> This software has been developed by @po;noquote@<br> (<a href="http://www.project-open.com/">http://www.project-open.com/</a>) based on the work of <br> several open-source projects and other contributors. </p> <table cellpadding="2"> <tr><td>&\#93;project-open&\#91;</td> <td>http://www.project-open.com/license/</td></tr> <tr><td>AOLserver</td> <td>http://www.aolserver.com/license/</td></tr> <tr><td>OpenACS</td> <td>http://openacs.org/about/licensing/</td></tr> <tr><td>CygWin</td> <td>http://cygwin.com/licensing.html</td></tr> </table> <p> You need to agree with the license terms of ALL of <br> these authors prio to using the software. </p>
32.517241
88
0.682927
0.871781
378
633
hrl
Erlang
ioolkos/khepri
[ "Apache-2.0" ]
null
ioolkos/khepri
[ "Apache-2.0" ]
null
ioolkos/khepri
[ "Apache-2.0" ]
null
%% This Source Code Form is subject to the terms of the Mozilla Public %% License, v. 2.0. If a copy of the MPL was not distributed with this %% file, You can obtain one at https://mozilla.org/MPL/2.0/. %% %% Copyright (c) 2021-2022 VMware, Inc. or its affiliates. All rights reserved. %% %% Structure representing an anonymous function "extracted" as a compiled %% module for storage. -record(standalone_fun, {module :: module(), beam :: binary(), arity :: arity(), literal_funs :: [khepri_fun:standalone_fun()], env :: list()}).
42.2
80
0.593997
0.836351
180
450
c
C
ttwings/WuXiaAndJiangHu_Godot
[ "MIT" ]
34
ttwings/WuXiaAndJiangHu_Godot
[ "MIT" ]
null
ttwings/WuXiaAndJiangHu_Godot
[ "MIT" ]
12
// qimeigun.c // Last Modified by winder on May. 25 2001 #include <weapon.h> inherit STAFF; void create() { set_name("齐眉棍", ({"qimeigun", "gun", "bang"})); set_weight(1000); if (clonep()) set_default_object(__FILE__); else { set("unit", "条"); set("value", 5); set("material", "wood"); set("long", "一根非常结实的齐眉棍。\n"); set("wield_msg", "$N拿起一根$n,顺手舞了个棍花。\n"); set("unwield_msg", "$N哼了一声,将$n插回后腰。\n"); } init_staff(18); setup(); }
18
48
0.606667
0.817727
254
173
rst
reStructuredText
lsst-it/ittn-006
[ "CC-BY-4.0" ]
null
lsst-it/ittn-006
[ "CC-BY-4.0" ]
1
lsst-it/ittn-006
[ "CC-BY-4.0" ]
1
Open Issues =========== - BroTaps - to OIR Lab and move to outside network (currently on internal network) - Chilean DAC and possible Amazon link (Chilean Data Observatory)
34.6
82
0.734104
0.82
48
99
tex
TeX
rpuntaie/dpic
[ "CC-BY-3.0", "Unlicense" ]
1
rpuntaie/dpic
[ "CC-BY-3.0", "Unlicense" ]
null
rpuntaie/dpic
[ "CC-BY-3.0", "Unlicense" ]
null
\documentclass{article} \usepackage{pstricks,graphicx} \begin{document} \input diag \end{document}
16.5
30
0.79798
0.87
38
372
cs
C#
SimonCropp/elasticsearch-net
[ "Apache-2.0" ]
null
SimonCropp/elasticsearch-net
[ "Apache-2.0" ]
null
SimonCropp/elasticsearch-net
[ "Apache-2.0" ]
null
// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. namespace Elastic.Clients.Elasticsearch { public sealed class BulkDeleteResponseItem : BulkResponseItemBase { public override string Operation => "delete"; } }
31
76
0.776882
0.820845
99
816
groovy
Groovy
ScottWarner/neon
[ "Apache-2.0" ]
34
fil-cox/neon
[ "Apache-2.0", "MIT" ]
8
fil-cox/neon
[ "Apache-2.0", "MIT" ]
16
/* * Copyright 2013 Next Century Corporation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.ncc.neon.query.result /** * Transforms a QueryResult into another QueryResult. */ interface Transformer { QueryResult convert(QueryResult queryResult, def params) String getName() }
29.142857
75
0.741422
0.8724
208
1,073
php
PHP
EmmanuelVella/MopaBootstrapBundle
[ "MIT" ]
null
EmmanuelVella/MopaBootstrapBundle
[ "MIT" ]
null
EmmanuelVella/MopaBootstrapBundle
[ "MIT" ]
null
<?php /* * This file is part of the MopaBootstrapBundle. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Mopa\Bundle\BootstrapBundle\Twig; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Add new twig functions related to forms * * @author Paweł Madej (nysander) <pawel.madej@profarmaceuta.pl> * @author Charles Sanquer <charles.sanquer@gmail.com> */ class MopaBootstrapTwigExtension extends \Twig_Extension { /** * Returns a list of functions to add to the existing list. * * @return array An array of functions */ public function getFunctions() { return array( 'form_help' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))), ); } /** * Returns the name of the extension. * * @return string The extension name */ public function getName() { return 'bootstrap_form'; } }
24.386364
139
0.666356
0.859539
318
24,125
pas
Pascal
danielmarschall/delphiutils
[ "Apache-2.0" ]
null
danielmarschall/delphiutils
[ "Apache-2.0" ]
null
danielmarschall/delphiutils
[ "Apache-2.0" ]
1
unit BitOps; (************************************************************* BitOps.pas Bit- Byte- and Nibbleoperations 64 Bit Edition; Rev 05 July 2010 (C) 2010 ViaThinkSoft [www.viathinksoft.com] Developed by Daniel Marschall [www.daniel-marschall.de] *************************************************************) interface uses SysUtils; // * TYPES * type Nibble = 0..127; THexNibble = $0..$F; T4BitPos = 0..3; T8BitPos = 0..7; T16BitPos = 0..15; T32BitPos = 0..31; T64BitPos = 0..63; // Maximum amount of bytes in the biggest data type (int64) TBytePos = 0..7; // Maximum amount of nibbles in the biggest data type (int64) THexNibblePos = 0..15; TBit = Boolean; THexNibbleBitArray = array[Low(T4BitPos)..High(T4BitPos)] of TBit; TByteBitArray = array[Low(T8BitPos)..High(T8BitPos)] of TBit; TBitString = type string; TByteBitString = type TBitString; THexNibbleBitString = type TBitString; // ****************** // * BYTE FUNCTIONS * // ****************** // Build a byte. // Either you combine two nibbles... function BuildByte(AUpperNibble, ALowerNibble: THexNibble): Byte; overload; // ...or you define an array of 8 bits. function BuildByte(ABitArray: TByteBitArray): Byte; overload; // ...or you define a bitstring (e.g. '00011100') function BuildByte(ABits: TByteBitString): Byte; overload; // ...or you define the bits as parameters function BuildByte(ABit1, ABit2, ABit3, ABit4, ABit5, ABit6, ABit7, ABit8: TBit): Byte; overload; // Converts a byte into a array of 8 bits function GetByteBitArray(AByte: Byte): TByteBitArray; // Getting and setting the lower nibble of a byte. function GetLowerNibble(AByte: Byte): THexNibble; function SetLowerNibble(AByte: Byte; ANewNibble: THexNibble): Byte; // Getting and setting the upper nibble of a byte. function GetUpperNibble(AByte: Byte): THexNibble; function SetUpperNibble(AByte: Byte; ANewNibble: THexNibble): Byte; // Interchanges upper and lower Nibble in a byte function InterchangeNibbles(AByte: Byte): Byte; // Creates an 8-bit-array from a 8-bit-string // Throws EBitStringTooLong and EBitStringInvalidCharacter function ByteBitArrayFromBitString(const ABits: TByteBitString): TByteBitArray; // Getting and setting of a bit in a byte function GetByteBit(AByte: Byte; ABitPos: T8BitPos): TBit; function SetByteBit(AByte: Byte; ABitPos: T8BitPos; ANewBit: TBit): Byte; // Getting and setting of a bit in a AnsiChar function GetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos): TBit; function SetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos; ANewBit: TBit): Byte; // Logical operations for the 8 bit arrays. function ByteBitArrayShr(ABitArray: TByteBitArray; AVal: Longword): TByteBitArray; function ByteBitArrayShl(ABitArray: TByteBitArray; AVal: Longword): TByteBitArray; function ByteBitArrayAnd(ABitArray, ABitArray2: TByteBitArray): TByteBitArray; function ByteBitArrayOr(ABitArray, ABitArray2: TByteBitArray): TByteBitArray; function ByteBitArrayXor(ABitArray, ABitArray2: TByteBitArray): TByteBitArray; function ByteBitArrayNot(ABitArray: TByteBitArray): TByteBitArray; // Inverse the bits of a byte function InverseByteBits(x: Byte): Byte; // Reverses the bit sequence of a byte function ReverseByteBitSequence(AByte: Byte): Byte; // ******************** // * NIBBLE FUNCTIONS * // ******************** // Build a Nibble. // You can define an array of 4 bits. function BuildNibble(ABitArray: THexNibbleBitArray): Nibble; overload; // ...or you define a bitstring (e.g. '0001') function BuildNibble(ABits: THexNibbleBitString): Nibble; overload; // ...or you define the bits as parameters function BuildNibble(ABit1, ABit2, ABit3, ABit4: TBit): Nibble; overload; // Converts a nibble into a array of 4 bits function GetNibbleBitArray(ANibble: Nibble): THexNibbleBitArray; // Creates an 4-bit-array from a 4-bit-string // Throws EBitStringTooLong and EBitStringInvalidCharacter function NibbleBitArrayFromBitString(const ABits: THexNibbleBitString): THexNibbleBitArray; // Getting and setting of a bit in a nibble function GetNibbleBit(ANibble: Nibble; ABitPos: T4BitPos): TBit; function SetNibbleBit(ANibble: Nibble; ABitPos: T4BitPos; ANewBit: TBit): Nibble; // Logical operations for the 4 bit arrays. function NibbleBitArrayShr(ABitArray: THexNibbleBitArray; AVal: Longword): THexNibbleBitArray; function NibbleBitArrayShl(ABitArray: THexNibbleBitArray; AVal: Longword): THexNibbleBitArray; function NibbleBitArrayAnd(ABitArray, ABitArray2: THexNibbleBitArray): THexNibbleBitArray; function NibbleBitArrayOr(ABitArray, ABitArray2: THexNibbleBitArray): THexNibbleBitArray; function NibbleBitArrayXor(ABitArray, ABitArray2: THexNibbleBitArray): THexNibbleBitArray; function NibbleBitArrayNot(ABitArray: THexNibbleBitArray): THexNibbleBitArray; // Inverse the bits of a nibble function InverseNibbleBits(x: Nibble): Nibble; // Reverses the bit sequence of a nibble function ReverseNibbleBitSequence(ANibble: Nibble): Nibble; // * EXCEPTIONS * type EInvalidBitString = class(Exception); EBitStringTooLong = class(EInvalidBitString); EBitStringInvalidCharacter = class(EInvalidBitString); // * CONSTANTS * // Lookup tables to avoid calculation each time const AllSetBitsBytes: array[TBytePos] of int64 = ($00000000000000FF, $000000000000FFFF, $0000000000FFFFFF, $00000000FFFFFFFF, $000000FFFFFFFFFF, $0000FFFFFFFFFFFF, $00FFFFFFFFFFFFFF, $FFFFFFFFFFFFFFFF); AllSetBitsNibbles: array[THexNibblePos] of int64 = ($000000000000000F, $00000000000000FF, $0000000000000FFF, $000000000000FFFF, $00000000000FFFFF, $0000000000FFFFFF, $000000000FFFFFFF, $00000000FFFFFFFF, $0000000FFFFFFFFF, $000000FFFFFFFFFF, $00000FFFFFFFFFFF, $0000FFFFFFFFFFFF, $000FFFFFFFFFFFFF, $00FFFFFFFFFFFFFF, $0FFFFFFFFFFFFFFF, $FFFFFFFFFFFFFFFF); AllSetBitsNibble: array[THexNibblePos] of int64 = ($000000000000000F, $00000000000000F0, $0000000000000F00, $000000000000F000, $00000000000F0000, $0000000000F00000, $000000000F000000, $00000000F0000000, $0000000F00000000, $000000F000000000, $00000F0000000000, $0000F00000000000, $000F000000000000, $00F0000000000000, $0F00000000000000, $F000000000000000); // Deprecated function: // function GetSingleBit(ABit: T64BitPos): Int64; // // Gives you a 64 bit datatype which is representing the binary coding // // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000010, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000100, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00001000, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010000, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00100000, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 01000000, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 10000000, // 00000000 00000000 00000000 00000000 00000000 00000000 00000001 00000000, // ... // 10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000. // // Limitation because of the data type: 64 Bit // // For the GetByteBit() and SetByteBit functions we only need this array to // be max at $80 (128). // Manual calculation (not 64 bit useable) would be // result := Math.Floor(Math.Power(2, ABit)); SingleBitArray: array[T64BitPos] of int64 = ($0000000000000001, $0000000000000002, $0000000000000004, $0000000000000008, $0000000000000010, $0000000000000020, $0000000000000040, $0000000000000080, $0000000000000100, $0000000000000200, $0000000000000400, $0000000000000800, $0000000000001000, $0000000000002000, $0000000000004000, $0000000000008000, $0000000000010000, $0000000000020000, $0000000000040000, $0000000000080000, $0000000000100000, $0000000000200000, $0000000000400000, $0000000000800000, $0000000001000000, $0000000002000000, $0000000004000000, $0000000008000000, $0000000010000000, $0000000020000000, $0000000040000000, $0000000080000000, $0000000100000000, $0000000200000000, $0000000400000000, $0000000800000000, $0000001000000000, $0000002000000000, $0000004000000000, $0000008000000000, $0000010000000000, $0000020000000000, $0000040000000000, $0000080000000000, $0000100000000000, $0000200000000000, $0000400000000000, $0000800000000000, $0001000000000000, $0002000000000000, $0004000000000000, $0008000000000000, $0010000000000000, $0020000000000000, $0040000000000000, $0080000000000000, $0100000000000000, $0200000000000000, $0400000000000000, $0800000000000000, $1000000000000000, $2000000000000000, $4000000000000000, $8000000000000000); // Deprecated function: // function GetSingleBitDynamicInversed(ABit: T64BitPos): Int64; // // Gives you a 64 bit datatype which is representing the dynamic inversed // binary encoding. (Dynamic inversed means, that only the used bytes get // inverted, so this is NOT the same as "NOT GetSingleBit(ABit)"!) // // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111110, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111101, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111011, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11110111, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11101111, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11011111, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 10111111, // 00000000 00000000 00000000 00000000 00000000 00000000 00000000 01111111, // 00000000 00000000 00000000 00000000 00000000 00000000 11111110 11111111, // ... // 01111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111. // // Limitation because of the data type: 64 Bit // // Manual calculation (not 64 bit useable) would be // result := MathFloor( // Math.Power(256, Math.Floor(ABit / 8)+1)-1 {***} - // Math.Power(2, ABit)); // // *** is the maximal value of the byte amount we were requesting. // Example: // If ABit in [ 0.. 7] => 1 Byte used => (256^1-1) = $FF // If ABit in [ 8..15] => 2 Bytes used => (256^2-1) = $FF FF // If ABit in [16..23] => 3 Bytes used => (256^3-1) = $FF FF FF // If ABit in [24..31] => 4 Bytes used => (256^3-1) = $FF FF FF FF // ... SingleBitArrayDynamicInversed: array[T64BitPos] of int64 = ($00000000000000FE, $00000000000000FD, $00000000000000FB, $00000000000000F7, $00000000000000EF, $00000000000000DF, $00000000000000BF, $000000000000007F, $000000000000FEFF, $000000000000FDFF, $000000000000FBFF, $000000000000F7FF, $000000000000EFFF, $000000000000DFFF, $000000000000BFFF, $0000000000007FFF, $0000000000FEFFFF, $0000000000FDFFFF, $0000000000FBFFFF, $0000000000F7FFFF, $0000000000EFFFFF, $0000000000DFFFFF, $0000000000BFFFFF, $00000000007FFFFF, $00000000FEFFFFFF, $00000000FDFFFFFF, $00000000FBFFFFFF, $00000000F7FFFFFF, $00000000EFFFFFFF, $00000000DFFFFFFF, $00000000BFFFFFFF, $000000007FFFFFFF, $000000FEFFFFFFFF, $000000FDFFFFFFFF, $000000FBFFFFFFFF, $000000F7FFFFFFFF, $000000EFFFFFFFFF, $000000DFFFFFFFFF, $000000BFFFFFFFFF, $0000007FFFFFFFFF, $0000FEFFFFFFFFFF, $0000FDFFFFFFFFFF, $0000FBFFFFFFFFFF, $0000F7FFFFFFFFFF, $0000EFFFFFFFFFFF, $0000DFFFFFFFFFFF, $0000BFFFFFFFFFFF, $00007FFFFFFFFFFF, $00FEFFFFFFFFFFFF, $00FDFFFFFFFFFFFF, $00FBFFFFFFFFFFFF, $00F7FFFFFFFFFFFF, $00EFFFFFFFFFFFFF, $00DFFFFFFFFFFFFF, $00BFFFFFFFFFFFFF, $007FFFFFFFFFFFFF, $FEFFFFFFFFFFFFFF, $FDFFFFFFFFFFFFFF, $FBFFFFFFFFFFFFFF, $F7FFFFFFFFFFFFFF, $EFFFFFFFFFFFFFFF, $DFFFFFFFFFFFFFFF, $BFFFFFFFFFFFFFFF, $7FFFFFFFFFFFFFFF); // Gives you a 64 bit datatype which is representing the inversed // binary encoding. // // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111110, // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111101, // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111011, // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11110111, // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11101111, // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11011111, // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 10111111, // 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01111111, // 11111111 11111111 11111111 11111111 11111111 11111111 11111110 11111111, // ... // 01111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111. // // Limitation because of the data type: 64 Bit // // Manual calculation (not 64 bit useable) would be // result := NOT GetSingleBit(ABit) // SingleBitArrayInversed: array[T64BitPos] of int64 = ($FFFFFFFFFFFFFFFE, $FFFFFFFFFFFFFFFD, $FFFFFFFFFFFFFFFB, $FFFFFFFFFFFFFFF7, $FFFFFFFFFFFFFFEF, $FFFFFFFFFFFFFFDF, $FFFFFFFFFFFFFFBF, $FFFFFFFFFFFFFF7F, $FFFFFFFFFFFFFEFF, $FFFFFFFFFFFFFDFF, $FFFFFFFFFFFFFBFF, $FFFFFFFFFFFFF7FF, $FFFFFFFFFFFFEFFF, $FFFFFFFFFFFFDFFF, $FFFFFFFFFFFFBFFF, $FFFFFFFFFFFF7FFF, $FFFFFFFFFFFEFFFF, $FFFFFFFFFFFDFFFF, $FFFFFFFFFFFBFFFF, $FFFFFFFFFFF7FFFF, $FFFFFFFFFFEFFFFF, $FFFFFFFFFFDFFFFF, $FFFFFFFFFFBFFFFF, $FFFFFFFFFF7FFFFF, $FFFFFFFFFEFFFFFF, $FFFFFFFFFDFFFFFF, $FFFFFFFFFBFFFFFF, $FFFFFFFFF7FFFFFF, $FFFFFFFFEFFFFFFF, $FFFFFFFFDFFFFFFF, $FFFFFFFFBFFFFFFF, $FFFFFFFF7FFFFFFF, $FFFFFFFEFFFFFFFF, $FFFFFFFDFFFFFFFF, $FFFFFFFBFFFFFFFF, $FFFFFFF7FFFFFFFF, $FFFFFFEFFFFFFFFF, $FFFFFFDFFFFFFFFF, $FFFFFFBFFFFFFFFF, $FFFFFF7FFFFFFFFF, $FFFFFEFFFFFFFFFF, $FFFFFDFFFFFFFFFF, $FFFFFBFFFFFFFFFF, $FFFFF7FFFFFFFFFF, $FFFFEFFFFFFFFFFF, $FFFFDFFFFFFFFFFF, $FFFFBFFFFFFFFFFF, $FFFF7FFFFFFFFFFF, $FFFEFFFFFFFFFFFF, $FFFDFFFFFFFFFFFF, $FFFBFFFFFFFFFFFF, $FFF7FFFFFFFFFFFF, $FFEFFFFFFFFFFFFF, $FFDFFFFFFFFFFFFF, $FFBFFFFFFFFFFFFF, $FF7FFFFFFFFFFFFF, $FEFFFFFFFFFFFFFF, $FDFFFFFFFFFFFFFF, $FBFFFFFFFFFFFFFF, $F7FFFFFFFFFFFFFF, $EFFFFFFFFFFFFFFF, $DFFFFFFFFFFFFFFF, $BFFFFFFFFFFFFFFF, $7FFFFFFFFFFFFFFF); implementation resourcestring LngEBitStringInvalidCharacter = 'The bitstring "%s" contains a invalid ' + 'character. Unexpected character "%s" at position "%d".'; LngEBitStringTooLong = 'The bitstring "%s" is too long. Expected: %d byte.'; function GetByteBitArray(AByte: Byte): TByteBitArray; var i: T8BitPos; begin for i := Low(T8BitPos) to High(T8BitPos) do begin // result[i] := GetByteBit(AByte, i); result[i] := AByte and SingleBitArray[i] = SingleBitArray[i]; end; end; function GetNibbleBitArray(ANibble: Nibble): THexNibbleBitArray; var i: T4BitPos; begin for i := Low(T4BitPos) to High(T4BitPos) do begin // result[i] := GetNibbleBit(ANibble, i); result[i] := ANibble and SingleBitArray[i] = SingleBitArray[i]; end; end; function BuildByte(AUpperNibble, ALowerNibble: THexNibble): Byte; begin // result := $10 * AUpperNibble + ALowerNibble; result := (AUpperNibble shl 4) + ALowerNibble; end; function BuildByte(ABitArray: TByteBitArray): Byte; var i: T8BitPos; begin result := 0; for i := Low(T8BitPos) to High(T8BitPos) do begin // SetByteBit(result, i, ABitArray[i]); if not ABitArray[i] then result := result and SingleBitArrayDynamicInversed[i] else result := result or SingleBitArray[i]; end; end; function BuildByte(ABits: TByteBitString): Byte; begin result := BuildByte(ByteBitArrayFromBitString(ABits)); end; function BuildByte(ABit1, ABit2, ABit3, ABit4, ABit5, ABit6, ABit7, ABit8: TBit): Byte; overload; var ba: TByteBitArray; begin ba[0] := ABit1; ba[1] := ABit2; ba[2] := ABit3; ba[3] := ABit4; ba[4] := ABit5; ba[5] := ABit6; ba[6] := ABit7; ba[7] := ABit8; result := BuildByte(ba); end; function ByteBitArrayFromBitString(const ABits: TByteBitString): TByteBitArray; var i: integer; begin if Length(ABits) <> 8 then begin raise EBitStringTooLong.CreateFmt(LngEBitStringTooLong, [ABits, 8]); exit; end; for i := 1 to Length(ABits) do begin case ABits[i] of '0': result[i-1] := false; '1': result[i-1] := true; else raise EBitStringInvalidCharacter.CreateFmt(LngEBitStringInvalidCharacter, [ABits, ABits[i], i]); end; end; end; function NibbleBitArrayFromBitString(const ABits: THexNibbleBitString): THexNibbleBitArray; var i: integer; begin if Length(ABits) <> 4 then begin raise EBitStringTooLong.CreateFmt(LngEBitStringTooLong, [ABits, 4]); exit; end; for i := 1 to Length(ABits) do begin case ABits[i] of '0': result[i-1] := false; '1': result[i-1] := true; else raise EBitStringInvalidCharacter.CreateFmt(LngEBitStringInvalidCharacter, [ABits, ABits[i], i]); end; end; end; function BuildNibble(ABit1, ABit2, ABit3, ABit4: TBit): Nibble; var ba: THexNibbleBitArray; begin ba[0] := ABit1; ba[1] := ABit2; ba[2] := ABit3; ba[3] := ABit4; result := BuildNibble(ba); end; function BuildNibble(ABitArray: THexNibbleBitArray): Nibble; var i: T4BitPos; begin result := 0; for i := Low(T4BitPos) to High(T4BitPos) do begin // SetNibbleBit(result, i, ABitArray[i]); if not ABitArray[i] then result := result and SingleBitArrayDynamicInversed[i] else result := result or SingleBitArray[i]; end; end; function BuildNibble(ABits: THexNibbleBitString): Nibble; begin result := BuildNibble(NibbleBitArrayFromBitString(ABits)); end; function GetLowerNibble(AByte: Byte): THexNibble; begin result := AByte and AllSetBitsNibble[0]; end; function SetLowerNibble(AByte: Byte; ANewNibble: THexNibble): Byte; begin // result := BuildByte(GetUpperNibble(AByte), ANewNibble); // result := $10 * (AByte and AllSetBitsNibble[1] shr 4) + ANewNibble; // result := (AByte and AllSetBitsNibble[1] shr 4) shl 4 + ANewNibble; // Optimized: "shr 4 shl 4" removed result := (AByte and AllSetBitsNibble[1]) + ANewNibble; end; function GetUpperNibble(AByte: Byte): THexNibble; begin result := AByte and AllSetBitsNibble[1] shr 4; end; function SetUpperNibble(AByte: Byte; ANewNibble: THexNibble): Byte; begin // result := BuildByte(ANewNibble, GetLowerNibble(AByte)); // result := ($10 * ANewNibble) + (AByte and AllSetBitsNibble[0]); result := (ANewNibble shl 4) + (AByte and AllSetBitsNibble[0]); end; function GetByteBit(AByte: Byte; ABitPos: T8BitPos): TBit; begin // result := AByte and SingleBitArray[ABitPos] shr ABitPos = 1; // result := AByte and Math.Power(2, ABitPos) shr ABitPos = 1; // result := AByte and SingleBitArray[ABitPos] shr ABitPos = 1; result := AByte and SingleBitArray[ABitPos] = SingleBitArray[ABitPos]; end; function SetByteBit(AByte: Byte; ABitPos: T8BitPos; ANewBit: TBit): Byte; begin if not ANewBit then begin // Set a bit to 0. // Example: abcdefgh AND 11111011 = abcde0gh // result := AByte and (AllSetBitsBytes[0] - SingleBitArray[ABitPos]); // result := AByte and (AllSetBitsBytes[0] - Math.Power(2, ABitPos)); result := AByte and SingleBitArrayDynamicInversed[ABitPos] end else begin // Set a bit to 1. // Example: abcdefgh OR 00000100 = abcde1gh // result := AByte or Math.Power(2, ABitPos); result := AByte or SingleBitArray[ABitPos]; end; end; function GetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos): TBit; begin result := GetByteBit(Ord(AChar), ABitPos); end; function SetAnsiCharBit(AChar: AnsiChar; ABitPos: T8BitPos; ANewBit: TBit): Byte; begin result := SetByteBit(Ord(AChar), ABitPos, ANewBit); end; function GetNibbleBit(ANibble: Nibble; ABitPos: T4BitPos): TBit; begin result := GetByteBit(ANibble, ABitPos); end; function SetNibbleBit(ANibble: Nibble; ABitPos: T4BitPos; ANewBit: TBit): Nibble; begin result := SetByteBit(ANibble, ABitPos, ANewBit); end; function ByteBitArrayShr(ABitArray: TByteBitArray; AVal: Longword): TByteBitArray; var b: Byte; begin b := BuildByte(ABitArray); result := GetByteBitArray(b shr AVal); end; function ByteBitArrayShl(ABitArray: TByteBitArray; AVal: Longword): TByteBitArray; var b: Byte; begin b := BuildByte(ABitArray); result := GetByteBitArray(b shl AVal); end; function ByteBitArrayAnd(ABitArray, ABitArray2: TByteBitArray): TByteBitArray; var b, b2: Byte; begin b := BuildByte(ABitArray); b2 := BuildByte(ABitArray2); result := GetByteBitArray(b and b2); end; function ByteBitArrayOr(ABitArray, ABitArray2: TByteBitArray): TByteBitArray; var b, b2: Byte; begin b := BuildByte(ABitArray); b2 := BuildByte(ABitArray2); result := GetByteBitArray(b or b2); end; function ByteBitArrayXor(ABitArray, ABitArray2: TByteBitArray): TByteBitArray; var b, b2: Byte; begin b := BuildByte(ABitArray); b2 := BuildByte(ABitArray2); result := GetByteBitArray(b xor b2); end; function ByteBitArrayNot(ABitArray: TByteBitArray): TByteBitArray; var b: Byte; begin b := BuildByte(ABitArray); result := GetByteBitArray(not b); end; function NibbleBitArrayShr(ABitArray: THexNibbleBitArray; AVal: Longword): THexNibbleBitArray; var b: Nibble; begin b := BuildNibble(ABitArray); result := GetNibbleBitArray(b shr AVal); end; function NibbleBitArrayShl(ABitArray: THexNibbleBitArray; AVal: Longword): THexNibbleBitArray; var b: Nibble; begin b := BuildNibble(ABitArray); result := GetNibbleBitArray(b shl AVal); end; function NibbleBitArrayAnd(ABitArray, ABitArray2: THexNibbleBitArray): THexNibbleBitArray; var b, b2: Nibble; begin b := BuildNibble(ABitArray); b2 := BuildNibble(ABitArray2); result := GetNibbleBitArray(b and b2); end; function NibbleBitArrayOr(ABitArray, ABitArray2: THexNibbleBitArray): THexNibbleBitArray; var b, b2: Nibble; begin b := BuildNibble(ABitArray); b2 := BuildNibble(ABitArray2); result := GetNibbleBitArray(b or b2); end; function NibbleBitArrayXor(ABitArray, ABitArray2: THexNibbleBitArray): THexNibbleBitArray; var b, b2: Nibble; begin b := BuildNibble(ABitArray); b2 := BuildNibble(ABitArray2); result := GetNibbleBitArray(b xor b2); end; function NibbleBitArrayNot(ABitArray: THexNibbleBitArray): THexNibbleBitArray; var b: Nibble; begin b := BuildNibble(ABitArray); result := GetNibbleBitArray(not b); end; function InverseByteBits(x: Byte): Byte; begin // 10110001 // xor 11111111 // = 01001110 result := x xor AllSetBitsBytes[0]; end; function InverseNibbleBits(x: Nibble): Nibble; begin // 0001 // xor 1111 // = 1110 result := x xor AllSetBitsNibbles[0]; end; function InterchangeNibbles(AByte: Byte): Byte; begin // result := BuildByte(GetLowerNibble(AByte), GetUpperNibble(AByte)); result := (AByte and AllSetBitsNibble[0] shl 4) + (AByte and AllSetBitsNibble[1] shr 4) end; function ReverseByteBitSequence(AByte: Byte): Byte; var ba: TByteBitArray; begin ba := GetByteBitArray(AByte); result := BuildByte(ba[7], ba[6], ba[5], ba[4], ba[3], ba[2], ba[1], ba[0]); end; function ReverseNibbleBitSequence(ANibble: Nibble): Nibble; var ba: THexNibbleBitArray; begin ba := GetNibbleBitArray(ANibble); result := BuildNibble(ba[3], ba[2], ba[1], ba[0]); end; end.
34.171388
82
0.711917
0.853131
12,068
316
go
Go
croixxant/golang-examples
[ "MIT" ]
null
croixxant/golang-examples
[ "MIT" ]
null
croixxant/golang-examples
[ "MIT" ]
null
// Code generated by sqlc. DO NOT EDIT. package db import ( "database/sql" ) type Post struct { ID int64 UserID int64 Body string LikesCount int32 } type User struct { ID int64 Email string HashedPassword string ConfirmedAt sql.NullTime LikesCount int32 }
13.73913
39
0.632911
0.879091
111
1,009
html
HTML
JakubSzwajka/JakubSzwajka.github.io
[ "MIT" ]
1
JakubSzwajka/JakubSzwajka.github.io
[ "MIT" ]
null
JakubSzwajka/JakubSzwajka.github.io
[ "MIT" ]
null
{% if site.google_analytics %} <!-- Google Analytics --> {% comment %} <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', '{{ site.google_analytics }}', 'auto'); ga('send', 'pageview', { 'page': '{{ site.baseurl }}{{ page.url }}', 'title': '{{ page.title | replace: "'", "\\'" }}' }); </script> {% endcomment %} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-LP35TQPY08"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-LP35TQPY08'); </script> <!-- End Google Analytics --> {% endif %}
37.37037
88
0.593657
0.826421
424
742
bib
TeX
yamadharma/blog
[ "CC-BY-4.0" ]
null
yamadharma/blog
[ "CC-BY-4.0" ]
null
yamadharma/blog
[ "CC-BY-4.0" ]
null
@patent{kulyabov:2016:certificate:2016618429, author = {Севастьянов, Леонид Антонович and Кулябов, Дмитрий Сергеевич and Геворкян, Мигран Нельсонович and Королькова, Анна Владиславовна}, file = {:/bib/2016/certificate-2016618429.pdf:pdf}, institution = {Федеральное государственное автономное образовательное учреждение высшего образования «Российский университет дружбы народов» (РУДН)}, keywords = {patent, rinc, rinc}, language = {russian}, mendeley-tags = {patent,РИНЦ}, month = {jul}, number = {2016618429}, timestamp = {2020-03-30}, title = {Вычисление дисперсионных зависимостей для планарных многослойных тонкопленочных волноводов}, type = {Свидетельство о государственной регистрации программы для ЭВМ}, year = {2016} }
46.375
150
0.77628
0.83
322
2,472
sol
Solidity
DraconiteToken/Draconite-Token
[ "MIT" ]
1
DraconiteToken/Draconite-Token
[ "MIT" ]
null
DraconiteToken/Draconite-Token
[ "MIT" ]
1
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
32.526316
89
0.653317
0.87132
639
994
lean
Lean
dselsam/lean3
[ "Apache-2.0" ]
2,232
forked-from-1kasper/lean
[ "Apache-2.0" ]
1,187
forked-from-1kasper/lean
[ "Apache-2.0" ]
306
inductive {u} vec (A : Type u) : nat → Type u | nil : vec 0 | cons : ∀ {n}, A → vec n → vec (n+1) open tactic nat vec def head {A : Type*} : ∀ {n : nat}, vec A (n+1) → A | n (cons h t) := h def tail {A : Type*} : ∀ {n : nat}, vec A (n+1) → vec A n | n (cons h t) := t @[simp] lemma head_cons {A : Type*} {n : nat} (a : A) (v : vec A n) : head (cons a v) = a := rfl @[simp] lemma tail_cons {A : Type*} {n : nat} (a : A) (v : vec A n) : tail (cons a v) = v := rfl example {A : Type*} {n : nat} (v w : vec A (n+1)) : head v = head w → tail v = tail w → v = w := by do v ← get_local `v, cases v [`n', `hv, `tv], trace_state, w ← get_local `w, cases w [`n', `hw, `tw], trace_state, dsimp_target, trace_state, Heq1 ← intro1, Heq2 ← intro1, subst Heq1, subst Heq2, reflexivity #print "-------" example (n : nat) : n ≠ 0 → succ (pred n) = n := by do H ← intro `H, n ← get_local `n, cases n [`n'], trace_state, contradiction, reflexivity #print "---------"
21.148936
96
0.517103
0.801214
468
1,056
tex
TeX
projeduc/ESI_1CP_BWeb
[ "CC-BY-4.0" ]
1
projeduc/ESI_1CP_BWeb
[ "CC-BY-4.0" ]
null
projeduc/ESI_1CP_BWeb
[ "CC-BY-4.0" ]
null
\documentclass{book} \usepackage{graphicx} \begin{document} \listoffigures \listoftables \clearpage Dans Tableau~\ref{tab-comp} \begin{table}[!ht] \caption{Comparaison entre A et B} \label{tab-comp} \centering \begin{tabular}{lll} \hline \hline & A & B \\ \hline ASCII & 65 & 66 \\ \hline \hline \end{tabular} \end{table} \clearpage Dans Figure~\ref{fig-exemp}, un exemple de ... \begin{figure}[!ht] \caption{Un exemple d'image} \label{fig-exemp} \includegraphics{banner.jpg} \end{figure} \clearpage Dans Tableau~\ref{tab-comp2} \begin{table}[!ht] \caption{Comparaison entre C et D} \label{tab-comp2} \centering \begin{tabular}{lll} \hline \hline & A & B \\ \hline ASCII & 67 & 68 \\ \hline \hline \end{tabular} \end{table} Dans Figure~\ref{fig-exemp2}, un exemple de ... \begin{figure}[!ht] \caption{Un autre exemple d'image} \label{fig-exemp2} \includegraphics{banner.jpg} \end{figure} \end{document}
18.857143
49
0.611742
0.854375
485
1,530
jsp
Java Server Pages
anupammaiti/ERP
[ "Apache-2.0" ]
1
anupammaiti/ERP
[ "Apache-2.0" ]
null
anupammaiti/ERP
[ "Apache-2.0" ]
null
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>ERP</title> <link rel="stylesheet" href="css/erp.css"/> <script type="text/javascript" src="js/jquery-1.7.1.js"></script> <script type="text/javascript" src="js/erpjs.js"></script> </head> <body> <center>ERP</center><a href="HRAdmin.erp">Back</a><hr/> <!-- Report Calling --> <a href="staticjasperreport.erp">report</a> <table border="1" cellpadding="0" cellspacing="0"> <tr> <td>Empno</td> <td>name</td> <td>nameihris</td> <td>fathername</td> <td>dob</td> <td>sex</td> <td>joiningdate</td> <td>designation</td> <td>department</td> <td>reportingto</td> <td>joblevel</td> <td>location</td> <td>entrymanner</td> <td>nomination</td> <td>birthplace</td> <td>maritalstatus</td> <td>marriagedate</td> <td>religion</td> <td>pannumber</td> <td>passportnumber</td> <td>issuedateandplace</td> <td>validity</td> <td>companyname</td> <td>qualification</td> </tr> <c:forEach items="${EmployeeList}" var="emplist" varStatus="status"> <tr> <td> <c:out value="${emplist.empno}"/></a> </td> <td> <c:out value="${emplist.name}"/> </td> </tr> </c:forEach> </table> </body> </html>
24.285714
72
0.611765
0.85528
674
365
scrbl
Racket
Yanjingzhu/racket
[ "Apache-2.0" ]
10
Yanjingzhu/racket
[ "Apache-2.0" ]
15
Yanjingzhu/racket
[ "Apache-2.0" ]
3
#lang scribble/base @(require "shared.rkt") @title{Todo List, Call for Contributions} @itemlist[#:style 'ordered @item{Write a section on when macros, when functions.} @item{Write a section on how to design test cases.} @item{Write a section on how to check the stressability of your software.} @item{Find and link to good/bad examples in the code base.} ]
20.277778
74
0.739726
0.850027
116
484
yy
Yacc
DatZach/astron.libgml
[ "MIT" ]
1
DatZach/astron.libgml
[ "MIT" ]
null
DatZach/astron.libgml
[ "MIT" ]
null
{ "id": "fd8783e2-f4e7-475a-94bf-24a294ce459b", "modelName": "GMFolder", "mvc": "1.1", "name": "fd8783e2-f4e7-475a-94bf-24a294ce459b", "children": [ "027014bd-951c-4679-890a-4008d5961f23", "dba326fa-a87c-4b5b-9bc3-743bfee7e9d9", "e874c911-1292-45a5-a43b-90342497a682", "ff32e94e-ace8-492d-940c-9249dc27a647" ], "filterType": "GMScript", "folderName": "Events", "isDefaultView": false, "localisedFolderName": "" }
30.25
51
0.617769
0.816667
302
4,128
asm
Assembly
AI-Factor-y/NASM-library
[ "Apache-2.0" ]
null
AI-Factor-y/NASM-library
[ "Apache-2.0" ]
null
AI-Factor-y/NASM-library
[ "Apache-2.0" ]
null
section .data msg1 : db 'debug here --',10 l1 : equ $-msg1 msg2 : db 'highest number :' l2 : equ $-msg2 msg3 : db 'lowest number :' l3 : equ $-msg3 msg4 : db 'enter number of elements : ' l4: equ $-msg4 msg5 : db 'enter the elements : ',10 l5: equ $-msg5 debug :db '----- debugger -----',10 debugl:equ $-debug space:db ' ' newline:db ' ',10 nwl :db ' ',10 nwl_l : equ $-nwl section .bss nod: resb 1 num: resw 1 temp: resb 1 counter: resw 1 num1: resw 1 num2: resw 1 n: resd 10 array: resw 50 matrix: resw 1 highest :resw 1 lowest : resw 1 curr_num : resw 1 count: resb 10 section .text global _start _start: mov word[num],10 mov eax, 4 mov ebx, 1 mov ecx, msg5 mov edx, l5 int 80h mov cx,word[num] mov word[n],cx mov ebx,array mov eax,0 call read_array ; ; debug---- ; mov eax, 4 ; mov ebx, 1 ; mov ecx, msg1 ; mov edx, l1 ; int 80h ; ;debug --- mov ebx,array mov eax,0 mov dx,0 mov word[highest],0 mov word[lowest],1000 loop1: mov cx,word[ebx+2*eax] inc eax mov word[curr_num],cx ; mov ax,cx push rax push rbx push rcx ; check high value mov ax,word[highest] cmp word[curr_num],ax jbe no_change_high mov ax,word[curr_num] mov word[highest],ax no_change_high: ; check low value mov ax,word[lowest] cmp word[curr_num],ax jae no_change_low mov ax,word[curr_num] mov word[lowest],ax no_change_low: pop rcx pop rbx pop rax cmp eax,dword[n] jb loop1 ; print message push rax push rbx push rcx mov eax, 4 mov ebx, 1 mov ecx, msg2 mov edx, l2 int 80h pop rcx pop rbx pop rax ; print highest mov ax,word[highest] mov word[num],ax; call print_num mov eax,4 mov ebx,1 mov ecx,newline mov edx,1 int 80h ; print low message push rax push rbx push rcx mov eax, 4 mov ebx, 1 mov ecx, msg3 mov edx, l3 int 80h pop rcx pop rbx pop rax ; print low mov ax,word[lowest] mov word[num],ax; call print_num mov eax,4 mov ebx,1 mov ecx,newline mov edx,1 int 80h exit: mov eax,1 mov ebx,0 int 80h read_array: ; pusha read_loop: cmp eax,dword[n] je end_read_1 push rax push rbx call read_num pop rbx pop rax ;;read num stores the input in ’num’ mov cx,word[num] mov word[ebx+2*eax],cx inc eax ;;Here, each word consists of two bytes, so the counter should be ; incremented by multiples of two. If the array is declared in bytes do mov word[ebx+eax],cx jmp read_loop end_read_1: ; popa ret print_array: ; pusha print_loop: cmp eax,dword[n] je end_print1 mov cx,word[ebx+2*eax] mov word[num],cx ;;The number to be printed is copied to ’num’ ; before calling print num function push rax push rbx call print_num pop rbx pop rax inc eax jmp print_loop end_print1: ; popa ret read_num: ;;push all the used registers into the stack using pusha ;call push_reg ;;store an initial value 0 to variable ’num’ mov word[num], 0 loop_read: ;; read a digit mov eax, 3 mov ebx, 0 mov ecx, temp mov edx, 1 int 80h ;;check if the read digit is the end of number, i.e, the enter-key whose ASCII cmp byte[temp], 10 cmp byte[temp], 10 je end_read mov ax, word[num] mov bx, 10 mul bx mov bl, byte[temp] sub bl, 30h mov bh, 0 add ax, bx mov word[num], ax jmp loop_read end_read: ;;pop all the used registers from the stack using popa ;call pop_reg ret print_num: mov byte[count],0 ;call push_reg extract_no: cmp word[num], 0 je print_no inc byte[count] mov dx, 0 mov ax, word[num] mov bx, 10 div bx push dx ; recursion here mov word[num], ax jmp extract_no print_no: cmp byte[count], 0 je end_print dec byte[count] pop dx mov byte[temp], dl ; dx is further divided into dh and dl add byte[temp], 30h mov eax, 4 mov ebx, 1 mov ecx, temp mov edx, 1 int 80h jmp print_no end_print: mov eax,4 mov ebx,1 mov ecx,nwl mov edx,nwl_l int 80h ;;The memory location ’newline’ should be declared with the ASCII key for new popa ;call pop_reg ret
12.981132
98
0.646076
0.850485
2,075