hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
81806fbe9e9fcd280f1e7babd1c30b9027e9a019
2,527
go
Go
atomicproposition.go
kwesiRutledge/ModelChecking
0abfab54a392fe9bae0c95dcb96659616a4ed246
[ "MIT" ]
null
null
null
atomicproposition.go
kwesiRutledge/ModelChecking
0abfab54a392fe9bae0c95dcb96659616a4ed246
[ "MIT" ]
null
null
null
atomicproposition.go
kwesiRutledge/ModelChecking
0abfab54a392fe9bae0c95dcb96659616a4ed246
[ "MIT" ]
null
null
null
/* atomicproposition.go Description: Basic implementation of an Atomic Proposition object. */ package modelchecking import ( "errors" combinations "github.com/mxschmitt/golang-combinations" ) type AtomicProposition struct { Name string } /* Equals Description: Compares the atomic propositions by their names. */ func (ap AtomicProposition) Equals(ap2 AtomicProposition) bool { return ap.Name == ap2.Name } /* StringSliceToAPs Description: Transforms a slice of int variables into a list of AtomicPropositions */ func StringSliceToAPs(stringSlice []string) []AtomicProposition { var APList []AtomicProposition for _, apName := range stringSlice { APList = append(APList, AtomicProposition{Name: apName}) } return APList } /* In Description: Determines if the Atomic Proposition is in a slice of atomic propositions. */ func (ap AtomicProposition) In(apSliceIn []AtomicProposition) bool { for _, tempAP := range apSliceIn { if ap.Equals(tempAP) { return true } } return false } /* ToSliceOfAtomicPropositions Description: Attempts to convert an arbitrary slice into a slice of atomic propositions. */ func ToSliceOfAtomicPropositions(slice1 interface{}) ([]AtomicProposition, error) { // Attempt To Cast castedSlice1, ok1 := slice1.([]AtomicProposition) if ok1 { return castedSlice1, nil } else { return []AtomicProposition{}, errors.New("There was an issue casting the slice into a slice of Atomic Propositions.") } } /* Powerset Description: Creates all possible subsets of the input array of atomic propositions. */ func Powerset(setOfAPs []AtomicProposition) [][]AtomicProposition { var AllCombinations [][]AtomicProposition var AllCombinationsAsStrings [][]string var AllNames []string for _, ap := range setOfAPs { AllNames = append(AllNames, ap.Name) } AllCombinationsAsStrings = combinations.All(AllNames) for _, tempStringSlice := range AllCombinationsAsStrings { AllCombinations = append(AllCombinations, StringSliceToAPs(tempStringSlice)) } AllCombinations = append(AllCombinations, []AtomicProposition{}) return AllCombinations } /* SatisfactionHelper Description: Identifies if the state stateIn satisfies the atomic proposition ap. */ func (ap AtomicProposition) SatisfactionHelper(stateIn TransitionSystemState) (bool, error) { // Constants SystemPointer := stateIn.System LOfState := SystemPointer.L[stateIn] // Find If ap is in LOfState return ap.In(LOfState), nil } func (ap AtomicProposition) String() string { return ap.Name }
21.235294
119
0.760981
4c3b39d64fb27d061371e039554c6e09a06fa4f0
5,557
php
PHP
app/Http/Controllers/SesionController.php
francolau/ferreteria
65afff282badcce4397f75d623dc0f3ae6aa8afd
[ "MIT" ]
null
null
null
app/Http/Controllers/SesionController.php
francolau/ferreteria
65afff282badcce4397f75d623dc0f3ae6aa8afd
[ "MIT" ]
null
null
null
app/Http/Controllers/SesionController.php
francolau/ferreteria
65afff282badcce4397f75d623dc0f3ae6aa8afd
[ "MIT" ]
null
null
null
<?php namespace App\Http\Controllers; use Illuminate\Support\Facades\Session; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; class SesionController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function login(Request $request) { $user = $request->input('user'); $password = $request->input('password'); $cliente = DB::select("SELECT * FROM cliente WHERE usuario LIKE '".$user."' AND contrasenia LIKE '".$password."' LIMIT 5;"); if($cliente != null) { $parametros = [ "cliente" => $cliente]; // $cliente = $cliente->first(); foreach ( $cliente as $clientes){ Session::put('id',$clientes -> id_cliente); Session::put('nombre',$clientes -> nombre); return back(); } } else { return back(); } } public function registro(Request $request) { if(Session::get('nombre') != null) { $user = $request->input ('user'); $password = $request->input('password'); $name = $request->input('name'); $lastname = $request->input('lastname'); $email = $request->input('email'); $date = $request->input('date'); $tel = $request->input('tel'); DB::insert('insert into cliente (usuario, contrasenia, nombre, apellido, email, fecha_nacimiento, telefono) values (?, ?, ?, ?, ?, ?, ?)' , [$user, $password, $name, $lastname, $email, $date, $tel]); return view ('inicio'); } else { return view('error_permisos'); } } public function cerrarSesion() { Session::flush(); return redirect('/'); } public function historialPedidos() { if(Session::get('nombre') != null) { $idCliente = Session::get('id'); $pedidosIniciadosYRealizados = DB::SELECT ("SELECT * FROM compra WHERE id_cliente LIKE '".$idCliente."' AND (estado like 'iniciada' OR estado like 'realizada') ORDER BY fecha_hora DESC"); $pedidosFinalizados = DB::SELECT ("SELECT * FROM compra WHERE id_cliente LIKE '".$idCliente."' AND estado like 'finalizada' ORDER BY fecha_hora DESC "); $parametro = [ "pedidos" => $pedidosIniciadosYRealizados, "pedidosFinalizados" => $pedidosFinalizados ]; // $pedidos = null; // deberia traer de la base de datos aquellos pedidos que sean del usuario en cuestion return view('usuario.pedidos', $parametro ); } else { return view('error_permisos'); } } public function detallesCompra($codigo) { $modo = 'historial'; $arraydp = DB::SELECT (" SELECT p.codigo, p.nombre, p.marca, p.precio, p.imagen, p.categoria, dc.subtotal, dc.cantidad FROM compra c INNER JOIN detalle_compra dc ON c.id_compra = dc.id_compra INNER JOIN producto p ON dc.id_producto = p.codigo WHERE c.id_compra =" .$codigo); $arraydc = DB::SELECT ("SELECT c.id_compra, dc.subtotal,dc.cantidad,p.precio,p.nombre,c.total, c.id_cliente,p.codigo FROM detalle_compra dc INNER JOIN compra c ON dc.id_compra = c.id_compra INNER JOIN producto p ON p.codigo = dc.id_producto AND c.id_compra = " .$codigo); $parametros = [ "arrayProductos" => $arraydp, "detallesProductosDelCarrito" => $arraydc, "modo" => $modo ]; return view( 'carrito.index', $parametros); } public function detallesCuenta() { if(Session::get('nombre') != null) { $idCliente = Session::get('id'); $cliente = DB::table('cliente')->where('id_cliente','=',$idCliente)->get('*')->firstOrFail(); // deberia traer el cliente de la base de datos o tomar los datos de Session::get para mostrarlos $parametros = [ 'cliente' => $cliente ]; return view('usuario.detalles',$parametros); } else { return view('error_permisos'); } } public function inicio() { return view('usuario.principal'); } // Esta funcion deberia guardar los cambios realizados en el perfil // borrarla en caso de que el boton "Finalizar" sirva para otra cosa public function guardarCambios(Request $request) { $nombre = request('nombre'); $apellido = request('apellido'); $email = request('email'); $fecha_nacimiento = request('fecha_nacimiento'); $telefono = request('telefono'); DB::table('cliente') ->where('id_cliente','=',Session::get('id')) ->update( [ 'nombre'=> $nombre, 'apellido' => $apellido, 'email' => $email, 'fecha_nacimiento' => $fecha_nacimiento, 'telefono' => $telefono ] ); return back(); } }
28.792746
203
0.511607
c50f2fa22bb51a4c4ed46a048263a220af9f1132
66
kt
Kotlin
app/src/main/java/com/alekskuzmin/flyhi/core/domain/action/Action.kt
alekskuzmin/flyhi
08e36815e966fd68d6f802bd9ed16c5294130b5b
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/alekskuzmin/flyhi/core/domain/action/Action.kt
alekskuzmin/flyhi
08e36815e966fd68d6f802bd9ed16c5294130b5b
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/alekskuzmin/flyhi/core/domain/action/Action.kt
alekskuzmin/flyhi
08e36815e966fd68d6f802bd9ed16c5294130b5b
[ "Apache-2.0" ]
null
null
null
package com.alekskuzmin.flyhi.core.domain.action interface Action
22
48
0.863636
40284e3c8ca8439890cce58407069268f549fe74
1,301
py
Python
2016/src/Advent2016_04.py
davidxbuck/advent2018
eed5424a8008b9c0829f5872ad6cd469ce9f70b9
[ "MIT" ]
1
2021-12-11T02:19:28.000Z
2021-12-11T02:19:28.000Z
2016/src/Advent2016_04.py
davidxbuck/advent2018
eed5424a8008b9c0829f5872ad6cd469ce9f70b9
[ "MIT" ]
null
null
null
2016/src/Advent2016_04.py
davidxbuck/advent2018
eed5424a8008b9c0829f5872ad6cd469ce9f70b9
[ "MIT" ]
1
2020-12-08T04:31:46.000Z
2020-12-08T04:31:46.000Z
# Advent of Code 2016 # # From https://adventofcode.com/2016/day/4 from collections import Counter, defaultdict import re keys = [row.strip('\n]').split('[') for row in open('../inputs/Advent2016_04.txt', 'r')] valid_count = 0 for key, code in keys: key_counts = Counter("".join(re.findall(r'[a-z]+', key))) sector_id = int(re.findall(r'\d+', key)[0]) count_keys = defaultdict(list) for k, v in key_counts.items(): count_keys[v] += k for k in count_keys.keys(): count_keys[k] = sorted(count_keys[k]) counter = 0 valid = True for i in sorted(count_keys.keys(), reverse=True): if valid: for j in count_keys[i]: if counter >= 5: break if j not in code: valid = False break counter += 1 if valid: valid_count += sector_id out = '' for letter in key: if 97 <= ord(letter) <= 122: out += chr((ord(letter) - 97 + sector_id) % 26 + 97) elif letter == '-': out += ' ' if out.strip() == 'northpole object storage': print('AoC 2016 Day 4, Part 2 answer is ', sector_id) print('AoC 2016 Day 4, Part 1 answer is ', valid_count)
30.255814
88
0.528055
0ea2e7ca59970502b4039b2eb1fc6355beb4a8d4
686
kt
Kotlin
src/main/kotlin/com/deflatedpickle/marvin/util/OSUtil.kt
DeflatedPickle/marvin
7bc909c13e4b1ee28e1507d8cffa051f756c38ca
[ "MIT" ]
null
null
null
src/main/kotlin/com/deflatedpickle/marvin/util/OSUtil.kt
DeflatedPickle/marvin
7bc909c13e4b1ee28e1507d8cffa051f756c38ca
[ "MIT" ]
2
2020-07-30T20:19:09.000Z
2020-07-30T20:19:12.000Z
src/main/kotlin/com/deflatedpickle/marvin/util/OSUtil.kt
DeflatedPickle/marvin
7bc909c13e4b1ee28e1507d8cffa051f756c38ca
[ "MIT" ]
null
null
null
/* Copyright (c) 2021 DeflatedPickle under the MIT license */ package com.deflatedpickle.marvin.util @Suppress("MemberVisibilityCanBePrivate", "unused") object OSUtil { val os = System.getProperty("os.name").toLowerCase() fun isWindows() = os.contains("win") fun isLinux() = os.contains("linux") fun isMac() = os.contains("mac") fun isSolaris() = os.contains("sunos") fun getOS(): OS = when { isWindows() -> OS.WINDOWS isLinux() -> OS.LINUX isMac() -> OS.MAC isSolaris() -> OS.SOLARIS else -> OS.UNKNOWN } enum class OS { WINDOWS, LINUX, MAC, SOLARIS, UNKNOWN } }
22.129032
61
0.580175
613a38707086a5174fadc35ae9cfd7c305e5c949
1,624
kt
Kotlin
core/src/commonMain/kotlin/com/episode6/redux/impl.kt
episode6/redux-store-flow
6769f2384ae5be653271c8a785952ac42150153f
[ "MIT" ]
1
2022-03-15T04:46:28.000Z
2022-03-15T04:46:28.000Z
core/src/commonMain/kotlin/com/episode6/redux/impl.kt
episode6/redux-store-flow
6769f2384ae5be653271c8a785952ac42150153f
[ "MIT" ]
null
null
null
core/src/commonMain/kotlin/com/episode6/redux/impl.kt
episode6/redux-store-flow
6769f2384ae5be653271c8a785952ac42150153f
[ "MIT" ]
null
null
null
package com.episode6.redux import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel.Factory.UNLIMITED import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.launch /** * Creates a new [StoreFlow], a redux store backed by a [kotlinx.coroutines.flow.StateFlow] */ @Suppress("FunctionName") fun <State : Any?> StoreFlow( scope: CoroutineScope, initialValue: State, reducer: Reducer<State>, middlewares: List<Middleware<State>> = emptyList(), ): StoreFlow<State> = StoreFlowImpl( scope = scope, initialState = initialValue, reducer = reducer, middlewares = middlewares, ) private class StoreFlowImpl<T : Any?>( scope: CoroutineScope, override val initialState: T, reducer: Reducer<T>, middlewares: List<Middleware<T>>, private val stateFlow: MutableStateFlow<T> = MutableStateFlow(initialState) ) : StoreFlow<T>, Flow<T> by stateFlow { private val actionChannel: Channel<Action> = Channel(capacity = UNLIMITED) init { scope.launch { val reduce: Dispatch = middlewares.foldRight( initial = { action -> stateFlow.value = stateFlow.value.reducer(action) }, operation = { middleware, next -> with(middleware) { interfere(this@StoreFlowImpl, next) } } ) try { for (action in actionChannel) { reduce(action) } } finally { actionChannel.close() } } } override val state: T get() = stateFlow.value override fun dispatch(action: Action) { actionChannel.trySend(action) } }
28.491228
100
0.706281
16a1f47f8725377c0ee6c8d73f9752b450403ab3
3,114
swift
Swift
Sources/MultiUser/Model/User.swift
smuellner/MultiUser.swift
c0700b4122e7d1391226019c7f5eeb4ed1ec69f5
[ "MIT" ]
1
2020-04-18T08:14:47.000Z
2020-04-18T08:14:47.000Z
Sources/MultiUser/Model/User.swift
smuellner/MultiUser-for-swift
c0700b4122e7d1391226019c7f5eeb4ed1ec69f5
[ "MIT" ]
null
null
null
Sources/MultiUser/Model/User.swift
smuellner/MultiUser-for-swift
c0700b4122e7d1391226019c7f5eeb4ed1ec69f5
[ "MIT" ]
null
null
null
// // User.swift // // // Created by Sascha Müllner on 29.02.20. // import Foundation import CoreImage public struct User: Codable { private var uuid: UUID public var username: String? public var firstname: String? public var lastname: String? public var birthday: Date? public var emails: [EMail] = [EMail]() public var phones: [Phone] = [Phone]() public var addresses: [Address] = [Address]() public var capabilities: Capabilities = Capabilities() public var attributes: [String: String] = [String: String]() public var icon: Data? public var data: [Data] = [Data]() public init() { self.uuid = UUID() } public init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) self.uuid = try values.decode(UUID.self, forKey: .uuid) self.username = try values.decodeIfPresent(String.self, forKey: .username) self.firstname = try values.decodeIfPresent(String.self, forKey: .firstname) self.lastname = try values.decodeIfPresent(String.self, forKey: .lastname) self.birthday = try values.decodeIfPresent(Date.self, forKey: .birthday) self.emails = try values.decodeIfPresent([EMail].self, forKey: .emails) ?? [EMail]() self.phones = try values.decodeIfPresent([Phone].self, forKey: .phones) ?? [Phone]() self.addresses = try values.decodeIfPresent([Address].self, forKey: .addresses) ?? [Address]() self.capabilities = try values.decodeIfPresent(Capabilities.self, forKey: .capabilities) ?? Capabilities() self.attributes = try values.decodeIfPresent([String: String].self, forKey: .attributes) ?? [String: String]() self.icon = try values.decodeIfPresent(Data.self, forKey: .icon) self.data = try values.decodeIfPresent([Data].self, forKey: .data) ?? [Data]() } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(self.uuid, forKey: .uuid) try container.encodeIfPresent(self.username, forKey: .username) try container.encodeIfPresent(self.firstname, forKey: .firstname) try container.encodeIfPresent(self.lastname, forKey: .lastname) try container.encodeIfPresent(self.birthday, forKey: .birthday) try container.encodeIfPresent(self.emails, forKey: .emails) try container.encodeIfPresent(self.phones, forKey: .phones) try container.encodeIfPresent(self.addresses, forKey: .addresses) try container.encodeIfPresent(self.capabilities, forKey: .capabilities) try container.encodeIfPresent(self.attributes, forKey: .attributes) try container.encodeIfPresent(self.icon, forKey: .icon) try container.encodeIfPresent(self.data, forKey: .data) } public var id: UUID { get { return self.uuid } } private enum CodingKeys: String, CodingKey { case uuid, username, firstname, lastname, birthday, emails, phones, addresses, capabilities, attributes, icon, data } }
43.25
123
0.679512
9d782f053222c183f33ba1f53a4a27f66bcdd923
1,377
sql
SQL
src/EA.Weee.Database/scripts/Update/Release 1/Sprint17/20151112-1328-AddNonClusteredIndexToTables.sql
uk-gov-mirror/defra.prsd-weee
0eb8cd9db9cf5625bb7ada3955916970634110e5
[ "Unlicense" ]
2
2018-02-08T09:42:51.000Z
2019-05-07T14:06:27.000Z
src/EA.Weee.Database/scripts/Update/Release 1/Sprint17/20151112-1328-AddNonClusteredIndexToTables.sql
uk-gov-mirror/defra.prsd-weee
0eb8cd9db9cf5625bb7ada3955916970634110e5
[ "Unlicense" ]
60
2017-03-16T11:35:44.000Z
2022-03-17T15:02:08.000Z
src/EA.Weee.Database/scripts/Update/Release 1/Sprint17/20151112-1328-AddNonClusteredIndexToTables.sql
uk-gov-mirror/defra.prsd-weee
0eb8cd9db9cf5625bb7ada3955916970634110e5
[ "Unlicense" ]
1
2021-04-10T21:31:54.000Z
2021-04-10T21:31:54.000Z
/****** Object: Index [IX_MemberUpload_IsSubmitted] Script Date: 12/11/2015 13:25:55 ******/ CREATE NONCLUSTERED INDEX [IX_MemberUpload_IsSubmitted] ON [PCS].[MemberUpload] ( [IsSubmitted] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) GO CREATE NONCLUSTERED INDEX [IX_SICCode_ProducerId] ON [Producer].[SICCode] ( [ProducerId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) GO /****** Object: Index [IX_Partner_PartnershipId] Script Date: 12/11/2015 13:26:32 ******/ CREATE NONCLUSTERED INDEX [IX_Partner_PartnershipId] ON [Producer].[Partner] ( [PartnershipId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) GO /****** Object: Index [IX_Producer_MemberUploadId] Script Date: 12/11/2015 13:27:01 ******/ CREATE NONCLUSTERED INDEX [IX_Producer_MemberUploadId] ON [Producer].[Producer] ( [MemberUploadId] ASC ) INCLUDE ( [RegistrationNumber], [UpdatedDate]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) GO
45.9
170
0.738562
2e40000718001206f34017625c73ac74779c9e0f
3,805
sql
SQL
SOFTTEK/softtek.scms.net/SOFTTEK.SCMS.DB/Procedures/spFAMGetNovelty.sql
ingscarrero/dotNet
6e7795b9a5e0af02c0a50445ddd98dcc7d1ed9fa
[ "MIT" ]
null
null
null
SOFTTEK/softtek.scms.net/SOFTTEK.SCMS.DB/Procedures/spFAMGetNovelty.sql
ingscarrero/dotNet
6e7795b9a5e0af02c0a50445ddd98dcc7d1ed9fa
[ "MIT" ]
null
null
null
SOFTTEK/softtek.scms.net/SOFTTEK.SCMS.DB/Procedures/spFAMGetNovelty.sql
ingscarrero/dotNet
6e7795b9a5e0af02c0a50445ddd98dcc7d1ed9fa
[ "MIT" ]
null
null
null
CREATE PROCEDURE [dbo].[spFAMGetNovelty] @token_id NVARCHAR(50), @filter_nvlrqs_id_Pk BIGINT = NULL, @filter_nvlrqs_number NVARCHAR(MAX) = NULL, @filter_nvlrqs_external_identifier NVARCHAR(500) = NULL, @filter_nvlrqs_informed_Fk INT = NULL, @filter_nvlrqs_responsible_Fk INT = NULL, @filter_nvlrqs_accountable_Fk INT = NULL, @filter_nvlrqs_request_Fk INT = NULL, @filter_nvlrqs_type_Fk BIGINT = NULL, @filter_nvlrqs_topic NVARCHAR(50) = NULL, @filter_nvlrqs_status NVARCHAR(10) = NULL, @filter_nvlrqs_comments NVARCHAR(500) = NULL AS DECLARE @v_token_user nvarchar(20); DECLARE @v_token_employee_id int; BEGIN SELECT @v_token_employee_id = [TBL_SRA_EMPLOYEE].[id], @v_token_user = [TBL_SCMS_TOKEN].[token_user_id] FROM [TBL_SRA_EMPLOYEE] INNER JOIN [TBL_SCMS_USER] ON [TBL_SCMS_USER].[user_id] = [TBL_SRA_EMPLOYEE].[user] INNER JOIN [TBL_SCMS_TOKEN] ON [TBL_SCMS_TOKEN].[token_user_id] = [TBL_SCMS_USER].[user_id] AND [TBL_SCMS_TOKEN].[token_id] = @token_id AND [TBL_SCMS_TOKEN].[token_expires_at] > GETDATE(); IF @v_token_employee_id IS NULL RAISERROR ('Invalid token', 16, 1); ELSE SELECT [TBL_FAM_NOVELTY].[nvlrqs_id_Pk], [TBL_FAM_NOVELTY].[nvlrqs_request_Fk], [TBL_FAM_NOVELTY].[nvlrqs_number], [TBL_FAM_NOVELTY].[nvlrqs_external_identifier], [informed].[id] AS nvlrqs_informed_Fk, [informed].[user], [responsible].[id]AS nvlrqs_responsible_Fk, [responsible].[user], [accountable].[id] AS nvlrqs_accountable_Fk, [accountable].[user], [TBL_FAM_REQUEST].[rqs_id_Pk], [TBL_FAM_NOVELTY].[nvlrqs_details], [TBL_FAM_NOVELTY].[nvlrqs_type_Fk], [TBL_FAM_NOVELTY].[nvlrqs_topic], [TBL_FAM_NOVELTY].[nvlrqs_registered_at], [TBL_FAM_NOVELTY].[nvlrqs_updated_at], [TBL_FAM_NOVELTY].[nvlrqs_status], [TBL_FAM_NOVELTY].[nvlrqs_comments] FROM [TBL_FAM_NOVELTY] INNER JOIN [TBL_SRA_EMPLOYEE] AS [informed] ON [informed].[id] = [TBL_FAM_NOVELTY].[nvlrqs_informed_Fk] INNER JOIN [TBL_SRA_EMPLOYEE] AS [responsible] ON [responsible].[id] = [TBL_FAM_NOVELTY].[nvlrqs_responsible_Fk] INNER JOIN [TBL_SRA_EMPLOYEE] AS [accountable] ON [accountable].[id] = [TBL_FAM_NOVELTY].[nvlrqs_accountable_Fk] INNER JOIN [TBL_FAM_REQUEST] ON [TBL_FAM_REQUEST].[rqs_id_Pk] = [TBL_FAM_NOVELTY].[nvlrqs_request_Fk] WHERE [TBL_FAM_NOVELTY].[nvlrqs_id_Pk] = ISNULL(@filter_nvlrqs_id_Pk, [TBL_FAM_NOVELTY].[nvlrqs_id_Pk]) AND [TBL_FAM_NOVELTY].[nvlrqs_request_Fk] = ISNULL(@filter_nvlrqs_request_Fk, [TBL_FAM_NOVELTY].[nvlrqs_request_Fk]) AND [TBL_FAM_NOVELTY].[nvlrqs_number] = ISNULL(@filter_nvlrqs_number, [TBL_FAM_NOVELTY].[nvlrqs_number]) AND [TBL_FAM_NOVELTY].[nvlrqs_external_identifier] = ISNULL(@filter_nvlrqs_external_identifier, [TBL_FAM_NOVELTY].[nvlrqs_external_identifier]) AND [TBL_FAM_NOVELTY].[nvlrqs_informed_Fk] = ISNULL(@filter_nvlrqs_informed_Fk, [TBL_FAM_NOVELTY].[nvlrqs_informed_Fk]) AND [TBL_FAM_NOVELTY].[nvlrqs_responsible_Fk] = ISNULL(@filter_nvlrqs_responsible_Fk, [TBL_FAM_NOVELTY].[nvlrqs_responsible_Fk]) AND [TBL_FAM_NOVELTY].[nvlrqs_accountable_Fk] = ISNULL(@filter_nvlrqs_accountable_Fk, [TBL_FAM_NOVELTY].[nvlrqs_accountable_Fk]) AND [TBL_FAM_NOVELTY].[nvlrqs_request_Fk] = ISNULL(@filter_nvlrqs_request_Fk, [TBL_FAM_NOVELTY].[nvlrqs_request_Fk]) AND [TBL_FAM_NOVELTY].[nvlrqs_type_Fk] = ISNULL(@filter_nvlrqs_type_Fk, [TBL_FAM_NOVELTY].[nvlrqs_type_Fk]) AND [TBL_FAM_NOVELTY].[nvlrqs_topic] = ISNULL(@filter_nvlrqs_topic, [TBL_FAM_NOVELTY].[nvlrqs_topic]) AND [TBL_FAM_NOVELTY].[nvlrqs_status] = ISNULL(@filter_nvlrqs_status, [TBL_FAM_NOVELTY].[nvlrqs_status]) AND [TBL_FAM_NOVELTY].[nvlrqs_comments] = ISNULL(@filter_nvlrqs_comments, [TBL_FAM_NOVELTY].[nvlrqs_comments]); END RETURN 0
55.955882
147
0.760578
670f0c99b6741cf55163827e966458eef9058321
309
swift
Swift
Recipes/Models/Recipe/ImprovedRecipe.swift
illescasDaniel/Recipes
857cc9e6da771caa2064f5df6612b36a6ca71b83
[ "MIT" ]
1
2019-12-04T17:18:58.000Z
2019-12-04T17:18:58.000Z
Recipes/Models/Recipe/ImprovedRecipe.swift
illescasDaniel/Recipes
857cc9e6da771caa2064f5df6612b36a6ca71b83
[ "MIT" ]
null
null
null
Recipes/Models/Recipe/ImprovedRecipe.swift
illescasDaniel/Recipes
857cc9e6da771caa2064f5df6612b36a6ca71b83
[ "MIT" ]
null
null
null
// // ImprovedRecipe.swift // RecipePuppy // // Created by Daniel Illescas Romero on 18/10/2018. // Copyright © 2018 Daniel Illescas Romero. All rights reserved. // import Foundation struct ImprovedRecipe { let title: String let href: URL let ingredients: [Ingredient] let thumbnail: String//URL? }
18.176471
65
0.724919
fb4863d3430b87cddcf3c558416f12e1e5fd35ef
1,072
java
Java
java-interview-questions/java-programs/DynamicProgramming/ncr.java
veilair/java-development
1d784dfe4f2b29e1413ab63df9163bc2dddd8ba1
[ "MIT" ]
1
2022-01-18T01:00:56.000Z
2022-01-18T01:00:56.000Z
java-interview-questions/java-programs/DynamicProgramming/ncr.java
veilair/java-development
1d784dfe4f2b29e1413ab63df9163bc2dddd8ba1
[ "MIT" ]
null
null
null
java-interview-questions/java-programs/DynamicProgramming/ncr.java
veilair/java-development
1d784dfe4f2b29e1413ab63df9163bc2dddd8ba1
[ "MIT" ]
null
null
null
package DynamicProgramming; import java.util.Arrays; public class ncr { public static int NcR(int n, int r) { if (n == 1 || r == 0 || n == r) { return 1; } if (r == 1) { return n; } return NcR(n - 1, r) + NcR(n - 1, r - 1); } public static int dpApproach(int n, int r) { if(r > n) return -1; if(n == r) return 1; if(r == 0) return n; int[][] dp = new int[n + 1][r + 1]; for (int i = 1; i <= n; i++) { for (int j = 0; j <= r; j++) { if (i >= j) { if (j == 0) { dp[i][j] = i; } else if (i == j) { dp[i][j] = 1; } else if (j == 1) { dp[i][j] = i; } else { dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - 1]) % 1000000007; } } } } // print(dp); return dp[n][r]; } public static void print(int[][] arr) { for(int i = 0; i < arr.length; i++) { System.out.println(Arrays.toString(arr[i])); } } public static void main(String[] args) { // TODO Auto-generated method stub // System.out.println(NcR(84, 56)); System.out.println(dpApproach(84, 56)); } }
17.290323
64
0.473881
c79382f316f4f46784f957e8e42a51ca5f9b301e
411
kt
Kotlin
kryptoprefs/src/androidTest/java/com/kryptoprefs/util/RandomStringGenerator.kt
rumboalla/KryptoPrefs
89f3fb446db36dba2c890201d16589c65f59f5c9
[ "MIT" ]
34
2019-11-12T11:58:54.000Z
2021-12-16T14:22:31.000Z
kryptoprefs/src/androidTest/java/com/kryptoprefs/util/RandomStringGenerator.kt
rumboalla/KryptoPrefs
89f3fb446db36dba2c890201d16589c65f59f5c9
[ "MIT" ]
1
2021-06-11T03:13:29.000Z
2021-06-11T03:13:29.000Z
kryptoprefs/src/androidTest/java/com/kryptoprefs/util/RandomStringGenerator.kt
rumboalla/KryptoPrefs
89f3fb446db36dba2c890201d16589c65f59f5c9
[ "MIT" ]
4
2019-11-19T07:37:02.000Z
2021-01-23T12:46:26.000Z
package com.kryptoprefs.util import java.util.Random object RandomStringGenerator { private const val source = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" private val random = Random() @JvmStatic @Synchronized fun generate(len: Int): String { val sb = StringBuilder(len) for (i in 0..len) sb.append(source[random.nextInt(source.length)]) return sb.toString() } }
21.631579
74
0.683698
c4c01a7aa4c38eb99108112056e42d0df8ec84f8
2,146
dart
Dart
test/header_parser_tests/nested_parsing_test.dart
listepo/ffigen
2f5a24076c1e691d771108c550999ada81ea8751
[ "BSD-3-Clause" ]
null
null
null
test/header_parser_tests/nested_parsing_test.dart
listepo/ffigen
2f5a24076c1e691d771108c550999ada81ea8751
[ "BSD-3-Clause" ]
null
null
null
test/header_parser_tests/nested_parsing_test.dart
listepo/ffigen
2f5a24076c1e691d771108c550999ada81ea8751
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/header_parser.dart' as parser; import 'package:ffigen/src/config_provider.dart'; import 'package:test/test.dart'; import 'package:yaml/yaml.dart' as yaml; import 'package:ffigen/src/strings.dart' as strings; import '../test_utils.dart'; Library actual, expected; void main() { group('nested_parsing_test', () { setUpAll(() { logWarnings(); expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' ${strings.description}: 'Nested Parsing Test' ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/nested_parsing.h' ${strings.structs}: ${strings.include}: - Struct1 ''') as yaml.YamlMap), ); }); test('Total bindings count', () { expect(actual.bindings.length, expected.bindings.length); }); test('Struct1', () { expect(actual.getBindingAsString('Struct1'), expected.getBindingAsString('Struct1')); }); test('Struct2', () { expect(actual.getBindingAsString('Struct2'), expected.getBindingAsString('Struct2')); }); }); } Library expectedLibrary() { final struc2 = Struc(name: 'Struct2', members: [ Member( name: 'e', type: Type.nativeType(SupportedNativeType.Int32), ), Member( name: 'f', type: Type.nativeType(SupportedNativeType.Int32), ), ]); return Library( name: 'Bindings', bindings: [ struc2, Struc(name: 'Struct1', members: [ Member( name: 'a', type: Type.nativeType(SupportedNativeType.Int32), ), Member( name: 'b', type: Type.nativeType(SupportedNativeType.Int32), ), Member(name: 'struct2', type: Type.pointer(Type.struct(struc2))), ]), ], ); }
26.493827
77
0.630009
e8091634ebd0d38bd6aa81b0dfcb2d588a61b4e7
632
kt
Kotlin
app/src/main/java/io/github/brunogabriel/unittestingsample/shared/view/MarginItemDecoration.kt
brunogabriel/AndroidUnitTesting
e1f8e3a888a54a416ffbe0bb16ca689dff6cab66
[ "MIT" ]
4
2021-09-25T18:21:08.000Z
2021-11-10T10:37:15.000Z
app/src/main/java/io/github/brunogabriel/unittestingsample/shared/view/MarginItemDecoration.kt
brunogabriel/AndroidUnitTesting
e1f8e3a888a54a416ffbe0bb16ca689dff6cab66
[ "MIT" ]
null
null
null
app/src/main/java/io/github/brunogabriel/unittestingsample/shared/view/MarginItemDecoration.kt
brunogabriel/AndroidUnitTesting
e1f8e3a888a54a416ffbe0bb16ca689dff6cab66
[ "MIT" ]
null
null
null
package io.github.brunogabriel.unittestingsample.shared.view import android.graphics.Rect import android.view.View import androidx.recyclerview.widget.RecyclerView class MarginItemDecoration( private val margin: Int ) : RecyclerView.ItemDecoration() { override fun getItemOffsets( outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State ) { with(outRect) { if (parent.getChildAdapterPosition(view) == 0) { top = margin } left = margin right = margin bottom = margin } } }
25.28
60
0.612342
0f2629637db453dd41ce42895d100e1c8075df5c
1,254
lua
Lua
technic_worldgen/init.lua
mt-mods/technic
39d786918c855625dfd70e3975c552621b9712a2
[ "DOC" ]
17
2020-02-20T06:32:56.000Z
2021-11-23T02:10:00.000Z
technic_worldgen/init.lua
mt-mods/technic
39d786918c855625dfd70e3975c552621b9712a2
[ "DOC" ]
193
2020-02-18T18:34:20.000Z
2022-03-30T12:22:03.000Z
technic_worldgen/init.lua
mt-mods/technic
39d786918c855625dfd70e3975c552621b9712a2
[ "DOC" ]
18
2020-06-30T11:55:52.000Z
2022-03-05T17:56:46.000Z
local modpath = minetest.get_modpath("technic_worldgen") technic = rawget(_G, "technic") or {} technic.worldgen = { gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end, } dofile(modpath.."/config.lua") dofile(modpath.."/nodes.lua") dofile(modpath.."/oregen.lua") dofile(modpath.."/crafts.lua") dofile(modpath.."/overrides.lua") -- Rubber trees, moretrees also supplies these if not minetest.get_modpath("moretrees") then dofile(modpath.."/rubber.lua") else -- Older versions of technic provided rubber trees regardless minetest.register_alias("technic:rubber_sapling", "moretrees:rubber_tree_sapling") minetest.register_alias("technic:rubber_tree_empty", "moretrees:rubber_tree_trunk_empty") end -- mg suppport if minetest.get_modpath("mg") then dofile(modpath.."/mg.lua") end minetest.register_alias("technic:wrought_iron_ingot", "default:steel_ingot") minetest.register_alias("technic:uranium", "technic:uranium_lump") minetest.register_alias("technic:wrought_iron_block", "default:steelblock") minetest.register_alias("technic:diamond_block", "default:diamondblock") minetest.register_alias("technic:diamond", "default:diamond") minetest.register_alias("technic:mineral_diamond", "default:stone_with_diamond")
35.828571
90
0.783094
e2134a09aaac72a7bdd4a6ae266f611556f09edb
324
swift
Swift
project/Component/NefSwiftPlayground/Models/SwiftPackageProduct.swift
chenrui333/nef
cc9210bb4151cb502a71e5b7a1e6166735f834b5
[ "Apache-2.0" ]
265
2018-12-19T16:17:22.000Z
2022-03-29T07:39:00.000Z
project/Component/NefSwiftPlayground/Models/SwiftPackageProduct.swift
chenrui333/nef
cc9210bb4151cb502a71e5b7a1e6166735f834b5
[ "Apache-2.0" ]
73
2019-01-02T12:17:18.000Z
2022-01-19T18:55:43.000Z
project/Component/NefSwiftPlayground/Models/SwiftPackageProduct.swift
chenrui333/nef
cc9210bb4151cb502a71e5b7a1e6166735f834b5
[ "Apache-2.0" ]
11
2019-04-18T12:31:38.000Z
2022-01-29T15:01:48.000Z
// Copyright © 2020 The nef Authors. import Foundation import NefCommon public struct SwiftPackageProduct { let name: String let dependencies: [String] } public extension Array where Element == SwiftPackageProduct { func names() -> [String] { (map(\.name) + flatMap(\.dependencies)).unique() } }
20.25
61
0.679012
98ae3eee3c699c0ef9987205b18a88cd50cb4ca3
5,058
html
HTML
app/content/texts/vnm_wh/JB40.html
youfriend20012001/VNGKBible
63f7b88f3d0d257a8730929c57e65221a6ce8824
[ "MIT" ]
null
null
null
app/content/texts/vnm_wh/JB40.html
youfriend20012001/VNGKBible
63f7b88f3d0d257a8730929c57e65221a6ce8824
[ "MIT" ]
4
2020-04-04T04:16:48.000Z
2022-03-26T19:19:12.000Z
app/content/texts/vnm_wh/JB40.html
youfriend20012001/VNGKBible
63f7b88f3d0d257a8730929c57e65221a6ce8824
[ "MIT" ]
1
2020-11-25T17:39:39.000Z
2020-11-25T17:39:39.000Z
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> <title>Job 40 (VNM)</title> <link href="../../../build/mobile.css" rel="stylesheet" /> <script src="../../../build/mobile.js"></script> </head> <body dir="ltr" class="section-document"> <div class="header"><div class="nav"> <a class="name" href="JB.html">1934</a><a class="location" href="JB.html">Job 40</a><a class="prev" href="JB39.html">&lt;</a> <a class="home" href="index.html">=</a> <a class="next" href="JB41.html">&gt;</a> </div></div> <div class="section chapter JB JB40 vnm_wh vnm " dir="ltr" lang="vnm" data-id="JB40" data-nextid="JB41" data-previd="JB39"> <div class="c">40</div> <div class="p"> <span class="v-num v-1">1&nbsp;</span><span class="v JB40_1" data-id="JB40_1">(39:34) Ðức Giê-hô-va còn đáp lại cho Gióp, mà rằng:</span> <span class="v-num v-2">2&nbsp;</span><span class="v JB40_2" data-id="JB40_2">(39:35) Kẻ bắt bẻ Ðấng Toàn năng há sẽ tranh luận cùng Ngài sao? Kẻ cãi luận cùng Ðức Chúa Trời, hãy đáp điều đó đi!</span> <span class="v-num v-3">3&nbsp;</span><span class="v JB40_3" data-id="JB40_3">(39:36) Gióp bèn thưa cùng Ðức Giê-hô-va rằng:</span> <span class="v-num v-4">4&nbsp;</span><span class="v JB40_4" data-id="JB40_4">(39:37) Tôi vốn là vật không ra gì, sẽ đáp chi với Chúa? Tôi đặt tay lên che miệng tôi.</span> <span class="v-num v-5">5&nbsp;</span><span class="v JB40_5" data-id="JB40_5">(39:38) Tôi đã nói một lần, song sẽ chẳng còn đáp lại; Phải, tôi đã nói hai lần, nhưng không nói thêm gì nữa.</span> <span class="v-num v-6">6&nbsp;</span><span class="v JB40_6" data-id="JB40_6">(40:1) Từ giữa trận gió trốt, Ðức Giê-hô-va đáp cùng Gióp, mà rằng:</span> <span class="v-num v-7">7&nbsp;</span><span class="v JB40_7" data-id="JB40_7">(40:2) Hãy thắt lưng ngươi như kẻ dõng sĩ; Ta sẽ hỏi ngươi, ngươi sẽ chỉ dạy cho ta!</span> <span class="v-num v-8">8&nbsp;</span><span class="v JB40_8" data-id="JB40_8">(40:3) Ngươi há có ý phế lý đoán ta sao? Có muốn định tội cho ta đặng xưng mình là công bình ư?</span> <span class="v-num v-9">9&nbsp;</span><span class="v JB40_9" data-id="JB40_9">(40:4) Ngươi có một cánh tay như của Ðức Chúa Trời chăng? Có thể phát tiếng sấm rền như Ngài sao?</span> <span class="v-num v-10">10&nbsp;</span><span class="v JB40_10" data-id="JB40_10">(40:5) Vậy bây giờ, ngươi hãy trang điểm mình bằng sự cao sang và oai nghi, Mặc lấy sự tôn trọng và vinh hiển.</span> <span class="v-num v-11">11&nbsp;</span><span class="v JB40_11" data-id="JB40_11">(40:6) Khá tuôn ra sự giận hoảng hốt của ngươi; Hãy liếc mắt xem kẻ kiêu ngạo và đánh hạ nó đi.</span> <span class="v-num v-12">12&nbsp;</span><span class="v JB40_12" data-id="JB40_12">(40:7) Hãy liếc mắt coi kẻ kiêu ngạo và đánh hạ nó đi; Khá chà nát kẻ hung bạo tại chỗ nó.</span> <span class="v-num v-13">13&nbsp;</span><span class="v JB40_13" data-id="JB40_13">(40:8) Hãy giấu chúng nó chung nhau trong bụi đất, Và lấp mặt họ trong chốn kín đáo.</span> <span class="v-num v-14">14&nbsp;</span><span class="v JB40_14" data-id="JB40_14">(40:9) Bấy giờ, ta cũng sẽ khen ngợi ngươi, Vì tay hữu ngươi chửng cứu ngươi được!</span> <span class="v-num v-15">15&nbsp;</span><span class="v JB40_15" data-id="JB40_15">(40:10) Nầy, con trâu nước mà ta đã dựng nên luôn với ngươi; Nó ăn cỏ như con bò.</span> <span class="v-num v-16">16&nbsp;</span><span class="v JB40_16" data-id="JB40_16">(40:11) Hãy xem: sức nó ở nơi lưng, Mãnh lực nó ở trong gân hông nó.</span> <span class="v-num v-17">17&nbsp;</span><span class="v JB40_17" data-id="JB40_17">(40:12) Nó cong đuôi nó như cây bá hương; Gân đùi nó tréo xỏ-rế.</span> <span class="v-num v-18">18&nbsp;</span><span class="v JB40_18" data-id="JB40_18">(40:13) Các xương nó như ống đồng, Tứ chi nó như cây sắt.</span> <span class="v-num v-19">19&nbsp;</span><span class="v JB40_19" data-id="JB40_19">(40:14) Nó là công việc khéo nhứt của Ðức Chúa Trời; Ðấng dựng nên nó giao cho nó cây gươm của nó.</span> <span class="v-num v-20">20&nbsp;</span><span class="v JB40_20" data-id="JB40_20">(40:15) Các núi non sanh đồng cỏ cho nó ăn, Là nơi các thú đồng chơi giỡn.</span> <span class="v-num v-21">21&nbsp;</span><span class="v JB40_21" data-id="JB40_21">(40:16) Nó nằm ngủ dưới bông sen, Trong bụi sậy và nơi bưng.</span> <span class="v-num v-22">22&nbsp;</span><span class="v JB40_22" data-id="JB40_22">(40:17) Bông sen che bóng cho nó, Và cây liễu của rạch vây quanh nó.</span> <span class="v-num v-23">23&nbsp;</span><span class="v JB40_23" data-id="JB40_23">(40:18) Kìa, sông tràn lên dữ tợn, nhưng nó không sợ hãi gì; Dầu sông Giô-đanh bủa lên miệng nó, nó cũng ở vững vàng.</span> <span class="v-num v-24">24&nbsp;</span><span class="v JB40_24" data-id="JB40_24">(40:19) Ai bắt được nó ở trước mặt? Ai hãm nó trong lưới, rồi xoi mũi nó?</span> </div> </div> <div class="footer"><div class="nav"> <a class="prev" href="JB39.html">&lt;</a> <a class="home" href="index.html">=</a> <a class="next" href="JB41.html">&gt;</a> </div></div> </body> </html>
103.22449
206
0.677738
90c0ff2d6c7539edaa13fe0407395b52b29042c8
4,528
py
Python
models/vision/detection/awsdet/models/necks/fpn.py
indhub/deep-learning-models
26f72870e0db8f092dabab42ad3a653a8dc83601
[ "Apache-2.0" ]
null
null
null
models/vision/detection/awsdet/models/necks/fpn.py
indhub/deep-learning-models
26f72870e0db8f092dabab42ad3a653a8dc83601
[ "Apache-2.0" ]
null
null
null
models/vision/detection/awsdet/models/necks/fpn.py
indhub/deep-learning-models
26f72870e0db8f092dabab42ad3a653a8dc83601
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- ''' FPN model for Keras. # Reference: - [Feature Pyramid Networks for Object Detection]( https://arxiv.org/abs/1612.03144) ''' import tensorflow as tf from tensorflow.keras import layers from ..registry import NECKS @NECKS.register_module class FPN(tf.keras.Model): def __init__(self, top_down_dims=256, weight_decay=1e-4, interpolation_method='bilinear', use_bias=True): super().__init__() self._build_p5_conv = layers.Conv2D(top_down_dims, 1, strides=1, use_bias=use_bias, name='build_p5', kernel_regularizer=tf.keras.regularizers.l2(weight_decay), kernel_initializer='he_normal') self._build_p6_max_pooling = layers.MaxPooling2D(strides=2, pool_size=(1, 1), name='build_p6') self._build_p4_reduce_dims = layers.Conv2D(top_down_dims, 1, strides=1, use_bias=use_bias, name='build_p4_reduce_dims', kernel_regularizer=tf.keras.regularizers.l2(weight_decay), kernel_initializer='he_normal') self._build_p4_fusion = layers.Add(name='build_p4_fusion') self._build_p4 = layers.Conv2D(top_down_dims, 3, 1, use_bias=use_bias, kernel_regularizer=tf.keras.regularizers.l2(weight_decay), padding='same', name='build_p4', kernel_initializer='he_normal') self._build_p3_reduce_dims = layers.Conv2D(top_down_dims, 1, strides=1, use_bias=use_bias, name='build_p3_reduce_dims', kernel_regularizer=tf.keras.regularizers.l2(weight_decay), kernel_initializer='he_normal') self._build_p3_fusion = layers.Add(name='build_p3_fusion') self._build_p3 = layers.Conv2D(top_down_dims, 3, 1, use_bias=use_bias, kernel_regularizer=tf.keras.regularizers.l2(weight_decay), padding='same', name='build_p3', kernel_initializer='he_normal') self._build_p2_reduce_dims = layers.Conv2D(top_down_dims, 1, strides=1, use_bias=use_bias, name='build_p2_reduce_dims', kernel_regularizer=tf.keras.regularizers.l2(weight_decay), kernel_initializer='he_normal') self._build_p2_fusion = layers.Add(name='build_p2_fusion') self._build_p2 = layers.Conv2D(top_down_dims, 3, 1, use_bias=use_bias, kernel_regularizer=tf.keras.regularizers.l2(weight_decay), padding='same', name='build_p2', kernel_initializer='he_normal') self._method = interpolation_method @tf.function(experimental_relax_shapes=True) def call(self, inputs, training=None, mask=None): c2, c3, c4, c5 = inputs # build p5 & p6 p5 = self._build_p5_conv(c5) p6 = self._build_p6_max_pooling(p5) # build p4 h, w = tf.shape(c4)[1], tf.shape(c4)[2] upsample_p5 = tf.image.resize(p5, (h, w), method=self._method, name='build_p4_resize') reduce_dims_c4 = self._build_p4_reduce_dims(c4) p4 = self._build_p4_fusion([upsample_p5 * 0.5, reduce_dims_c4 * 0.5]) # build p3 h, w = tf.shape(c3)[1], tf.shape(c3)[2] upsample_p4 = tf.image.resize(p4, (h, w), method=self._method, name='build_p3_resize') reduce_dims_c3 = self._build_p3_reduce_dims(c3) p3 = self._build_p3_fusion([upsample_p4 * 0.5, reduce_dims_c3 * 0.5]) # build p2 h, w = tf.shape(c2)[1], tf.shape(c2)[2] upsample_p3 = tf.image.resize(p3, (h, w), method=self._method, name='build_p2_resize') reduce_dims_c2 = self._build_p2_reduce_dims(c2) p2 = self._build_p2_fusion([upsample_p3 * 0.5, reduce_dims_c2 * 0.5]) p4 = self._build_p4(p4) p3 = self._build_p3(p3) p2 = self._build_p2(p2) return p2, p3, p4, p5, p6
50.876404
109
0.569788
5de3552e9bfaefa9ff7cfd302b47b10c0c4ac35b
1,305
go
Go
pkg/apis/resolution/v1alpha1/resource_request_validation.go
sbwsg/resolution
b54134d264c969eea67a46f3a02d13c7d790b88f
[ "Apache-2.0" ]
null
null
null
pkg/apis/resolution/v1alpha1/resource_request_validation.go
sbwsg/resolution
b54134d264c969eea67a46f3a02d13c7d790b88f
[ "Apache-2.0" ]
null
null
null
pkg/apis/resolution/v1alpha1/resource_request_validation.go
sbwsg/resolution
b54134d264c969eea67a46f3a02d13c7d790b88f
[ "Apache-2.0" ]
null
null
null
/* Copyright 2022 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1alpha1 import ( "context" "knative.dev/pkg/apis" ) const TypeLabel = "resolution.tekton.dev/type" func (rr *ResourceRequest) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(validateTypeLabel(rr)) return errs.Also(rr.Spec.Validate(ctx).ViaField("spec")) } func (rs *ResourceRequestSpec) Validate(ctx context.Context) *apis.FieldError { return nil } func validateTypeLabel(rr *ResourceRequest) *apis.FieldError { typeLabel := getTypeLabel(rr.ObjectMeta.Labels) if typeLabel == "" { return apis.ErrMissingField(TypeLabel).ViaField("labels").ViaField("meta") } return nil } func getTypeLabel(labels map[string]string) string { if labels == nil { return "" } return labels[TypeLabel] }
26.1
82
0.758621
23f6fd0a7fbe2d999a6ea1bc682f568331ac1712
711
ps1
PowerShell
deprecated/winpatrol/tools/chocolateyUninstall.ps1
JourneyOver/chocolatey-packages
a32ae32125a05dd41b8cabbeea11a541cfb4c884
[ "Apache-2.0" ]
8
2019-01-22T18:54:58.000Z
2021-09-27T03:29:41.000Z
deprecated/winpatrol/tools/chocolateyUninstall.ps1
JourneyOver/chocolatey-packages
a32ae32125a05dd41b8cabbeea11a541cfb4c884
[ "Apache-2.0" ]
54
2017-09-16T22:41:15.000Z
2022-02-17T23:19:24.000Z
deprecated/winpatrol/tools/chocolateyUninstall.ps1
JourneyOver/chocolatey-packages
a32ae32125a05dd41b8cabbeea11a541cfb4c884
[ "Apache-2.0" ]
2
2017-10-29T06:55:31.000Z
2021-02-08T07:22:47.000Z
$programUninstallEntryName = 'WinPatrol' $uninstallString = (Get-ItemProperty HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, QuietUninstallString | Where-Object { $_.DisplayName -like "$programUninstallEntryName*" }).QuietUninstallString # get the uninstall string of the installed WinPatrol version from the registry $uninstallString = "$uninstallString" -replace '[{]', '`{' # adding escape character to the braces $uninstallString = "$uninstallString" -replace '[}]', '`} /remove /q' # to work properly with the Invoke-Expression command, add silent arguments if ($uninstallString -ne "") { Invoke-Expression "$uninstallString" # start uninstaller }
64.636364
250
0.770745
04ee5bb921eaea62a518bf2be36cc70c77916132
7,717
java
Java
addOns/exportreport/src/main/java/org/zaproxy/zap/extension/exportreport/PanelSource.java
KajanM/zap-extensions
de740fbef5f4c0731a7e799002718345a1975be6
[ "Apache-2.0" ]
3
2017-03-16T19:44:45.000Z
2021-11-15T11:27:26.000Z
addOns/exportreport/src/main/java/org/zaproxy/zap/extension/exportreport/PanelSource.java
KajanM/zap-extensions
de740fbef5f4c0731a7e799002718345a1975be6
[ "Apache-2.0" ]
1
2020-05-20T13:41:21.000Z
2020-06-17T21:18:59.000Z
addOns/exportreport/src/main/java/org/zaproxy/zap/extension/exportreport/PanelSource.java
KajanM/zap-extensions
de740fbef5f4c0731a7e799002718345a1975be6
[ "Apache-2.0" ]
1
2020-05-12T12:58:08.000Z
2020-05-12T12:58:08.000Z
/* * Zed Attack Proxy (ZAP) and its related class files. * * ZAP is an HTTP/HTTPS proxy for assessing web application security. * * Copyright 2016 The ZAP Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.zaproxy.zap.extension.exportreport; import java.awt.BorderLayout; import java.awt.FlowLayout; import javax.swing.JFormattedTextField; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.SpringLayout; import org.parosproxy.paros.Constant; import org.parosproxy.paros.model.Model; import org.zaproxy.zap.extension.exportreport.utility.SharedFunctions; import org.zaproxy.zap.extension.exportreport.utility.SpringUtilities; /* * AUTHOR: GORAN SARENKAPA - JordanGS * SPONSOR: RYERSON UNIVERSITY */ @SuppressWarnings("serial") public class PanelSource extends JPanel { private JTextField txtTitle = null; private JFormattedTextField txtScanDate = null; private JTextField txtReportDate = null; private JTextField txtScanVer = null; private JTextField txtReportVer = null; private JTextArea txtDescription = null; private JTextField txtBy = null; private JTextField txtFor = null; ExtensionExportReport extension = null; public PanelSource(ExtensionExportReport extension) { this.extension = extension; initialize(); } private void initialize() { String strLabel = Constant.messages.getString("exportreport.menu.source.label"); String strTitle = Constant.messages.getString("exportreport.source.title.label"); String ttTitle = Constant.messages.getString("exportreport.source.title.tooltip"); String strBy = Constant.messages.getString("exportreport.source.by.label"); String ttBy = Constant.messages.getString("exportreport.source.by.tooltip"); String strFor = Constant.messages.getString("exportreport.source.for.label"); String ttFor = Constant.messages.getString("exportreport.source.for.tooltip"); String strScanDate = Constant.messages.getString("exportreport.source.scandate.label"); String ttScanDate = Constant.messages.getString("exportreport.source.scandate.tooltip"); String strReportDate = Constant.messages.getString("exportreport.source.reportdate.label"); String ttReportDate = Constant.messages.getString("exportreport.source.reportdate.tooltip"); String strScanVer = Constant.messages.getString("exportreport.source.scanver.label"); String ttScanVer = Constant.messages.getString("exportreport.source.scanver.tooltip"); String strReportVer = Constant.messages.getString("exportreport.source.reportver.label"); String ttReportVer = Constant.messages.getString("exportreport.source.reportver.tooltip"); String strDescription = Constant.messages.getString("exportreport.source.description.label"); String ttDescription = Constant.messages.getString("exportreport.source.description.tooltip"); JPanel top = null; JPanel container = null; JPanel content = null; SpringLayout sl = null; top = new JPanel(new FlowLayout(FlowLayout.LEFT)); container = new JPanel(); content = new JPanel(); this.setLayout(new BorderLayout()); this.add(top, BorderLayout.PAGE_START); SharedFunctions.createLabel(top, strLabel, SharedFunctions.getTitleFont()); int[] pad = {0, 0, 295, 360}; content.setLayout(new SpringLayout()); sl = new SpringLayout(); container.setLayout(sl); this.add(container, BorderLayout.CENTER); sl = SharedFunctions.setupConstraints(sl, content, container, pad); container.add(content); SharedFunctions.createLabel(content, strTitle, SharedFunctions.getLabelFont()); txtTitle = SharedFunctions.createTextField( content, Model.getSingleton().getSession().getSessionName().toString(), ttTitle, true, extension.getTextfieldLimit()); SharedFunctions.createLabel(content, strBy, SharedFunctions.getLabelFont()); txtBy = SharedFunctions.createTextField( content, "", ttBy, true, extension.getTextfieldLimit()); SharedFunctions.createLabel(content, strFor, SharedFunctions.getLabelFont()); txtFor = SharedFunctions.createTextField( content, "", ttFor, true, extension.getTextfieldLimit()); String date = SharedFunctions .getCurrentTimeStamp(); // Set the Scan date as the current timestamp to // give user idea of format. SharedFunctions.createLabel(content, strScanDate, SharedFunctions.getLabelFont()); txtScanDate = SharedFunctions.createDateField(content, date, ttScanDate); SharedFunctions.createLabel(content, strReportDate, SharedFunctions.getLabelFont()); txtReportDate = SharedFunctions.createTextField( content, date, ttReportDate, false, extension.getTextfieldNoLimit()); SharedFunctions.createLabel(content, strScanVer, SharedFunctions.getLabelFont()); txtScanVer = SharedFunctions.createTextField( content, Constant.messages.getString("exportreport.message.notice.notavailable"), ttScanVer, false, extension.getTextfieldNoLimit()); SharedFunctions.createLabel(content, strReportVer, SharedFunctions.getLabelFont()); txtReportVer = SharedFunctions.createTextField( content, Constant.PROGRAM_NAME + " " + Constant.PROGRAM_VERSION, ttReportVer, false, extension.getTextfieldNoLimit()); SharedFunctions.createLabel(content, strDescription, SharedFunctions.getLabelFont()); txtDescription = SharedFunctions.createTextArea(2, 0, ttDescription, extension.getTextareaLimit()); JScrollPane sp = new JScrollPane(txtDescription); content.add(sp); SpringUtilities.makeCompactGrid( content, 8, 2, 6, 6, 6, 6); // Lay out the panel, rows, cols, initX, initY, xPad, yPad } public String getTitle() { return txtTitle.getText(); } public String getBy() { return txtBy.getText(); } public String getFor() { return txtFor.getText(); } public String getScanDate() { return txtScanDate.getText(); } public String getReportDate() { return txtReportDate.getText(); } public String getScanVer() { return txtScanVer.getText(); } public String getReportVer() { return txtReportVer.getText(); } public String getDescription() { return txtDescription.getText(); } }
38.393035
100
0.662693
0ed2ecd21a31b9c6894f63d94a51b5e70e67110d
171
ts
TypeScript
src/models/combinedPortfolioView.model.ts
dickwolff/Google-Finance-Plus
3ae7acf7c5e3c596bba360fa0f3d4cb8f1a5840c
[ "MIT" ]
null
null
null
src/models/combinedPortfolioView.model.ts
dickwolff/Google-Finance-Plus
3ae7acf7c5e3c596bba360fa0f3d4cb8f1a5840c
[ "MIT" ]
null
null
null
src/models/combinedPortfolioView.model.ts
dickwolff/Google-Finance-Plus
3ae7acf7c5e3c596bba360fa0f3d4cb8f1a5840c
[ "MIT" ]
null
null
null
import { PortfolioView } from "./portfolioView.model"; export class CombinedPortfolioView { public totalValue!: number; public portfolios: PortfolioView[] = []; }
28.5
54
0.725146
12bbc8ec9f2c7fa17f9bf8c9c36e6fce2c3f59f2
729
html
HTML
cluster-copy/help/intro.ro.auto.html
GalaxyGFX/webmin
134311032e3e69a6f7386648733a3a65c9a3ba1d
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1,863
2015-01-04T21:45:45.000Z
2022-03-30T09:10:50.000Z
cluster-copy/help/intro.ro.auto.html
GalaxyGFX/webmin
134311032e3e69a6f7386648733a3a65c9a3ba1d
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1,233
2015-01-03T12:45:51.000Z
2022-03-31T02:39:58.000Z
cluster-copy/help/intro.ro.auto.html
GalaxyGFX/webmin
134311032e3e69a6f7386648733a3a65c9a3ba1d
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
546
2015-01-05T13:07:28.000Z
2022-03-25T21:47:51.000Z
<header> Cluster Copiați fișiere </header> Acest modul vă permite să configurați transferuri programate de fișiere de la un server master la alte servere dintr-un cluster Webmin. Acest lucru poate fi util pentru distribuirea fișierelor precum <tt>/etc/hosts</tt> , <tt>httpd.conf</tt> și altele pentru care nu este disponibil niciun protocol de rețea precum NIS sau LDAP. <p> Pagina principală a modulului listează toate copiile programate definite și are un link pentru crearea unei noi. Pentru fiecare copie puteți defini fișierele sursă, directorul destinație, serverele țintă și orele la care puteți rula. Țintele trebuie să fi fost create mai întâi în modulul <b>Index Web Servers</b> cu o autentificare și o parolă. <p><hr>
729
729
0.801097
251fe0be91f27d7693ebe3571a62f8db39c1f19b
5,958
lua
Lua
ZxUIText/modules/ActionBarFont.lua
toddnguyen11/ZxTextUnitPower
c5f2a8d939762753cc190d636ce1e85d8f3588f3
[ "MIT" ]
null
null
null
ZxUIText/modules/ActionBarFont.lua
toddnguyen11/ZxTextUnitPower
c5f2a8d939762753cc190d636ce1e85d8f3588f3
[ "MIT" ]
null
null
null
ZxUIText/modules/ActionBarFont.lua
toddnguyen11/ZxTextUnitPower
c5f2a8d939762753cc190d636ce1e85d8f3588f3
[ "MIT" ]
null
null
null
local ZxUIText = LibStub("AceAddon-3.0"):GetAddon("ZxUIText") local CoreOptions47 = ZxUIText["optionTables"]["CoreOptions47"] local media = LibStub("LibSharedMedia-3.0") local _MODULE_NAME = "ActionBarFont" local _DECORATIVE_NAME = "Action Bar Font" local ActionBarFont = ZxUIText:NewModule(_MODULE_NAME) ActionBarFont.MODULE_NAME = _MODULE_NAME ActionBarFont.DECORATIVE_NAME = _DECORATIVE_NAME ActionBarFont.FACTORY_DEFAULT_FONT = "Arial Narrow" ActionBarFont.MAX_CHATFRAMES = 10 ActionBarFont.KEY_SUFFIXES = {"", "EditBox", "EditBoxHeader"} local _defaults = { profile = { enabledToggle = true, font = "Oxygen Bold", fontsize = 14, outline = true, thickoutline = false, monochrome = false } } function ActionBarFont:OnInitialize() self.db = ZxUIText.db:RegisterNamespace(_MODULE_NAME, _defaults) self:__init__() self:SetEnabledState(ZxUIText:getModuleEnabledState(_MODULE_NAME)) ZxUIText:registerModuleOptions(self.MODULE_NAME, self:getOptionTable(), self.DECORATIVE_NAME) end function ActionBarFont:__init__() self.option = {} self._coreOptions47 = CoreOptions47:new(self) self._defaultStubs = { ActionButton = 12, MultiBarRightButton = 12, MultiBarLeftButton = 12, MultiBarBottomRightButton = 12, MultiBarBottomLeftButton = 12, BonusActionButton = 12, PetActionButton = 10, MultiCastActionButton = 12 } end function ActionBarFont:OnEnable() self:handleOnEnable() end function ActionBarFont:OnDisable() self:handleOnDisable() end function ActionBarFont:handleOnEnable() self:refreshConfig() end function ActionBarFont:handleOnDisable() self:_resetFactoryDefaultFonts() end function ActionBarFont:refreshConfig() self:handleEnableToggle() if self:IsEnabled() then self:_refreshAll() end end function ActionBarFont:handleEnableToggle() ZxUIText:setModuleEnabledState(_MODULE_NAME, self.db.profile.enabledToggle) end function ActionBarFont:printGlobalChatFrameKeys() local sortedTable = {} for k, v in pairs(_G) do if k:find("%d+HotKey") then if type(v.GetFont) == "function" then local index = tonumber(k:match("%d+")) if sortedTable[index] == nil then sortedTable[index] = {} end table.insert(sortedTable[index], k) end end end for _, tableOfKeys in pairs(sortedTable) do table.sort(tableOfKeys) for _, globalKey in pairs(tableOfKeys) do --- Ref: https://wow.gamepedia.com/API_FontInstance_GetFont local fontName, fontHeight, fontFlags = _G[globalKey]:GetFont() fontName = fontName:gsub("\\", "/") fontName = fontName:match(".*/(%S+)") fontHeight = math.ceil(fontHeight) ZxUIText:Print(string.format("[%s] --> [%s, %s, %s]", globalKey, fontName, tostring(fontHeight), fontFlags)) end end end ---@return string function ActionBarFont:getFontFlags() local s = "" if self.db.profile.outline then s = s .. "OUTLINE, " end if self.db.profile.thickoutline then s = s .. "THICKOUTLINE, " end if self.db.profile.monochrome then s = s .. "MONOCHROME, " end if s ~= "" then s = string.sub(s, 0, (string.len(s) - 2)) end return s end ---@return table function ActionBarFont:getOptionTable() if next(self.option) == nil then self.option = { type = "group", name = self.DECORATIVE_NAME, --- "Parent" get/set get = function(info) return self._coreOptions47:getOption(info) end, set = function(info, value) self._coreOptions47:setOption(info, value) end, args = { header = { type = "header", name = self.DECORATIVE_NAME, order = ZxUIText.HEADER_ORDER_INDEX }, enabledToggle = { type = "toggle", name = "Enable", desc = "Enable / Disable this module", order = ZxUIText.HEADER_ORDER_INDEX + 1 }, -- LSM30_ is LibSharedMedia's custom controls font = { name = "Action Bar Font", desc = "Action Bar Font", type = "select", dialogControl = "LSM30_Font", values = media:HashTable("font"), order = self._coreOptions47:incrementOrderIndex() }, fontsize = { name = "Action Bar Font Size", desc = "Action Bar Font Size", type = "range", min = 10, max = 36, step = 1, order = self._coreOptions47:incrementOrderIndex() }, fontflags = { name = "Font Flags", type = "group", inline = true, order = self._coreOptions47:incrementOrderIndex(), args = { outline = {name = "Outline", type = "toggle", order = 1}, thickoutline = {name = "Thick Outline", type = "toggle", order = 2}, monochrome = {name = "Monochrome", type = "toggle", order = 3} } }, printButton = { name = "Print Keys", desc = "Print the Hotkey keys in the _G global table", type = "execute", func = function(info) self:printGlobalChatFrameKeys() end } } } end return self.option end -- #################################### -- # PRIVATE FUNCTIONS -- #################################### function ActionBarFont:_refreshAll() self:_setHotkeyFont() end function ActionBarFont:_setHotkeyFont() for stub, numButtons in pairs(self._defaultStubs) do for i = 1, numButtons do local localKey = stub .. i .. "HotKey" _G[localKey]:SetFont(media:Fetch("font", self.db.profile.font), self.db.profile.fontsize, self:getFontFlags()) end end end function ActionBarFont:_resetFactoryDefaultFonts() for stub, numButtons in pairs(self._defaultStubs) do for i = 1, numButtons do local localKey = stub .. i .. "HotKey" _G[localKey]:SetFont(media:Fetch("font", self.FACTORY_DEFAULT_FONT), self.db.profile.fontsize, self:getFontFlags()) end end end
31.691489
95
0.641826
249ee91261d4d84a331b3767a69e651d8d4db00f
71
sql
SQL
conf/evolutions/default/3.sql
Mnozil/guide.me
d2529462eca7883b2625cc27e6d512016883a04c
[ "Apache-2.0" ]
null
null
null
conf/evolutions/default/3.sql
Mnozil/guide.me
d2529462eca7883b2625cc27e6d512016883a04c
[ "Apache-2.0" ]
null
null
null
conf/evolutions/default/3.sql
Mnozil/guide.me
d2529462eca7883b2625cc27e6d512016883a04c
[ "Apache-2.0" ]
null
null
null
# --- !Ups ALTER TABLE `Movie` ADD COLUMN `genre` TEXT # --- !Downs
10.142857
43
0.577465
164bfd82f4527ffdef9bfd79fdeae46fee8112cc
656
tsx
TypeScript
docs/src/components/CiCd/PipelineFlow.tsx
JacobTheEvans/kvlt-konverter
a57390c6ec4977c86d7427a7250219a8ec850f61
[ "Apache-2.0" ]
4
2020-06-13T16:43:45.000Z
2021-12-15T22:57:35.000Z
docs/src/components/CiCd/PipelineFlow.tsx
JacobTheEvans/kvlt-bot
a57390c6ec4977c86d7427a7250219a8ec850f61
[ "Apache-2.0" ]
2
2022-01-22T11:53:35.000Z
2022-01-22T11:53:36.000Z
docs/src/components/CiCd/PipelineFlow.tsx
JacobTheEvans/kvlt-konverter
a57390c6ec4977c86d7427a7250219a8ec850f61
[ "Apache-2.0" ]
1
2020-06-04T07:46:50.000Z
2020-06-04T07:46:50.000Z
import React from 'react' import styled from 'styled-components' import SubHeader from '../common/SubHeader' import Text from '../common/Text' import Image from '../common/Image' import KvltCiCdImage from './kvlt-ci-cd.png' const Container = styled.div` margin-top: 100px; ` export default function PipelineFlow () { return ( <Container> <SubHeader text='Pipeline Flow' /> <Text> Below you will find a sequence diagram explaining the full flow of the CI/CD pipeline for the Kvlt Konverter project. </Text> <Image src={KvltCiCdImage} defaultWidth={850} /> </Container> ) }
23.428571
125
0.653963
40df8e3ec72b9fadb55e6de6973f45105e20bcd0
4,522
sql
SQL
EmployeeSQL/EmployeeSQL_queries.sql
cdmoorman/sql-challenge
80ccd7546ccce2014308dd1178d4431d890ffbd4
[ "ADSL" ]
null
null
null
EmployeeSQL/EmployeeSQL_queries.sql
cdmoorman/sql-challenge
80ccd7546ccce2014308dd1178d4431d890ffbd4
[ "ADSL" ]
null
null
null
EmployeeSQL/EmployeeSQL_queries.sql
cdmoorman/sql-challenge
80ccd7546ccce2014308dd1178d4431d890ffbd4
[ "ADSL" ]
null
null
null
-- SQL Homework - Employee Database: A Mystery in Two Parts -- Drop table for departments if it exists DROP TABLE departments; -- CREATE Table for departments CREATE TABLE departments( dept_no VARCHAR(30) NOT NULL, dept_name VARCHAR(30) NOT NULL, PRIMARY KEY (dept_no) ); -- Import departments csv file SELECT * FROM departments; -- Drop table for dep_emp if it exists DROP TABLE dep_emp; -- CREATE Table for dept_emp CREATE TABLE dep_emp( emp_no INT NOT NULL, dept_no VARCHAR(30) NOT NULL, FOREIGN KEY (emp_no) REFERENCES employees (emp_no), FOREIGN KEY (dept_no) REFERENCES departments (dept_no), PRIMARY KEY (emp_no, dept_no) ); -- Import dept_emp csv file -- Drop table for dept_manager if it exists DROP TABLE dept_manager; -- CREATE Table for dept_manager CREATE TABLE dept_manager( dept_no VARCHAR(30) NOT NULL, emp_no INT NOT NULL, FOREIGN KEY (emp_no) REFERENCES employees (emp_no), FOREIGN KEY (dept_no) REFERENCES departments (dept_no), PRIMARY KEY (emp_no,dept_no) ); -- Import dept_manager csv file -- Drop table for employees if it exists DROP TABLE employees; -- CREATE Table for employees CREATE TABLE employees( emp_no INT NOT NULL, emp_title_id VARCHAR(30), birth_date DATE NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, sex VARCHAR(1) NOT NULL, hire_date DATE NOT NULL, PRIMARY KEY (emp_no) ); -- Import employees csv file SELECT * FROM employees -- Drop table for salaries if it exists DROP TABLE salaries; -- CREATE Table for salaries CREATE TABLE salaries( emp_no INT NOT NULL, salary INT NOT NULL, FOREIGN KEY (emp_no) REFERENCES employees (emp_no), PRIMARY KEY (emp_no) ); -- Import salaries csv file -- Drop table for titles if it exists DROP TABLE titles; -- CREATE Table for titles CREATE TABLE titles( title_id VARCHAR(30) NOT NULL, title VARCHAR(30) NOT NULL ); -- Import titles csv file -----QUERIES---- SELECT * FROM departments; SELECT * FROM dep_emp; SELECT * FROM dept_manager; SELECT * FROM employees; SELECT * FROM salaries; SELECT * FROM titles; -- List the following details of each employee: employee number, last name, first name, sex, and salary. SELECT employees.emp_no, employees.last_name, employees.first_name, employees.sex, salaries.salary FROM employees JOIN salaries ON employees.emp_no = salaries.emp_no; -- List first name, last name, and hire date for employees who were hired in 1986. SELECT first_name, first_name, hire_date FROM employees WHERE extract(year from hire_date) = '1986'; -- List the manager of each department with the following information: department number, department name, the manager's employee number, last name, first name. SELECT dept_manager.dept_no, dept_name, dept_manager.emp_no, first_name, last_name FROM dept_manager LEFT JOIN departments on dept_manager.dept_no = departments.dept_no LEFT JOIN employees on dept_manager.emp_no = employees.emp_no; -- List the department of each employee with the following information: employee number, last name, first name, and department name SELECT employees.emp_no, first_name, last_name, dept_name FROM employees LEFT JOIN dep_emp ON employees.emp_no = dep_emp.emp_no LEFT JOIN departments ON dep_emp.dept_no = departments.dept_no; -- List first name, last name, and sex for employees whose first name is "Hercules" and last names begin with "B." SELECT employees.first_name, last_name, sex FROM employees WHERE(first_name LIKE 'Hercules' AND last_name LIKE '%B%'); -- List all employees in the Sales department, including their employee number, last name, first name, and department name. SELECT employees.emp_no, first_name, last_name, dept_name FROM employees LEFT JOIN dep_emp ON employees.emp_no = dep_emp.emp_no LEFT JOIN departments ON dep_emp.dept_no = departments.dept_no WHERE departments.dept_name lIKE 'Sales'; -- List all employees in the Sales and Development departments, including their employee number, last name, first name, and department name. SELECT employees.emp_no, first_name, last_name, dept_name FROM employees LEFT JOIN dep_emp ON employees.emp_no = dep_emp.emp_no LEFT JOIN departments ON dep_emp.dept_no = departments.dept_no WHERE departments.dept_name lIKE 'Sales' OR departments.dept_name LIKE 'Development'; --In descending order, list the frequency count of employee last names, i.e., how many employees share each last name. SELECT last_name, COUNT(last_name) AS "name_frequency" FROM employees GROUP BY last_name ORDER BY name_frequency DESC;
24.053191
160
0.775542
04e890659dc9112993e0e5408b6339b2250c165d
1,979
java
Java
backend/plugins/org.eclipse.emfcloud.coffee.modelserver/src/org/eclipse/emfcloud/coffee/modelserver/commands/contributions/AddFlowCommandContribution.java
alxflam/coffee-editor
8456e17b6cc4e75a8a001038622cdedc368bbaf5
[ "MIT" ]
null
null
null
backend/plugins/org.eclipse.emfcloud.coffee.modelserver/src/org/eclipse/emfcloud/coffee/modelserver/commands/contributions/AddFlowCommandContribution.java
alxflam/coffee-editor
8456e17b6cc4e75a8a001038622cdedc368bbaf5
[ "MIT" ]
null
null
null
backend/plugins/org.eclipse.emfcloud.coffee.modelserver/src/org/eclipse/emfcloud/coffee/modelserver/commands/contributions/AddFlowCommandContribution.java
alxflam/coffee-editor
8456e17b6cc4e75a8a001038622cdedc368bbaf5
[ "MIT" ]
null
null
null
/******************************************************************************* * Copyright (c) 2021 EclipseSource and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * https://www.eclipse.org/legal/epl-2.0, or the MIT License which is * available at https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: EPL-2.0 OR MIT ******************************************************************************/ package org.eclipse.emfcloud.coffee.modelserver.commands.contributions; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emfcloud.coffee.modelserver.commands.compound.AddFlowCompoundCommand; import org.eclipse.emfcloud.modelserver.command.CCommand; import org.eclipse.emfcloud.modelserver.command.CCommandFactory; import org.eclipse.emfcloud.modelserver.command.CCompoundCommand; import org.eclipse.emfcloud.modelserver.common.codecs.DecodingException; public class AddFlowCommandContribution extends CompoundCommandContribution { public static final String TYPE = "addFlowContribution"; public static CCompoundCommand create(final String sourceUriFragment, final String targetUriFragment) { CCompoundCommand command = CCommandFactory.eINSTANCE.createCompoundCommand(); command.setType(TYPE); command.getProperties().put(SOURCE_URI_FRAGMENT, sourceUriFragment); command.getProperties().put(TARGET_URI_FRAGMENT, targetUriFragment); return command; } @Override protected Command toServer(URI modelUri, EditingDomain domain, CCommand command) throws DecodingException { String sourceUriFragment = command.getProperties().get(SOURCE_URI_FRAGMENT); String targetUriFragment = command.getProperties().get(TARGET_URI_FRAGMENT); return new AddFlowCompoundCommand(domain, modelUri, sourceUriFragment, targetUriFragment); } }
47.119048
108
0.75139
eb58809f1fc377e4bca133ebf8fbba3cb82ad12a
1,122
dart
Dart
lib/blocs/shops_search/shops_search_state.dart
duythien0912/fix_map
84598f4145a9eaf5e7dcf5a7e40a37cd781c2b1c
[ "MIT" ]
8
2020-01-21T15:14:29.000Z
2020-04-25T08:16:29.000Z
lib/blocs/shops_search/shops_search_state.dart
duythien0912/fix_map
84598f4145a9eaf5e7dcf5a7e40a37cd781c2b1c
[ "MIT" ]
null
null
null
lib/blocs/shops_search/shops_search_state.dart
duythien0912/fix_map
84598f4145a9eaf5e7dcf5a7e40a37cd781c2b1c
[ "MIT" ]
6
2020-01-21T14:22:27.000Z
2020-03-13T06:19:00.000Z
import "package:equatable/equatable.dart"; import "package:fix_map/models/models.dart"; import "package:flutter/foundation.dart"; @immutable abstract class ShopsSearchState extends Equatable { const ShopsSearchState(); @override List<Object> get props => []; } class InitialShopsSearchState extends ShopsSearchState {} class ShopsSearchLoadingState extends ShopsSearchState {} class ShopsSearchSuggestionsLoadingState extends ShopsSearchState {} class ShopsSearchSuggestionsLoadedState extends ShopsSearchState { final List<String> suggestions; const ShopsSearchSuggestionsLoadedState(this.suggestions); List<Object> get props => [suggestions]; @override String toString() => "ShopsSearchSuggestionsLoadedState {suggestions: $suggestions}"; } class ShopsSearchLoadedState extends ShopsSearchState { final List<Shop> shops; final int size; final String query; const ShopsSearchLoadedState(this.shops, this.size, this.query); List<Object> get props => [shops, size, query]; @override String toString() => "ShopsSearchLoadedState {shops: $shops, size: $size, query: $query}"; }
27.365854
92
0.77451
fbb6bf885c127ccf0fcafcef53b4e0b8ea245568
2,213
java
Java
src/main/gov/nasa/jpf/vm/BootstrapMethodInfo.java
Jaikishan-Saroj-786/jpf-core
0df77f0a2a8fa55d58a4ed89b70b61e39626866c
[ "Apache-2.0" ]
387
2018-02-19T12:46:39.000Z
2022-03-27T07:51:40.000Z
src/main/gov/nasa/jpf/vm/BootstrapMethodInfo.java
Jaikishan-Saroj-786/jpf-core
0df77f0a2a8fa55d58a4ed89b70b61e39626866c
[ "Apache-2.0" ]
237
2018-03-03T10:30:44.000Z
2022-03-31T21:14:57.000Z
src/main/gov/nasa/jpf/vm/BootstrapMethodInfo.java
Jaikishan-Saroj-786/jpf-core
0df77f0a2a8fa55d58a4ed89b70b61e39626866c
[ "Apache-2.0" ]
316
2018-02-13T15:53:58.000Z
2022-03-28T16:45:19.000Z
/* * Copyright (C) 2014, United States Government, as represented by the * Administrator of the National Aeronautics and Space Administration. * All rights reserved. * * The Java Pathfinder core (jpf-core) platform is 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 gov.nasa.jpf.vm; /** * @author Nastaran Shafiei <nastaran.shafiei@gmail.com> * * For now, this is only used to capture boostrap methods for lambda expression, * which link the method representing the lambda body to a single abstract method * (SAM) declared in a functional interface. References to bootstrap methods are * provided by the invokedynamic bytecode instruction. */ public class BootstrapMethodInfo { int lambdaRefKind; // method capturing lambda body to be linked to the function method of function object MethodInfo lambdaBody; // class containing lamabda expression ClassInfo enclosingClass; // descriptor of a SAM declared within the functional interface String samDescriptor; public BootstrapMethodInfo(int lambdaRefKind, ClassInfo enclosingClass, MethodInfo lambdaBody, String samDescriptor) { this.lambdaRefKind = lambdaRefKind; this.enclosingClass = enclosingClass; this.lambdaBody = lambdaBody; this.samDescriptor = samDescriptor; } @Override public String toString() { return "BootstrapMethodInfo[" + enclosingClass.getName() + "." + lambdaBody.getBaseName() + "[SAM descriptor:" + samDescriptor + "]]"; } public MethodInfo getLambdaBody() { return lambdaBody; } public String getSamDescriptor() { return samDescriptor; } public int getLambdaRefKind () { return lambdaRefKind; } }
33.530303
120
0.733394
877585ff6c34bfda66fecd0a94e6a78086e72560
1,790
html
HTML
lacueva/addCat.html
mirdape/TAKEAWAY
ae539762bd68d19767beaf09a2c565e6f5525308
[ "MIT" ]
null
null
null
lacueva/addCat.html
mirdape/TAKEAWAY
ae539762bd68d19767beaf09a2c565e6f5525308
[ "MIT" ]
null
null
null
lacueva/addCat.html
mirdape/TAKEAWAY
ae539762bd68d19767beaf09a2c565e6f5525308
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <!--Import Google Icon Font--> <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <!--Import materialize.css--> <link type="text/css" rel="stylesheet" href="../css/materialize.min.css" media="screen,projection"/> <link type="text/css" rel="stylesheet" href="../css/styles.css"/> <!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> </head> <body> <!--Import jQuery before materialize.js--> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../js/materialize.min.js"></script> <script type="text/javascript" src="../js/addCat.js"></script> <div class="container"> <h2>Nueva categoría</h2> <form id="formCat"> <div class="row"> <div class="col s12 m6 l6 input-field"> <input id="nCat" name="nombre" type="text" class="validate"> <label for="nombre">Nombre</label> </div> <div class="col s12 m6 l6 input-field"> <input id="foto" name="foto" type="text" class="validate"> <label for="foto">Foto</label> </div> <div class="col s12 m12 l12 input-field"> <textarea id="descripcion" name="descripcion" class="materialize-textarea"></textarea> <label for="descripcion">Descripción</label> </div> <div class="col s12 m6 l6 input-field"> <button class="btn waves-effect waves-light" type="submit" name="action">Enviar <i class="material-icons right">send</i> </button> </form> </div> </body> </html>
41.627907
107
0.591061
64b39d4a4298994c66bb107c5430eab22355c2a1
1,052
swift
Swift
Source/LogConfig.swift
HumanDevice/ios-logger
ea2069082fac7e089060468daef7536bb69f21a4
[ "MIT" ]
null
null
null
Source/LogConfig.swift
HumanDevice/ios-logger
ea2069082fac7e089060468daef7536bb69f21a4
[ "MIT" ]
1
2016-07-15T07:31:34.000Z
2016-07-15T08:07:43.000Z
Source/LogConfig.swift
HumanDevice/ios-logger
ea2069082fac7e089060468daef7536bb69f21a4
[ "MIT" ]
null
null
null
// // LogConfig.swift // logger // // Created by Mikołaj Styś on 10.07.2016. // Copyright © 2016 Mikołaj Styś. All rights reserved. // import Foundation /** Struct that hold data that enables HDLogger configurability. */ public struct LogConfig { var timeFormat: String = "HH:mm:ss.SSS" var enableLogging: Bool = true var logLevel: LogLevel = .Verbose var showThread: Bool = false var showLineNumber: Bool = true var showFile: Bool = true var showFunction: Bool = false var showTime: Bool = true var showLevel: Bool = true init() { } } /** Data related to particular log message that will be printed */ public struct LogData { var message: Any var file: String var logLevel: LogLevel var thread: String var lineNumber: Int var function: String var time: NSDate } /** Represents available log levels. Numbers states for level priority (smaller number, smaller priority) */ public enum LogLevel: Int { case Verbose = 1 case Debug = 2 case Info = 3 case Warning = 4 case Error = 5 }
19.127273
102
0.689163
2dbacacbacaf97c2915e34b89dc68919026411fc
3,758
html
HTML
pipermail/stringtemplate-interest/2009-May/001957.html
hpcc-systems/website-antlr3
aa6181595356409f8dc624e54715f56bd10707a8
[ "BSD-3-Clause" ]
null
null
null
pipermail/stringtemplate-interest/2009-May/001957.html
hpcc-systems/website-antlr3
aa6181595356409f8dc624e54715f56bd10707a8
[ "BSD-3-Clause" ]
null
null
null
pipermail/stringtemplate-interest/2009-May/001957.html
hpcc-systems/website-antlr3
aa6181595356409f8dc624e54715f56bd10707a8
[ "BSD-3-Clause" ]
null
null
null
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <TITLE> [stringtemplate-interest] Question about C# port of StringTemplate </TITLE> <LINK REL="Index" HREF="index.html" > <LINK REL="made" HREF="mailto:stringtemplate-interest%40antlr.org?Subject=Re:%20%5Bstringtemplate-interest%5D%20Question%20about%20C%23%20port%20of%20StringTemplate&In-Reply-To=%3C9AD1589768863046959D51D1EC6C41D70341A6E4%40SDGEXEVS06.corp.intuit.net%3E"> <META NAME="robots" CONTENT="index,nofollow"> <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> <LINK REL="Previous" HREF="001956.html"> <LINK REL="Next" HREF="001959.html"> </HEAD> <BODY BGCOLOR="#ffffff"> <H1>[stringtemplate-interest] Question about C# port of StringTemplate</H1> <B>Magdalin, Vlad</B> <A HREF="mailto:stringtemplate-interest%40antlr.org?Subject=Re:%20%5Bstringtemplate-interest%5D%20Question%20about%20C%23%20port%20of%20StringTemplate&In-Reply-To=%3C9AD1589768863046959D51D1EC6C41D70341A6E4%40SDGEXEVS06.corp.intuit.net%3E" TITLE="[stringtemplate-interest] Question about C# port of StringTemplate">Vladimir_Magdalin at intuit.com </A><BR> <I>Wed May 20 11:01:33 PDT 2009</I> <P><UL> <LI>Previous message: <A HREF="001956.html">[stringtemplate-interest] Truncate string? </A></li> <LI>Next message: <A HREF="001959.html">[stringtemplate-interest] Question about C# port of StringTemplate </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#1957">[ date ]</a> <a href="thread.html#1957">[ thread ]</a> <a href="subject.html#1957">[ subject ]</a> <a href="author.html#1957">[ author ]</a> </LI> </UL> <HR> <!--beginarticle--> <PRE>Hi Sam, I downloaded your binary assemblies that you linked to from this post: <A HREF="http://www.antlr.org/pipermail/stringtemplate-interest/2009-May/001915.h">http://www.antlr.org/pipermail/stringtemplate-interest/2009-May/001915.h</A> tml and had a few questions: 1. What is the license of your library? Is it the same as the main ST C# 3.1 library? 2. Is there any way to keep up with the changes via Subversion or by downloading source somewhere? 3. Is the behavior around updating templates after an edit the same as the 3.1beta1 version? I noticed that after I switched to your library, I seem to have lost the ability to change templates on the fly without restarting the web application outright. Previously, it looked like a FileSystemWatcher was used in FileSystemTemplateLoader to watch for file system changes, and I'm wondering if the same process exists in your port? Thanks, Vlad Magdalin -------------- next part -------------- An HTML attachment was scrubbed... URL: <A HREF="http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20090520/dc18af6f/attachment.html">http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20090520/dc18af6f/attachment.html</A> </PRE> <!--endarticle--> <HR> <P><UL> <!--threads--> <LI>Previous message: <A HREF="001956.html">[stringtemplate-interest] Truncate string? </A></li> <LI>Next message: <A HREF="001959.html">[stringtemplate-interest] Question about C# port of StringTemplate </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#1957">[ date ]</a> <a href="thread.html#1957">[ thread ]</a> <a href="subject.html#1957">[ subject ]</a> <a href="author.html#1957">[ author ]</a> </LI> </UL> <hr> <a href="http://www.antlr.org/mailman/listinfo/stringtemplate-interest">More information about the stringtemplate-interest mailing list</a><br> </body></html>
39.557895
257
0.686801
e31a80f6b2cf75c74a613e8cac699bef2e83a424
141
sql
SQL
CSharp-DB/Databases-Basics/Exams/DemoExam-13-Oct-2019/05Commits.sql
kalintsenkov/SoftUni-Software-Engineering
add12909bd0c82d721b8bae43144626173f6023a
[ "MIT" ]
8
2020-12-30T08:58:37.000Z
2022-01-15T12:52:14.000Z
CSharp-DB/Databases-Basics/Exams/DemoExam-13-Oct-2019/05Commits.sql
zanovasevi/SoftUni-Software-Engineering
add12909bd0c82d721b8bae43144626173f6023a
[ "MIT" ]
null
null
null
CSharp-DB/Databases-Basics/Exams/DemoExam-13-Oct-2019/05Commits.sql
zanovasevi/SoftUni-Software-Engineering
add12909bd0c82d721b8bae43144626173f6023a
[ "MIT" ]
52
2019-06-08T08:50:21.000Z
2022-03-21T21:20:21.000Z
SELECT c.Id, c.[Message], c.RepositoryId, c.ContributorId FROM Commits AS c ORDER BY c.Id, c.[Message], c.RepositoryId, c.ContributorId
47
59
0.730496
0edb9118dc070aa78888d9e4c7ecfb90a6eea112
8,382
h
C
circular_list.h
thyagow/EstruturaDados
413973649231493005758e4f5f6fd7df0abdecee
[ "Apache-2.0" ]
null
null
null
circular_list.h
thyagow/EstruturaDados
413973649231493005758e4f5f6fd7df0abdecee
[ "Apache-2.0" ]
null
null
null
circular_list.h
thyagow/EstruturaDados
413973649231493005758e4f5f6fd7df0abdecee
[ "Apache-2.0" ]
null
null
null
// Copyright [2016] <THIAGO DE SOUZA VENTURA>" #ifndef STRUCTURES_CIRCULAR_LIST_H #define STRUCTURES_CIRCULAR_LIST_H #include <cstdint> #include <stdexcept> namespace structures { //! lista circular encadeada /* igual uma lista encadeada normal, porém o último elemento é ligado ao primeiro da lista, formando um círculo */ template<typename T> class CircularList { public: CircularList() { //! construtor padrão head = new Node(0u); size_ = 0u; } // inicia o head e o size da lista ~CircularList() { //! destrutor clear(); delete(head); } // destrutor padrao void clear() { //! limpa lista while (!empty()) { pop_back(); } } // limpa a lista void push_back(const T& data) { //! inserir no fim Node *previous, *new_; if (size() == 0) { push_front(data); } else { new_ = new Node(data); previous = head->next(); if (new_ == NULL) { throw std::out_of_range("LISTACHEIApushback"); } else { for (auto i = 0; i < size()-1; i++) { previous = previous->next(); } new_->next(head); previous->next(new_); size_++; } } } // insere o elemento no fim da lista void push_front(const T& data) { //! inserir no início Node *new_; new_ = new Node(data); if (new_ == NULL) { throw std::out_of_range("LISTACHEIApushfront"); } else { new_->next(head->next()); head->next(new_); size_++; } } // insere o elemento no início da lista void insert(const T& data, std::size_t index) { //! inserir na posição Node *new_, *previous_; if (index > size() || index < 0) { throw std::out_of_range("ERROPOSIÇÃOinsert"); } else { if (index == 0) { return push_front(data); } else { new_ = new Node(data); if (new_ == NULL) { throw std::out_of_range("LISTACHEIAinsert"); } else { previous_ = head->next(); for (auto i = 0; i < index-1; i++) { previous_ = previous_->next(); } new_->next(previous_->next()); previous_->next(new_); size_++; } } } } // insere o elemento na posição indicada void insert_sorted(const T& data) { //! inserir em ordem Node *actual; int position; if (empty()) { return push_front(data); } else { actual = head->next(); position = 0; while (actual->next() != NULL && data > actual->data()) { position++; actual = actual->next(); } if (data > actual->data()) return insert(data, position+1); else return insert(data, position); } } // insere o elemento em ordem crescente T at(std::size_t index) { //! valor na posição Node* run; std::size_t aux = 0; run = head->next(); if (empty()) { throw std::out_of_range("LISTAVAZIAat"); } else { if (index < 0 || index > size()) { throw std::out_of_range("ERROPOSIÇÃOat"); } else { while (aux < index) { run = run->next(); aux++; } } } return run->data(); } // informa o valor do elemento na posição indicada const T& at(std::size_t index) const { //! versão const do acesso ao indice Node* run; std::size_t aux = 0; run = head->next(); if (empty()) { throw std::out_of_range("LISTAVAZIAat"); } else { if (index < 0 || index > size()) { throw std::out_of_range("ERROPOSIÇÃOat"); } else { while (aux < index) { run = run->next(); aux++; } } } return run->data(); } // igual o anterior, só que constante T pop(std::size_t index) { //! retira na posição Node *previous_, *destroy_; T back_; if (index > size()-1 || index < 0) { throw std::out_of_range("ERROPOSIÇÃOpop"); } else { if (index == 0) { return pop_front(); } else { if (index == size()) previous_ = head; else previous_ = head->next(); for (auto i = 0; i < index-1; i++) { previous_ = previous_->next(); } destroy_ = previous_->next(); back_ = destroy_->data(); previous_->next(destroy_->next()); size_--; delete(destroy_); } return back_; } } // retira o elemento na posição indicada T pop_back() { //! retira no fim if (empty()) throw std::out_of_range("LISTAVAZIApopback"); else return pop(size()-1); } // retira o último elemento da lista T pop_front() { //! retira no início Node *left_; T back_; if (empty()) { throw std::out_of_range("LISTAVAZIApopfront"); } else { left_ = head->next(); head->next(left_->next()); back_ = left_->data(); size_--; delete(left_); } return back_; } // retira o último elemento da lista void remove(const T& data) { //! remove elemento Node *run, *previous; if (empty()) { throw std::out_of_range("LISTAVAZIAremove"); } else { run = head->next(); for (auto i = 0; i < size(); i++) { if (data == run->data()) { previous->next(run->next()); delete(run); size_--; break; } previous = run; run = run->next(); } } } // retira o elemento indicado bool empty() const { //! lista vazia if (size() == 0) return true; else return false; } // verifica se lista está vazia bool contains(const T& data) const { //! contém elemento Node *run; run = head->next(); for (auto i = 0; i < size(); i++) { if (data == run->data()) { return true; } run = run->next(); } return false; } // verifica se a lista contém o elemento idicado std::size_t find(const T& data) const { //! busca elemento Node *run; run = head->next(); for (auto i = 0; i < size(); i++) { if (data == run->data()) { return i; } run = run->next(); } return size(); } // mostra a posição do elemento indicado std::size_t size() const { //! tamanho lista return size_; } // mostra o tamanho atual da lista private: class Node { //! classe nodo public: explicit Node(const T& data): //! construtor set data data_{data} {} Node(const T& data, Node *next): //! construtor set data e next data_{data}, next_{next} {} T& data() { //! getter data return data_; } T& data() const { //! getter data constante return data_; } Node* next() { //! getter próximo elemento return next_; } Node* next() const { //! getter próximo elemento constante return next_; } void next(Node *next) { //! setter próximo elemento constante next_ = next; } private: T data_; Node *next_{nullptr}; }; Node *head; std::size_t size_; }; } // namespace structures #endif
27.754967
80
0.4487
21d5e088e58ae22a7afc722af04dc20ec77adc07
1,183
html
HTML
GUIScripts/University Website/templates/fees.html
Gaurav1401/Awesome_Python_Scripts
e98044cc42a975e81d880b27546fadcdead17a42
[ "MIT" ]
1
2021-12-07T17:37:56.000Z
2021-12-07T17:37:56.000Z
GUIScripts/University Website/templates/fees.html
Gaurav1401/Awesome_Python_Scripts
e98044cc42a975e81d880b27546fadcdead17a42
[ "MIT" ]
null
null
null
GUIScripts/University Website/templates/fees.html
Gaurav1401/Awesome_Python_Scripts
e98044cc42a975e81d880b27546fadcdead17a42
[ "MIT" ]
2
2021-10-03T16:22:08.000Z
2021-10-03T17:35:14.000Z
{% extends 'base.html' %} {% block title %} Fees {% endblock %} {% block content %} <hr> <table class="table table-hover table-dark"> <thead> <tr> <th scope="col">Roll Number</th> <th scope="col">Name</th> <th scope="col">Amount</th> <th scope="col">Options</th> </tr> </thead> <tbody> {% for fee in fees %} <tr> <td>{{ fee.id }}</td> <td>{{ fee.name }}</td> <td>{{ fee.amount }}</td> <td> <button class="btn btn-outline btn-info" onclick=info()>Fees Breakup</button> <script> function info(){ alert("{{fee.fees_desc}}"); } </script> <button class="btn btn-outline btn-success">Pay</button> </td> </tr> {% endfor %} </tbody> </table> {% endblock %}
31.972973
102
0.337278
d6de68e88beb4bbe8a9e283adef5ccc5025c5080
672
lua
Lua
src/base/actor.lua
AricHasting/regrid
8b64520db09f8e5011aacef2f4eea07cb90309e3
[ "MIT" ]
null
null
null
src/base/actor.lua
AricHasting/regrid
8b64520db09f8e5011aacef2f4eea07cb90309e3
[ "MIT" ]
null
null
null
src/base/actor.lua
AricHasting/regrid
8b64520db09f8e5011aacef2f4eea07cb90309e3
[ "MIT" ]
null
null
null
do local _class_0 local _base_0 = { move = function(self, x, y) return self.grid:move_actor(x, y, self.id) end, destroy = function(self) return self.grid:remove_actor(self.id) end } _base_0.__index = _base_0 _class_0 = setmetatable({ __init = function(self) self.x = 1 self.y = 1 self.id = -1 self.grid = nil end, __base = _base_0, __name = "Actor" }, { __index = _base_0, __call = function(cls, ...) local _self_0 = setmetatable({}, _base_0) cls.__init(_self_0, ...) return _self_0 end }) _base_0.__class = _class_0 Actor = _class_0 return _class_0 end
20.363636
48
0.589286
79aa94002d03b5dbb84ea16137d8cf0db8329363
126
swift
Swift
TextFieldTesterTests/TextFieldTesterTests.swift
PoikileCreations/TextFieldUITester
c6e5e73f32f9032af90bbacd303d430441f9e893
[ "MIT" ]
null
null
null
TextFieldTesterTests/TextFieldTesterTests.swift
PoikileCreations/TextFieldUITester
c6e5e73f32f9032af90bbacd303d430441f9e893
[ "MIT" ]
null
null
null
TextFieldTesterTests/TextFieldTesterTests.swift
PoikileCreations/TextFieldUITester
c6e5e73f32f9032af90bbacd303d430441f9e893
[ "MIT" ]
null
null
null
// Created by nrith on 8/10/21. import XCTest @testable import TextFieldTester class TextFieldTesterTests: XCTestCase { }
14
40
0.769841
4c1b2741b4db716719d1936a0adb631ded1590df
7,152
php
PHP
test/ChaCha20CipherTest.php
nipil/ChaCha20
32c8f73e2b9ef443cba0855198938b84a73b8a9b
[ "MIT" ]
null
null
null
test/ChaCha20CipherTest.php
nipil/ChaCha20
32c8f73e2b9ef443cba0855198938b84a73b8a9b
[ "MIT" ]
null
null
null
test/ChaCha20CipherTest.php
nipil/ChaCha20
32c8f73e2b9ef443cba0855198938b84a73b8a9b
[ "MIT" ]
null
null
null
<?php declare(strict_types=1); use PHPUnit\Framework\TestCase; use ChaCha20\ChaCha20Exception; use ChaCha20\ChaCha20Block; use ChaCha20\ChaCha20Random; use ChaCha20\ChaCha20Cipher; final class ChaCha20CipherTest extends TestCase { public function testConstructorValued() { // rfc7539 test vector 2.3.2 $key = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"; $nonce = "000000000000004a00000000"; $ctr = 1; // valued constructor $c = new ChaCha20Cipher(hex2bin($key), hex2bin($nonce), $ctr, 0); // first block setup $this->assertEquals([ 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574, 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c, 0x13121110, 0x17161514, 0x1b1a1918, 0x1f1e1d1c, 0x00000001, 0x00000000, 0x4a000000, 0x00000000 ], $c->get_state(ChaCha20Block::STATE_INITIAL), "1st initial state failed"); // check counter before operation $this->assertEquals(1, $c->get_counter()); // check counter before operation $this->assertEquals(0, $c->get_sub_counter()); // first block after block operation $this->assertEquals([ ChaCha20Block::buildUint32(0xf351, 0x4f22), ChaCha20Block::buildUint32(0xe1d9, 0x1b40), 0x6f27de2f, ChaCha20Block::buildUint32(0xed1d, 0x63b8), ChaCha20Block::buildUint32(0x821f, 0x138c), ChaCha20Block::buildUint32(0xe206, 0x2c3d), ChaCha20Block::buildUint32(0xecca, 0x4f7e), 0x78cff39e, ChaCha20Block::buildUint32(0xa30a, 0x3b8a), ChaCha20Block::buildUint32(0x920a, 0x6072), ChaCha20Block::buildUint32(0xcd74, 0x79b5), 0x34932bed, 0x40ba4c79, ChaCha20Block::buildUint32(0xcd34, 0x3ec6), 0x4c2c21ea, ChaCha20Block::buildUint32(0xb741, 0x7df0), ], $c->get_state(ChaCha20Block::STATE_FINAL), "1st final state failed"); // provides return $c; } /** * @expectedException ChaCha20\ChaCha20Exception */ public function testConstructorSubCounterNegative() { $c = new ChaCha20Cipher( "f0e1d2v3b4a5968778695a4b3c2d1e0f", "1c2b3a495867", 1, -1); } /** * @expectedException ChaCha20\ChaCha20Exception */ public function testConstructorSubCounterOverload() { $c = new ChaCha20Cipher( "f0e1d2v3b4a5968778695a4b3c2d1e0f", "1c2b3a495867", 1, ChaCha20Cipher::MAX_SUB_COUNTER); } /** * @depends testConstructorValued */ public function testCipher($c) { // rfc7539 test vector 2.4.2 $key_stream_1st_block = $c->serialize_state(ChaCha20Block::STATE_FINAL); $input = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; $this->assertEquals(114, strlen($input), "invalid input length"); $this->assertEquals( "4c616469657320616e642047656e746c" . "656d656e206f662074686520636c6173" . "73206f66202739393a20496620492063" . "6f756c64206f6666657220796f75206f" . "6e6c79206f6e652074697020666f7220" . "746865206675747572652c2073756e73" . "637265656e20776f756c642062652069" . "742e", bin2hex($input), "invalid input content"); $output = $c->transform($input); $this->assertEquals(114, strlen($output), "invalid input length"); // second block setup $this->assertEquals([ 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574, 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c, 0x13121110, 0x17161514, 0x1b1a1918, 0x1f1e1d1c, 0x00000002, 0x00000000, 0x4a000000, 0x00000000 ], $c->get_state(ChaCha20Block::STATE_INITIAL), "2nd initial state failed"); // check counter after operation $this->assertEquals(2, $c->get_counter()); // check counter after operation $this->assertEquals(50, $c->get_sub_counter()); // second block after block operation $this->assertEquals([ ChaCha20Block::buildUint32(0x9f74, 0xa669), 0x410f633f, 0x28feca22, 0x7ec44dec, 0x6d34d426, 0x738cb970, 0x3ac5e9f3, 0x45590cc4, ChaCha20Block::buildUint32(0xda6e, 0x8b39), ChaCha20Block::buildUint32(0x892c, 0x831a), ChaCha20Block::buildUint32(0xcdea, 0x67c1), 0x2b7e1d90, 0x037463f3, ChaCha20Block::buildUint32(0xa11a, 0x2073), ChaCha20Block::buildUint32(0xe8bc, 0xfb88), ChaCha20Block::buildUint32(0xedc4, 0x9139) ], $c->get_state(ChaCha20Block::STATE_FINAL), "2nd final state failed"); $key_stream_2nd_block = $c->serialize_state(ChaCha20Block::STATE_FINAL); $key_steam = substr($key_stream_1st_block . $key_stream_2nd_block, 0, 114); $this->assertEquals( "224f51f3401bd9e12fde276fb8631ded8c131f823d2c06" . "e27e4fcaec9ef3cf788a3b0aa372600a92b57974cded2b" . "9334794cba40c63e34cdea212c4cf07d41b769a6749f3f" . "630f4122cafe28ec4dc47e26d4346d70b98c73f3e9c53a" . "c40c5945398b6eda1a832c89c167eacd901d7e2bf363", bin2hex($key_steam), "invalid key_stream"); $this->assertEquals( "6e2e359a2568f98041ba0728dd0d6981" ."e97e7aec1d4360c20a27afccfd9fae0b" ."f91b65c5524733ab8f593dabcd62b357" ."1639d624e65152ab8f530c359f0861d8" ."07ca0dbf500d6a6156a38e088a22b65e" ."52bc514d16ccf806818ce91ab7793736" ."5af90bbf74a35be6b40b8eedf2785e42" ."874d", bin2hex($output), "invalid cipher_text"); } /** * @depends testConstructorValued * @expectedException ChaCha20\ChaCha20Exception */ public function testExceptionSubCounterOverload($c) { $c->set_sub_counter(64); } /** * @depends testConstructorValued * @expectedException ChaCha20\ChaCha20Exception */ public function testExceptionSubCounterNegative($c) { $c->set_sub_counter(-1); } /** * @depends testConstructorValued */ public function testSubCounter($c) { $n = ChaCha20Block::STATE_ARRAY_LENGTH * ChaCha20Block::INT_BIT_LENGTH >> 3; for ($i=0; $i<$n; $i++) { $c->set_sub_counter($i); $this->assertEquals( $i, $c->get_sub_counter(), sprintf("sub counter test %d", $i)); } } }
33.265116
134
0.591163
48c4fccf035835e8e62f39f8ca17ce0a00e88029
1,394
kt
Kotlin
src/jsMain/kotlin/net/kyori/adventure/webui/js/Background.kt
thiccaxe/adventure-webui
05f564fbed2fd443f350cd23d9212d185441c4d3
[ "MIT" ]
10
2021-07-29T18:03:39.000Z
2022-03-05T17:30:58.000Z
src/jsMain/kotlin/net/kyori/adventure/webui/js/Background.kt
thiccaxe/adventure-webui
05f564fbed2fd443f350cd23d9212d185441c4d3
[ "MIT" ]
54
2021-08-02T13:59:20.000Z
2022-03-20T18:18:21.000Z
src/jsMain/kotlin/net/kyori/adventure/webui/js/Background.kt
thiccaxe/adventure-webui
05f564fbed2fd443f350cd23d9212d185441c4d3
[ "MIT" ]
7
2021-08-03T04:44:35.000Z
2022-03-23T22:15:45.000Z
package net.kyori.adventure.webui.js import kotlinx.browser.document import kotlinx.browser.window import org.w3c.dom.HTMLDivElement import org.w3c.dom.HTMLOptionElement import org.w3c.dom.HTMLSelectElement import org.w3c.dom.asList import org.w3c.dom.set private val outputPane: HTMLDivElement by lazy { document.getElementById("output-pane")!!.unsafeCast<HTMLDivElement>() } private val settingBackground: HTMLSelectElement by lazy { document.getElementById("setting-background")!!.unsafeCast<HTMLSelectElement>() } private val validBackgrounds: List<String> by lazy { settingBackground.options.asList().map { it.unsafeCast<HTMLOptionElement>().value } } public var currentBackground: String? = null set(value) { field = value updateBackground() } public fun updateBackground() { val bg = currentBackground ?: return if (!validBackgrounds.contains(currentBackground)) return window.localStorage[PARAM_BACKGROUND] = bg settingBackground.value = bg if (currentMode == Mode.SERVER_LIST) { // Remove the current background if we are switching to "server list" // as it has a black background that is otherwise overridden outputPane.style.removeProperty("background-image") } else { // Otherwise, try to put back the background from before outputPane.style.backgroundImage = "url(\"img/$bg.jpg\")" } }
41
140
0.741033
b60af390fa71e0f18aa13edc95aa0b89085810ab
2,388
swift
Swift
Sources/ZIPFoundation/Archive+Progress.swift
vit1812/ZIPFoundation
b7bde1ac6ab0291e73ed89abe34107791eedb2b3
[ "MIT" ]
1,904
2017-06-27T05:19:54.000Z
2022-03-29T07:49:50.000Z
Sources/ZIPFoundation/Archive+Progress.swift
vit1812/ZIPFoundation
b7bde1ac6ab0291e73ed89abe34107791eedb2b3
[ "MIT" ]
202
2017-06-27T20:58:08.000Z
2022-03-25T10:59:57.000Z
Sources/ZIPFoundation/Archive+Progress.swift
vit1812/ZIPFoundation
b7bde1ac6ab0291e73ed89abe34107791eedb2b3
[ "MIT" ]
200
2017-06-27T20:52:07.000Z
2022-03-30T15:25:32.000Z
// // Archive+Progress.swift // ZIPFoundation // // Copyright © 2017-2021 Thomas Zoechling, https://www.peakstep.com and the ZIP Foundation project authors. // Released under the MIT License. // // See https://github.com/weichsel/ZIPFoundation/blob/master/LICENSE for license information. // import Foundation extension Archive { /// The number of the work units that have to be performed when /// removing `entry` from the receiver. /// /// - Parameter entry: The entry that will be removed. /// - Returns: The number of the work units. public func totalUnitCountForRemoving(_ entry: Entry) -> Int64 { return Int64(self.endOfCentralDirectoryRecord.offsetToStartOfCentralDirectory - UInt32(entry.localSize)) } func makeProgressForRemoving(_ entry: Entry) -> Progress { return Progress(totalUnitCount: self.totalUnitCountForRemoving(entry)) } /// The number of the work units that have to be performed when /// reading `entry` from the receiver. /// /// - Parameter entry: The entry that will be read. /// - Returns: The number of the work units. public func totalUnitCountForReading(_ entry: Entry) -> Int64 { switch entry.type { case .file, .symlink: return Int64(entry.uncompressedSize) case .directory: return defaultDirectoryUnitCount } } func makeProgressForReading(_ entry: Entry) -> Progress { return Progress(totalUnitCount: self.totalUnitCountForReading(entry)) } /// The number of the work units that have to be performed when /// adding the file at `url` to the receiver. /// - Parameter entry: The entry that will be removed. /// - Returns: The number of the work units. public func totalUnitCountForAddingItem(at url: URL) -> Int64 { var count = Int64(0) do { let type = try FileManager.typeForItem(at: url) switch type { case .file, .symlink: count = Int64(try FileManager.fileSizeForItem(at: url)) case .directory: count = defaultDirectoryUnitCount } } catch { count = -1 } return count } func makeProgressForAddingItem(at url: URL) -> Progress { return Progress(totalUnitCount: self.totalUnitCountForAddingItem(at: url)) } }
35.117647
108
0.646985
4b29877983bd885380047413d4633abe24bc4178
124
sql
SQL
schema/revert/tables/application_revision.sql
bcgov/cas-ciip-portal
dceb5331fa17902b1100e6faccac9d36eeb8b4a5
[ "Apache-2.0" ]
9
2019-10-09T20:57:34.000Z
2020-11-19T15:32:32.000Z
schema/revert/tables/application_revision.sql
bcgov/cas-ciip-portal
dceb5331fa17902b1100e6faccac9d36eeb8b4a5
[ "Apache-2.0" ]
1,282
2019-08-21T20:43:34.000Z
2022-03-30T16:46:46.000Z
schema/revert/tables/application_revision.sql
bcgov/cas-ciip-portal
dceb5331fa17902b1100e6faccac9d36eeb8b4a5
[ "Apache-2.0" ]
2
2019-10-16T22:27:43.000Z
2021-01-26T20:05:13.000Z
-- Revert ggircs-portal:table_application_revision from pg begin; drop table ggircs_portal.application_revision; commit;
15.5
58
0.830645
31a7a10b07087a8bf3bc7145d5d8dd0402b25d8e
11,642
dart
Dart
lib/matcher/default.dart
eyouyou/SimpleRouter
00e1643a344311965f45cc7c8956ba317ac0a898
[ "MIT" ]
null
null
null
lib/matcher/default.dart
eyouyou/SimpleRouter
00e1643a344311965f45cc7c8956ba317ac0a898
[ "MIT" ]
null
null
null
lib/matcher/default.dart
eyouyou/SimpleRouter
00e1643a344311965f45cc7c8956ba317ac0a898
[ "MIT" ]
null
null
null
import 'package:path/path.dart' as p; import 'package:simple_route/simple_route.dart'; class DefaultQueryStringParser extends QueryStringParser { static const String intTag = "int!"; static const String boolTag = "bool!"; static const String stringTag = "string!"; static RegExp search = RegExp('([^&=]+)=?([^&]*)'); static decode(String s) => Uri.decodeComponent(s.replaceAll('+', ' ')); @override Map<String, dynamic>? parseToQueries(String queryString) { var params = <String, dynamic>{}; if (queryString.startsWith('?')) queryString = queryString.substring(1); for (Match match in search.allMatches(queryString)) { var matchKey = match.group(1); var matchValue = match.group(2); if (matchKey != null && matchValue != null) { String key = decode(matchKey); String value = decode(matchValue); if (value.startsWith(intTag)) { value = value.replaceFirst(RegExp(intTag), ''); params[key] = int.parse(value); } else if (value.startsWith(boolTag)) { value = value.replaceFirst(RegExp(boolTag), ''); params[key] = value.toLowerCase() == "true"; } else { params[key] = value; } } } return params; } @override String parseToString(Map<String, dynamic> queries) { if (queries.isEmpty) return ""; var queryString = ""; if (queries.entries.isNotEmpty) { StringBuffer queryStringBuffer = StringBuffer(); queries.forEach((key, value) { var temp = value; if (value is int) { temp = "$intTag$value"; } else if (value is bool) { temp = "$boolTag$value"; } queryStringBuffer .write("$key=${Uri.encodeComponent(temp.toString())}&"); }); queryString = queryStringBuffer.toString(); var index = queryString.lastIndexOf("&"); if (index > 0) { queryString = queryString.replaceRange(index, index + 1, ""); } } return queryString; } } /// A [RouteTreeNote] type enum RouteTreeNodeType { component, parameter, } /// A node on [RouteTree] class RouteTreeNode { // constructors RouteTreeNode(this.part, this.type); // properties final String part; final RouteTreeNodeType type; /// 防止引用被修改 final List<SimpleRoute> routes = <SimpleRoute>[]; final ObservableList<RouteTreeNode> nodes = ObservableList(<RouteTreeNode>[]); RouteTreeNode? parent; bool isParameter() { return type == RouteTreeNodeType.parameter; } } /// A matched [RouteTreeNode] class RouteTreeNodeMatch { // constructors RouteTreeNodeMatch(this.node); RouteTreeNodeMatch.fromMatch(RouteTreeNodeMatch? match, this.node) { parameters = <String, dynamic>{}; if (match != null) { parameters.addAll(match.parameters); } } // properties RouteTreeNode node; Map<String, dynamic> parameters = <String, dynamic>{}; } // /// route列表 替代 // class Routes { // final List<SimpleRoute> routes = <SimpleRoute>[]; // RouteCollection.from // } /// /users/:id/story?qwe=1&w=12 class RouteTree extends RouteCollection with RouteMatcher { final QueryStringParser _queryStringParser = DefaultQueryStringParser(); late final String _path; /// 为了方便根路由从构造函数中传入 RouteTree(SimpleRoute root) { var path = p.normalize(root.path); // is root/default route, just add it assert(path == p.separator, "必须为根路径"); var node = RouteTreeNode(path, RouteTreeNodeType.component); node.routes.add(root); _nodes.add(node); _path = path; _routes[root] = path; } @override QueryStringParser get queryStringParser => _queryStringParser; final ObservableList<RouteTreeNode> _nodes = ObservableList(<RouteTreeNode>[]); final Map<SimpleRoute, String> _routes = {}; @override RouteMatch? match(String path) { var usePath = p.normalize(path); assert(p.isAbsolute(usePath)); return _match(usePath, _nodes.list, untilFindRoute: true); } RouteMatch? matchAll(String path) { return _match(path, _nodes.list); } RouteMatch? _match(String path, List<RouteTreeNode> nodes, {bool untilFindRoute = false}) { var components = p.split(path); var nodeMatches = <RouteTreeNode, RouteTreeNodeMatch>{}; var nodesToCheck = nodes; var nodePath = <String>[]; for (final checkComponent in components) { final currentMatches = <RouteTreeNode, RouteTreeNodeMatch>{}; final nextNodes = <RouteTreeNode>[]; var pathPart = checkComponent; Map<String, dynamic>? queryMap; if (checkComponent.contains("?")) { var splitParam = checkComponent.split("?"); pathPart = splitParam[0]; queryMap = queryStringParser.parseToQueries(splitParam[1]); } for (final node in nodesToCheck) { final isMatch = (node.part == pathPart || node.isParameter()); if (isMatch) { RouteTreeNodeMatch? parentMatch = nodeMatches[node.parent]; final match = RouteTreeNodeMatch.fromMatch(parentMatch, node); if (node.isParameter()) { final paramKey = node.part.substring(1); match.parameters[paramKey] = pathPart; } if (queryMap != null) { assert(!match.parameters.keys.any((p) => queryMap!.containsKey(p)), "不能存在相同key"); match.parameters.addAll(queryMap); } nodePath.add(checkComponent); currentMatches[node] = match; nextNodes.addAll(node.nodes.list); } } nodeMatches = currentMatches; nodesToCheck = nextNodes; // 如果已经匹配到route了 就不在匹配了 不包括根目录 if (untilFindRoute && currentMatches.keys.any((it) => it.routes.isNotEmpty && p.normalize(it.routes.first.path) != p.separator)) { break; } if (currentMatches.values.isEmpty) { return null; } } final matches = nodeMatches.values.toList(); if (matches.isNotEmpty) { final match = matches.first; final nodeToUse = match.node; final routes = nodeToUse.routes; if (routes.isNotEmpty) { final routeMatch = RouteMatch(routes[0], p.joinAll(nodePath)); routeMatch.parameters.addAll(match.parameters); return routeMatch; } } return null; } @override String add(SimpleRoute route) { return addNode(route, parentPath: _path); } String addNode(SimpleRoute route, {String parentPath = ""}) { String path = p.normalize(route.path); parentPath = p.normalize(parentPath); assert(p.isRelative(path) && p.isAbsolute(parentPath) || p.isAbsolute(path), "相对路径需要[parentPath]"); if (p.isRelative(path)) { path = p.join(parentPath, path); } assert(path != p.separator, "不能多次添加根节点"); final pathComponents = p.split(path); RouteTreeNode? parent; for (int i = 0; i < pathComponents.length; i++) { String? component = pathComponents[i]; RouteTreeNode? node = _nodeForComponent(component, parent); if (node == null) { RouteTreeNodeType type = _typeForComponent(component); node = RouteTreeNode(component, type); node.parent = parent; if (parent == null) { _nodes.add(node); } else { parent.nodes.add(node); } } if (i == pathComponents.length - 1) { node.routes.add(route); } parent = node; } _routes[route] = path; return path; } RouteTreeNode? _nodeForComponent(String component, RouteTreeNode? parent) { var nodes = _nodes; if (parent != null) { // search parent for sub-node matches nodes = parent.nodes; } for (final node in nodes.list) { if (node.part == component) { return node; } } return null; } RouteTreeNodeType _typeForComponent(String component) { var type = RouteTreeNodeType.component; if (_isParameterComponent(component)) { type = RouteTreeNodeType.parameter; } return type; } /// Is the path component a parameter bool _isParameterComponent(String component) { return component.startsWith(":"); } @override void clearChildren(String path) { path = p.normalize(path); assert(p.isAbsolute(path), "[path] 必须要绝对路径"); final pathComponents = p.split(path); RouteTreeNode? parent; for (int i = 0; i < pathComponents.length; i++) { String? component = pathComponents[i]; RouteTreeNode? node = _nodeForComponent(component, parent); if (i == pathComponents.length - 1) { if (node != null) { node.nodes.clear(); for (int j = 0; j < node.routes.length; j++) { _routes.remove(node.routes[j]); } node.routes.clear(); } } parent = node; } } RouterLayerCollection? getRoutesFromPath(String path) { path = p.normalize(path); assert(p.isAbsolute(path), "[path] 必须要绝对路径"); final pathComponents = p.split(path); RouteTreeNode? parent; for (int i = 0; i < pathComponents.length; i++) { String? component = pathComponents[i]; RouteTreeNode? node = _nodeForComponent(component, parent); if (i == pathComponents.length - 1) { if (node != null) { return RouterLayerCollection(path, this, node.nodes); } } parent = node; } return null; } @override String get path => _path; @override int get length => _nodes.length; @override List<SimpleRoute> get routes => List.unmodifiable( _nodes.list.fold<List>([], (pre, e) => pre..addAll(e.routes))); @override String? getAbsolutePath(SimpleRoute route) { return _routes[route]; } @override String getRelativePath(String path, String prefix) { path = p.normalize(path); prefix = p.normalize(prefix); var pathPart = p.split(path); var prefixPart = p.split(prefix); var matched = 0; for (var i = 0; i < prefixPart.length; i++) { // 如果相等 则继续匹配 if (prefixPart[i] != pathPart[i]) { break; } matched++; } return p.joinAll(pathPart.skip(matched)); } } /// 必须是相对路径 class RouterLayerCollection extends RouteCollection with RouteMatcher { @override List<SimpleRoute> get routes => List.unmodifiable( _nodes.list.fold<List>([], (pre, e) => pre..addAll(e.routes))); final String _path; final ObservableList<RouteTreeNode> _nodes; final RouteTree _tree; RouterLayerCollection( String path, this._tree, ObservableList<RouteTreeNode> nodes) : _nodes = nodes, _path = path; @override int get length => _nodes.length; @override String? add(SimpleRoute route) { assert(p.isRelative(route.path)); return _tree.addNode(route, parentPath: _path); } @override void clearChildren(String path) { assert(p.isRelative(path)); path = p.join(_path, path); _tree.clearChildren(path); } /// 根据当前nodes 匹配孩子 @override RouteMatch? match(String path) { var usePath = p.normalize(path); assert(p.isRelative(usePath)); return _tree._match(usePath, _nodes.list, untilFindRoute: true); } int indexOf(SimpleRoute route) { return routes.indexOf(route); } @override QueryStringParser get queryStringParser => throw UnimplementedError(); @override String get path => _path; @override String? getAbsolutePath(SimpleRoute route) { return _tree.getAbsolutePath(route); } @override String getRelativePath(String path, String prefix) { return _tree.getRelativePath(path, prefix); } }
25.986607
80
0.629016
28dd2a9061f567c32d31f1b56179181556346365
472
asm
Assembly
ConditionalStatement.asm
akshithsriram/Hack-Computer
2cdbe28defe554f449c3664417a5d120ab0863c2
[ "CC0-1.0" ]
null
null
null
ConditionalStatement.asm
akshithsriram/Hack-Computer
2cdbe28defe554f449c3664417a5d120ab0863c2
[ "CC0-1.0" ]
null
null
null
ConditionalStatement.asm
akshithsriram/Hack-Computer
2cdbe28defe554f449c3664417a5d120ab0863c2
[ "CC0-1.0" ]
null
null
null
// Implementing an alternative statement in the hack machine language // Equivalent C Program: // if(a > b) // c = a - b; // else // c = b - a; @a D = M // D <-- a @b D = D - M // D <-- a - b @ENDIF D; JGT // if (a - b > 0) jump to ENDIF @b D = M // D <-- b @a D = D - M // D <-- D - a = (b - a) (ENDIF) @c M = D // c = D
17.481481
70
0.319915
74bfa3f89d26c0e915555fa4ca5d05cf4c09543d
3,372
js
JavaScript
webpack.production.config.js
ouxu/NEUQ-OJ
5f16f56bfc644b53fdea8aa88275d093a9b701d2
[ "MIT" ]
25
2016-12-24T05:44:30.000Z
2022-02-12T11:25:27.000Z
webpack.production.config.js
ouxu/NEUQ-OJ
5f16f56bfc644b53fdea8aa88275d093a9b701d2
[ "MIT" ]
2
2018-02-24T16:55:12.000Z
2018-07-28T06:21:38.000Z
webpack.production.config.js
ouxu/NEUQ-OJ
5f16f56bfc644b53fdea8aa88275d093a9b701d2
[ "MIT" ]
12
2017-06-29T09:50:56.000Z
2020-04-11T03:32:34.000Z
/* eslint-disable no-path-concat,no-unused-vars */ const webpack = require('webpack') const path = require('path') const ExtractTextPlugin = require('extract-text-webpack-plugin') // 打包 css const autoprefixer = require('autoprefixer') // 自动处理浏览器前缀 const HtmlWebpackPlugin = require('html-webpack-plugin') // 生成 html const CleanWebpackPlugin = require('clean-webpack-plugin') // 用于清除上次打包文件 const Visualizer = require('webpack-visualizer-plugin') const QiniuPlugin = require('qiniu-webpack-plugin') const getThemeConfig = require('./theme.config') const theme = getThemeConfig() module.exports = { entry: { bundle: path.join(__dirname, '/app/src/main.js'), vendor1: ['react', 'react-dom', 'react-router'], // 第三方库和框架另外打包 vendor2: ['redux', 'react-redux'] }, output: { path: path.join(__dirname, '/dist/build/'), publicPath: 'http://p0y3d4gdq.bkt.clouddn.com/fe/', // 表示 index.html 中引入资源的前缀path filename: 'js/bundle.[chunkhash:8].js', chunkFilename: 'js/[name].[chunkhash:8].js' }, devtool: false, module: { noParse: [/moment.js/], rules: [ { test: /\.jsx?$/, loaders: 'react-hot-loader!babel-loader', exclude: /node_modules/ }, { test: /\.css$/, loaders: ExtractTextPlugin.extract({ fallback: 'style-loader', use: ['css-loader?minimize', 'postcss-loader'] }) }, { test: /\.less$/, loaders: ExtractTextPlugin.extract({ fallback: 'style-loader', use: ['css-loader', 'postcss-loader', `less-loader?{"modifyVars":${JSON.stringify(theme)}}`] }) }, { test: /\.(png|jpg|gif|woff|woff2|svg)$/, loaders: [ 'url-loader?limit=10000&name=img/[hash:8].[name].[ext]' ] } ] }, resolve: { extensions: [' ', '.js', '.jsx'], alias: { 'actions': path.join(__dirname, '/app/src/actions'), 'api': path.join(__dirname, '/app/src/api'), 'components': path.join(__dirname, '/app/src/components'), 'containers': path.join(__dirname, '/app/src/containers'), 'images': path.join(__dirname, '/app/src/images'), 'reducers': path.join(__dirname, '/app/src/reducers'), 'utils': path.join(__dirname, '/app/src/utils') } }, plugins: [ new webpack.NoEmitOnErrorsPlugin(), new webpack.LoaderOptionsPlugin({ options: { postcss: function () { return [autoprefixer] } } }), new webpack.optimize.CommonsChunkPlugin({ name: ['minifast', 'vendor1', 'vendor2'], filename: 'js/[name].[chunkhash:8].js' }), new ExtractTextPlugin({ filename: 'css/style.[contenthash:8].css', allChunks: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') } }), new Visualizer(), new webpack.optimize.LimitChunkCountPlugin({maxChunks: 15}), new webpack.optimize.MinChunkSizePlugin({minChunkSize: 1000}), new HtmlWebpackPlugin({ template: './dist/template.ejs', title: 'NEUQ OJ', favicon: './app/favicon.ico', chunks: ['vendor1', 'vendor2', 'bundle'] }), new CleanWebpackPlugin(['dist/build'], { verbose: true, dry: false }), new QiniuPlugin(require('./publishConfig').qiniu) ] }
31.514019
102
0.594009
27d00b4194f4c7c516a6414bcd0a721399b5424f
2,752
css
CSS
styles/stack.css
mycolorway/simple-stack
7ba9a1900f4237563eb9cb71cf6cfc690366d14b
[ "MIT" ]
2
2019-07-06T09:43:43.000Z
2020-12-04T08:33:47.000Z
styles/stack.css
mycolorway/simple-stack
7ba9a1900f4237563eb9cb71cf6cfc690366d14b
[ "MIT" ]
null
null
null
styles/stack.css
mycolorway/simple-stack
7ba9a1900f4237563eb9cb71cf6cfc690366d14b
[ "MIT" ]
null
null
null
.simple-stack { position: relative; width: 962px; margin: 0 auto; } .simple-stack:before { content: ""; display: table; clear: both; } .simple-stack .page { width: 100%; min-height: 600px; border: 1px solid #dbdfd6; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); background: #ffffff; opacity: 1; position: relative; transform: none; -webkit-transform: none; transform-origin: 50% 0 0; -webkit-transform-origin: 50% 0 0; } .simple-stack .page.pjax-loading { min-height: 9999px; } .simple-stack .page.page-behind { border: 1px solid #dddddd; background: #f9f9f9; transform: scale(0.985); -webkit-transform: scale(0.985); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); position: absolute; top: 0; left: 0; } .simple-stack .page > a.link-page-behind { display: block; padding: 0 30px; line-height: 46px; line-height: 46px; font-size: 18px; color: #888888; background: #f9f9f9; } .simple-stack .page > a.link-page-behind:hover { background: #ffffff; } .simple-stack .page.page-root.page-behind { top: 2px; } .simple-stack .page.page-1 { top: 0; margin-top: 46px; } .simple-stack .page.page-1.page-behind { top: 48px; margin-top: 0; } .simple-stack .page.page-2 { top: 0; margin-top: 92px; } .simple-stack .page.page-2.page-behind { top: 94px; margin-top: 0; } .simple-stack .page.page-3 { top: 0; margin-top: 138px; } .simple-stack .page.page-3.page-behind { top: 140px; margin-top: 0; } .simple-stack .page.page-4 { top: 0; margin-top: 184px; } .simple-stack .page.page-4.page-behind { top: 186px; margin-top: 0; } .simple-stack .page.page-5 { top: 0; margin-top: 230px; } .simple-stack .page.page-5.page-behind { top: 232px; margin-top: 0; } .simple-stack .page.page-6 { top: 0; margin-top: 276px; } .simple-stack .page.page-6.page-behind { top: 278px; margin-top: 0; } .simple-stack .page.page-7 { top: 0; margin-top: 322px; } .simple-stack .page.page-7.page-behind { top: 324px; margin-top: 0; } .simple-stack .page.page-8 { top: 0; margin-top: 368px; } .simple-stack .page.page-8.page-behind { top: 370px; margin-top: 0; } .simple-stack .page.page-9 { top: 0; margin-top: 414px; } .simple-stack .page.page-9.page-behind { top: 416px; margin-top: 0; } .simple-stack .page.page-10 { top: 0; margin-top: 460px; } .simple-stack .page.page-10.page-behind { top: 462px; margin-top: 0; } .simple-stack.simple-stack-fluid { width: auto; } .simple-stack.simple-stack-transition .page { -webkit-transition-property: top, margin-top, opacity, -webkit-transform, box-shadow; -webkit-transition-duration: 200ms; transition-property: top, margin-top, opacity, transform, box-shadow; transition-duration: 200ms; }
19.51773
87
0.65516
1c41b639b49df2ed0aadf6a103ca9b01a9782b71
1,018
asm
Assembly
programs/oeis/168/A168269.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/168/A168269.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/168/A168269.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A168269: a(n) = 2*n - (-1)^n. ; 3,3,7,7,11,11,15,15,19,19,23,23,27,27,31,31,35,35,39,39,43,43,47,47,51,51,55,55,59,59,63,63,67,67,71,71,75,75,79,79,83,83,87,87,91,91,95,95,99,99,103,103,107,107,111,111,115,115,119,119,123,123,127,127,131,131,135,135,139,139,143,143,147,147,151,151,155,155,159,159,163,163,167,167,171,171,175,175,179,179,183,183,187,187,191,191,195,195,199,199,203,203,207,207,211,211,215,215,219,219,223,223,227,227,231,231,235,235,239,239,243,243,247,247,251,251,255,255,259,259,263,263,267,267,271,271,275,275,279,279,283,283,287,287,291,291,295,295,299,299,303,303,307,307,311,311,315,315,319,319,323,323,327,327,331,331,335,335,339,339,343,343,347,347,351,351,355,355,359,359,363,363,367,367,371,371,375,375,379,379,383,383,387,387,391,391,395,395,399,399,403,403,407,407,411,411,415,415,419,419,423,423,427,427,431,431,435,435,439,439,443,443,447,447,451,451,455,455,459,459,463,463,467,467,471,471,475,475,479,479,483,483,487,487,491,491,495,495,499,499 mov $1,$0 div $1,2 mul $1,4 add $1,3
127.25
947
0.71611
383a4c1dcdb959cc6f3f2b7e8b7b605e55632b21
224
sql
SQL
Sources/PLMPackDB/dbo/Tables/Files.sql
minrogi/PLMPack
7e9fffd7fa21deabb9dc0b9d72d9269864350054
[ "MIT" ]
1
2018-09-05T12:58:27.000Z
2018-09-05T12:58:27.000Z
Sources/PLMPackDB/dbo/Tables/Files.sql
minrogi/PLMPack
7e9fffd7fa21deabb9dc0b9d72d9269864350054
[ "MIT" ]
null
null
null
Sources/PLMPackDB/dbo/Tables/Files.sql
minrogi/PLMPack
7e9fffd7fa21deabb9dc0b9d72d9269864350054
[ "MIT" ]
2
2021-03-10T08:33:22.000Z
2021-03-16T07:24:00.000Z
CREATE TABLE [dbo].[Files] ( [Guid] NVARCHAR (128) NOT NULL, [Extension] NVARCHAR (5) NULL, [DateCreated] DATE NOT NULL, CONSTRAINT [PK_dbo.Files] PRIMARY KEY CLUSTERED ([Guid] ASC) );
28
64
0.589286
534880a30dd2e494c9971ad0de1c23d3e6981c95
316
ps1
PowerShell
code/scripts/get_votes.ps1
theAverageCoder/data-512-final
b811dd845e9d17a03d95d286032afa68fece8a29
[ "MIT" ]
null
null
null
code/scripts/get_votes.ps1
theAverageCoder/data-512-final
b811dd845e9d17a03d95d286032afa68fece8a29
[ "MIT" ]
null
null
null
code/scripts/get_votes.ps1
theAverageCoder/data-512-final
b811dd845e9d17a03d95d286032afa68fece8a29
[ "MIT" ]
null
null
null
for ($i=42; $i -gt 0; $i--){ $finalYear = 2018 - (50-$i)*2 $congress = 115 - (50 - $i) for($j=0; $j -lt2; $j++) { $session=$finalYear-$j Write-Host "Running python run votes --congress=$congress --session=$session" python run votes --congress=$congress --session=$session } }
35.111111
85
0.547468
04d9f877c6c738cf02af8fdb34fc30e7e58f980b
728
java
Java
core/src/test/java/org/esbench/generator/field/type/date/DateFieldFactoryTest.java
kucera-jan-cz/esBench
fc7d031595b63244e6638a1b9b1a4cb4e3175ae3
[ "Apache-2.0" ]
12
2015-11-04T09:34:55.000Z
2021-12-03T07:47:46.000Z
core/src/test/java/org/esbench/generator/field/type/date/DateFieldFactoryTest.java
kucera-jan-cz/esBench
fc7d031595b63244e6638a1b9b1a4cb4e3175ae3
[ "Apache-2.0" ]
2
2016-04-04T09:23:02.000Z
2019-12-30T13:05:05.000Z
core/src/test/java/org/esbench/generator/field/type/date/DateFieldFactoryTest.java
kucera-jan-cz/esBench
fc7d031595b63244e6638a1b9b1a4cb4e3175ae3
[ "Apache-2.0" ]
11
2016-03-09T10:04:55.000Z
2020-04-09T20:44:35.000Z
package org.esbench.generator.field.type.date; import static org.testng.Assert.assertEquals; import java.time.Instant; import java.time.temporal.ChronoUnit; import org.testng.annotations.Test; public class DateFieldFactoryTest { @Test public void newInstance() { ChronoUnit unit = ChronoUnit.MINUTES; Instant from = Instant.parse("2011-12-03T00:00:00Z"); int modulo = 10; long step = 5L; DateFieldFactory factory = new DateFieldFactory(from, step, unit, modulo); Instant expected = from; for(int i = 0; i < modulo; i++) { Instant instance = factory.newInstance(i); assertEquals(instance, expected); expected = expected.plus(step, unit); } assertEquals(factory.newInstance(modulo), from); } }
25.103448
76
0.732143
90a2f158cec384ed3cf284c20031f94c2aa6b170
3,567
swift
Swift
Sources/ConsoleKit/Execution/REPLExecution.swift
apparata/ConsoleKit
8e2736f2d0b01fcfa3313702fdaac052a5f9ffb9
[ "MIT" ]
5
2020-11-29T14:34:53.000Z
2022-03-13T13:24:15.000Z
Sources/ConsoleKit/Execution/REPLExecution.swift
apparata/ConsoleKit
8e2736f2d0b01fcfa3313702fdaac052a5f9ffb9
[ "MIT" ]
null
null
null
Sources/ConsoleKit/Execution/REPLExecution.swift
apparata/ConsoleKit
8e2736f2d0b01fcfa3313702fdaac052a5f9ffb9
[ "MIT" ]
null
null
null
import Foundation public final class REPLExecution { public enum SignalType { /// User interrupted program, typically by pressing Ctrl-C. case interrupt /// Terminal disconnected, e.g. user closed terminal window. case terminalDisconnected /// The program is about to be terminated. case terminate } /// The signal handler is run when the `SIGINT`, `SIGHUP`, or `SIGTERM` /// signal is received by the process. It is used to clean up before /// exiting the program, or to attempt to suppress the signal. /// /// Returns `true` if the program should exit, or `false` to keep running. /// The normal case would be to return `true`. public typealias SignalHandler = (SignalType) -> Bool /// Private singleton instance. private static let instance = REPLExecution() private var signalSources: [DispatchSourceSignal] = [] private let signalQueue = DispatchQueue(label: "Execution.signalhandler") /// Starts the main run loop and optionally installs a signal handler /// for the purpose of cleanup before terminating. The signal handler /// will be executed for `SIGINT`, `SIGHUP` and `SIGTERM`. /// /// - parameter signalHandler: Optional signal handler to execute before /// the program is terminated. If the signal /// handler returns `false`, the program will /// suppress the signal and not exit. public static func run(signalHandler: SignalHandler? = nil) { if let signalHandler = signalHandler { instance.signalSources = instance.installSignalHandler(signalHandler) } var keepGoing = true while keepGoing { let result = CFRunLoopRunInMode(.defaultMode, 3600, false) switch result { case .finished: keepGoing = false case .stopped: keepGoing = false default: break } } } /// Installs `SIGINT`, `SIGHUP`, and `SIGTERM` signal handler. private func installSignalHandler(_ handler: @escaping SignalHandler) -> [DispatchSourceSignal] { let sigintSource = DispatchSource.makeSignalSource(signal: SIGINT, queue: signalQueue) sigintSource.setEventHandler { let shouldExit = handler(.interrupt) print() if shouldExit { exit(0) } } let sighupSource = DispatchSource.makeSignalSource(signal: SIGHUP, queue: signalQueue) sigintSource.setEventHandler { let shouldExit = handler(.terminalDisconnected) print() if shouldExit { exit(0) } } let sigtermSource = DispatchSource.makeSignalSource(signal: SIGTERM, queue: signalQueue) sigtermSource.setEventHandler { let shouldExit = handler(.terminate) print() if shouldExit { exit(0) } } // Ignore default handlers. signal(SIGINT, SIG_IGN) signal(SIGHUP, SIG_IGN) signal(SIGTERM, SIG_IGN) sigintSource.resume() sighupSource.resume() sigtermSource.resume() return [sigintSource, sighupSource, sigtermSource] } public static func stop() { CFRunLoopStop(CFRunLoopGetMain()) } }
34.970588
101
0.584805
48db33d674a94f230c81be04bed240a908dfc8b0
1,719
swift
Swift
Sources/App/Models/Issue.swift
theseanything/coup
f25c3e47abc33139720a0795be3bb3d1d260aa83
[ "MIT" ]
null
null
null
Sources/App/Models/Issue.swift
theseanything/coup
f25c3e47abc33139720a0795be3bb3d1d260aa83
[ "MIT" ]
null
null
null
Sources/App/Models/Issue.swift
theseanything/coup
f25c3e47abc33139720a0795be3bb3d1d260aa83
[ "MIT" ]
null
null
null
import FluentSQLite import Vapor /// A single entry of a Issue list. final class Issue: SQLiteModel { /// The unique identifier for this `Issue`. var id: Int? var title: String var description: String var upVotes: Int = 0 var downVotes: Int = 0 var propertyId: Property.ID /// Creates a new `Issue`. init(id: Int? = nil, title: String, description: String, propertyId: Property.ID) { self.id = id self.title = title self.description = description self.propertyId = propertyId } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) self.id = try values.decodeIfPresent(Int.self, forKey: .id) self.title = try values.decode(String.self, forKey: .title) self.description = try values.decode(String.self, forKey: .description) self.propertyId = try values.decode(Int.self, forKey: .propertyId) } } /// Allows `Issue` to be used as a dynamic migration. extension Issue: Migration { static func prepare(on connection: SQLiteConnection) -> Future<Void> { return Database.create(self, on: connection) { builder in try addProperties(to: builder) builder.addField(type: SQLiteFieldType.text, name: "upVotes") builder.addField(type: SQLiteFieldType.text, name: "downVotes") } } } /// Allows `Issue` to be encoded to and decoded from HTTP messages. extension Issue: Content { } /// Allows `Issue` to be used as a dynamic parameter in route definitions. extension Issue: Parameter { } extension Issue { var property: Parent<Issue, Property> { return parent(\.propertyId) } }
31.833333
87
0.657941
cd995ed54c1ad2912771d871b1a0e59f0131c6e8
28
asm
Assembly
text/maps/mt_moon_b1f.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
16
2018-08-28T21:47:01.000Z
2022-02-20T20:29:59.000Z
text/maps/mt_moon_b1f.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
5
2019-04-03T19:53:11.000Z
2022-03-11T22:49:34.000Z
text/maps/mt_moon_b1f.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
2
2019-12-09T19:46:02.000Z
2020-12-05T21:36:30.000Z
_MtMoonText1:: db $0 done
7
14
0.678571
140a0f2e1b0eef43208a79811254a6cabe5055bb
73
sql
SQL
hasura/migrations/default/1620066532813_alter_table_public_student_alter_column_school_entry/up.sql
kreako/soklaki
6830d2b3f6f20c953a2dc726241e8daf3f41e49b
[ "MIT" ]
null
null
null
hasura/migrations/default/1620066532813_alter_table_public_student_alter_column_school_entry/up.sql
kreako/soklaki
6830d2b3f6f20c953a2dc726241e8daf3f41e49b
[ "MIT" ]
null
null
null
hasura/migrations/default/1620066532813_alter_table_public_student_alter_column_school_entry/up.sql
kreako/soklaki
6830d2b3f6f20c953a2dc726241e8daf3f41e49b
[ "MIT" ]
null
null
null
alter table "public"."student" alter column "school_entry" set not null;
36.5
72
0.767123
8744c3d99660a349a7d465dc4ea31ae1c7024cc4
12,937
html
HTML
web/build/blog.html
romaten1/ua-catalog
311d920bdc4cc2dc37275e458cc66af41943e858
[ "BSD-3-Clause" ]
null
null
null
web/build/blog.html
romaten1/ua-catalog
311d920bdc4cc2dc37275e458cc66af41943e858
[ "BSD-3-Clause" ]
null
null
null
web/build/blog.html
romaten1/ua-catalog
311d920bdc4cc2dc37275e458cc66af41943e858
[ "BSD-3-Clause" ]
null
null
null
<!doctype html> <html> <head> <meta charset="utf-8"> <title>SemiFinal</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/main.css"> </head> <body> <div class="header"> <div class="wrapper clearfix"> <div class="logo"><a href="#" title="logo"><img src="img/logo.png" alt="logo"></a> </div> <ul class="UAkatalog"> <li class="UAkatalog-link"><a href="#" title="Каталог">Каталог</a> <ul class="sub-menu-lv1"> <li class="hygiene"><a href="#" title="Засоби гігієни">Засоби гігієни</a> <ul class="sub-menu-lv2"> <li class="personal-hygiene"><a href="#" title="Особиста гігієна">Особиста гігієна</a> <ul class="sub-menu-lv3"> <li><a href="#" title="Зубні пасти">Зубні пасти</a></li> <li><a href="#" title="Шампуні">Шампуні</a></li> <li><a href="#" title="Мило">Мило</a></li> </ul> </li> <li><a href="#" title="Для дому">Для дому</a></li> <li><a href="#" title="Для дітей">Для дітей</a></li> <li><a href="#" title="Жіноча гігієна">Жіноча гігієна</a></li> </ul> </li> <li><a href="#" title="Одяг">Одяг</a></li> <li><a href="#" title="Взуття">Взуття</a></li> <li><a href="#" title="Сумки">Сумки</a></li> <li><a href="#" title="Косметика">Косметика</a></li> <li><a href="#" title="Прикраси">Прикраси</a></li> <li><a href="#" title="Посуд">Посуд</a></li> <li><a href="#" title="Дитячі товари">Дитячі товари</a></li> <li><a href="#" title="Їжа">Їжа</a></li> <li><a href="#" title="Алкогольні напої">Алкогольні напої</a></li> <li><a href="#" title="Різне">Різне</a></li> </ul> </li> </ul> <ul class="main-menu"> <li><a href="#" title="Про нас">Про нас</a></li> <li><a href="#" title="Події">Події</a></li> <li><a href="#" title="Новини">Новини</a></li> <li><a href="#" title="Блог">Блог</a></li> </ul> <div class="personal-info"> <a href="#" title="Привіт, Таня" class="login">Привіт, Таня</a> <a href="#" title="Моя колекція" class="my-collection">Моя колекція</a> </div> <div class="language"> <a href="#" title="Укр" class="UA active">Укр</a> <a href="#" title="Рос" class="RU">Рос</a> </div> </div> </div> <section class="blog-content"> <div class="wrapper"> <h1>Блог</h1> <div class="flex-container"> <div class="blog-column"> <div class="blog-column-item"> <img src="img/blog_item_1.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Найстильніше україньке висілля 2015 </div> <p class="text">На відміну від поширеної думки Lorem Ipsum не є випадковим набором літер. Він походить з уривку класичної латинської літератури 45 року до н.е., тобто має більш як 2000-річну історію. Річард Макклінток, професор латини з коледжу Хемпдін-Сидні, що у Вірджінії, вивчав одне з найменш зрозумілих латинських слів - consectetur - з уривку Lorem Ipsum, і у пошуку цього слова в класичній літературі знайшов безсумнівне джерело... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <div class="blog-column-item"> <img src="img/blog_item_2.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Айдентика в націнальному стилі тепер у моді </div> <p class="text">На відміну від поширеної думки Lorem Ipsum не є випадковим набором літер. Він походить з уривку класичної латинської літератури 45 року до н.е., тобто має більш як 2000-річну історію. Річард Макклінток, професор латини з коледжу Хемпдін-Сидні... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <span class="spinner"> </span> </div> <div class="blog-column"> <div class="blog-column-item"> <img src="img/blog_item_2.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Айдентика в націнальному стилі тепер у моді </div> <p class="text">На відміну від поширеної думки Lorem Ipsum не є випадковим набором літер. Він походить з уривку класичної латинської літератури 45 року до н.е., тобто має більш як 2000-річну історію. Річард Макклінток, професор латини з коледжу Хемпдін-Сидні... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <div class="blog-column-item"> <img src="img/blog_item_1.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Найстильніше україньке висілля 2015 </div> <p class="text">На відміну від поширеної думки Lorem Ipsum не є випадковим набором літер. Він походить з уривку класичної латинської літератури 45 року до н.е., тобто має більш як 2000-річну історію. Річард Макклінток, професор латини з коледжу Хемпдін-Сидні, що у Вірджінії, вивчав одне з найменш зрозумілих латинських слів - consectetur - з уривку Lorem Ipsum, і у пошуку цього слова в класичній літературі знайшов безсумнівне джерело... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <span class="spinner"> </span> </div> <div class="blog-column"> <div class="blog-column-item"> <img src="img/blog_item_3.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Залиш свій слід </div> <p class="text">Існує багато варіацій уривків з Lorem Ipsum, але більшість з них зазнала певних змін на кшталт жартівливих вставок або змішування слів, які навіть не виглядають правдоподібно. Якщо ви збираєтесь використовувати Lorem Ipsum, ви маєте упевнитись в тому, що всередині тексту не приховано нічого, що могло б викликати у читача конфуз. Більшість відомих генераторів Lorem Ipsum в Мережі генерують текст... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <div class="blog-column-item"> <img src="img/blog_item_4.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Парад фотоконкурсів в українському строї </div> <p class="text">Існує багато варіацій уривків з Lorem Ipsum, але більшість з них зазнала певних змін на кшталт жартівливих вставок або змішування слів, які навіть не виглядають правдоподібно. Якщо ви збираєтесь використовувати Lorem Ipsum... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <span class="spinner"> </span> </div> <div class="blog-column"> <div class="blog-column-item"> <img src="img/blog_item_4.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Парад фотоконкурсів в українському строї </div> <p class="text">Існує багато варіацій уривків з Lorem Ipsum, але більшість з них зазнала певних змін на кшталт жартівливих вставок або змішування слів, які навіть не виглядають правдоподібно. Якщо ви збираєтесь використовувати Lorem Ipsum... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <div class="blog-column-item"> <img src="img/blog_item_3.jpg" alt="Найстильніше україньке висілля 2015"> <div class="text-head">Залиш свій слід </div> <p class="text">Існує багато варіацій уривків з Lorem Ipsum, але більшість з них зазнала певних змін на кшталт жартівливих вставок або змішування слів, які навіть не виглядають правдоподібно. Якщо ви збираєтесь використовувати Lorem Ipsum, ви маєте упевнитись в тому, що всередині тексту не приховано нічого, що могло б викликати у читача конфуз. Більшість відомих генераторів Lorem Ipsum в Мережі генерують текст... </p> <a href="#" title="далі" class="read-more">далі ></a> </div> <span class="spinner"> </span> </div> </div> </div> </section> <div class="search-container-blog"> <div class="search-block"> <div class="search-block-container"> <div class="search-head"> Повний каталог українських виробників </div> <form action="index.php" method="post"> <input type="text" name="search" placeholder="Назва товару"><!-- --><input type="submit" name="search-buton" value=" "> </form> </div> </div> </div> <div class="footer"> <div class="UA-brand"> <div class="wrapper"> <ul class="UA-brand-list"> <li><a href="#" title="ЕтноМодерн"><img src="img/ethno.png" alt="ЕтноМодерн"></a></li> <li><a href="#" title="nenka"><img src="img/nenka.png" alt="nenka"></a></li> <li><a href="#" title="raslov"><img src="img/raslov.png" alt="raslov"></a></li> <li><a href="#" title="sem"><img src="img/sem.png" alt="sem"></a></li> <li><a href="#" title="tago"><img src="img/tago.png" alt="tago"></a></li> <li><a href="#" title="corali"><img src="img/corali.jpg" alt="corali"></a></li> </ul> </div> </div> <div class="footer-container"> <div class="wrapper"> <div class="footer-lists"> <div class="footer-column column-1"> <span class="list-head">Про нас</span> <ul> <li><a href="#" title="Що таке UA КАТАЛОГ?">Що таке UA КАТАЛОГ?</a></li> <li><a href="#" title="Реквізити">Реквізити</a></li> <li><a href="#" title="Робота і вакансії">Робота і вакансії</a></li> <li><a href="#" title="Контакти">Контакти</a></li> </ul> <span class="social-head">бУДЬТЕ НА ЗВ’ЯЗКУ</span> <ul class="social-list"> <li><a href="#" title="" class="fb"> </a></li><!-- --><li><a href="#" title="" class="vk"> </a></li><!-- --><li><a href="#" title="" class="twitter"> </a></li><!-- --><li><a href="#" title="" class="pinterest"> </a></li> </ul> <ul class="copyright"> <li>2015 UA КАТАЛОГ</li> <li>© Всі права захищені</li> <li>Всі ціни вказані в гривнях</li> <li>з урахуванням ПДВ</li> <li><a href="#" title="Правова інформація">Правова інформація</a></li> </ul> </div><!-- --><div class="footer-column column-2"> <span class="list-head">Виробникам</span> <ul> <li><a href="#" title="Про проект">Про проект</a></li> <li><a href="#" title="Зареєсрувати магазин">Зареєсрувати магазин</a></li> <li><a href="#" title="Розмістити рекламу">Розмістити рекламу</a></li> <li><a href="#" title="Розмістити акцію">Розмістити акцію</a></li> <li><a href="#" title="Зворотній з’язок">Зворотній з’язок</a></li> </ul> </div><!-- --><div class="footer-column column-3"> <span class="list-head">Користувачам</span> <ul> <li><a href="#" title="Власна колекція">Власна колекція</a></li> <li><a href="#" title="Правила коментування і написання відгуків">Правила коментування і написання відгуків</a></li> <li><a href="#" title="Зворотній зв'язок">Зворотній зв'язок</a></li> <li><a href="#" title="Допомога">Допомога</a></li> <li><a href="#" title="Мобільна версія">Мобільна версія</a></li> </ul> </div><!-- --><div class="footer-column column-4"> <span class="list-head">НОВИНИ ТА ПУБЛІКАЦІЇ</span> <ul class="list-news"> <li><a href="#" title=" &quot;Зелене світло&quot; у Європу: українські товари стають помітнішими на ринку ЄС">&quot;Зелене світло&quot; у Європу: українські товари стають помітнішими на ринку ЄС</a></li> <li><a href="#" title="Росспоживнагляд почав масштабну перевірку українських товарів">Росспоживнагляд почав масштабну перевірку українських товарів</a></li> <li><a href="#" title="За останні 5 місяців Україна поставила в Крим товарів більш, ніж на $ 500 млн">За останні 5 місяців Україна поставила в Крим товарів більш, ніж на $ 500 млн</a></li> <li><a href="#" title="Огляд українського бренду">Огляд українського бренду</a></li> <li><a href="#" title="Києві пройде ярмарка український товарів">Києві пройде ярмарка український товарів</a></li> <li><a href="#" title="Українські іграшки мають свою філософію">Українські іграшки мають свою філософію</a></li> <li><a href="#" title=" &quot;Зелене світло&quot; у Європу: українські товари стають помітнішими на ринку ЄС"> &quot;Зелене світло&quot; у Європу: українські товари стають помітнішими на ринку ЄС</a></li> <li><a href="#" title="Росспоживнагляд почав масштабну перевірку українських товарів">Росспоживнагляд почав масштабну перевірку українських товарів</a></li> </ul> <span class="good-news">Ми приносимо ТІЛЬКИ ДОБРІ НОВИНИ</span> <span class="good-news-rss">Підпишись та дізнавайся першим</span> <form action="index.php" method="get"> <input type="text" name="Email" placeholder="Email"> <input type="submit" name="submit" value="Підписатись"> </form> </div> </div> </div> </div> </div> </body> </html>
53.238683
444
0.625029
cf4e06f0aeae03972d87913dd99f018c71a5eabd
20,917
sql
SQL
database.sql
thinhnguyen88/QLKD
2078cb478d0069bc16220b8eb99e3bf50fa3e3cf
[ "MIT" ]
null
null
null
database.sql
thinhnguyen88/QLKD
2078cb478d0069bc16220b8eb99e3bf50fa3e3cf
[ "MIT" ]
null
null
null
database.sql
thinhnguyen88/QLKD
2078cb478d0069bc16220b8eb99e3bf50fa3e3cf
[ "MIT" ]
null
null
null
/* Navicat MySQL Data Transfer Source Server : localhost 2 Source Server Version : 50505 Source Host : localhost:3306 Source Database : viettel Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2018-03-28 14:31:27 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for appointment -- ---------------------------- DROP TABLE IF EXISTS `appointment`; CREATE TABLE `appointment` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `title` varchar(255) DEFAULT NULL, `place` varchar(255) DEFAULT NULL, `start_time` datetime DEFAULT NULL, `finish_time` datetime DEFAULT NULL, `active` tinyint(2) DEFAULT NULL, `company_id` int(11) DEFAULT NULL, `approver_uid` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of appointment -- ---------------------------- INSERT INTO `appointment` VALUES ('1', '1', 'test', '28 Hue', '2018-03-20 16:11:00', '2018-03-21 16:11:00', '1', '1', '1'); INSERT INTO `appointment` VALUES ('2', '1', '2', '2', '2018-03-22 16:11:00', '2018-03-23 16:55:00', '2', '1', '1'); -- ---------------------------- -- Table structure for business -- ---------------------------- DROP TABLE IF EXISTS `business`; CREATE TABLE `business` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `daily_revenue` decimal(10,2) DEFAULT NULL, `monthly_revenue_accumulated` decimal(10,2) DEFAULT NULL, `goal_revenue` decimal(10,2) DEFAULT NULL, `percent_completed` double DEFAULT NULL, `lack_revenue` decimal(10,2) DEFAULT NULL, `compare_with_1st` varchar(255) DEFAULT NULL, `ranking` tinyint(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of business -- ---------------------------- -- ---------------------------- -- Table structure for company -- ---------------------------- DROP TABLE IF EXISTS `company`; CREATE TABLE `company` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `company_name` varchar(255) DEFAULT NULL, `tax_identification_number` varchar(255) DEFAULT NULL, `phone_number` varchar(255) DEFAULT NULL, `email_address` varchar(255) DEFAULT NULL, `address` varchar(255) DEFAULT NULL, `person_charge` varchar(255) DEFAULT NULL, `website` varchar(255) DEFAULT NULL, `account_number` varchar(255) DEFAULT NULL, `bank_branch` varchar(255) DEFAULT NULL, `person_charge_phone_number` varchar(255) DEFAULT NULL, `person_charge_email_address` varchar(255) DEFAULT NULL, `active` tinyint(2) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of company -- ---------------------------- INSERT INTO `company` VALUES ('1', 'Test', '123456', '02445868963', 'email@congty.com', '26 main st', 'Nguyen A', 'congty.com', '123456', 'VCB', '0982555239', 'a@congty.com', '1'); -- ---------------------------- -- Table structure for goals -- ---------------------------- DROP TABLE IF EXISTS `goals`; CREATE TABLE `goals` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `goals` bigint(11) unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of goals -- ---------------------------- INSERT INTO `goals` VALUES ('1', '5000', '2017-11-10 15:15:32', '2017-11-10 15:30:55'); -- ---------------------------- -- Table structure for history -- ---------------------------- DROP TABLE IF EXISTS `history`; CREATE TABLE `history` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `type_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `entity_id` int(10) unsigned DEFAULT NULL, `icon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `class` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `text` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `assets` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `history_type_id_foreign` (`type_id`), KEY `history_user_id_foreign` (`user_id`), CONSTRAINT `history_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `history_types` (`id`) ON DELETE CASCADE, CONSTRAINT `history_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of history -- ---------------------------- INSERT INTO `history` VALUES ('1', '1', '1', '2', 'save', 'bg-aqua', 'trans(\"history.backend.users.updated\") <strong>{user}</strong>', '{\"user_link\":[\"admin.access.user.show\",\"Backend User\",2]}', '2017-11-10 14:25:59', '2017-11-10 14:25:59'); INSERT INTO `history` VALUES ('2', '1', '1', '3', 'lock', 'bg-blue', 'trans(\"history.backend.users.changed_password\") <strong>{user}</strong>', '{\"user_link\":[\"admin.access.user.show\",\"Default User\",3]}', '2017-11-11 10:27:21', '2017-11-11 10:27:21'); INSERT INTO `history` VALUES ('3', '1', '1', '2', 'lock', 'bg-blue', 'trans(\"history.backend.users.changed_password\") <strong>{user}</strong>', '{\"user_link\":[\"admin.access.user.show\",\"Backend User\",2]}', '2017-11-11 10:31:17', '2017-11-11 10:31:17'); -- ---------------------------- -- Table structure for history_types -- ---------------------------- DROP TABLE IF EXISTS `history_types`; CREATE TABLE `history_types` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of history_types -- ---------------------------- INSERT INTO `history_types` VALUES ('1', 'User', '2017-11-09 10:33:04', '2017-11-09 10:33:04'); INSERT INTO `history_types` VALUES ('2', 'Role', '2017-11-09 10:33:04', '2017-11-09 10:33:04'); -- ---------------------------- -- Table structure for migrations -- ---------------------------- DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of migrations -- ---------------------------- INSERT INTO `migrations` VALUES ('1', '2014_10_12_000000_create_users_table', '1'); INSERT INTO `migrations` VALUES ('2', '2014_10_12_100000_create_password_resets_table', '1'); INSERT INTO `migrations` VALUES ('3', '2015_12_28_171741_create_social_logins_table', '1'); INSERT INTO `migrations` VALUES ('4', '2015_12_29_015055_setup_access_tables', '1'); INSERT INTO `migrations` VALUES ('5', '2016_07_03_062439_create_history_tables', '1'); INSERT INTO `migrations` VALUES ('6', '2017_04_04_131153_create_sessions_table', '1'); -- ---------------------------- -- Table structure for password_resets -- ---------------------------- DROP TABLE IF EXISTS `password_resets`; CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of password_resets -- ---------------------------- -- ---------------------------- -- Table structure for permissions -- ---------------------------- DROP TABLE IF EXISTS `permissions`; CREATE TABLE `permissions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `permissions_name_unique` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of permissions -- ---------------------------- INSERT INTO `permissions` VALUES ('1', 'view-backend', 'Xem Backend', '2017-11-09 10:33:04', '2017-11-09 10:33:04'); INSERT INTO `permissions` VALUES ('2', 'add-users', 'Thêm người dùng', '2017-11-09 14:50:49', '2017-11-09 14:50:51'); INSERT INTO `permissions` VALUES ('3', 'remove-users', 'Xóa người dùng', '2017-11-09 14:52:29', '2017-11-09 14:52:32'); INSERT INTO `permissions` VALUES ('4', 'print-business-report', 'In báo cáo kinh doanh', '2017-11-09 14:54:42', '2017-11-09 14:54:45'); -- ---------------------------- -- Table structure for permission_role -- ---------------------------- DROP TABLE IF EXISTS `permission_role`; CREATE TABLE `permission_role` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `permission_id` int(10) unsigned NOT NULL, `role_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `permission_role_permission_id_foreign` (`permission_id`), KEY `permission_role_role_id_foreign` (`role_id`), CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE, CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of permission_role -- ---------------------------- INSERT INTO `permission_role` VALUES ('2', '1', '3'); INSERT INTO `permission_role` VALUES ('7', '1', '2'); INSERT INTO `permission_role` VALUES ('8', '2', '2'); INSERT INTO `permission_role` VALUES ('9', '4', '2'); INSERT INTO `permission_role` VALUES ('10', '1', '4'); INSERT INTO `permission_role` VALUES ('11', '2', '4'); INSERT INTO `permission_role` VALUES ('12', '4', '4'); -- ---------------------------- -- Table structure for revenues -- ---------------------------- DROP TABLE IF EXISTS `revenues`; CREATE TABLE `revenues` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `company` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `phone` varchar(255) DEFAULT NULL, `datetime` datetime DEFAULT NULL, `revenue` decimal(10,2) DEFAULT NULL, `advisor` varchar(255) DEFAULT NULL, `reason_for_update` varchar(255) DEFAULT NULL, `profit` decimal(10,2) DEFAULT NULL, `company_id` int(11) DEFAULT NULL, `service_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of revenues -- ---------------------------- INSERT INTO `revenues` VALUES ('1', '1', 'Công Ty A', 'a@a.com', '123456789', '2017-11-11 21:33:40', '2332.00', 'VV', '323', '11.00', null, null); INSERT INTO `revenues` VALUES ('2', '1', 'Công Ty B', 'b@b.com', '098255696', '2017-11-07 21:33:44', '345.00', 'Nguyễn văn B', null, '11.00', null, null); INSERT INTO `revenues` VALUES ('3', '2', 'ViettelGlobal', 'c@gmail.com', '0988888888', '2017-11-11 10:40:00', '25200000.00', 'Nguyễn Văn C', null, '2000000.00', null, null); INSERT INTO `revenues` VALUES ('4', '2', 'Công Ty C', 'admin@x.com', '098255696', '2017-11-09 10:42:00', '4324234.00', 'a', null, '3244324.00', null, null); INSERT INTO `revenues` VALUES ('5', '2', 'Công Ty D', 'd@gmail.com', '0999999999', '2017-11-08 10:43:00', '13333333.00', 'Nguyễn Văn D', null, '1300000.00', null, null); INSERT INTO `revenues` VALUES ('6', '3', 'Viettel Global', 'user@user.com', '098255696', '2017-11-07 11:05:00', '100000.00', 'Nguyễn văn B', null, '100000.00', null, null); INSERT INTO `revenues` VALUES ('7', '3', 'Viettel Global', 'user@user.com', '098255696', '2017-11-08 11:05:00', '100000.00', 'Nguyễn văn B', '', '100000.00', null, null); INSERT INTO `revenues` VALUES ('8', '1', null, null, null, '2018-03-21 16:59:00', '25000000.00', null, null, '10000000.00', '1', '1'); -- ---------------------------- -- Table structure for roles -- ---------------------------- DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `all` tinyint(1) NOT NULL DEFAULT '0', `sort` smallint(5) unsigned NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `roles_name_unique` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of roles -- ---------------------------- INSERT INTO `roles` VALUES ('1', 'Kỹ thuật', '1', '1', '2017-11-09 10:33:04', '2017-11-09 14:46:43'); INSERT INTO `roles` VALUES ('2', 'Trưởng phòng', '0', '2', '2017-11-09 10:33:04', '2017-11-09 15:08:09'); INSERT INTO `roles` VALUES ('3', 'Nhân viên', '0', '3', '2017-11-09 10:33:04', '2017-11-09 14:46:27'); INSERT INTO `roles` VALUES ('4', 'Giám đốc', '0', '4', '2017-11-09 14:47:19', '2017-11-09 15:08:26'); -- ---------------------------- -- Table structure for role_user -- ---------------------------- DROP TABLE IF EXISTS `role_user`; CREATE TABLE `role_user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(10) unsigned NOT NULL, `role_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `role_user_user_id_foreign` (`user_id`), KEY `role_user_role_id_foreign` (`role_id`), CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE, CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of role_user -- ---------------------------- INSERT INTO `role_user` VALUES ('1', '1', '1'); INSERT INTO `role_user` VALUES ('3', '3', '3'); INSERT INTO `role_user` VALUES ('4', '2', '2'); INSERT INTO `role_user` VALUES ('5', '2', '3'); -- ---------------------------- -- Table structure for service -- ---------------------------- DROP TABLE IF EXISTS `service`; CREATE TABLE `service` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `active` tinyint(2) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of service -- ---------------------------- INSERT INTO `service` VALUES ('1', 'test', '1'); -- ---------------------------- -- Table structure for sessions -- ---------------------------- DROP TABLE IF EXISTS `sessions`; CREATE TABLE `sessions` ( `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(10) unsigned DEFAULT NULL, `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_agent` text COLLATE utf8mb4_unicode_ci, `payload` text COLLATE utf8mb4_unicode_ci NOT NULL, `last_activity` int(11) NOT NULL, UNIQUE KEY `sessions_id_unique` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of sessions -- ---------------------------- INSERT INTO `sessions` VALUES ('mHP8uFBY3Zn3WOHeAWhfzlgF6jsQlvXsQcdETySQ', '1', '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0', 'ZXlKcGRpSTZJbnBqU0VkUU5XVkdXazlFY1U5a2IzZzJOVzEyYW5jOVBTSXNJblpoYkhWbElqb2lVVmxwVFZGalVuTlBTekJSUkdaVlpVczJhWFlyTTFGRFZFeHJhU3REYmxOSGNtWndkM2RZYVVWQ1MwcEdNbUo2TTJSVVdUWk1ObXBQYmxCY0wxd3ZRU3MyV1ROdlNsUTNaeXNyTkhoMWFHbFJiR0pDVXpJNWR6UmpXbVZUT0d0UGNFVjVNMFkxTWtSWVVWQk5iRGhrU0RCa2NUUXdVVk5KUkRkamVERlVaU3REZEVweVVuWkxhR05FVDBwVWVtZERVR2RqTTNOS1RuazNhbXBXWlZCeWRpdHFXbnAwSzNWNmRHTkNaSE5qTUhKbWJXb3JRbHBEZWxJMU56QmtaVzB5ZDI5U2NXbGxXSEZ1WW5salExTk1LekpDUkc4clREWmNMMWwwWkZkclJWd3ZiVlV4WkhGSFpXTXpkVnd2YVd0d09ETkxWbEZvY0ZwME56UmpabVJWUmpsclhDOXRiMUEwYlhaak1HaG5VRWsyUWt4Qk1ETlNVVTFGWEM5NVNrUjBWa1JWYUd3M1Mxd3ZTaXRyVFZOR2FXeHdlSGN6WEM5NVpXbGhNRU1yV0N0MlJHNVVSbTFJU1ZWQmVVaFZNbmhET1RSclNHczFXVTVvWjJ0VE5XZHNTek51UjNsTlVtSTVXamhwZFVkbk1sTXlhWFV3UFNJc0ltMWhZeUk2SWpoak1UQXpOV1E0WkRJMU5UZGlPVFEwT1daaE9EUTFPRGhqWmpnMk0yUTFZalF5T0RkaU56a3dNR1psT0dKak16aGtOV1UxWkRRMU5tSmxNbVpqTUdJaWZRPT0=', '1521626504'); -- ---------------------------- -- Table structure for social_logins -- ---------------------------- DROP TABLE IF EXISTS `social_logins`; CREATE TABLE `social_logins` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(10) unsigned NOT NULL, `provider` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, `provider_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `social_logins_user_id_foreign` (`user_id`), CONSTRAINT `social_logins_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of social_logins -- ---------------------------- -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `first_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `last_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` tinyint(3) unsigned NOT NULL DEFAULT '1', `confirmation_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `confirmed` tinyint(1) NOT NULL DEFAULT '0', `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `pid` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `phone` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `phone2` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `height` int(11) DEFAULT NULL, `weight` double DEFAULT NULL, `hobbies` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `experience` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `strength` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `advisor` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `goal` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of users -- ---------------------------- INSERT INTO `users` VALUES ('1', 'Admin', 'Istrator', 'admin@admin.com', '$2y$10$DRqTWd78Y/SsRM8vUObZy.NXCuuBpgsAQgOf4tFFRhOTNrttsl9Aa', '1', '2c959e83b79aa3e938b61ff9dbaa0e56', '1', 'xTndaEubbCSCgIhVjLjpgFaBIwPJYssVPMv7lkEliYLw80IWLhwE6UcvtnCB', '2017-11-09 10:33:04', '2018-03-21 14:40:37', null, '1_21-03-2018-14-40-37.jpg', null, null, null, null, null, null, null, null, null, null, '208.00'); INSERT INTO `users` VALUES ('2', 'Backend', 'User', 'executive@executive.com', '$2y$10$T5oN6VHLhXn5OsMhaRucnOhtHZo/4SWavfBERjmikI.m0sEfHImiu', '1', '790eb0439981e217afdb500def406a99', '1', 'zB9A7u3unICFH2tByy65MHcDgJJg59M6YNM5sSwtd95Tnw2tHhzXXTRtKZei', '2017-11-09 10:33:04', '2017-11-11 10:31:17', null, null, null, null, null, null, null, null, null, null, null, null, '208.33'); INSERT INTO `users` VALUES ('3', 'Default', 'User', 'user@user.com', '$2y$10$4osjHn87P.rj0z0OeYMC/.prGRS1LDXIh6T5LNBYasfgx2sUoFeIq', '1', '4339c781eb59a35c120708339cc7c496', '1', 'B4pnqK4DBqxk40CPqUtA2jxSv7kDlWbanLvmnfIFbOdBP3AkPA0SJMDowO4V', '2017-11-09 10:33:04', '2017-11-11 10:27:20', null, null, null, null, null, null, null, null, null, null, null, null, '208.33');
51.017073
1,070
0.644356
f6553a1f1084161ea5a4b45116a524f365f0d60d
992
swift
Swift
Forms/Forms/Source/Components/Utils/GradientDivider.swift
sayler8182/Forms
0d1937882304d1e55e50b337696245b0cf6baf6b
[ "MIT" ]
1
2022-02-06T08:27:50.000Z
2022-02-06T08:27:50.000Z
Forms/Forms/Source/Components/Utils/GradientDivider.swift
sayler8182/Forms
0d1937882304d1e55e50b337696245b0cf6baf6b
[ "MIT" ]
null
null
null
Forms/Forms/Source/Components/Utils/GradientDivider.swift
sayler8182/Forms
0d1937882304d1e55e50b337696245b0cf6baf6b
[ "MIT" ]
null
null
null
// // GradientDivider.swift // Forms // // Created by Konrad on 6/26/20. // Copyright © 2020 Limbo. All rights reserved. // import FormsAnchor import UIKit // MARK: GradientDivider open class GradientDivider: Divider { open var colors: [UIColor?]? = nil { didSet { self.setNeedsDisplay() } } open var style: UIColor.GradientStyle = .linearHorizontal { didSet { self.setNeedsDisplay() } } override open func draw(_ rect: CGRect) { super.draw(rect) guard let colors: [UIColor?] = self.colors else { return } let frame: CGRect = self.bounds self.backgroundView.backgroundColor = UIColor(style: self.style, frame: frame, colors: colors) } } // MARK: Builder public extension GradientDivider { func with(colors: [UIColor?]?) -> Self { self.colors = colors return self } func with(style: UIColor.GradientStyle) -> Self { self.style = style return self } }
24.195122
102
0.623992
1c09b680f9281a56489562b54ea066577c4674fb
2,739
swift
Swift
ios/Runner/Sensor/CellularSensor.swift
hyperion-hyn/titan_flutter
8c68a99a155ea245b8d1ea26027f25a51ee9d5ae
[ "MIT" ]
10
2019-12-26T06:27:42.000Z
2021-09-23T12:13:31.000Z
ios/Runner/Sensor/CellularSensor.swift
hyperion-hyn/titan_flutter
8c68a99a155ea245b8d1ea26027f25a51ee9d5ae
[ "MIT" ]
null
null
null
ios/Runner/Sensor/CellularSensor.swift
hyperion-hyn/titan_flutter
8c68a99a155ea245b8d1ea26027f25a51ee9d5ae
[ "MIT" ]
3
2020-12-01T17:17:42.000Z
2021-07-19T10:31:14.000Z
// // CellularSensor.swift // Runner // // Created by naru.j on 2019/12/20. // Copyright © 2019 The Chromium Authors. All rights reserved. // import Foundation import CoreTelephony class CellularSensor: NSObject, Sensor { var onSensorChange: OnSensorValueChangeListener! var type = SensorType.CELLULAR func initialize() { // 获取运营商信息 let info = CTTelephonyNetworkInfo() if #available(iOS 12.0, *) { let carrier = info.serviceSubscriberCellularProviders if #available(iOS 13.0, *) { //print("dataServiceIdentifier: \(info.dataServiceIdentifier), carried: \(carrier)") guard let carrier = carrier?.values.first else { return } let values: [String : Any] = [ "carrierName": carrier.carrierName ?? "", "mcc": carrier.mobileCountryCode ?? "", "mnc": carrier.mobileNetworkCode ?? "", "icc": carrier.isoCountryCode ?? "", "allowsVOIP": carrier.allowsVOIP, "type": getMobileType(rat: info.currentRadioAccessTechnology) ] if onSensorChange != nil { onSensorChange(type, values) } } else { // Fallback on earlier versions } // 如果运营商变化将更新运营商输出 info.serviceSubscriberCellularProvidersDidUpdateNotifier = {(update: String) in print("update: \(update)") } // 输出手机的数据业务信息 // let currentInfo = info.currentRadioAccessTechnology // print("currentInfo: \(currentInfo)") } else { // Fallback on earlier versions } } func startScan() { } func stopScan() { } func destory() { } func getMobileType(rat: String? = "") -> String { guard let rat = rat else { return "2G"}; switch rat { case CTRadioAccessTechnologyEdge, CTRadioAccessTechnologyGPRS, CTRadioAccessTechnologyCDMA1x: return "2G" case CTRadioAccessTechnologyHSDPA, CTRadioAccessTechnologyWCDMA, CTRadioAccessTechnologyHSUPA, CTRadioAccessTechnologyCDMAEVDORev0, CTRadioAccessTechnologyCDMAEVDORevA, CTRadioAccessTechnologyCDMAEVDORevB, CTRadioAccessTechnologyeHRPD: return "3G" case CTRadioAccessTechnologyLTE: return "4G" default: return rat } } }
28.237113
100
0.527565
636a5f488edcc0803b350a01a2cbb98b425d354c
9,667
kt
Kotlin
sceneform-ux/src/main/java/com/google/ar/sceneform/ux/TranslationController.kt
niusounds/sceneform-android-sdk
3ca962ff52b17719cd6dc4ee78f6063f1e741aa7
[ "Apache-2.0" ]
null
null
null
sceneform-ux/src/main/java/com/google/ar/sceneform/ux/TranslationController.kt
niusounds/sceneform-android-sdk
3ca962ff52b17719cd6dc4ee78f6063f1e741aa7
[ "Apache-2.0" ]
null
null
null
sceneform-ux/src/main/java/com/google/ar/sceneform/ux/TranslationController.kt
niusounds/sceneform-android-sdk
3ca962ff52b17719cd6dc4ee78f6063f1e741aa7
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2018 Google LLC 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. */ package com.google.ar.sceneform.ux import com.google.ar.core.HitResult import com.google.ar.core.Plane import com.google.ar.core.TrackingState import com.google.ar.sceneform.AnchorNode import com.google.ar.sceneform.ArSceneView import com.google.ar.sceneform.FrameTime import com.google.ar.sceneform.Node import com.google.ar.sceneform.math.MathHelper import com.google.ar.sceneform.math.Quaternion import com.google.ar.sceneform.math.Vector3 import com.google.ar.sceneform.utilities.Preconditions import java.util.* /** * Manipulates the position of a [BaseTransformableNode] using a [ ]. If not selected, the [BaseTransformableNode] will become selected * when the [DragGesture] starts. */ class TranslationController( transformableNode: BaseTransformableNode, gestureRecognizer: DragGestureRecognizer, ) : BaseTransformationController<DragGesture>(transformableNode, gestureRecognizer) { private var lastArHitResult: HitResult? = null private var desiredLocalPosition: Vector3? = null private var desiredLocalRotation: Quaternion? = null private val initialForwardInLocal = Vector3() /** * Gets a reference to the EnumSet that determines which types of ArCore Planes this * TranslationController is allowed to translate on. */ /** Sets which types of ArCore Planes this TranslationController is allowed to translate on. */ var allowedPlaneTypes = EnumSet.allOf(Plane.Type::class.java) override fun onUpdated(node: Node, frameTime: FrameTime) { updatePosition(frameTime) updateRotation(frameTime) } override val isTransforming: Boolean get() = super.isTransforming || desiredLocalRotation != null || desiredLocalPosition != null override fun canStartTransformation(gesture: DragGesture): Boolean { val targetNode = gesture.targetNode ?: return false val transformableNode = transformableNode if (targetNode !== transformableNode && !targetNode.isDescendantOf(transformableNode)) { return false } if (!transformableNode.isSelected() && !transformableNode.select()) { return false } val initialForwardInWorld = transformableNode.forward val parent = transformableNode.parent if (parent != null) { initialForwardInLocal.set(parent.worldToLocalDirection(initialForwardInWorld)) } else { initialForwardInLocal.set(initialForwardInWorld) } return true } override fun onContinueTransformation(gesture: DragGesture) { val scene = transformableNode.scene ?: return val frame = (scene.view as ArSceneView).arFrame ?: return val arCamera = frame.camera if (arCamera.trackingState != TrackingState.TRACKING) { return } val position = gesture.getPosition() val hitResultList = frame.hitTest(position.x, position.y) for (i in hitResultList.indices) { val hit = hitResultList[i] val trackable = hit.trackable val pose = hit.hitPose if (trackable is Plane) { val plane = trackable if (plane.isPoseInPolygon(pose) && allowedPlaneTypes.contains(plane.type)) { desiredLocalPosition = Vector3(pose.tx(), pose.ty(), pose.tz()) desiredLocalRotation = Quaternion(pose.qx(), pose.qy(), pose.qz(), pose.qw()) val parent = transformableNode.parent if (parent != null && desiredLocalPosition != null && desiredLocalRotation != null) { desiredLocalPosition = parent.worldToLocalPoint(desiredLocalPosition) desiredLocalRotation = Quaternion.multiply( parent.worldRotation.inverted(), Preconditions.checkNotNull(desiredLocalRotation) ) } desiredLocalRotation = calculateFinalDesiredLocalRotation( Preconditions.checkNotNull(desiredLocalRotation) ) lastArHitResult = hit break } } } } override fun onEndTransformation(gesture: DragGesture) { val hitResult = lastArHitResult ?: return if (hitResult.trackable.trackingState == TrackingState.TRACKING) { val anchorNode = anchorNodeOrDie val oldAnchor = anchorNode.anchor oldAnchor?.detach() val newAnchor = hitResult.createAnchor() val worldPosition = transformableNode.worldPosition val worldRotation = transformableNode.worldRotation var finalDesiredWorldRotation = worldRotation // Since we change the anchor, we need to update the initialForwardInLocal into the new // coordinate space. Local variable for nullness analysis. val desiredLocalRotation = desiredLocalRotation if (desiredLocalRotation != null) { transformableNode.localRotation = desiredLocalRotation finalDesiredWorldRotation = transformableNode.worldRotation } anchorNode.anchor = newAnchor // Temporarily set the node to the final world rotation so that we can accurately // determine the initialForwardInLocal in the new coordinate space. transformableNode.worldRotation = finalDesiredWorldRotation val initialForwardInWorld = transformableNode.forward initialForwardInLocal.set(anchorNode.worldToLocalDirection(initialForwardInWorld)) transformableNode.worldRotation = worldRotation transformableNode.worldPosition = worldPosition } desiredLocalPosition = Vector3.zero() desiredLocalRotation = calculateFinalDesiredLocalRotation(Quaternion.identity()) } private val anchorNodeOrDie: AnchorNode get() { val parent = transformableNode.parent check(parent is AnchorNode) { "TransformableNode must have an AnchorNode as a parent." } return parent } private fun updatePosition(frameTime: FrameTime) { // Store in local variable for nullness static analysis. val desiredLocalPosition = desiredLocalPosition ?: return var localPosition = transformableNode.localPosition val lerpFactor = MathHelper.clamp(frameTime.deltaSeconds * LERP_SPEED, 0f, 1f) localPosition = Vector3.lerp(localPosition, desiredLocalPosition, lerpFactor) val lengthDiff = Math.abs(Vector3.subtract(desiredLocalPosition, localPosition).length()) if (lengthDiff <= POSITION_LENGTH_THRESHOLD) { localPosition = desiredLocalPosition this.desiredLocalPosition = null } transformableNode.localPosition = localPosition } private fun updateRotation(frameTime: FrameTime) { // Store in local variable for nullness static analysis. val desiredLocalRotation = desiredLocalRotation ?: return var localRotation = transformableNode.localRotation val lerpFactor = MathHelper.clamp(frameTime.deltaSeconds * LERP_SPEED, 0f, 1f) localRotation = Quaternion.slerp(localRotation, desiredLocalRotation, lerpFactor) val dot = Math.abs(dotQuaternion(localRotation, desiredLocalRotation)) if (dot >= ROTATION_DOT_THRESHOLD) { localRotation = desiredLocalRotation this.desiredLocalRotation = null } transformableNode.localRotation = localRotation } /** * When translating, the up direction of the node must match the up direction of the plane from * the hit result. However, we also need to make sure that the original forward direction of the * node is respected. */ private fun calculateFinalDesiredLocalRotation(desiredLocalRotation: Quaternion): Quaternion { // Get a rotation just to the up direction. // Otherwise, the node will spin around as you rotate. var desiredLocalRotation = desiredLocalRotation val rotatedUp = Quaternion.rotateVector(desiredLocalRotation, Vector3.up()) desiredLocalRotation = Quaternion.rotationBetweenVectors(Vector3.up(), rotatedUp) // Adjust the rotation to make sure the node maintains the same forward direction. val forwardInLocal = Quaternion.rotationBetweenVectors(Vector3.forward(), initialForwardInLocal) desiredLocalRotation = Quaternion.multiply(desiredLocalRotation, forwardInLocal) return desiredLocalRotation.normalized() } companion object { private const val LERP_SPEED = 12.0f private const val POSITION_LENGTH_THRESHOLD = 0.01f private const val ROTATION_DOT_THRESHOLD = 0.99f private fun dotQuaternion(lhs: Quaternion, rhs: Quaternion): Float { return lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z + lhs.w * rhs.w } } }
46.700483
135
0.680252
0e87bbb3b937b4ddfeb7eb8b64868667237d00a2
1,244
html
HTML
app/partials/login.html
steveplesha/carlife
8067ddc580898c53416fe922f6325a29bc795df1
[ "MIT" ]
null
null
null
app/partials/login.html
steveplesha/carlife
8067ddc580898c53416fe922f6325a29bc795df1
[ "MIT" ]
null
null
null
app/partials/login.html
steveplesha/carlife
8067ddc580898c53416fe922f6325a29bc795df1
[ "MIT" ]
null
null
null
<form id="frmLogin" class="container center-form" ng-controller="MainController" ng-submit="login()"> <h2>Login</h2> <div class="form-group"> <label for="loginEmail">Email address</label> <input type="email" class="form-control" id="loginEmail" ng-model="emailLogin" placeholder="enter email address" name="email" /> </div> <div class="form-group"> <label for="passwordInput">Password</label> <input type="password" class="form-control" id="loginPassword" ng-model="passwordLogin" placeholder="enter password" name="password" /> </div> <button type="submit" class="btn btn-primary">Login</button> <div> <h2>Or login using:</h2> <a href = '#' class='btn bt-social facebook-btn' data-provider="facebook">Facebook</a> <a href = '#' class='btn bt-social google-btn' data-provider="google">Google</a> <a href = '#' class='btn bt-social twitter-btn' data-provider="twitter">Twitter</a> <a href = '#' class='btn bt-social github-btn' data-provider="github">Github</a> </div> <div class="forgot-password"> <a href="/register">Sign Up</a><br> <a href="/passwordreset">Forgot your password?</a> </div> </form>
51.833333
143
0.626206
7d5be2e0067cac40f234b388af94b83c3d462cf8
1,481
html
HTML
core/src/app/content/settings/organisation/organisation.component.html
rakesh-garimella/console
ff27264741420f264b0ccfe9baa97aa581fbad23
[ "Apache-2.0" ]
null
null
null
core/src/app/content/settings/organisation/organisation.component.html
rakesh-garimella/console
ff27264741420f264b0ccfe9baa97aa581fbad23
[ "Apache-2.0" ]
null
null
null
core/src/app/content/settings/organisation/organisation.component.html
rakesh-garimella/console
ff27264741420f264b0ccfe9baa97aa581fbad23
[ "Apache-2.0" ]
null
null
null
<ng-container> <div class="sf-toolbar"> <div class="sf-toolbar__header">Your Organisation</div> </div> <div class="sf-panel"> <div class="sf-panel__content"> <div class="row"> <div class="tn-form__group col-sm-6"> <div class="tn-form__group"> <div class="tn-form__item"> <label class="tn-form__label">Name</label> <input class="tn-form__control" type="text" placeholder="Function name" value={{orgName}} readonly> </div> </div> </div> <div class="tn-form__group col-sm-6"> <div class="tn-form__item"> <label class="tn-form__label">Org-ID</label> <input class="tn-form__control" type="text" value={{orgId}} readonly> </div> </div> </div> <div class="row"> <div class="tn-form__group col-sm-6"> <div class="tn-form__group"> <div class="tn-form__item"> <label class="tn-form__label">kubeconfig</label> <span class="info-text">kubeconfig is a file used to configure access to a cluster. Download it to access the cluster using command line.</span> <button class="tn-button tn-button--small tn-button--text download-button" (click)="downloadKubeconfig()">Download config<img src="assets/download.svg" class="download-icon"/></button> </div> </div> </div> </div> </div> </div> </ng-container>
40.027027
198
0.573937
9688486ce90860b69e2b6904ec684b4bef0eba72
343
php
PHP
app/Category.php
D-nice69/ShoppingB2C
0f5e868ce851524772adcc1276db93848b19598b
[ "MIT" ]
null
null
null
app/Category.php
D-nice69/ShoppingB2C
0f5e868ce851524772adcc1276db93848b19598b
[ "MIT" ]
null
null
null
app/Category.php
D-nice69/ShoppingB2C
0f5e868ce851524772adcc1276db93848b19598b
[ "MIT" ]
null
null
null
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Category extends Model { protected $guarded = []; public function products() { return $this ->hasMany(Product::class,'category_id'); } public function categoryChildrent() { return $this->hasMany(Category::class,'parent_id'); } }
18.052632
61
0.64723
90af3837824055232c7aa3f0afef3a3394468fe9
104
py
Python
tests/conftest.py
sethmccombs/tau-intro-to-pytest
a4e8983841e6afcae6b0264ff48e47c37778b443
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
sethmccombs/tau-intro-to-pytest
a4e8983841e6afcae6b0264ff48e47c37778b443
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
sethmccombs/tau-intro-to-pytest
a4e8983841e6afcae6b0264ff48e47c37778b443
[ "Apache-2.0" ]
null
null
null
import pytest from stuff.accum import Accumulator @pytest.fixture def accum(): return Accumulator()
17.333333
35
0.778846
57525b61535bb0e4c093d10cc642dd187187a4e6
2,431
kt
Kotlin
app/src/main/java/com/yu/tools/activity/MainActivity.kt
Yu2002s/Yu-Tools
e9f3dd019241676980ebe3dfb3ffbbdab98a2534
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/yu/tools/activity/MainActivity.kt
Yu2002s/Yu-Tools
e9f3dd019241676980ebe3dfb3ffbbdab98a2534
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/yu/tools/activity/MainActivity.kt
Yu2002s/Yu-Tools
e9f3dd019241676980ebe3dfb3ffbbdab98a2534
[ "Apache-2.0" ]
null
null
null
package com.yu.tools.activity import android.os.Bundle import android.view.MenuItem import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter import androidx.viewpager.widget.ViewPager import com.google.android.material.bottomnavigation.BottomNavigationView import com.yu.tools.BaseActivity import com.yu.tools.R import com.yu.tools.fragment.AppFragment import com.yu.tools.fragment.FindFragment import com.yu.tools.util.AppBarScrollChangeListener import com.yu.tools.util.StatusBarUtil import kotlinx.android.synthetic.main.activity_main.* class MainActivity : BaseActivity(), BottomNavigationView.OnNavigationItemSelectedListener, ViewPager.OnPageChangeListener { private val fragments = ArrayList<Fragment>() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) requestPermission() fragments.add(AppFragment()) fragments.add(FindFragment()) bottomNavigationView.setOnNavigationItemSelectedListener(this) viewPager.addOnPageChangeListener(this) viewPager.adapter = MyPagerAdapter(supportFragmentManager, 0) } inner class MyPagerAdapter( fm: FragmentManager, root: Int, ) : FragmentPagerAdapter(fm, root) { override fun getCount(): Int { return fragments.size } override fun getItem(position: Int): Fragment { return fragments[position] } } override fun onNavigationItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.item1 -> viewPager.currentItem = 0 R.id.item2 -> viewPager.currentItem = 1 } return true } override fun onPageSelected(position: Int) { bottomNavigationView.menu.getItem(position).isChecked = true when (position) { 0 -> StatusBarUtil.setStatusBar(this, true) 1 -> { val state = (fragments[1] as FindFragment).getCollapseState() val isLight = state == AppBarScrollChangeListener.State.COLLAPSED StatusBarUtil.setStatusBar(this, isLight) } } } override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {} override fun onPageScrollStateChanged(state: Int) {} }
33.30137
99
0.701769
fe17f316ce5f4df54ca3e5a0dccc7946ada5d878
8,623
h
C
inetsrv/iis/svcs/smtp/inc/pbagstm.h
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
inetsrv/iis/svcs/smtp/inc/pbagstm.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
inetsrv/iis/svcs/smtp/inc/pbagstm.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/*++ Copyright (c) 1997 Microsoft Corporation Module Name: pbagstm.h Abstract: This module contains the definition of the property bag stream Author: Keith Lau (keithlau@microsoft.com) Revision History: keithlau 07/09/97 created --*/ #ifndef _PBAGSTM_H_ #define _PBAGSTM_H_ #include "cpool.h" #define MAX_PROPERTY_NAME_LENGTH 256 typedef struct _TABLE_ENTRY { DWORD dwOffset; DWORD dwSize; DWORD dwNameSize; DWORD dwMaxSize; DWORD dwKey; WORD fFlags; WORD wIndex; } TABLE_ENTRY, *LPTABLE_ENTRY; typedef struct _STREAM_HEADER { DWORD dwSignature; WORD wVersionHigh; WORD wVersionLow; DWORD dwHeaderSize; DWORD dwProperties; DWORD dwDirectorySize; DWORD dwEndOfData; } STREAM_HEADER, *LPSTREAM_HEADER; #define _CACHE_SIZE 64 typedef enum _PROPERTY_BAG_CREATORS { PBC_NONE = 0, PBC_BUILDQ, PBC_DIRNOT, PBC_ENV, PBC_LOCALQ, PBC_MAILQ, PBC_REMOTEQ, PBC_RRETRYQ, PBC_SMTPCLI } PROPERTY_BAG_CREATORS; typedef enum _PROPERTY_FLAG_OPERATIONS { PFO_NONE = 0, PFO_OR, PFO_ANDNOT } PROPERTY_FLAG_OPERATIONS; ///////////////////////////////////////////////////////////////////////////// // CPropertyBagStream // class CPropertyBagStream { public: CPropertyBagStream(DWORD dwContext = 0); ~CPropertyBagStream(); static CPool Pool; // override the mem functions to use CPool functions void *operator new (size_t cSize) { return Pool.Alloc(); } void operator delete (void *pInstance) { Pool.Free(pInstance); } // Reference count methods ... ULONG AddRef(); ULONG Release(BOOL fDeleteIfZeroRef = FALSE); HRESULT SetStreamFileName(LPSTR szStreamFileName); LPSTR GetStreamFileName() { return(m_szStreamName); } // Mechanisms for locking and unlocking the property bag HRESULT Lock(); HRESULT Unlock(); // Force opens the stream file if it is not already opened. // This is useful in checking if a stream file exists. HRESULT OpenStreamFile(); // Access to properties as a whole HRESULT GetProperty(LPSTR pszName, LPVOID pvBuffer, LPDWORD pdwBufferLen); HRESULT SetProperty(LPSTR pszName, LPVOID pvBuffer, DWORD dwBufferLen); // Access to properties, providing specific access to // portions of the property data relative to the start // of the property data HRESULT GetPropertyAt(LPSTR pszName, DWORD dwOffsetFromStart, LPVOID pvBuffer, LPDWORD pdwBufferLen); HRESULT SetPropertyAt(LPSTR pszName, DWORD dwOffsetFromStart, LPVOID pvBuffer, DWORD dwBufferLen); // Ad-hoc function to allow access to a specific DWORD of // a property, treating the DWORD as a set of flags. The // dwOperation argument specifies what kind of binary operation // we would like to have performed on the original value. // If the property does not originally exist, this function // will fail. HRESULT UpdatePropertyFlagsAt(LPSTR pszName, DWORD dwOffsetFromStart, DWORD dwFlags, DWORD dwOperation); #ifdef USE_PROPERTY_ITEM_ISTREAM // Returns an IStream interface to the desired property // for random access HRESULT GetIStreamToProperty(LPSTR pszName, IStream **ppIStream); #endif BOOL DeleteStream(); private: BOOL ReleaseStream(); HRESULT Seek(DWORD dwOffset, DWORD dwMethod); HRESULT LoadIntoCache(DWORD dwStartIndex); LPTABLE_ENTRY FindFromCache(DWORD dwKey, LPDWORD pdwStartIndex); HRESULT FindFrom(LPSTR pszName, DWORD dwKey, DWORD dwStartIndex, BOOL fForward, LPVOID pvBuffer, LPDWORD pdwBufferLen, LPTABLE_ENTRY *ppEntry); HRESULT FindFromEx(LPSTR pszName, DWORD dwKey, DWORD dwStartIndex, BOOL fForward, DWORD dwOffsetFromStart, LPVOID pvBuffer, LPDWORD pdwBufferLen, LPTABLE_ENTRY *ppEntry); HRESULT GetRecordData(LPTABLE_ENTRY pEntry, LPVOID pvBuffer); HRESULT GetRecordName(LPTABLE_ENTRY pEntry, LPVOID pvBuffer); HRESULT GetRecordValue(LPTABLE_ENTRY pEntry, LPVOID pvBuffer); HRESULT GetRecordValueAt(LPTABLE_ENTRY pEntry, DWORD dwOffsetFromStart, LPVOID pvBuffer, DWORD dwBufferLen); HRESULT UpdateEntry(LPTABLE_ENTRY pEntry); HRESULT UpdateHeader(); HRESULT UpdateHeaderUsingHandle(HANDLE hStream); HRESULT FindProperty(LPSTR pszName, LPVOID pvBuffer, LPDWORD pdwBufferLen, LPTABLE_ENTRY *ppEntry = NULL); HRESULT FindPropertyEx(LPSTR pszName, DWORD dwOffsetFromStart, LPVOID pvBuffer, LPDWORD pdwBufferLen, LPTABLE_ENTRY *ppEntry = NULL); HRESULT SetRecordData(LPTABLE_ENTRY pEntry, LPSTR pszName, LPVOID pvBuffer, DWORD dwBufferLen); HRESULT SetRecordDataAt(LPTABLE_ENTRY pEntry, LPSTR pszName, DWORD dwOffsetFromStart, LPVOID pvBuffer, DWORD dwBufferLen, BOOL fNewRecord = FALSE); HRESULT RelocateRecordData(LPTABLE_ENTRY pEntry); HRESULT DetermineIfCacheValid(BOOL *pfCacheInvalid); DWORD CreateKey(LPSTR pszName) { CHAR cKey[9]; DWORD dwLen = 0; // Convert to lower case ... while (*pszName && (dwLen < 8)) if ((*pszName >= 'A') && (*pszName <= 'Z')) cKey[dwLen++] = *pszName++ - 'A' + 'a'; else cKey[dwLen++] = *pszName++; cKey[dwLen] = '\0'; dwLen = lstrlen(cKey); // Create the key if (dwLen < 4) return((DWORD)cKey[dwLen - 1]); else if (dwLen < 8) return(*(DWORD *)cKey); else return(~*(DWORD *)cKey ^ *(DWORD *)(cKey + 4)); } DWORD GetTotalHeaderSize() { return(sizeof(STREAM_HEADER) + (m_Header.dwDirectorySize * sizeof(TABLE_ENTRY))); } // Current context DWORD m_dwContext; // Base file name CHAR m_szStreamName[MAX_PATH + 1]; // Handle to stream HANDLE m_hStream; // Stream header STREAM_HEADER m_Header; // Directory caching TABLE_ENTRY m_Cache[_CACHE_SIZE]; DWORD m_dwCacheStart; DWORD m_dwCachedItems; // Reference counting LONG m_lRef; // This is a signature placed at the end to catch memory overwrite DWORD m_dwSignature; }; ///////////////////////////////////////////////////////////////////////////// // CPropertyItemStream // // // Not everyone wants to use the property IStream, so we don't expose // it if it's not wanted // #ifdef USE_PROPERTY_ITEM_ISTREAM class CPropertyItemStream : public IStream { public: CPropertyItemStream(LPSTR pszName, CPropertyBagStream *pBag) { m_cRef = 0; m_pParentBag = pBeg; m_szName = pszName; m_libOffset.QuadPart = (DWORDLONG)0; } ~CPropertyItemStream() { Cleanup(); } // IUnknown STDMETHODIMP QueryInterface(REFIID, void**); STDMETHODIMP_(ULONG) AddRef(void); STDMETHODIMP_(ULONG) Release(void); void Cleanup() {} HRESULT ReadOffset(void *pv, ULONG cb, ULONG *pcbRead, ULARGE_INTEGER *plibOffset); HRESULT WriteOffset(void const* pv, ULONG cb, ULONG *pcbWritten, ULARGE_INTEGER *plibOffset); HRESULT GetSize(ULARGE_INTEGER *plibSize); HRESULT CopyToOffset(IStream *pstm, ULARGE_INTEGER libOffset, ULARGE_INTEGER *plibRead, ULARGE_INTEGER *plibWritten, ULARGE_INTEGER *plibOffset); HRESULT CloneOffset(IStream **pstm, ULARGE_INTEGER libOffset); // IStream public: HRESULT STDMETHODCALLTYPE Read(void *pv, ULONG cb, ULONG *pcbRead); HRESULT STDMETHODCALLTYPE Write(void const* pv, ULONG cb, ULONG *pcbWritten); HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *pdlibNewPosition); HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize); HRESULT STDMETHODCALLTYPE CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten); HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags); HRESULT STDMETHODCALLTYPE Revert(void); HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType); HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType); HRESULT STDMETHODCALLTYPE Stat(STATSTG * pstatstg, DWORD grfStatFlag); HRESULT STDMETHODCALLTYPE Clone(IStream **pstm); private: CPropertyBagStream *m_pParentBag; LPSTR m_szName; ULARGE_INTEGER m_libOffset; long m_cRef; }; #endif // USE_PROPERTY_ISTREAM #endif
24.637143
148
0.678998
65ed52971b3781730bd45ffba86cf157275d0401
7,113
lua
Lua
m12-tpt-secondary.lua
Imavoyc/Mother2Gba-chs
1e285d3e58d2371045bc0680fb09fa3912af5a78
[ "MIT" ]
null
null
null
m12-tpt-secondary.lua
Imavoyc/Mother2Gba-chs
1e285d3e58d2371045bc0680fb09fa3912af5a78
[ "MIT" ]
null
null
null
m12-tpt-secondary.lua
Imavoyc/Mother2Gba-chs
1e285d3e58d2371045bc0680fb09fa3912af5a78
[ "MIT" ]
1
2022-02-18T17:39:42.000Z
2022-02-18T17:39:42.000Z
return { { Index= 12, PointerLocation= 584724, OldPointer= 437286, Label= "L1017" }, { Index= 61, PointerLocation= 585704, OldPointer= 437286, Label= "L1017" }, { Index= 98, PointerLocation= 586444, OldPointer= 235659, Label= "L1018" }, { Index= 105, PointerLocation= 586584, OldPointer= 236372, Label= "L1019" }, { Index= 106, PointerLocation= 586604, OldPointer= 236624, Label= "L1020" }, { Index= 128, PointerLocation= 587044, OldPointer= 240598, Label= "L1021" }, { Index= 147, PointerLocation= 587424, OldPointer= 390119, Label= "L1022" }, { Index= 162, PointerLocation= 587724, OldPointer= 240598, Label= "L1021" }, { Index= 226, PointerLocation= 589004, OldPointer= 258297, Label= "L1023" }, { Index= 248, PointerLocation= 589444, OldPointer= 260046, Label= "L1024" }, { Index= 249, PointerLocation= 589464, OldPointer= 260495, Label= "L1025" }, { Index= 250, PointerLocation= 589484, OldPointer= 260677, Label= "L1026" }, { Index= 251, PointerLocation= 589504, OldPointer= 261200, Label= "L1027" }, { Index= 252, PointerLocation= 589524, OldPointer= 261027, Label= "L1028" }, { Index= 253, PointerLocation= 589544, OldPointer= 261457, Label= "L1029" }, { Index= 259, PointerLocation= 589664, OldPointer= 437286, Label= "L1017" }, { Index= 268, PointerLocation= 589844, OldPointer= 272341, Label= "L1030" }, { Index= 275, PointerLocation= 589984, OldPointer= 437286, Label= "L1017" }, { Index= 286, PointerLocation= 590204, OldPointer= 437286, Label= "L1017" }, { Index= 302, PointerLocation= 590524, OldPointer= 437286, Label= "L1017" }, { Index= 406, PointerLocation= 592604, OldPointer= 437286, Label= "L1017" }, { Index= 419, PointerLocation= 592864, OldPointer= 441774, Label= "L1031" }, { Index= 436, PointerLocation= 593204, OldPointer= 460231, Label= "L1032" }, { Index= 450, PointerLocation= 593484, OldPointer= 458839, Label= "L1033" }, { Index= 479, PointerLocation= 594064, OldPointer= 390868, Label= "L1034" }, { Index= 488, PointerLocation= 594244, OldPointer= 437286, Label= "L1017" }, { Index= 506, PointerLocation= 594604, OldPointer= 437286, Label= "L1017" }, { Index= 595, PointerLocation= 596384, OldPointer= 390188, Label= "L1035" }, { Index= 596, PointerLocation= 596404, OldPointer= 390296, Label= "L1036" }, { Index= 597, PointerLocation= 596424, OldPointer= 390350, Label= "L1037" }, { Index= 598, PointerLocation= 596444, OldPointer= 390404, Label= "L1038" }, { Index= 599, PointerLocation= 596464, OldPointer= 390242, Label= "L1039" }, { Index= 611, PointerLocation= 596704, OldPointer= 437286, Label= "L1017" }, { Index= 645, PointerLocation= 597384, OldPointer= 458915, Label= "L1040" }, { Index= 671, PointerLocation= 597904, OldPointer= 388441, Label= "L1041" }, { Index= 716, PointerLocation= 598804, OldPointer= 437286, Label= "L1017" }, { Index= 728, PointerLocation= 599044, OldPointer= 305567, Label= "L1042" }, { Index= 734, PointerLocation= 599164, OldPointer= 441819, Label= "L1043" }, { Index= 750, PointerLocation= 599484, OldPointer= 437286, Label= "L1017" }, { Index= 827, PointerLocation= 601024, OldPointer= 458879, Label= "L1044" }, { Index= 839, PointerLocation= 601264, OldPointer= 320938, Label= "L1045" }, { Index= 849, PointerLocation= 601464, OldPointer= 323106, Label= "L1046" }, { Index= 855, PointerLocation= 601584, OldPointer= 323461, Label= "L1047" }, { Index= 893, PointerLocation= 602344, OldPointer= 437286, Label= "L1017" }, { Index= 908, PointerLocation= 602644, OldPointer= 332004, Label= "L1048" }, { Index= 937, PointerLocation= 603224, OldPointer= 437286, Label= "L1017" }, { Index= 940, PointerLocation= 603284, OldPointer= 437286, Label= "L1017" }, { Index= 1009, PointerLocation= 604664, OldPointer= 437286, Label= "L1017" }, { Index= 1014, PointerLocation= 604764, OldPointer= 437286, Label= "L1017" }, { Index= 1022, PointerLocation= 604924, OldPointer= 437286, Label= "L1017" }, { Index= 1037, PointerLocation= 605224, OldPointer= 342291, Label= "L1049" }, { Index= 1107, PointerLocation= 606624, OldPointer= 350557, Label= "L1050" }, { Index= 1108, PointerLocation= 606644, OldPointer= 350557, Label= "L1050" }, { Index= 1109, PointerLocation= 606664, OldPointer= 350557, Label= "L1050" }, { Index= 1127, PointerLocation= 607024, OldPointer= 437286, Label= "L1017" }, { Index= 1150, PointerLocation= 607484, OldPointer= 353012, Label= "L1051" }, { Index= 1206, PointerLocation= 608604, OldPointer= 437286, Label= "L1017" }, { Index= 1250, PointerLocation= 609484, OldPointer= 357492, Label= "L1052" }, { Index= 1251, PointerLocation= 609504, OldPointer= 357492, Label= "L1052" }, { Index= 1252, PointerLocation= 609524, OldPointer= 358136, Label= "L1053" }, { Index= 1253, PointerLocation= 609544, OldPointer= 357492, Label= "L1052" }, { Index= 1254, PointerLocation= 609564, OldPointer= 357492, Label= "L1052" }, { Index= 1255, PointerLocation= 609584, OldPointer= 357492, Label= "L1052" }, { Index= 1256, PointerLocation= 609604, OldPointer= 357492, Label= "L1052" }, { Index= 1257, PointerLocation= 609624, OldPointer= 357492, Label= "L1052" }, { Index= 1258, PointerLocation= 609644, OldPointer= 357492, Label= "L1052" }, { Index= 1259, PointerLocation= 609664, OldPointer= 357492, Label= "L1052" }, { Index= 1261, PointerLocation= 609704, OldPointer= 357492, Label= "L1052" }, { Index= 1299, PointerLocation= 610464, OldPointer= 363364, Label= "L1054" }, { Index= 1320, PointerLocation= 610884, OldPointer= 437286, Label= "L1017" }, { Index= 1358, PointerLocation= 611644, OldPointer= 441668, Label= "L1055" }, { Index= 1375, PointerLocation= 611984, OldPointer= 437286, Label= "L1017" }, { Index= 1406, PointerLocation= 612604, OldPointer= 441668, Label= "L1055" } }
16.165909
28
0.568536
b8631060cc1f9c47c85c177c6445f634e8d9e785
269
kt
Kotlin
features/feature-flicker-data/src/main/java/com/mctech/showcase/feature/flicker_data/tag_history/entity/RoomTagHistoryEntity.kt
MayconCardoso/Modularized-Flicker-Showcase
aad7d8abac6b79416a52ebc76e0d23a574715de2
[ "Apache-2.0" ]
3
2020-03-02T22:41:21.000Z
2021-05-13T17:32:42.000Z
features/feature-flicker-data/src/main/java/com/mctech/showcase/feature/flicker_data/tag_history/entity/RoomTagHistoryEntity.kt
MayconCardoso/Modularized-Flicker-Showcase
aad7d8abac6b79416a52ebc76e0d23a574715de2
[ "Apache-2.0" ]
null
null
null
features/feature-flicker-data/src/main/java/com/mctech/showcase/feature/flicker_data/tag_history/entity/RoomTagHistoryEntity.kt
MayconCardoso/Modularized-Flicker-Showcase
aad7d8abac6b79416a52ebc76e0d23a574715de2
[ "Apache-2.0" ]
null
null
null
package com.mctech.showcase.feature.flicker_data.tag_history.entity import androidx.room.Entity import androidx.room.PrimaryKey @Entity( tableName = "flicker_tag_history" ) data class RoomTagHistoryEntity( @PrimaryKey val tag: String, val date: Long )
20.692308
67
0.773234
ece946b1e9e3d8f85ebf47fdbd0c4a316683ec60
1,027
dart
Dart
lib/src/events/resize.dart
HrX03/wm
6cd96c00c55a81df4bf4ea7ce1c3c0001f0f1165
[ "Apache-2.0" ]
6
2020-12-10T18:18:34.000Z
2020-12-11T13:41:39.000Z
lib/src/events/resize.dart
dahlia-os/utopia
6cd96c00c55a81df4bf4ea7ce1c3c0001f0f1165
[ "Apache-2.0" ]
null
null
null
lib/src/events/resize.dart
dahlia-os/utopia
6cd96c00c55a81df4bf4ea7ce1c3c0001f0f1165
[ "Apache-2.0" ]
null
null
null
import 'package:flutter/foundation.dart'; import 'package:utopia_wm/src/entry.dart'; import 'package:utopia_wm/src/events/base.dart'; /// Mixin to add shorthands for events generated by the [ResizeWindowFeature] feature. mixin ResizeEvents on WindowEventHandler { @override void onEvent(WindowEvent event) { if (event is WindowResizeStartEvent) { return onStartResize(); } else if (event is WindowResizeEndEvent) { return onEndResize(); } super.onEvent(event); } /// Handler for [WindowResizeStartEvent] events. @protected void onStartResize() {} /// Handler for [WindowResizeEndEvent] events. @protected void onEndResize() {} } /// Event generated when the user starts resizing the window. class WindowResizeStartEvent extends WindowEvent { const WindowResizeStartEvent({required super.timestamp}); } /// Event generated when the user is done resizing the window. class WindowResizeEndEvent extends WindowEvent { const WindowResizeEndEvent({required super.timestamp}); }
29.342857
86
0.748783
21e84ccc9ebfaa8eca7c05b38ff030ddaafdcfc1
67,938
html
HTML
output/ruc6edu.page121.html
basicworld/scrappy_ruc6
cd1c8047fdc9e85565f04fd11c46fb4737f876ad
[ "MIT" ]
null
null
null
output/ruc6edu.page121.html
basicworld/scrappy_ruc6
cd1c8047fdc9e85565f04fd11c46fb4737f876ad
[ "MIT" ]
null
null
null
output/ruc6edu.page121.html
basicworld/scrappy_ruc6
cd1c8047fdc9e85565f04fd11c46fb4737f876ad
[ "MIT" ]
null
null
null
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>出售 - 交易市场 - 第121页 - 品知人大</title> <meta name="keywords" content="交易市场" /> <meta name="description" content="交易市场 ,品知人大" /> <meta name="generator" content="Discuz! X2" /> <meta name="author" content="Discuz! Team and Comsenz UI Team" /> <meta name="copyright" content="2001-2011 Comsenz Inc." /> <meta name="MSSmartTagsPreventParsing" content="True" /> <meta http-equiv="MSThemeCompatible" content="Yes" /> <base href="http://bt.ruc6.edu.cn/b/" /><link rel="stylesheet" type="text/css" href="data/cache/style_1_common.css?2TR" /><link rel="stylesheet" type="text/css" href="data/cache/style_1_forum_forumdisplay.css?2TR" /><script type="text/javascript">var STYLEID = '1', STATICURL = 'static/', IMGDIR = 'static/image/common', VERHASH = '2TR', charset = 'utf-8', discuz_uid = '0', cookiepre = 'Caqh_bdeb_', cookiedomain = 'bt.ruc6.edu.cn', cookiepath = '/', showusercard = '0', attackevasive = '0', disallowfloat = 'sendpm|newthread|reply|tradeorder|activity|debate|nav|usergroups|task', creditnotice = '1|金币|,2|下载|G,6|上传|G,7|保种|,8|变参|', defaultstyle = '', REPORTURL = 'aHR0cDovL2J0LnJ1YzYuZWR1LmNuL2IvZm9ydW0ucGhwP21vZD1mb3J1bWRpc3BsYXkmZmlkPTMzJmZpbHRlcj10eXBlaWQmdHlwZWlkPTc0JnBhZ2U9MTIx', SITEURL = 'http://bt.ruc6.edu.cn/b/', JSPATH = 'static/js/';</script> <script src="static/js/common.js?2TR" type="text/javascript"></script><meta name="application-name" content="品知人大" /> <meta name="msapplication-tooltip" content="品知人大" /> <meta name="msapplication-task" content="name=大杂烩;action-uri=http://bt.ruc6.edu.cn/b/portal.php;icon-uri=http://bt.ruc6.edu.cn/b/static/image/common/portal.ico" /><meta name="msapplication-task" content="name=品知人大;action-uri=http://bt.ruc6.edu.cn/b/forum.php;icon-uri=http://bt.ruc6.edu.cn/b/static/image/common/bbs.ico" /> <meta name="msapplication-task" content="name=群组;action-uri=http://bt.ruc6.edu.cn/b/group.php;icon-uri=http://bt.ruc6.edu.cn/b/static/image/common/group.ico" /><meta name="msapplication-task" content="name=家园;action-uri=http://bt.ruc6.edu.cn/b/home.php;icon-uri=http://bt.ruc6.edu.cn/b/static/image/common/home.ico" /><link rel="alternate" type="application/rss+xml" title="品知人大 - " href="http://bt.ruc6.edu.cn/b/forum.php?mod=rss&fid=33&amp;auth=0" /> <script src="static/js/forum.js?2TR" type="text/javascript"></script> </head> <body id="nv_forum" class="pg_forumdisplay" onkeydown="if(event.keyCode==27) return false;"> <div id="append_parent"></div><div id="ajaxwaitid"></div> <div id="toptb" class="cl"> <div class="wp"> <div class="z"></div> <div class="y"> </div> </div> </div> <div id="qmenu_menu" class="p_pop blk" style="display: none;"> <div class="ptm pbw hm"> 请 <a href="javascript:;" class="xi2" onclick="lsSubmit()"><strong>登录</strong></a> 后使用快捷导航<br />没有帐号?<a href="member.php?mod=register.php" class="xi2 xw1">注册帐号</a> </div> </div> <div id="hd"> <div class="wp"> <div class="hdc cl"><h2><a href="http://bt.ruc6.edu.cn" title="品知人大"><img src="static/image/common/logo.gif" alt="品知人大" border="0" /></a></h2> <script src="static/js/logging.js?2TR" type="text/javascript"></script> <form method="post" autocomplete="off" id="lsform" action="member.php?mod=logging&amp;action=login&amp;loginsubmit=yes&amp;infloat=yes&amp;lssubmit=yes" onsubmit="return lsSubmit()"> <div class="fastlg cl"> <span id="return_ls" style="display:none"></span> <div class="y pns"> <table cellspacing="0" cellpadding="0"> <tr> <td><label for="ls_username">帐号</label></td> <td><input type="text" name="username" id="ls_username" class="px vm xg1" value="UID/用户名/Email" onfocus="if(this.value == 'UID/用户名/Email'){this.value = '';this.className = 'px vm';}" onblur="if(this.value == ''){this.value = 'UID/用户名/Email';this.className = 'px vm xg1';}" tabindex="901" /></td> <td class="fastlg_l"><label for="ls_cookietime"><input type="checkbox" name="cookietime" id="ls_cookietime" class="pc" value="2592000" tabindex="903" />自动登录</label></td> <td>&nbsp;<a href="javascript:;" onclick="showWindow('login', 'member.php?mod=logging&action=login&viewlostpw=1')">找回密码</a></td> </tr> <tr> <td><label for="ls_password">密码</label></td> <td><input type="password" name="password" id="ls_password" class="px vm" autocomplete="off" tabindex="902" /></td> <td class="fastlg_l"><button type="submit" class="pn vm" tabindex="904" style="width: 75px;"><em>登录</em></button></td> <td>&nbsp;<a href="member.php?mod=register.php" class="xi2 xw1">注册帐号</a></td> </tr> </table> <input type="hidden" name="quickforward" value="yes" /> <input type="hidden" name="handlekey" value="ls" /> </div> </div> </form> </div> <div id="nv"> <a href="javascript:;" id="qmenu" onMouseOver="showMenu({'ctrlid':'qmenu','pos':'34!','ctrlclass':'a','duration':2});">快捷导航</a> <ul><li class="a" id="mn_Nddeb" ><a href="http://bt.ruc6.edu.cn/" hidefocus="true" >品知首页</a></li><li id="mn_portal" ><a href="portal.php" hidefocus="true" title="Portal" >大杂烩<span>Portal</span></a></li><li id="mn_Na6dd" ><a href="../browse.php" hidefocus="true" >资源列表</a></li><li id="mn_N5c1a" ><a href="../upload.php" hidefocus="true" >发布资源</a></li><li id="mn_home" ><a href="home.php" hidefocus="true" title="Space" >家园<span>Space</span></a></li><li id="mn_group" ><a href="group.php" hidefocus="true" title="Group" >群组<span>Group</span></a></li><li id="mn_N1447" ><a href="http://www.daoiqi.com/iptv6.html" hidefocus="true" >IPv6电视</a></li><li id="mn_N0259" onmouseover="showMenu({'ctrlid':this.id,'ctrlclass':'hover','duration':2})"><a href="http://bt.ruc6.edu.cn" hidefocus="true" >排行榜</a></li><li id="mn_Ne008" ><a href="search.php" hidefocus="true" >搜索</a></li><li id="mn_N974d" ><a href="forum-7-1.html" hidefocus="true" target="_blank" >帮助</a></li></ul> </div> <ul class="p_pop h_pop" id="plugin_menu" style="display: none"> <li><a id="mn_plink_sign" href="plugin.php?id=dsu_paulsign:sign">每日签到</a></li> </ul> <ul class="p_pop h_pop" id="mn_N0259_menu" style="display: none"><li><a href="../topten.php?type=user" hidefocus="true" >BT排行榜</a></li><li><a href="misc.php?mod=ranklist" hidefocus="true" >BBS排行榜</a></li><li><a href="plugin.php?id=dsu_paulsign:sign" hidefocus="true" >签到排行榜</a></li></ul><div id="mu" class="cl"> </div><div id="scbar" class="cl"> <form id="scbar_form" method="post" autocomplete="off" onsubmit="searchFocus($('scbar_txt'))" action="search.php?searchsubmit=yes" target="_blank"> <input type="hidden" name="mod" id="scbar_mod" value="search" /> <input type="hidden" name="formhash" value="f8ed5426" /> <input type="hidden" name="srchtype" value="title" /> <input type="hidden" name="srhfid" value="33" /> <input type="hidden" name="srhlocality" value="forum::forumdisplay" /> <table cellspacing="0" cellpadding="0"> <tr> <td class="scbar_icon_td"></td> <td class="scbar_txt_td"><input type="text" name="srchtxt" id="scbar_txt" value="请输入搜索内容" autocomplete="off" /></td> <td class="scbar_type_td"><a href="javascript:;" id="scbar_type" class="showmenu xg1 xs2" onclick="showMenu(this.id)" hidefocus="true">搜索</a></td> <td class="scbar_btn_td"><button type="submit" name="searchsubmit" id="scbar_btn" class="pn pnc" value="true"><strong class="xi2 xs2">搜索</strong></button></td> <td class="scbar_hot_td"> <div id="scbar_hot"> </div> </td> </tr> </table> </form> </div> <ul id="scbar_type_menu" class="p_pop" style="display: none;"><li><a href="javascript:;" rel="curforum" class="curtype">本版</a></li><li><a href="javascript:;" rel="user">用户</a></li></ul> <script type="text/javascript"> initSearchmenu('scbar'); </script> </div> </div> <div id="wp" class="wp"><style id="diy_style" type="text/css"></style> <!--[diy=diynavtop]--><div id="diynavtop" class="area"></div><!--[/diy]--> <div id="pt" class="bm cl"> <div class="z"> <a href="./" class="nvhm" title="首页">品知人大</a> <em>&rsaquo;</em> <a href="forum.php">品知人大</a> <em>&rsaquo;</em> <a href="forum.php?gid=1">信息分享</a><em>&rsaquo;</em> <a href="forum-33-1.html">交易市场</a></div> </div><div class="wp"> <!--[diy=diy1]--><div id="diy1" class="area"></div><!--[/diy]--> </div> <div class="boardnav"> <div id="ct" class="wp cl"> <div class="mn"> <div class="bm bml pbn"> <img src="data/attachment/common/18/common_33_banner.jpg" alt="交易市场" /><div class="bm_h cl"> <span class="y"> <a href="home.php?mod=spacecp&amp;ac=favorite&amp;type=forum&amp;id=33&amp;handlekey=favoriteforum" id="a_favorite" class="fa_fav" onclick="showWindow(this.id, this.href, 'get', 0);">收藏本版</a> <span class="pipe">|</span><a href="forum.php?mod=rss&amp;fid=33&amp;auth=0" class="fa_rss" target="_blank" title="RSS">订阅</a> </span> <h1 class="xs2"> <a href="forum-33-1.html">交易市场</a> <span class="xs1 xw0 i">今日: <strong class="xi1">5</strong><span class="pipe">|</span>主题: <strong class="xi1">48553</strong></span></h1> </div> <div class="bm_c cl pbn"> <div>版主: <span class="xi2"><a href="home.php?mod=space&username=%E5%87%89%E6%84%8F" class="notabs" c="1">凉意</a>, <a href="home.php?mod=space&username=%E6%9D%A8%E5%B0%8F%E5%8C%97" class="notabs" c="1">杨小北</a>, <a href="home.php?mod=space&username=Ironman33" class="notabs" c="1">Ironman33</a>, <a href="home.php?mod=space&username=Chee_Lao" class="notabs" c="1">Chee_Lao</a></span></div></div> </div> <div class="drag"> <!--[diy=diy4]--><div id="diy4" class="area"></div><!--[/diy]--> </div> <div id="pgt" class="bm bw0 pgs cl"> <div class="pg"><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=1" class="first">1 ...</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=120" class="prev">&nbsp;&nbsp;</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=117">117</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=118">118</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=119">119</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=120">120</a><strong>121</strong><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=122">122</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=123">123</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=124">124</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=750" class="last">... 750</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=122" class="nxt">下一页</a></div><span class="pgb y" ><a href="forum.php">返&nbsp;回</a></span> <a href="javascript:;" id="newspecial" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})" onclick="showWindow('newthread', 'forum.php?mod=post&action=newthread&fid=33')" title="发新帖"><img src="static/image/common/pn_post.png" alt="发新帖" /></a></div><ul id="thread_types" class="ttp bm cl"> <li id="ttp_all" ><a href="forum-33-1.html">全部</a></li> <li class="xw1 a"><a href="forum-33-1.html">出售</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=typeid&amp;typeid=73">求购</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=typeid&amp;typeid=310">自创物品</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=typeid&amp;typeid=273">租房</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=typeid&amp;typeid=75">交易完成</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=typeid&amp;typeid=76">咨询交流</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=typeid&amp;typeid=360">代购自营</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=typeid&amp;typeid=77">版务公告</a></li> </ul> <script type="text/javascript">showTypes('thread_types');</script> <div id="threadlist" class="tl bm bmw"> <div class="th"> <table cellspacing="0" cellpadding="0"> <tr> <th colspan="2"> <div class="tf"> <span id="atarget" onclick="setatarget(1)" class="y" title="在新窗口中打开帖子">新窗</span> 筛选: <a id="filter_special" href="javascript:;" class="showmenu xi2" onclick="showMenu(this.id)"> 全部主题</a> <a id="filter_dateline" href="javascript:;" class="showmenu xi2" onclick="showMenu(this.id)"> 全部时间</a> 排序: <a id="filter_orderby" href="javascript:;" class="showmenu xi2" onclick="showMenu(this.id)"> 最后发表</a><span class="pipe">|</span><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=digest&amp;digest=1&typeid=74" class="xi2">精华</a><span class="pipe">|</span><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=recommend&amp;orderby=recommends&amp;recommend=1&typeid=74" class="xi2">推荐</a></div> </th> <td class="by">作者</td> <td class="num">回复/查看</td> <td class="by">最后发表</td> </tr> </table> </div> <div class="bm_c"> <script type="text/javascript">var lasttime = 1473963021;</script> <div id="forumnew" style="display:none"></div> <form method="post" autocomplete="off" name="moderate" id="moderate" action="forum.php?mod=topicadmin&amp;action=moderate&amp;fid=33&amp;infloat=yes&amp;nopost=yes"> <input type="hidden" name="formhash" value="f8ed5426" /> <input type="hidden" name="listextra" value="page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" /> <table summary="forum_33" id="forum_33" cellspacing="0" cellpadding="0"> <tbody id="separatorline" class="emptb"><tr><td class="icn"></td><th></th><td class="by"></td><td class="num"></td><td class="by"></td></tr></tbody> <tbody id="normalthread_218043"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=218043&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=218043&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >施华洛世奇 手镯</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=108114" c="1">会有那么一天</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=218043&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">1</a><em>123</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E4%BC%9A%E6%9C%89%E9%82%A3%E4%B9%88%E4%B8%80%E5%A4%A9" c="1">会有那么一天</a></cite> <em><a href="forum.php?mod=redirect&tid=218043&goto=lastpost#lastpost">2016-3-15 20:30:20</a></em> </td> </tr> </tbody> <tbody id="normalthread_218042"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=218042&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=218042&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >施华洛世奇</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=108114" c="1">会有那么一天</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=218042&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">1</a><em>72</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E4%BC%9A%E6%9C%89%E9%82%A3%E4%B9%88%E4%B8%80%E5%A4%A9" c="1">会有那么一天</a></cite> <em><a href="forum.php?mod=redirect&tid=218042&goto=lastpost#lastpost">2016-3-15 20:28:19</a></em> </td> </tr> </tbody> <tbody id="normalthread_218039"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=218039&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=218039&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【兰蔻香水】 【护肤品】全新未用乳液、洗面奶甩~~</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=45559" c="1">fslamer</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=218039&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">1</a><em>93</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=fslamer" c="1">fslamer</a></cite> <em><a href="forum.php?mod=redirect&tid=218039&goto=lastpost#lastpost">2016-3-15 20:26:46</a></em> </td> </tr> </tbody> <tbody id="normalthread_218041"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=218041&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=218041&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >施华洛世奇</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=108114" c="1">会有那么一天</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=218041&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">4</a><em>97</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E4%BC%9A%E6%9C%89%E9%82%A3%E4%B9%88%E4%B8%80%E5%A4%A9" c="1">会有那么一天</a></cite> <em><a href="forum.php?mod=redirect&tid=218041&goto=lastpost#lastpost">2016-3-15 20:25:42</a></em> </td> </tr> </tbody> <tbody id="normalthread_218021"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=218021&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=218021&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【钱包】Rebeccaminkoff中长款钱包</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=53643" c="1">evelynnn</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=218021&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">2</a><em>217</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=evelynnn" c="1">evelynnn</a></cite> <em><a href="forum.php?mod=redirect&tid=218021&goto=lastpost#lastpost">2016-3-15 19:32:34</a></em> </td> </tr> </tbody> <tbody id="normalthread_217997"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217997&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217997&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【化妆师】资生堂嘉美艳容露</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=43978" c="1">福尔猫斯</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217997&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>55</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E7%A6%8F%E5%B0%94%E7%8C%AB%E6%96%AF" c="1">福尔猫斯</a></cite> <em><a href="forum.php?mod=redirect&tid=217997&goto=lastpost#lastpost">2016-3-15 16:27:47</a></em> </td> </tr> </tbody> <tbody id="normalthread_217219"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217219&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217219&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【西门外钢琴课次数】转让西门外硕士林钢琴课次数(6.10)</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=106808" c="1">tamarahxg</a></cite> <em><span>2016-3-9</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217219&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">6</a><em>102</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=tamarahxg" c="1">tamarahxg</a></cite> <em><a href="forum.php?mod=redirect&tid=217219&goto=lastpost#lastpost">2016-3-15 14:48:11</a></em> </td> </tr> </tbody> <tbody id="normalthread_217807"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217807&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217807&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【施华洛世奇项链】【自行车】【柔肤水】研三学姐甩卖 ~~</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=45559" c="1">fslamer</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217807&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">12</a><em>432</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=fslamer" c="1">fslamer</a></cite> <em><a href="forum.php?mod=redirect&tid=217807&goto=lastpost#lastpost">2016-3-15 13:12:04</a></em> </td> </tr> </tbody> <tbody id="normalthread_217969"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217969&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217969&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【各种日需品】清北BBS团购版版主牵头~清北人三校联合团购版~扫二维码查看</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=103319" c="1">xiaomaomi1</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217969&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>78</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=xiaomaomi1" c="1">xiaomaomi1</a></cite> <em><a href="forum.php?mod=redirect&tid=217969&goto=lastpost#lastpost">2016-3-15 12:50:53</a></em> </td> </tr> </tbody> <tbody id="normalthread_217726"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217726&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217726&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【iPadmini】校友出售几个iPadmini,仅850RMB,可小刀,速戳!</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=14335" c="1">澄心糖</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217726&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">2</a><em>404</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E8%80%B3%E6%9C%B5%E6%89%93%E9%B8%A3" c="1">耳朵打鸣</a></cite> <em><a href="forum.php?mod=redirect&tid=217726&goto=lastpost#lastpost">2016-3-15 12:42:16</a></em> </td> </tr> </tbody> <tbody id="normalthread_217955"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217955&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217955&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【春季美衣】低价出售春季美衣啦!</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=50812" c="1">旁边有一罐雪碧</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217955&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">1</a><em>111</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E6%97%81%E8%BE%B9%E6%9C%89%E4%B8%80%E7%BD%90%E9%9B%AA%E7%A2%A7" c="1">旁边有一罐雪碧</a></cite> <em><a href="forum.php?mod=redirect&tid=217955&goto=lastpost#lastpost">2016-3-15 10:29:46</a></em> </td> </tr> </tbody> <tbody id="normalthread_217291"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217291&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217291&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【交易完成】</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=41114" c="1">judy917</a></cite> <em><span>2016-3-10</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217291&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">1</a><em>117</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=452170217" c="1">452170217</a></cite> <em><a href="forum.php?mod=redirect&tid=217291&goto=lastpost#lastpost">2016-3-15 10:21:37</a></em> </td> </tr> </tbody> <tbody id="normalthread_217948"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217948&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217948&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【CFA】2016CFA 1级 notes复印版</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=22571" c="1">zhoushi11</a></cite> <em><span>2016-3-15</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217948&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>63</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=zhoushi11" c="1">zhoushi11</a></cite> <em><a href="forum.php?mod=redirect&tid=217948&goto=lastpost#lastpost">2016-3-15 09:51:41</a></em> </td> </tr> </tbody> <tbody id="normalthread_217708"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217708&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217708&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【衣服】大四学姐一宿舍毕业清系列:四季美衣1元起!155-170尺码多~</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=217708&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a><a href="forum.php?mod=viewthread&tid=217708&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=3">3</a><a href="forum.php?mod=viewthread&tid=217708&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=4">4</a><a href="forum.php?mod=viewthread&tid=217708&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=5">5</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=34795" c="1">jianglw</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217708&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">63</a><em>1784</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=jianglw" c="1">jianglw</a></cite> <em><a href="forum.php?mod=redirect&tid=217708&goto=lastpost#lastpost">2016-3-14 23:30:56</a></em> </td> </tr> </tbody> <tbody id="normalthread_216634"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=216634&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=216634&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【考研书籍】2016年法学家考研全套,考研英语,司考书籍,要考法学院的研的快来</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=36417" c="1">墨墨。</a></cite> <em><span>2016-3-5</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=216634&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">8</a><em>112</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E5%A2%A8%E5%A2%A8%E3%80%82" c="1">墨墨。</a></cite> <em><a href="forum.php?mod=redirect&tid=216634&goto=lastpost#lastpost">2016-3-14 21:38:18</a></em> </td> </tr> </tbody> <tbody id="normalthread_217893"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217893&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217893&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【书/衣服/帽子/饰品】教材白衬衫裙子毛衣等,毕业季清宿舍,半卖半送啦,快来捡白菜!</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=37051" c="1">ivyivyboom</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217893&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>145</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=ivyivyboom" c="1">ivyivyboom</a></cite> <em><a href="forum.php?mod=redirect&tid=217893&goto=lastpost#lastpost">2016-3-14 20:27:50</a></em> </td> </tr> </tbody> <tbody id="normalthread_214863"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=214863&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=214863&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【护肤品/化妆品】兰蔻/fresh/倩碧/kiss me 师姐含泪低价出闲置化妆品护肤品 九成新 保证正品!</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=45347" c="1">大TT</a></cite> <em><span>2016-2-24</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=214863&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">9</a><em>373</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E5%BD%BC%E5%B0%94%E7%BB%B4%E5%8D%8E" c="1">彼尔维华</a></cite> <em><a href="forum.php?mod=redirect&tid=214863&goto=lastpost#lastpost">2016-3-14 19:38:21</a></em> </td> </tr> </tbody> <tbody id="normalthread_217742"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217742&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217742&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【新鞋】女鞋38码 vans万斯/clarks其乐/热风</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=58762" c="1">懒虫芳美人</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217742&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">9</a><em>444</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=ldl526232454" c="1">ldl526232454</a></cite> <em><a href="forum.php?mod=redirect&tid=217742&goto=lastpost#lastpost">2016-3-14 17:56:47</a></em> </td> </tr> </tbody> <tbody id="normalthread_217656"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217656&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217656&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【Dolly Wink/Cow牛牌/柳屋杏仁/妮维雅蓝罐】一大波注意是一大波小饰品、护肤品、化妆品、日用品来啦</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=2164" c="1">七真如</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217656&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">3</a><em>302</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E4%B8%83%E7%9C%9F%E5%A6%82" c="1">七真如</a></cite> <em><a href="forum.php?mod=redirect&tid=217656&goto=lastpost#lastpost">2016-3-14 16:03:11</a></em> </td> </tr> </tbody> <tbody id="normalthread_217857"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217857&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217857&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【足球】全新未拆封正品 阿迪达斯桑巴荣耀 F82193 5号足球 2014世界杯</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=55834" c="1">Sophie_meow</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217857&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>43</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=Sophie_meow" c="1">Sophie_meow</a></cite> <em><a href="forum.php?mod=redirect&tid=217857&goto=lastpost#lastpost">2016-3-14 15:32:48</a></em> </td> </tr> </tbody> <tbody id="normalthread_217856"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217856&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217856&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【男生西装】全新亮面银灰色纯棉双扣西装套装 178/78 XL</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=55834" c="1">Sophie_meow</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217856&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>33</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=Sophie_meow" c="1">Sophie_meow</a></cite> <em><a href="forum.php?mod=redirect&tid=217856&goto=lastpost#lastpost">2016-3-14 15:29:48</a></em> </td> </tr> </tbody> <tbody id="normalthread_217855"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217855&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217855&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【Calvin Klein正品女包】</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=55193" c="1">qaz</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217855&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>272</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=qaz" c="1">qaz</a></cite> <em><a href="forum.php?mod=redirect&tid=217855&goto=lastpost#lastpost">2016-3-14 15:27:05</a></em> </td> </tr> </tbody> <tbody id="normalthread_217851"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217851&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217851&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【化妆品】闲置化妆品 全是专柜货 白菜价出</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=55834" c="1">Sophie_meow</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217851&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>173</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=Sophie_meow" c="1">Sophie_meow</a></cite> <em><a href="forum.php?mod=redirect&tid=217851&goto=lastpost#lastpost">2016-3-14 15:15:35</a></em> </td> </tr> </tbody> <tbody id="normalthread_217698"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217698&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217698&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【自行车】已售出</a> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=217698&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a><a href="forum.php?mod=viewthread&tid=217698&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=3">3</a><a href="forum.php?mod=viewthread&tid=217698&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=4">4</a><a href="forum.php?mod=viewthread&tid=217698&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=5">5</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=20900" c="1">双语彩色插图本</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217698&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">69</a><em>1103</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=gdworkshop" c="1">gdworkshop</a></cite> <em><a href="forum.php?mod=redirect&tid=217698&goto=lastpost#lastpost">2016-3-14 15:10:42</a></em> </td> </tr> </tbody> <tbody id="normalthread_217530"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217530&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217530&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【美美哒衣服、包包】姑娘,遛弯吗?那就快来看看嘛!新增价格~</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=217530&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=33637" c="1">莫失莫忘</a></cite> <em><span>2016-3-12</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217530&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">23</a><em>638</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=Yonni" c="1">Yonni</a></cite> <em><a href="forum.php?mod=redirect&tid=217530&goto=lastpost#lastpost">2016-3-14 15:08:14</a></em> </td> </tr> </tbody> <tbody id="normalthread_217845"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217845&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217845&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【国考资料】2016国考笔试面试资料低价出售,130+上岸哦!</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=14476" c="1">yi_xiaozhong</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217845&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>36</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=yi_xiaozhong" c="1">yi_xiaozhong</a></cite> <em><a href="forum.php?mod=redirect&tid=217845&goto=lastpost#lastpost">2016-3-14 14:53:22</a></em> </td> </tr> </tbody> <tbody id="normalthread_215040"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=215040&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=215040&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【蜂蜜】在干燥的春天里,快来喝点蜂蜜滋养一下吧!师姐老家自产的蜂蜜,纯天然,无添加!【长期有效】</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=105084" c="1">小宇宙的钱袋</a></cite> <em><span>2016-2-25</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=215040&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">8</a><em>175</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E5%B0%8F%E5%AE%87%E5%AE%99%E7%9A%84%E9%92%B1%E8%A2%8B" c="1">小宇宙的钱袋</a></cite> <em><a href="forum.php?mod=redirect&tid=215040&goto=lastpost#lastpost">2016-3-14 14:50:45</a></em> </td> </tr> </tbody> <tbody id="normalthread_217089"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217089&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217089&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【生活杂物/护肤品/礼品】持续更新~</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=50075" c="1">初见eranthe</a></cite> <em><span>2016-3-8</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217089&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">14</a><em>382</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E5%88%9D%E8%A7%81eranthe" c="1">初见eranthe</a></cite> <em><a href="forum.php?mod=redirect&tid=217089&goto=lastpost#lastpost">2016-3-14 14:31:19</a></em> </td> </tr> </tbody> <tbody id="normalthread_215589"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=215589&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=215589&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【粉底】资生堂粉底液</a> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=215589&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=45151" c="1">璐瑶</a></cite> <em><span>2016-2-28</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=215589&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">23</a><em>406</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E7%92%90%E7%91%B6" c="1">璐瑶</a></cite> <em><a href="forum.php?mod=redirect&tid=215589&goto=lastpost#lastpost">2016-3-14 12:42:25</a></em> </td> </tr> </tbody> <tbody id="normalthread_217812"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217812&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217812&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【司考课程】独角兽vip保过班学习机会及资料等你来抢!</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=34322" c="1">qiyuannn</a></cite> <em><span>2016-3-14</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217812&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">2</a><em>23</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=qiyuannn" c="1">qiyuannn</a></cite> <em><a href="forum.php?mod=redirect&tid=217812&goto=lastpost#lastpost">2016-3-14 11:32:51</a></em> </td> </tr> </tbody> <tbody id="normalthread_215325"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=215325&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=215325&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >[保健品]转一瓶澳洲Blackmores月见草 调节内分泌 190粒~不再为姨妈和痘痘犯愁~戳进来~</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=215325&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=54896" c="1">木子isabel</a></cite> <em><span>2016-2-27</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=215325&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">16</a><em>241</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E6%9C%A8%E5%AD%90isabel" c="1">木子isabel</a></cite> <em><a href="forum.php?mod=redirect&tid=215325&goto=lastpost#lastpost">2016-3-14 11:30:21</a></em> </td> </tr> </tbody> <tbody id="normalthread_217771"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217771&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217771&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >白色小龟王电动车</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=27331" c="1">RUC大心脏</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217771&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">2</a><em>194</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=michelle_j" c="1">michelle_j</a></cite> <em><a href="forum.php?mod=redirect&tid=217771&goto=lastpost#lastpost">2016-3-14 11:09:06</a></em> </td> </tr> </tbody> <tbody id="normalthread_215130"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=215130&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=215130&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【托业资料】七本资料好好复习就妥妥的啦~~~</a> <img src="static/image/filetype/common.gif" alt="attachment" title="附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=53075" c="1">默柚柚子君</a></cite> <em><span>2016-2-26</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=215130&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">6</a><em>162</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E9%BB%98%E6%9F%9A%E6%9F%9A%E5%AD%90%E5%90%9B" c="1">默柚柚子君</a></cite> <em><a href="forum.php?mod=redirect&tid=215130&goto=lastpost#lastpost">2016-3-14 09:17:37</a></em> </td> </tr> </tbody> <tbody id="normalthread_217766"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217766&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217766&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【鞋子】 tory burch经典款黑色金扣小羊皮芭蕾舞鞋 reva 正品</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=47660" c="1">融化老虎的黄油</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217766&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">2</a><em>159</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E8%9E%8D%E5%8C%96%E8%80%81%E8%99%8E%E7%9A%84%E9%BB%84%E6%B2%B9" c="1">融化老虎的黄油</a></cite> <em><a href="forum.php?mod=redirect&tid=217766&goto=lastpost#lastpost">2016-3-13 23:43:14</a></em> </td> </tr> </tbody> <tbody id="normalthread_217780"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217780&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217780&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【Fendi钱包、肩颈按摩器、Acne衬衫、首饰】出一些个人闲置,换点流动性(截止4月底春假前)</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=53739" c="1">Zoewww</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217780&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">1</a><em>167</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=Zoewww" c="1">Zoewww</a></cite> <em><a href="forum.php?mod=redirect&tid=217780&goto=lastpost#lastpost">2016-3-13 23:06:35</a></em> </td> </tr> </tbody> <tbody id="normalthread_217769"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217769&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217769&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >[化妆品]兰芝隔离(绿色)只用过几次90出~</a> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=67623" c="1">周Cathy</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217769&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">0</a><em>155</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E5%91%A8Cathy" c="1">周Cathy</a></cite> <em><a href="forum.php?mod=redirect&tid=217769&goto=lastpost#lastpost">2016-3-13 22:16:32</a></em> </td> </tr> </tbody> <tbody id="normalthread_217760"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217760&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/folder_new.gif" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217760&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【书籍】雅思口语、写作、剑桥雅思,5元一本,半卖半送</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=23072" c="1">lzy0_0</a></cite> <em><span>2016-3-13</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217760&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">3</a><em>85</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E4%BA%BA%E5%A4%A7%E7%BF%BB%E8%AF%91%E6%B3%A2" c="1">人大翻译波</a></cite> <em><a href="forum.php?mod=redirect&tid=217760&goto=lastpost#lastpost">2016-3-13 21:21:37</a></em> </td> </tr> </tbody> <tbody id="normalthread_217257"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217257&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217257&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【衣服、鞋子】简单出一些冬季春季的衣服腾地方,主简洁风格</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=217257&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=45591" c="1">酸菜彩球鱼</a></cite> <em><span>2016-3-9</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217257&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">17</a><em>736</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=bbklan" c="1">bbklan</a></cite> <em><a href="forum.php?mod=redirect&tid=217257&goto=lastpost#lastpost">2016-3-13 20:28:37</a></em> </td> </tr> </tbody> <tbody id="normalthread_216972"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=216972&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=216972&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【女鞋】大四师姐一宿舍毕业清系列一之四季美鞋篇,1元起!全新非全新都在出,会分开说明的!欢迎来宿舍试穿</a> <img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle" /> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=216972&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=34795" c="1">jianglw</a></cite> <em><span>2016-3-8</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=216972&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">26</a><em>716</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=jianglw" c="1">jianglw</a></cite> <em><a href="forum.php?mod=redirect&tid=216972&goto=lastpost#lastpost">2016-3-13 20:11:46</a></em> </td> </tr> </tbody> <tbody id="normalthread_217077"> <tr> <td class="icn"> <a href="forum.php?mod=viewthread&amp;tid=217077&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" title="商品 - 有新回复 - 新窗口打开" target="_blank"> <img src="static/image/common/tradesmall.gif" alt="商品" /> </a> </td> <th class="new"> <em>[<a href="forum.php?mod=forumdisplay&fid=33&amp;filter=typeid&amp;typeid=74">出售</a>]</em> <a href="forum.php?mod=viewthread&amp;tid=217077&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" onclick="atarget(this)" class="xst" >【化妆品/衣服/鞋/书/杂物】the saem面膜、暗疮水、帆布鞋、四级单词、衣服、保温杯垫……|清宿舍啦!!!</a> <span class="tps">&nbsp;...<a href="forum.php?mod=viewthread&tid=217077&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74&amp;page=2">2</a></span> </th> <td class="by"> <cite> <a href="home.php?mod=space&amp;uid=57171" c="1">檬萌热带鱼</a></cite> <em><span>2016-3-8</span></em> </td> <td class="num"><a href="forum.php?mod=viewthread&amp;tid=217077&amp;extra=page%3D121%26filter%3Dtypeid%26typeid%3D74%26typeid%3D74" class="xi2">19</a><em>446</em></td> <td class="by"> <cite><a href="home.php?mod=space&username=%E9%80%86%E8%A2%AD" c="1">逆袭</a></cite> <em><a href="forum.php?mod=redirect&tid=217077&goto=lastpost#lastpost">2016-3-13 19:56:53</a></em> </td> </tr> </tbody> </table><!-- end of table "forum_G[fid]" branch 1/3 --> </form> </div> </div> <div id="filter_special_menu" class="p_pop" style="display:none" change="location.href='forum.php?mod=forumdisplay&fid=33&filter='+$('filter_special').value"> <ul> <li><a href="forum-33-1.html">全部主题</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=specialtype&amp;specialtype=trade&typeid=74">商品</a></li><li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=specialtype&amp;specialtype=reward&typeid=74">悬赏</a></li></ul> </div> <div id="filter_dateline_menu" class="p_pop" style="display:none"> <ul> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;orderby=lastpost&amp;filter=dateline&typeid=74">全部时间</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;orderby=lastpost&amp;filter=dateline&amp;dateline=86400&typeid=74">一天</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;orderby=lastpost&amp;filter=dateline&amp;dateline=172800&typeid=74">两天</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;orderby=lastpost&amp;filter=dateline&amp;dateline=604800&typeid=74">一周</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;orderby=lastpost&amp;filter=dateline&amp;dateline=2592000&typeid=74">一个月</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;orderby=lastpost&amp;filter=dateline&amp;dateline=7948800&typeid=74">三个月</a></li> </ul> </div> <div id="filter_orderby_menu" class="p_pop" style="display:none"> <ul> <li><a href="forum-33-1.html">默认排序</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=author&amp;orderby=dateline&typeid=74">发帖时间</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=reply&amp;orderby=replies&typeid=74">回复/查看</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=reply&amp;orderby=views&typeid=74">查看</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=lastpost&amp;orderby=lastpost&typeid=74">最后发表</a></li> <li><a href="forum.php?mod=forumdisplay&amp;fid=33&amp;filter=heat&amp;orderby=heats">热门</a></li> <ul> </div> <div class="bm bw0 pgs cl"> <div class="pg"><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=1" class="first">1 ...</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=120" class="prev">&nbsp;&nbsp;</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=117">117</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=118">118</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=119">119</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=120">120</a><strong>121</strong><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=122">122</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=123">123</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=124">124</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=750" class="last">... 750</a><a href="forum.php?mod=forumdisplay&fid=33&filter=typeid&typeid=74&amp;page=122" class="nxt">下一页</a></div><span class="pgb y"><a href="forum.php">返&nbsp;回</a></span> <a href="javascript:;" id="newspecialtmp" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})" onclick="showWindow('newthread', 'forum.php?mod=post&action=newthread&fid=33')" title="发新帖"><img src="static/image/common/pn_post.png" alt="发新帖" /></a></div><!--[diy=diyfastposttop]--><div id="diyfastposttop" class="area"></div><!--[/diy]--> <!--[diy=diyforumdisplaybottom]--><div id="diyforumdisplaybottom" class="area"></div><!--[/diy]--> </div> </div> </div> <script type="text/javascript">document.onkeyup = function(e){keyPageScroll(e, 1, 1, 'forum.php?mod=forumdisplay&fid=33&filter=typeid&orderby=lastpost&typeid=74&', 121);}</script> <div class="wp mtn"> <!--[diy=diy3]--><div id="diy3" class="area"></div><!--[/diy]--> </div> </div> <div id="ft" class="wp cl"> <div id="flk" class="y"> <p><a href="http://bt.ruc6.edu.cn/b/forum.php?mod=viewthread&tid=3633" >关于品知</a><span class="pipe">|</span><a href="forum.php?mobile=yes" >移动版品知</a><span class="pipe">|</span><a href="http://bt.ruc6.edu.cn/b/forum.php?mod=viewthread&tid=1300" >广告服务</a><span class="pipe">|</span><a href="http://bt.ruc6.edu.cn/b/forum.php?mod=viewthread&tid=2628" >联系我们</a><span class="pipe">|</span><a href="http://weibo.com/rendabt" target="_blank" >官方微博</a><span class="pipe">|</span><strong><a href="" target="_blank">品知人大</a></strong> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-20235669-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fd6490066e6c9bcb0c7dab4b6f6a1a1b9' type='text/javascript'%3E%3C/script%3E")); </script> </p> <p class="xs0"> GMT+8, 2016-9-16 02:10<span id="debuginfo"> , Processed in 0.042058 second(s), 3 queries , Memcache On. </span> </p> </div> <div id="frt"> <p>Powered by <a href="http://www.discuz.net" target="_blank">Discuz!</a> <em>X2</em></p> <p class="xs0">&copy; 2010-2016 <a href="http://bt.ruc6.edu.cn" target="_blank">Pinzhi Team</a> Version: 4.0</p> </div></script> </div> <div id="g_upmine_menu" class="tip tip_3" style="display:none;"> <div class="tip_c"> 积分 0, 距离下一级还需 积分 </div> <div class="tip_horn"></div> </div> <script src="home.php?mod=misc&ac=sendmail&rand=1473963021" type="text/javascript"></script> <span id="scrolltop" onclick="window.scrollTo('0','0')">回顶部</span> <script type="text/javascript">_attachEvent(window, 'scroll', function(){showTopLink();});</script> </body> </html>
57.331646
1,136
0.703377
14afe4c445d984e86d629b64c3cd6c8fab3f3d6b
29,716
kt
Kotlin
korge/src/commonMain/kotlin/com/soywiz/korge/render/BatchBuilder2D.kt
lokeshsharma97/korge
a4b4af0df846b55fed53a21085cf5e7a8a1e4505
[ "Apache-2.0" ]
null
null
null
korge/src/commonMain/kotlin/com/soywiz/korge/render/BatchBuilder2D.kt
lokeshsharma97/korge
a4b4af0df846b55fed53a21085cf5e7a8a1e4505
[ "Apache-2.0" ]
null
null
null
korge/src/commonMain/kotlin/com/soywiz/korge/render/BatchBuilder2D.kt
lokeshsharma97/korge
a4b4af0df846b55fed53a21085cf5e7a8a1e4505
[ "Apache-2.0" ]
null
null
null
@file:UseExperimental(KorgeInternal::class) package com.soywiz.korge.render import com.soywiz.kds.* import com.soywiz.kds.iterators.* import com.soywiz.klogger.* import com.soywiz.kmem.* import com.soywiz.korag.* import com.soywiz.korag.shader.* import com.soywiz.korge.internal.* import com.soywiz.korge.view.* import com.soywiz.korim.bitmap.* import com.soywiz.korim.color.* import com.soywiz.korio.async.* import com.soywiz.korma.geom.* import kotlin.jvm.* import kotlin.math.* import kotlin.native.concurrent.* @SharedImmutable private val logger = Logger("BatchBuilder2D") /** * Allows to draw quads and sprites buffering the geometry to limit the draw batches executed calling [AG] (Accelerated Graphics). * This class handles a vertex structure of: x, y, u, v, colorMul, colorAdd. Allowing to draw texturized and tinted primitives. * * You should call: [drawQuad], [drawQuadFast], [drawNinePatch], [drawVertices] for buffering the geometries. * * For performance the actual drawing/rendering doesn't happen until the [flush] method is called (normally that happens automatically). * Then the engine will call [flush] when required, automatically once the buffer is filled, at the end of the frame, or when [RenderContext.flush] is executed * by other renderers. */ // @TODO: We could dynamically select a fragment shader based on the number of textures to reduce the numbers of IFs per pixel class BatchBuilder2D constructor( @KorgeInternal val ctx: RenderContext, /** Maximum number of quads that could be drawn in a single batch. * Bigger numbers will increase memory usage, but might reduce the number of batches per frame when using the same texture and properties. */ val reqMaxQuads: Int = DEFAULT_BATCH_QUADS, ) { val maxQuads: Int = min(reqMaxQuads, MAX_BATCH_QUADS) val texManager = ctx.agBitmapTextureManager constructor(ag: AG, maxQuads: Int = DEFAULT_BATCH_QUADS) : this(RenderContext(ag), maxQuads) val ag: AG = ctx.ag init { logger.trace { "BatchBuilder2D[0]" } ctx.flushers.add { flush() } } var flipRenderTexture = true //var flipRenderTexture = false val maxQuadsMargin = maxQuads + 9 /** Maximum number of vertices that can be buffered here in a single batch. It depens on the [maxQuads] parameter */ val maxVertices = maxQuads * 4 /** Maximum number of indices that can be buffered here in a single batch. It depens on the [maxQuads] parameter */ val maxIndices = maxQuads * 6 init { logger.trace { "BatchBuilder2D[1]" } } @PublishedApi internal val vertices = FBuffer.alloc(6 * 4 * maxVertices) @PublishedApi internal val verticesTexIndex = ByteArray(maxVertices) @PublishedApi internal val indices = FBuffer.alloc(2 * maxIndices) //@PublishedApi internal val indices = ShortArray(maxIndices) //internal val vertices = FBuffer.allocNoDirect(6 * 4 * maxVertices) //internal val indices = FBuffer.allocNoDirect(2 * maxIndices) val indicesI16 = indices.i16 //val indicesI16 = indices private val verticesI32 = vertices.i32 private val verticesF32 = vertices.f32 private val verticesData = vertices.data internal val verticesFast32 = vertices.fast32 init { logger.trace { "BatchBuilder2D[2]" } } @PublishedApi internal var _vertexCount = 0 var vertexCount: Int get() = _vertexCount internal set(value) { _vertexCount = value } @PublishedApi internal var vertexPos = 0 @PublishedApi internal var indexPos = 0 @PublishedApi internal var currentTexIndex = 0 @PublishedApi internal var currentTexN: Array<AG.Texture?> = Array(BB_MAX_TEXTURES) { null } //@PublishedApi internal var currentTex0: AG.Texture? = null //@PublishedApi internal var currentTex1: AG.Texture? = null @PublishedApi internal var currentSmoothing: Boolean = false @PublishedApi internal var currentBlendFactors: AG.Blending = BlendMode.NORMAL.factors @PublishedApi internal var currentProgram: Program? = null init { logger.trace { "BatchBuilder2D[3]" } } private val vertexBuffer = ag.createVertexBuffer() private val texIndexVertexBuffer = ag.createVertexBuffer() private val indexBuffer = ag.createIndexBuffer() init { logger.trace { "BatchBuilder2D[4]" } } /** The current stencil state. If you change it, you must call the [flush] method to ensure everything has been drawn. */ var stencil = AG.StencilState() init { logger.trace { "BatchBuilder2D[5]" } } /** The current color mask state. If you change it, you must call the [flush] method to ensure everything has been drawn. */ var colorMask = AG.ColorMaskState() init { logger.trace { "BatchBuilder2D[6]" } } /** The current scissor state. If you change it, you must call the [flush] method to ensure everything has been drawn. */ var scissor: AG.Scissor? = null private val identity = Matrix() init { logger.trace { "BatchBuilder2D[7]" } } private val ptt1 = Point() private val ptt2 = Point() private val pt1 = Point() private val pt2 = Point() private val pt3 = Point() private val pt4 = Point() private val pt5 = Point() private val pt6 = Point() private val pt7 = Point() private val pt8 = Point() init { logger.trace { "BatchBuilder2D[8]" } } private val projMat = Matrix3D() private val texTransformMat = Matrix3D() @KorgeInternal val viewMat = Matrix3D() init { logger.trace { "BatchBuilder2D[9]" } } val textureUnitN = Array(BB_MAX_TEXTURES) { AG.TextureUnit(null, linear = false) } //@KorgeInternal val textureUnit0 = AG.TextureUnit(null, linear = false) //@KorgeInternal val textureUnit1 = AG.TextureUnit(null, linear = false) init { logger.trace { "BatchBuilder2D[10]" } } // @TODO: kotlin-native crash: [1] 80122 segmentation fault ./sample1-native.kexe //private val uniforms = mapOf<Uniform, Any>( // DefaultShaders.u_ProjMat to projMat, // DefaultShaders.u_Tex to textureUnit //) @KorgeInternal val uniforms by lazy { AG.UniformValues( DefaultShaders.u_ProjMat to projMat, DefaultShaders.u_ViewMat to viewMat, *Array(BB_MAX_TEXTURES) { u_TexN[it] to textureUnitN[it] }, *Array(BB_MAX_TEXTURES) { DefaultShaders.u_TexTransformMatN[it] to texTransformMat } ) } init { logger.trace { "BatchBuilder2D[11]" } } fun readVertices(): List<VertexInfo> = (0 until vertexCount).map { readVertex(it) } fun readVertex(n: Int, out: VertexInfo = VertexInfo()): VertexInfo { out.read(this.vertices, n) val source = textureUnitN[0].texture?.source out.texWidth = source?.width ?: -1 out.texHeight = source?.height ?: -1 return out } // @TODO: copy data from TexturedVertexArray fun addVertex(x: Float, y: Float, u: Float, v: Float, colorMul: RGBA, colorAdd: ColorAdd, texIndex: Int = currentTexIndex) { vertexPos += _addVertex(verticesFast32, vertexPos, x, y, u, v, colorMul.value, colorAdd.value, texIndex) vertexCount++ } fun _addVertex(vd: Fast32Buffer, vp: Int, x: Float, y: Float, u: Float, v: Float, colorMul: Int, colorAdd: Int, texIndex: Int = currentTexIndex): Int { vd.setF(vp + 0, x) vd.setF(vp + 1, y) vd.setF(vp + 2, u) vd.setF(vp + 3, v) vd.setI(vp + 4, colorMul) vd.setI(vp + 5, colorAdd) verticesTexIndex[vp / 6] = texIndex.toByte() //println("texIndex.toByte()=${texIndex.toByte()}") return TEXTURED_ARRAY_COMPONENTS_PER_VERTEX } inline fun addIndex(idx: Int) { indicesI16[indexPos++] = idx.toShort() } inline fun addIndexRelative(idx: Int) { indicesI16[indexPos++] = (vertexCount + idx).toShort() } private fun _addIndices(indicesI16: Int16Buffer, pos: Int, i0: Int, i1: Int, i2: Int, i3: Int, i4: Int, i5: Int): Int { indicesI16[pos + 0] = i0.toShort() indicesI16[pos + 1] = i1.toShort() indicesI16[pos + 2] = i2.toShort() indicesI16[pos + 3] = i3.toShort() indicesI16[pos + 4] = i4.toShort() indicesI16[pos + 5] = i5.toShort() return 6 } /** * Draws/buffers a textured ([tex]) and colored ([colorMul] and [colorAdd]) quad with this shape: * * 0..1 * | | * 3..2 * * Vertices: * 0: [x0], [y0] (top left) * 1: [x1], [y1] (top right) * 2: [x2], [y2] (bottom right) * 3: [x3], [y3] (bottom left) */ fun drawQuadFast( x0: Float, y0: Float, x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float, tex: Texture, colorMul: RGBA, colorAdd: ColorAdd, texIndex: Int = currentTexIndex ) { drawQuadFast(x0, y0, x1, y1, x2, y2, x3, y3, tex.x0, tex.y0, tex.x1, tex.y1, colorMul, colorAdd, texIndex) } fun drawQuadFast( x0: Float, y0: Float, x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float, tx0: Float, ty0: Float, tx1: Float, ty1: Float, colorMul: RGBA, colorAdd: ColorAdd, texIndex: Int = currentTexIndex ) { ensure(6, 4) addQuadIndices() addQuadVerticesFastNormal(x0, y0, x1, y1, x2, y2, x3, y3, tx0, ty0, tx1, ty1, colorMul.value, colorAdd.value, texIndex) } @JvmOverloads fun addQuadIndices(vc: Int = vertexCount) { indexPos += _addIndices(indicesI16, indexPos, vc + 0, vc + 1, vc + 2, vc + 3, vc + 0, vc + 2) } fun addQuadIndicesBatch(batchSize: Int) { var vc = vertexCount var ip = indexPos val i16 = indicesI16 for (n in 0 until batchSize) { ip += _addIndices(i16, ip, vc + 0, vc + 1, vc + 2, vc + 3, vc + 0, vc + 2) vc += 4 } indexPos = ip vertexCount = vc } fun addQuadVerticesFastNormal( x0: Float, y0: Float, x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float, tx0: Float, ty0: Float, tx1: Float, ty1: Float, colorMul: Int, colorAdd: Int, texIndex: Int = currentTexIndex ) { vertexPos = _addQuadVerticesFastNormal(vertexPos, verticesFast32, x0, y0, x1, y1, x2, y2, x3, y3, tx0, ty0, tx1, ty1, colorMul, colorAdd, texIndex) vertexCount += 4 } fun _addQuadVerticesFastNormal( vp: Int, vd: Fast32Buffer, x0: Float, y0: Float, x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float, tx0: Float, ty0: Float, tx1: Float, ty1: Float, colorMul: Int, colorAdd: Int, texIndex: Int = currentTexIndex, ): Int { var vp = vp vp += _addVertex(vd, vp, x0, y0, tx0, ty0, colorMul, colorAdd, texIndex) vp += _addVertex(vd, vp, x1, y1, tx1, ty0, colorMul, colorAdd, texIndex) vp += _addVertex(vd, vp, x2, y2, tx1, ty1, colorMul, colorAdd, texIndex) vp += _addVertex(vd, vp, x3, y3, tx0, ty1, colorMul, colorAdd, texIndex) return vp } fun _addQuadVerticesFastNormalNonRotated( vp: Int, vd: Fast32Buffer, x0: Float, y0: Float, x1: Float, y1: Float, tx0: Float, ty0: Float, tx1: Float, ty1: Float, colorMul: Int, colorAdd: Int, texIndex: Int = currentTexIndex, ): Int { var vp = vp vp += _addVertex(vd, vp, x0, y0, tx0, ty0, colorMul, colorAdd, texIndex) vp += _addVertex(vd, vp, x1, y0, tx1, ty0, colorMul, colorAdd, texIndex) vp += _addVertex(vd, vp, x1, y1, tx1, ty1, colorMul, colorAdd, texIndex) vp += _addVertex(vd, vp, x0, y1, tx0, ty1, colorMul, colorAdd, texIndex) return vp } /** * Draws/buffers a set of textured and colorized array of vertices [array] with the current state previously set by calling [setStateFast]. */ fun drawVertices(array: TexturedVertexArray, matrix: Matrix?, vcount: Int = array.vcount, icount: Int = array.isize, texIndex: Int = currentTexIndex) { ensure(icount, vcount) val i16 = indicesI16 val ip = indexPos val vc = vertexCount val arrayIndices = array.indices val icount = min(icount, array.isize) arraycopy(arrayIndices, 0, i16, ip, icount) arrayadd(i16, vc.toShort(), ip, ip + icount) //for (n in 0 until icount) i16[ip + n] = (vc + arrayIndices[n]).toShort() val vp = vertexPos val src = array._data.i32 val dst = vertices.i32 arraycopy(src, 0, dst, vp, vcount * 6) //for (n in 0 until vcount * 6) dst[vp + n] = src[n] //println("texIndex=$texIndex") val vp6 = vertexPos / 6 arrayfill(verticesTexIndex, texIndex.toByte(), vp6, vp6 + vcount) if (matrix != null) { applyMatrix(matrix, vertexPos, vcount) } _vertexCount += vcount vertexPos += vcount * 6 indexPos += icount } private fun applyMatrix(matrix: Matrix, idx: Int, vcount: Int) { val f32 = vertices.f32 var idx = idx val ma = matrix.af val mb = matrix.bf val mc = matrix.cf val md = matrix.df val mtx = matrix.txf val mty = matrix.tyf for (n in 0 until vcount) { val x = f32[idx + 0] val y = f32[idx + 1] f32[idx + 0] = Matrix.transformXf(ma, mb, mc, md, mtx, mty, x, y) f32[idx + 1] = Matrix.transformYf(ma, mb, mc, md, mtx, mty, x, y) idx += VERTEX_INDEX_SIZE } } /** * Draws/buffers a set of textured and colorized array of vertices [array] with the specified texture [tex] and optionally [smoothing] it and an optional [program]. */ inline fun drawVertices(array: TexturedVertexArray, tex: Texture.Base, smoothing: Boolean, blendFactors: AG.Blending, vcount: Int = array.vcount, icount: Int = array.isize, program: Program? = null, matrix: Matrix? = null) { setStateFast(tex.base, smoothing, blendFactors, program) drawVertices(array, matrix, vcount, icount) } private fun checkAvailable(indices: Int, vertices: Int): Boolean { return (this.indexPos + indices < maxIndices) || (this.vertexPos + vertices < maxVertices) } fun ensure(indices: Int, vertices: Int) { if (!checkAvailable(indices, vertices)) flush() if (!checkAvailable(indices, vertices)) error("Too much vertices") } /** * Sets the current texture [tex], [smoothing], [blendFactors] and [program] that will be used by the following drawing calls not specifying these attributes. */ fun setStateFast(tex: Texture.Base, smoothing: Boolean, blendFactors: AG.Blending, program: Program?) = setStateFast(tex.base, smoothing, blendFactors, program) /** * Sets the current texture [tex], [smoothing], [blendFactors] and [program] that will be used by the following drawing calls not specifying these attributes. */ inline fun setStateFast(tex: AG.Texture?, smoothing: Boolean, blendFactors: AG.Blending, program: Program?) { val isCurrentStateFast = isCurrentStateFast(tex, smoothing, blendFactors, program) //println("isCurrentStateFast=$isCurrentStateFast, tex=$tex, currentTex=$currentTex, currentTex2=$currentTex2") if (isCurrentStateFast) return flush() currentTexIndex = 0 currentTexN[0] = tex currentSmoothing = smoothing currentBlendFactors = if (tex != null && tex.isFbo) blendFactors.toRenderFboIntoBack() else blendFactors currentProgram = program } fun hasTex(tex: AG.Texture?): Boolean { currentTexN.fastForEach { if (it === tex) return true } return false } @PublishedApi internal fun isCurrentStateFast(tex: AG.Texture?, smoothing: Boolean, blendFactors: AG.Blending, program: Program?): Boolean { var hasTex = hasTex(tex) if (currentTexN[0] !== null && !hasTex) { for (n in 1 until currentTexN.size) { if (currentTexN[n] === null) { currentTexN[n] = tex hasTex = true break } } } for (n in currentTexN.indices) { if (tex === currentTexN[n]) { currentTexIndex = n break } } return hasTex && (currentSmoothing == smoothing) && (currentBlendFactors === blendFactors) && (currentProgram === program) } fun setStateFast(tex: Bitmap, smoothing: Boolean, blendFactors: AG.Blending, program: Program?) { setStateFast(texManager.getTextureBase(tex), smoothing, blendFactors, program) } fun setStateFast(tex: BmpSlice, smoothing: Boolean, blendFactors: AG.Blending, program: Program?) { setStateFast(texManager.getTexture(tex).base, smoothing, blendFactors, program) } /** * Draws/buffers a 9-patch image with the texture [tex] at [x], [y] with the total size of [width] and [height]. * [posCuts] and [texCuts] are [Point] an array of 4 points describing ratios (values between 0 and 1) inside the width/height of the area to be drawn, * and the positions inside the texture. * * The 9-patch looks like this (dividing the image in 9 parts). * * 0--+-----+--+ * | | | | * |--1-----|--| * | |SSSSS| | * | |SSSSS| | * | |SSSSS| | * |--|-----2--| * | | | | * +--+-----+--3 * * 0: Top-left of the 9-patch * 1: Top-left part where scales starts * 2: Bottom-right part where scales ends * 3: Bottom-right of the 9-patch * * S: Is the part that is scaled. The other regions are not scaled. * * It uses the transform [m] matrix, with an optional [filtering] and [colorMul]/[colorAdd], [blendFactors] and [program] */ fun drawNinePatch( tex: Texture, x: Float = 0f, y: Float = 0f, width: Float = tex.width.toFloat(), height: Float = tex.height.toFloat(), posCuts: Array<Point>, texCuts: Array<Point>, m: Matrix = identity, filtering: Boolean = true, colorMul: RGBA = Colors.WHITE, colorAdd: ColorAdd = ColorAdd.NEUTRAL, blendFactors: AG.Blending = BlendMode.NORMAL.factors, program: Program? = null, ) { setStateFast(tex.base, filtering, blendFactors, program) val texIndex: Int = currentTexIndex ensure(indices = 6 * 9, vertices = 4 * 4) val p_o = pt1.setToTransform(m, ptt1.setTo(x, y)) val p_dU = pt2.setToSub(ptt1.setToTransform(m, ptt1.setTo(x + width, y)), p_o) val p_dV = pt3.setToSub(ptt1.setToTransform(m, ptt1.setTo(x, y + height)), p_o) val t_o = pt4.setTo(tex.x0, tex.y0) val t_dU = pt5.setToSub(ptt1.setTo(tex.x1, tex.y0), t_o) val t_dV = pt6.setToSub(ptt1.setTo(tex.x0, tex.y1), t_o) val start = vertexCount for (cy in 0 until 4) { val posCutY = posCuts[cy].y val texCutY = texCuts[cy].y for (cx in 0 until 4) { val posCutX = posCuts[cx].x val texCutX = texCuts[cx].x val p = pt7.setToAdd( p_o, ptt1.setToAdd( ptt1.setToMul(p_dU, posCutX), ptt2.setToMul(p_dV, posCutY) ) ) val t = pt8.setToAdd( t_o, ptt1.setToAdd( ptt1.setToMul(t_dU, texCutX), ptt2.setToMul(t_dV, texCutY) ) ) addVertex(p.x.toFloat(), p.y.toFloat(), t.x.toFloat(), t.y.toFloat(), colorMul, colorAdd, texIndex) } } for (cy in 0 until 3) { for (cx in 0 until 3) { // v0...v1 // . . // v2...v3 val v0 = start + cy * 4 + cx val v1 = v0 + 1 val v2 = v0 + 4 val v3 = v0 + 5 addIndex(v0) addIndex(v1) addIndex(v2) addIndex(v2) addIndex(v1) addIndex(v3) } } } /** * Draws a textured [tex] quad at [x], [y] and size [width]x[height]. * * It uses [m] transform matrix, an optional [filtering] and [colorMul], [colorAdd], [blendFactors] and [program] as state for drawing it. * * Note: To draw solid quads, you can use [Bitmaps.white] + [AgBitmapTextureManager] as texture and the [colorMul] as quad color. */ fun drawQuad( tex: Texture, x: Float = 0f, y: Float = 0f, width: Float = tex.width.toFloat(), height: Float = tex.height.toFloat(), m: Matrix = identity, filtering: Boolean = true, colorMul: RGBA = Colors.WHITE, colorAdd: ColorAdd = ColorAdd.NEUTRAL, blendFactors: AG.Blending = BlendMode.NORMAL.factors, program: Program? = null ) { val x0 = x val x1 = (x + width) val y0 = y val y1 = (y + height) setStateFast(tex.base, filtering, blendFactors, program) drawQuadFast( m.transformXf(x0, y0), m.transformYf(x0, y0), m.transformXf(x1, y0), m.transformYf(x1, y0), m.transformXf(x1, y1), m.transformYf(x1, y1), m.transformXf(x0, y1), m.transformYf(x0, y1), tex, colorMul, colorAdd ) } companion object { val DEFAULT_BATCH_QUADS = 4096 val MAX_BATCH_QUADS = 16383 init { logger.trace { "BatchBuilder2D.Companion[0]" } } @KorgeInternal val a_ColMul = DefaultShaders.a_Col @KorgeInternal val a_ColAdd = Attribute("a_Col2", VarType.Byte4, normalized = true) init { logger.trace { "BatchBuilder2D.Companion[1]" } } @KorgeInternal val v_ColMul = DefaultShaders.v_Col @KorgeInternal val v_ColAdd = Varying("v_Col2", VarType.Byte4) val a_TexIndex = Attribute("a_TexIndex", VarType.UByte1, normalized = false, precision = Precision.LOW) val v_TexIndex = Varying("v_TexIndex", VarType.Float1, precision = Precision.LOW) //val u_Tex0 = Uniform("u_Tex0", VarType.TextureUnit) val u_TexN = Array(BB_MAX_TEXTURES) { Uniform("u_Tex$it", VarType.TextureUnit) } //val u_Tex0 = DefaultShaders.u_Tex //val u_Tex1 = Uniform("u_Tex1", VarType.TextureUnit) init { logger.trace { "BatchBuilder2D.Companion[2]" } } @KorgeInternal val LAYOUT = VertexLayout(DefaultShaders.a_Pos, DefaultShaders.a_Tex, a_ColMul, a_ColAdd) @KorgeInternal val LAYOUT_TEX_INDEX = VertexLayout(a_TexIndex) @KorgeInternal val VERTEX = VertexShader { DefaultShaders.apply { SET(v_Tex, a_Tex) SET(v_TexIndex, a_TexIndex) SET(v_ColMul, a_ColMul) SET(v_ColAdd, a_ColAdd) SET(out, (u_ProjMat * u_ViewMat) * vec4(DefaultShaders.a_Pos, 0f.lit, 1f.lit)) } } init { logger.trace { "BatchBuilder2D.Companion[3]" } } private fun getShaderProgramIndex(premultiplied: Boolean, preadd: Boolean): Int { return 0.insert(premultiplied, 0).insert(preadd, 1) } private val FRAGMENTS = Array(4) { index -> val premultiplied = index.extractBool(0) val preadd = index.extractBool(1) buildTextureLookupFragment(premultiplied = premultiplied, preadd = preadd) } @KorgeInternal val FRAGMENT_PRE = FRAGMENTS[getShaderProgramIndex(premultiplied = true, preadd = false)] @KorgeInternal val FRAGMENT_NOPRE = FRAGMENTS[getShaderProgramIndex(premultiplied = false, preadd = false)] private val PROGRAMS = Array(4) { index -> val premultiplied = index.extractBool(0) val preadd = index.extractBool(1) Program( vertex = VERTEX, fragment = FRAGMENTS[index], name = "BatchBuilder2D.${if (premultiplied) "Premultiplied" else "NoPremultiplied"}.Tinted${if (preadd) ".Preadd" else ""}" ) } @KorgeInternal val PROGRAM_PRE = PROGRAMS[getShaderProgramIndex(true, false)] @KorgeInternal val PROGRAM_NOPRE = PROGRAMS[getShaderProgramIndex(false, false)] init { logger.trace { "BatchBuilder2D.Companion[4]" } } @KorgeInternal fun getTextureLookupProgram(premultiplied: Boolean, preadd: Boolean = false) = PROGRAMS[getShaderProgramIndex(premultiplied, preadd)] //val PROGRAM_NORMAL = Program( // vertex = VERTEX, // fragment = FragmentShader { // SET(out, texture2D(DefaultShaders.u_Tex, DefaultShaders.v_Tex["xy"])["rgba"] * v_Col2["rgba"]) // SET(out, out + v_Col2) // // Required for shape masks: // IF(out["a"] le 0f.lit) { DISCARD() } // }, // name = "BatchBuilder2D.Tinted" //) fun getTextureLookupFragment(premultiplied: Boolean, preadd: Boolean = false) = FRAGMENTS[getShaderProgramIndex(premultiplied, preadd)] /** * Builds a [FragmentShader] for textured and colored drawing that works matching if the texture is [premultiplied] */ @KorgeInternal fun buildTextureLookupFragment(premultiplied: Boolean, preadd: Boolean = false) = FragmentShader { DefaultShaders.apply { for (n in 0 until BB_MAX_TEXTURES) { IF(v_TexIndex eq (n.toFloat()).lit) { SET(out, texture2D(u_TexN[n], (u_TexTransformMatN[n] * vec4(v_Tex["xy"], 0f.lit, 1f.lit))["xy"])) } } if (premultiplied) { SET(out["rgb"], out["rgb"] / out["a"]) } // @TODO: Kotlin.JS bug? //SET(out, (out["rgba"] * v_ColMul["rgba"]) + ((v_ColAdd["rgba"] - vec4(.5f, .5f, .5f, .5f)) * 2f)) if (preadd) { SET(out, (clamp(out["rgba"] + ((BatchBuilder2D.v_ColAdd["rgba"] - vec4(.5f.lit, .5f.lit, .5f.lit, .5f.lit)) * 2f.lit), 0f.lit, 1f.lit) * BatchBuilder2D.v_ColMul["rgba"])) } else { SET(out, (out["rgba"] * v_ColMul["rgba"]) + ((v_ColAdd["rgba"] - vec4(.5f.lit, .5f.lit, .5f.lit, .5f.lit)) * 2f.lit)) } //SET(out, t_Temp1) // Required for shape masks: if (premultiplied) { IF(out["a"] le 0f.lit) { DISCARD() } } } } //init { println(PROGRAM_PRE.fragment.toGlSl()) } } private val tempRect = Rectangle() val beforeFlush = Signal<BatchBuilder2D>() val onInstanceCount = Signal<Int>() fun uploadVertices() { vertexBuffer.upload(vertices, 0, vertexPos * 4) texIndexVertexBuffer.upload(verticesTexIndex, 0, vertexPos / 6) } fun uploadIndices() { indexBuffer.upload(indices, 0, indexPos * 2) } private val vertexData = fastArrayListOf( AG.VertexData(vertexBuffer, LAYOUT), AG.VertexData(texIndexVertexBuffer, LAYOUT_TEX_INDEX), ) fun updateStandardUniforms() { if (flipRenderTexture && ag.renderingToTexture) { projMat.setToOrtho(tempRect.setBounds(0, ag.currentHeight, ag.currentWidth, 0), -1f, 1f) } else if (ag.flipRender) { projMat.setToOrtho(tempRect.setBounds(0, ag.currentHeight, ag.currentWidth, 0), -1f, 1f) } else { projMat.setToOrtho(tempRect.setBounds(0, 0, ag.currentWidth, ag.currentHeight), -1f, 1f) } for (n in 0 until BB_MAX_TEXTURES) { val textureUnit = textureUnitN[n] textureUnit.texture = currentTexN[n] textureUnit.linear = currentSmoothing } } /** When there are vertices pending, this performs a [AG.draw] call flushing all the buffered geometry pending to draw */ fun flush(uploadVertices: Boolean = true, uploadIndices: Boolean = true) { //println("vertexCount=${vertexCount}") if (vertexCount > 0) { updateStandardUniforms() //println("ORTHO: ${ag.backHeight.toFloat()}, ${ag.backWidth.toFloat()}") val factors = currentBlendFactors if (uploadVertices) uploadVertices() if (uploadIndices) uploadIndices() //println("MyUniforms: $uniforms") val realFactors = if (ag.renderingToTexture) factors.toRenderImageIntoFbo() else factors //println("RENDER: $realFactors") ag.drawV2( vertexData = vertexData, indices = indexBuffer, program = currentProgram ?: (if (currentTexN[0]?.premultiplied == true) PROGRAM_PRE else PROGRAM_NOPRE), //program = PROGRAM_PRE, type = AG.DrawType.TRIANGLES, vertexCount = indexPos, blending = realFactors, uniforms = uniforms, stencil = stencil, colorMask = colorMask, scissor = scissor ) beforeFlush(this) } vertexCount = 0 vertexPos = 0 indexPos = 0 for (n in 0 until BB_MAX_TEXTURES) currentTexN[n] = null currentTexIndex = 0 } /** * Executes [callback] while setting temporarily the view matrix to [matrix] */ inline fun setViewMatrixTemp(matrix: Matrix, crossinline callback: () -> Unit) { ctx.matrix3DPool.alloc { temp -> flush() temp.copyFrom(this.viewMat) this.viewMat.copyFrom(matrix) //println("viewMat: $viewMat, matrix: $matrix") try { callback() } finally { flush() this.viewMat.copyFrom(temp) } } } /** * Executes [callback] while setting temporarily an [uniform] to a [value] */ inline fun setTemporalUniform(uniform: Uniform, value: Any?, callback: () -> Unit) { val old = this.uniforms[uniform] this.uniforms.putOrRemove(uniform, value) try { callback() } finally { this.uniforms.putOrRemove(uniform, old) } } @PublishedApi internal val tempOldUniforms = AG.UniformValues() /** * Executes [callback] while setting temporarily a set of [uniforms] */ inline fun setTemporalUniforms(uniforms: AG.UniformValues, callback: () -> Unit) { flush() tempOldUniforms.setTo(this.uniforms) this.uniforms.put(uniforms) try { callback() } finally { flush() this.uniforms.setTo(tempOldUniforms) } } } //internal const val BB_MAX_TEXTURES = 6 internal const val BB_MAX_TEXTURES = 4 //internal const val BB_MAX_TEXTURES = 2
34.796253
228
0.629493
130067607e72061c8a87645ecef043cdd5833326
1,977
h
C
code_reading/oceanbase-master/src/observer/virtual_table/ob_agent_virtual_table.h
wangcy6/weekly_read
3a8837ee9cd957787ee1785e4066dd623e02e13a
[ "Apache-2.0" ]
null
null
null
code_reading/oceanbase-master/src/observer/virtual_table/ob_agent_virtual_table.h
wangcy6/weekly_read
3a8837ee9cd957787ee1785e4066dd623e02e13a
[ "Apache-2.0" ]
null
null
null
code_reading/oceanbase-master/src/observer/virtual_table/ob_agent_virtual_table.h
wangcy6/weekly_read
3a8837ee9cd957787ee1785e4066dd623e02e13a
[ "Apache-2.0" ]
1
2020-10-18T12:59:31.000Z
2020-10-18T12:59:31.000Z
/** * Copyright (c) 2021 OceanBase * OceanBase CE is licensed under Mulan PubL v2. * You can use this software according to the terms and conditions of the Mulan PubL v2. * You may obtain a copy of Mulan PubL v2 at: * http://license.coscl.org.cn/MulanPubL-2.0 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * See the Mulan PubL v2 for more details. */ #ifndef OCEANBASE_VIRTUAL_TABLE_OB_AGENT_VIRTUAL_TABLE_H_ #define OCEANBASE_VIRTUAL_TABLE_OB_AGENT_VIRTUAL_TABLE_H_ #include "lib/allocator/page_arena.h" #include "ob_agent_table_base.h" namespace oceanbase { namespace observer { // mysql mode system table access agent for oracle tenant. class ObAgentVirtualTable : public ObAgentTableBase { public: ObAgentVirtualTable(); virtual ~ObAgentVirtualTable(); int init(const uint64_t base_table_id, const bool sys_tenant_base_table, const share::schema::ObTableSchema* index_table, const ObVTableScanParam& scan_param, const bool only_sys_data); virtual int do_open() override; virtual int inner_get_next_row(common::ObNewRow*& row) override; private: virtual int set_convert_func(convert_func_t& func, const share::schema::ObColumnSchemaV2& col, const share::schema::ObColumnSchemaV2& base_col) override; virtual int init_non_exist_map_item(MapItem& item, const share::schema::ObColumnSchemaV2& col) override; virtual int add_extra_condition(common::ObSqlString& sql) override; int should_add_tenant_condition(bool& need, const uint64_t tenant_id) const; private: // id of simple agent tenant before switching to system tenant. uint64_t general_tenant_id_; bool only_sys_data_; DISALLOW_COPY_AND_ASSIGN(ObAgentVirtualTable); }; } // end namespace observer } // end namespace oceanbase #endif // OCEANBASE_VIRTUAL_TABLE_OB_AGENT_VIRTUAL_TABLE_H_
36.611111
118
0.78351
a4882fa2028db0ec6b23dd2f34c1229313c303a6
105
asm
Assembly
data/mcp/asm/prog_07_07.asm
colinw7/CZ80
458e83ffdca23dcfc92e78de9b802219a85f059a
[ "MIT" ]
null
null
null
data/mcp/asm/prog_07_07.asm
colinw7/CZ80
458e83ffdca23dcfc92e78de9b802219a85f059a
[ "MIT" ]
null
null
null
data/mcp/asm/prog_07_07.asm
colinw7/CZ80
458e83ffdca23dcfc92e78de9b802219a85f059a
[ "MIT" ]
null
null
null
0D00 2A 00 0E 0D03 ED 5B 02 0E 0D07 19 0D08 22 04 0E 0D0B DF 5B 0E00 38 0E01 4A 0E02 F8 0E03 2A 0E04 00
8.75
16
0.72381
6145bbe0101b6aa797d77c269b31c02aa9a26ad2
1,311
kt
Kotlin
app/src/main/java/no/sintef/fiskinfo/model/fishingfacility/ToolTypeCode.kt
erlendstav/FiskInfo3
6045b1551166ce87852434e670b45241e4c4b0d2
[ "Apache-2.0" ]
null
null
null
app/src/main/java/no/sintef/fiskinfo/model/fishingfacility/ToolTypeCode.kt
erlendstav/FiskInfo3
6045b1551166ce87852434e670b45241e4c4b0d2
[ "Apache-2.0" ]
null
null
null
app/src/main/java/no/sintef/fiskinfo/model/fishingfacility/ToolTypeCode.kt
erlendstav/FiskInfo3
6045b1551166ce87852434e670b45241e4c4b0d2
[ "Apache-2.0" ]
null
null
null
/** * Copyright (C) 2020 SINTEF * * 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 no.sintef.fiskinfo.model.fishingfacility import android.content.Context import com.google.gson.annotations.SerializedName import no.sintef.fiskinfo.R enum class ToolTypeCode(val code : String, val stringResource : Int) { @SerializedName("NETS") NETS("NETS", R.string.tool_type_code_nets), @SerializedName("LONGLINE") LONGLINE("LONGLINE", R.string.tool_type_code_longline), @SerializedName("CRABPOT") CRABPOT("CRABPOT", R.string.tool_type_code_crabpot), @SerializedName("DANPURSEINE") DANPURSEINE("DANPURSEINE", R.string.tool_type_code_danpurseine); fun getLocalizedName(context : Context):String { return context.resources.getString(stringResource) } }
32.775
75
0.743707
1243ce95d39aee10943f8e84d4076b30aa22e5ff
564
h
C
src/components/src/core/CameraComponent.h
walter-strazak/chimarrao
b4c9f9d726eb5e46d61b33e10b7579cc5512cd09
[ "MIT" ]
6
2021-04-20T10:32:29.000Z
2021-06-05T11:48:56.000Z
src/components/src/core/CameraComponent.h
walter-strazak/chimarrao
b4c9f9d726eb5e46d61b33e10b7579cc5512cd09
[ "MIT" ]
1
2021-05-18T21:00:12.000Z
2021-06-02T07:59:03.000Z
src/components/src/core/CameraComponent.h
walter-strazak/chimarrao
b4c9f9d726eb5e46d61b33e10b7579cc5512cd09
[ "MIT" ]
3
2020-09-12T08:54:04.000Z
2021-04-17T11:16:36.000Z
#pragma once #include "Component.h" #include "Rect.h" #include "RendererPool.h" namespace components::core { class CameraComponent : public Component { public: CameraComponent(ComponentOwner* owner, std::shared_ptr<graphics::RendererPool> rendererPool, utils::FloatRect mapRect, bool blockCameraOnRightSide = true); void lateUpdate(utils::DeltaTime time, const input::Input& input) override; private: std::shared_ptr<graphics::RendererPool> rendererPool; utils::FloatRect mapRect; const bool blockCameraOnRightSide; }; }
25.636364
96
0.739362
5e89f301fb2691b86cbfcb8be7651798de80b315
831
sql
SQL
bbs/sql/bbs_bias_xp1.sql
masseelch/Better-Balanced-Game
27e20c232abc1be7756f70b699271ec497bab641
[ "Apache-2.0", "MIT" ]
9
2020-10-31T16:39:55.000Z
2021-06-22T15:12:34.000Z
bbs/sql/bbs_bias_xp1.sql
masseelch/Better-Balanced-Game
27e20c232abc1be7756f70b699271ec497bab641
[ "Apache-2.0", "MIT" ]
2
2020-12-16T00:28:51.000Z
2021-08-08T21:13:28.000Z
1958135962/sql/bbs_bias_xp1.sql
57fan/Civ6-BBS
1ef4fc2072c22c77a6261ccd3dd9cf2efad49666
[ "Apache-2.0" ]
10
2020-11-16T10:34:05.000Z
2022-03-29T21:25:05.000Z
------------------------------------------------------------------------------ -- FILE: bbg_bias_xp1.sql -- AUTHOR: D. / Jack The Narrator -- PURPOSE: Database modifications by new BBS ------------------------------------------------------------------------------ -- Tier 1 = most impactful, Tier 5 = least impactful INSERT OR IGNORE INTO StartBiasNegatives (CivilizationType, FeatureType, Tier) VALUES ('CIVILIZATION_NETHERLANDS', 'FEATURE_FLOODPLAINS', 5), ('CIVILIZATION_NETHERLANDS', 'FEATURE_FLOODPLAINS_PLAINS', 5), ('CIVILIZATION_NETHERLANDS', 'FEATURE_FLOODPLAINS_GRASSLAND', 5), ('CIVILIZATION_MAPUCHE', 'FEATURE_FLOODPLAINS', 1), ('CIVILIZATION_MAPUCHE', 'FEATURE_FLOODPLAINS_PLAINS', 1), ('CIVILIZATION_MAPUCHE', 'FEATURE_FLOODPLAINS_GRASSLAND', 1);
41.55
78
0.569194
82afc0851cdc65508178d97a56599a905c088b01
2,089
sql
SQL
sinotopia-pay-migration/scripts/20170513135908_add_table_rp_account_check_batch.sql
sinotopia/sinotopia-pay
c4790ee7398951c221ef95d4f7bd4eb4fef42d4c
[ "Apache-2.0" ]
null
null
null
sinotopia-pay-migration/scripts/20170513135908_add_table_rp_account_check_batch.sql
sinotopia/sinotopia-pay
c4790ee7398951c221ef95d4f7bd4eb4fef42d4c
[ "Apache-2.0" ]
null
null
null
sinotopia-pay-migration/scripts/20170513135908_add_table_rp_account_check_batch.sql
sinotopia/sinotopia-pay
c4790ee7398951c221ef95d4f7bd4eb4fef42d4c
[ "Apache-2.0" ]
null
null
null
-- -- Copyright 2010-2016 the original author or authors. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- // add table rp_account_check_batch -- Migration SQL that makes the change goes here. CREATE TABLE `rp_account_check_batch` ( id VARCHAR(50) NOT NULL, version INT UNSIGNED NOT NULL, create_time DATETIME NOT NULL, editor VARCHAR(100) COMMENT '修改者', creator VARCHAR(100) COMMENT '创建者', edit_time DATETIME COMMENT '最后修改时间', status VARCHAR(30) NOT NULL, remark VARCHAR(500), batch_no VARCHAR(30) NOT NULL, bill_date DATE NOT NULL, bill_type VARCHAR(30), handle_status VARCHAR(10), bank_type VARCHAR(30), mistake_count INT(8), unhandle_mistake_count INT(8), trade_count INT(8), bank_trade_count INT(8), trade_amount DECIMAL(20, 6), bank_trade_amount DECIMAL(20, 6), refund_amount DECIMAL(20, 6), bank_refund_amount DECIMAL(20, 6), bank_fee DECIMAL(20, 6), org_check_file_path VARCHAR(500), release_check_file_path VARCHAR(500), release_status VARCHAR(15), check_fail_msg VARCHAR(300), bank_err_msg VARCHAR(300), PRIMARY KEY (id) ) COMMENT = 'account_check_batch'; -- //@UNDO -- SQL to undo the change goes here. DROP TABLE IF EXISTS `rp_account_check_batch`;
36.649123
78
0.615606
3e4c3473a84899ba6eeb823eeb4662bb8a6aad8b
5,294
c
C
tools/tpm2_createpolicy.c
asac/tpm2-tools
8e3c266f4de942ae6ab1bfbe0cb947ce36237746
[ "BSD-3-Clause" ]
1
2020-11-03T21:27:05.000Z
2020-11-03T21:27:05.000Z
tools/tpm2_createpolicy.c
braincorp/tpm2-tools
b9c8108561237a344b063e9c45e5353dc9114276
[ "BSD-3-Clause" ]
1
2019-10-31T13:13:04.000Z
2019-10-31T13:13:04.000Z
tools/tpm2_createpolicy.c
braincorp/tpm2-tools
b9c8108561237a344b063e9c45e5353dc9114276
[ "BSD-3-Clause" ]
null
null
null
/* SPDX-License-Identifier: BSD-3-Clause */ #include <stdbool.h> #include <stdlib.h> #include "files.h" #include "log.h" #include "pcr.h" #include "tpm2_alg_util.h" #include "tpm2_policy.h" #include "tpm2_tool.h" //Records the type of policy and if one is selected typedef struct { bool policy_pcr; } policy_type; //Common policy options typedef struct tpm2_common_policy_options tpm2_common_policy_options; struct tpm2_common_policy_options { tpm2_session *policy_session; // policy session TPM2_SE policy_session_type; // TPM2_SE_TRIAL or TPM2_SE_POLICY TPM2B_DIGEST *policy_digest; // buffer to hold policy digest TPMI_ALG_HASH policy_digest_hash_alg; // hash alg of final policy digest char *policy_file; // filepath for the policy digest bool policy_file_flag; // if policy file input has been given policy_type policy_type; const char *context_file; }; //pcr policy options typedef struct tpm2_pcr_policy_options tpm2_pcr_policy_options; struct tpm2_pcr_policy_options { char *raw_pcrs_file; // filepath of input raw pcrs file TPML_PCR_SELECTION pcr_selections; // records user pcr selection per setlist }; typedef struct create_policy_ctx create_policy_ctx; struct create_policy_ctx { tpm2_common_policy_options common_policy_options; tpm2_pcr_policy_options pcr_policy_options; }; #define TPM2_COMMON_POLICY_INIT { \ .policy_session = NULL, \ .policy_session_type = TPM2_SE_TRIAL, \ .policy_digest = NULL, \ .policy_digest_hash_alg = TPM2_ALG_SHA256, \ } static create_policy_ctx pctx = { .common_policy_options = TPM2_COMMON_POLICY_INIT }; static tool_rc parse_policy_type_specific_command(ESYS_CONTEXT *ectx) { if (!pctx.common_policy_options.policy_type.policy_pcr) { LOG_ERR("Only PCR policy is currently supported!"); return tool_rc_option_error; } tpm2_session_data *session_data =tpm2_session_data_new( pctx.common_policy_options.policy_session_type); if (!session_data) { LOG_ERR("oom"); return tool_rc_general_error; } tpm2_session_set_authhash(session_data, pctx.common_policy_options.policy_digest_hash_alg); tpm2_session **s = &pctx.common_policy_options.policy_session; tool_rc rc = tpm2_session_open(ectx, session_data, s); if (rc != tool_rc_success) { return rc; } rc = tpm2_policy_build_pcr(ectx, pctx.common_policy_options.policy_session, pctx.pcr_policy_options.raw_pcrs_file, &pctx.pcr_policy_options.pcr_selections); if (rc != tool_rc_success) { LOG_ERR("Could not build pcr policy"); return rc; } rc = tpm2_policy_get_digest(ectx, pctx.common_policy_options.policy_session, &pctx.common_policy_options.policy_digest); if (rc != tool_rc_success) { LOG_ERR("Could not build tpm policy"); return rc; } return tpm2_policy_tool_finish(ectx, pctx.common_policy_options.policy_session, pctx.common_policy_options.policy_file); } static bool on_option(char key, char *value) { switch (key) { case 'L': pctx.common_policy_options.policy_file_flag = true; pctx.common_policy_options.policy_file = value; break; case 'f': pctx.pcr_policy_options.raw_pcrs_file = value; break; case 'g': pctx.common_policy_options.policy_digest_hash_alg = tpm2_alg_util_from_optarg(value, tpm2_alg_util_flags_hash); if (pctx.common_policy_options.policy_digest_hash_alg == TPM2_ALG_ERROR) { LOG_ERR("Invalid choice for policy digest hash algorithm"); return false; } break; case 'l': if (!pcr_parse_selections(value, &pctx.pcr_policy_options.pcr_selections)) { return false; } break; case 0: pctx.common_policy_options.policy_type.policy_pcr = true; break; case 1: pctx.common_policy_options.policy_session_type = TPM2_SE_POLICY; break; } return true; } bool tpm2_tool_onstart(tpm2_options **opts) { const struct option topts[] = { { "policy", required_argument, NULL, 'L' }, { "policy-algorithm", required_argument, NULL, 'g' }, { "pcr-list", required_argument, NULL, 'l' }, { "pcr", required_argument, NULL, 'f' }, { "policy-pcr", no_argument, NULL, 0 }, { "policy-session", no_argument, NULL, 1 }, }; *opts = tpm2_options_new("L:g:l:f:", ARRAY_LEN(topts), topts, on_option, NULL, 0); return *opts != NULL; } tool_rc tpm2_tool_onrun(ESYS_CONTEXT *ectx, tpm2_option_flags flags) { UNUSED(flags); if (pctx.common_policy_options.policy_file_flag == false && pctx.common_policy_options.policy_session_type == TPM2_SE_TRIAL) { LOG_ERR("Provide the file name to store the resulting " "policy digest"); return tool_rc_option_error; } return parse_policy_type_specific_command(ectx); } void tpm2_onexit(void) { free(pctx.common_policy_options.policy_digest); }
30.959064
80
0.672082
9befc913bd0bf161dbc144c42b25dfd546f8249a
6,479
js
JavaScript
routes/events.js
michshi/wardogs
cbd922321134d4f3ae3fd6f5c85913e962772742
[ "MIT" ]
null
null
null
routes/events.js
michshi/wardogs
cbd922321134d4f3ae3fd6f5c85913e962772742
[ "MIT" ]
79
2018-04-13T20:50:24.000Z
2018-04-27T18:59:10.000Z
routes/events.js
ericmbudd/wardogs
cbd922321134d4f3ae3fd6f5c85913e962772742
[ "MIT" ]
3
2018-04-28T16:09:47.000Z
2018-07-13T17:01:58.000Z
const express = require('express') const router = express.Router() const knex = require('../knex') const jwt = require('jsonwebtoken') const bcrypt = require('bcrypt') const nodemailer = require('nodemailer'); const verifyEvent = (req, res, next) => { const { id } = req.params knex('events') .where('id', id) .then(event => { if (event.length === 0) res.status(404).send(`No event found with id ${id}`) else { res.locals.host_id = event[0].owner_id next() } }) } const getOwnerEvents = (req, res, next) => { console.log("getOwnerEvents") //res.status(200).send() const users_id = jwt.verify(req.cookies.token, process.env.JWT_KEY).id knex('events') .where('owner_id', users_id) .then(events => { res.status(200).send(events) }) .catch((err) => { next(err) }) } const getJoinedEvents = (req, res, next) => { console.log("getJoinedEvents") //res.status(200).send() const users_id = jwt.verify(req.cookies.token, process.env.JWT_KEY).id knex('events_users') .where('users_id', users_id) .join('events', 'events_users.events_id', 'events.id') .then(events => { res.status(200).send(events) }) .catch((err) => { next(err) }) } const verifyJoined = (req, res, next) => { if (!req.cookies.token) next() const events_id = req.params.id const users_id = jwt.verify(req.cookies.token, process.env.JWT_KEY).id res.locals.registered = false; knex('events_users') .where({ events_id, users_id }) .then(match => { if (match.length > 0) { res.locals.registered = true; next() } else next() }) } const verifyUserEvent = (req, res, next) => { const events_id = req.body.eventId const users_id = jwt.verify(req.cookies.token, process.env.JWT_KEY).id res.locals.registered = false; knex('events_users') .where({ events_id, users_id }) .then(match => { if (match.length > 0) { res.locals.registered = true next() } else next() }) } const getEvents = (req, res, next) => { const { id } = req.params if (id) { knex('events') .where('events.id', id) .innerJoin('users', 'events.owner_id', 'users.id') .first() .then(event => { res.status(200).send(event) }) .catch(err => { next(err) }) } else { knex('events') .then(events => { res.status(200).send(events) }) .catch((err) => { next(err) }) } } const postEvent = (req, res, next) => { const { owner_id, title, location, start_date_time, duration_minutes, description } = req.body const newEvent = { 'owner_id': owner_id, 'title': title, 'location': location, 'start_date_time': start_date_time, 'duration_minutes': duration_minutes, 'description': description } knex('events') .insert(newEvent) .returning(['id', 'title', 'location', 'start_date_time', 'duration_minutes', 'description']) .then(event => { res.status(200).send(event) }) .catch(err => { next(err) }) } const toggleJoinEvent = (req, res, next) => { const events_id = req.body.eventId const users_id = jwt.verify(req.body.userToken, process.env.JWT_KEY).id if (res.locals.registered) { knex('events_users') .where({ events_id, users_id }) .del() .returning('*') .then(entry => { res.status(200).send(res.locals.registered) }) .catch(err => { next(err) }) } else { knex('events_users') .insert({ events_id, users_id }) .returning('*') .then(entry => { res.status(200).send(res.locals.registered) next() }) .catch(err => { next(err) }) } } const emailEventHostOnJoin = (req, res, next) => { console.log("emailEventHostOnJoin"); console.log(res.locals.host_id); const user = jwt.verify(req.cookies.token, process.env.JWT_KEY) knex('users') .where({ id: res.locals.host_id, }) //.del() .then(host => { console.log("user", host); console.log("host.email_address", host[0].email_address); //res.status(200).send(host) let transporter = nodemailer.createTransport({ service: 'gmail', auth: { user: 'rocky.mntn.pols@gmail.com', pass: '********' } }) let mailOptions = { from: 'rocky.mntn.pols@gmail.com', to: host[0].email_address, subject: 'Sending Email using Node.js', text: 'That was easy!' } transporter.sendMail(mailOptions, function(error, info) { if (error) { console.log(error); } else { console.log('Email sent: ' + info.response); } }) }) .catch(err => { next(err) }) } const updateEvent = (req, res, next) => { const { id } = req.params const { owner_id, title, location, start_date_time, duration_minutes, description } = req.body knex('events') .where('id', id) .update({ title, location, start_date_time, duration_minutes, description }) .returning('*') .then(event => { res.status(200).send(event[0]) }) .catch(err => { next(err) }) } const deleteEvent = (req, res, next) => { const { id } = req.params knex('events') .where('id', id) .del() .returning('*') .then(event => { res.status(200).send(event[0]) }) .catch(err => { next(err) }) } const renderEventPage = (req, res, next) => { let registered = "Join Event" let buttonClass = "btn-success" if (res.locals.registered) { registered = "Leave Event" buttonClass = "btn-danger" } res.render('events', { title: 'Event Detail', registered: registered, buttonClass: buttonClass }) } router.get('/', getEvents) router.get('/owner/', getOwnerEvents) router.get('/joined/', getJoinedEvents) router.get('/:id', verifyEvent, verifyJoined, renderEventPage) router.get('/data/:id', verifyEvent, getEvents) router.post('/', postEvent) router.post('/:id', verifyEvent, verifyUserEvent, toggleJoinEvent) router.patch('/:id', verifyEvent, updateEvent) router.delete('/:id', verifyEvent, deleteEvent) module.exports = router
21.382838
97
0.566754
fb974938113c78fa248efc0dfb10a465a7065e24
1,884
java
Java
hollow/src/main/java/com/netflix/hollow/core/HollowBlobOptionalPartHeader.java
BOSS-code/hollow
804114d468072f1cf6d303cda28fae20f41ca503
[ "Apache-2.0" ]
1,103
2016-12-03T06:17:22.000Z
2022-03-30T15:56:16.000Z
hollow/src/main/java/com/netflix/hollow/core/HollowBlobOptionalPartHeader.java
BOSS-code/hollow
804114d468072f1cf6d303cda28fae20f41ca503
[ "Apache-2.0" ]
268
2016-12-03T00:53:44.000Z
2022-03-28T21:48:23.000Z
hollow/src/main/java/com/netflix/hollow/core/HollowBlobOptionalPartHeader.java
BOSS-code/hollow
804114d468072f1cf6d303cda28fae20f41ca503
[ "Apache-2.0" ]
221
2016-12-02T18:27:13.000Z
2022-03-25T14:10:18.000Z
/* * Copyright 2021 Netflix, Inc. * * 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.netflix.hollow.core; import com.netflix.hollow.core.schema.HollowSchema; import java.util.Collections; import java.util.List; public class HollowBlobOptionalPartHeader { public static final int HOLLOW_BLOB_PART_VERSION_HEADER = 1031; private final String partName; private List<HollowSchema> schemas = Collections.emptyList(); private long originRandomizedTag; private long destinationRandomizedTag; public HollowBlobOptionalPartHeader(String partName) { this.partName = partName; } public List<HollowSchema> getSchemas() { return schemas; } public void setSchemas(List<HollowSchema> schemas) { this.schemas = schemas; } public long getOriginRandomizedTag() { return originRandomizedTag; } public void setOriginRandomizedTag(long originRandomizedTag) { this.originRandomizedTag = originRandomizedTag; } public long getDestinationRandomizedTag() { return destinationRandomizedTag; } public void setDestinationRandomizedTag(long destinationRandomizedTag) { this.destinationRandomizedTag = destinationRandomizedTag; } public String getPartName() { return partName; } }
28.984615
79
0.70966
cb683c64976dc5f95f83903a37a74daee48f1ca1
1,483
html
HTML
simplified/src/_includes/layouts/base.html
charlottebrf/charlottebrf.dev
8cd6fb4b9cb16479c99be77c467b7db6ecc0f1e8
[ "MIT" ]
1
2019-05-09T20:11:50.000Z
2019-05-09T20:11:50.000Z
simplified/src/_includes/layouts/base.html
charlottebrf/charlottebrf.dev
8cd6fb4b9cb16479c99be77c467b7db6ecc0f1e8
[ "MIT" ]
10
2020-04-12T12:02:59.000Z
2020-04-19T20:07:56.000Z
simplified/src/_includes/layouts/base.html
charlottebrf/charlottebrf.dev
8cd6fb4b9cb16479c99be77c467b7db6ecc0f1e8
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=3.0, minimum-scale=0.86 shrink-to-fit=no"> <meta name="description" content="Website for Software Engineer Charlotte Fereday"> <meta name="keywords" content="Security, Engineering"> <meta name="author" content="Charlotte Fereday"> <title>👩‍💻 {{ title }}</title> <link rel="stylesheet" href="/css/reset.css"/> <link rel="stylesheet" href="/css/index.css"/> <script src="https://unpkg.com/scrollreveal" defer></script> <script type="text/javascript" src="/js/scrolling.js" defer></script> <script async defer data-domain="charlottebrf.dev" src="https://plausible.io/js/plausible.js"></script> </head> <body class="placeholder-to-trigger-reset-cs text-size"> <div class="fancy-gradient-rainbow"> {% include "partials/site-head.html" %}</div> <main class="center main-content"> <h1 class="small-stack text-size-l">{{ title }}</h1> <h2 class="text-size-m small-stack"> {{ description }}</h2> {% block content %}{% endblock %} <address class="center large-stack space-evenly"> {% include "partials/social/linkedin.html" %} {% include "partials/social/twitter.html" %} {% include "partials/social/github.html" %} {% include "partials/social/devto.html" %} </address> </main> <footer class="center space-evenly text-size-xs"> <p>⚡️ 2022 © Charlotte Fereday</p></footer> </body> </html>
44.939394
113
0.681726
224713139c2ce6a925e8ba3c7db54a2f3e6d2844
4,397
asm
Assembly
MIPS Runner/MIPS Runner/Long.asm
VuHuy-cse-9/MIPS-Runner
aea3adaa68fdce18e73ae4452977cf33e423ce98
[ "MIT" ]
null
null
null
MIPS Runner/MIPS Runner/Long.asm
VuHuy-cse-9/MIPS-Runner
aea3adaa68fdce18e73ae4452977cf33e423ce98
[ "MIT" ]
null
null
null
MIPS Runner/MIPS Runner/Long.asm
VuHuy-cse-9/MIPS-Runner
aea3adaa68fdce18e73ae4452977cf33e423ce98
[ "MIT" ]
1
2020-11-26T17:28:30.000Z
2020-11-26T17:28:30.000Z
.data array: .word 5, 1, 50, 26, 17, 20, 9, 12, 42, 85, 99, 33, 46, 75, 80, 19, 55, 56, 57, 60, 42, 53, 44, 11, 98, 97, 69, 96, 2, 77, 66, 32, 13, 91, 89, 30, 50, 51, 76, 40, 3, 4, 6, 7, 8, 9, 10, 82, 81, 71 size: .word 50 spaceSymb: .asciiz " " .text .globl _main _main: la $a0, array add $a1, $0, $0 lw $a2, size subi $a2, $a2, 1 jal _quicksort li $v0, 10 syscall # func swap(x: int*, y: int*) { # (*x, *y) = (*y, *x) # } _swap: lw $t0, 0($a0) lw $t1, 0($a1) sw $t0, 0($a1) sw $t1, 0($a0) jr $ra # func quicksort(array: int*, start: int, end: int) { # guard start < end # let position = partition(array, start, end) # quicksort(array, start, position - 1) # quicksort(array, position + 1, end) # } _quicksort: # array, start, end = a0, a1, a2, resp. bge $a1, $a2, quicksort_returning # guard a1 < a2 subi $sp, $sp, 20 # we need to save ra, array, start, end, position sw $ra, 0($sp) # push ra sw $a0, 4($sp) # push array sw $a1, 8($sp) # push start sw $a2, 12($sp) # push end jal print jal _partition # call partition, return to v0 sw $v0, 16($sp) # push position lw $a1, 8($sp) # a1 = start lw $a2, 16($sp) # a2 = position subi $a2, $a2, 1 # a2 = position - 1 jal _quicksort # call quicksort lw $a1, 16($sp) # a1 = position addi $a1, $a1, 1 # a1 = position + 1 lw $a2, 12($sp) # a2 = end jal _quicksort # call quicksort lw $a2, 12($sp) # pop end lw $a1, 8($sp) # pop start lw $a0, 4($sp) # pop array lw $ra, 0($sp) # pop ra addi $sp, $sp, 20 # re-align the stack quicksort_returning: jr $ra # func partition(array: int*, start: int, end: int) -> int { # let pivot = array[end] # var left = start # var right = end - 1 # while true { # while left <= right and array[left] <= pivot { left += 1 } # while left <= right and array[right] > pivot { right -= 1 } # if left >= right { break } # swap(array + left, array + right) # left += 1 # right -= 1 # } # swap(array + left, array + end) # return left # } _partition: # array, start, end = a0, a1, a2, resp. subi $sp, $sp, 16 # we need to save ra, array, start, end sw $ra, 0($sp) # push ra sw $a0, 4($sp) # push rray sw $a1, 8($sp) # push start sw $a2, 12($sp) # push end # pivot, left, right = s0, s1, s2, resp. lw $s0, 12($sp) # s0 = end sll $s0, $s0, 2 # s0 = 4.end lw $t0, 4($sp) # t0 = array add $s0, $s0, $t0 # s0 = array + 4.end lw $s0, 0($s0) # pivot = s0 = array[end] lw $s1, 8($sp) # left = s1 = start lw $s2, 12($sp) # right = s2 = end subi $s2, $s2, 1 # right = end - 1 loop1: lw $a0, 4($sp) # load array from stack loop2: bgt $s1, $s2, end_loop2 # if left > right then break sll $t0, $s1, 2 # t0 = 4.left add $t0, $t0, $a0 # t0 = array + 4.left lw $t0, 0($t0) # t0 = array[left] bgt $t0, $s0, end_loop2 # if array[left] > pivot then break addi $s1, $s1, 1 # left += 1 j loop2 end_loop2: loop3: bgt $s1, $s2, end_loop3 # if left > right then break sll $t0, $s2, 2 # t0 = 4.right add $t0, $t0, $a0 # t0 = array + 4.right lw $t0, 0($t0) # t0 = array[right] ble $t0, $s0, end_loop3 # if array[right] <= pivot then break subi $s2, $s2, 1 # right -= 1 j loop3 end_loop3: bge $s1, $s2, end_loop1 # if left >= right then break sll $t0, $s1, 2 # t0 = 4.left add $a0, $a0, $t0 # a0 = array + 4.left lw $a1, 4($sp) # a1 = array sll $t0, $s2, 2 # t0 = 4.right add $a1, $a1, $t0 # a1 = array + 4.right jal _swap # call swap addi $s1, $s1, 1 # left += 1 subi $s2, $s2, 1 # right -= 1 j loop1 end_loop1: lw $a0, 4($sp) # a0 = array sll $t0, $s1, 2 # t0 = 4.left add $a0, $a0, $t0 # a0 = array + 4.left lw $a1, 4($sp) # a1 = array lw $t0, 12($sp) # t0 = end sll $t0, $t0, 2 # t0 = 4.end add $a1, $a1, $t0 # a1 = array = 4.end jal _swap # call swap add $v0, $s1, $0 # return left lw $a2, 12($sp) # pop end lw $a1, 8($sp) # pop start lw $a0, 4($sp) # pop array lw $ra, 0($sp) # pop ra addi $sp, $sp, 16 # re-align the stack partition_returning: jr $ra print: subi $sp, $sp, 4 sw $a0, 0($sp) la $t0, array add $t1, $0, $0 for: bge $t1, 50, end_for li $v0, 1 lw $a0, 0($t0) syscall la $a0, spaceSymb li $v0, 4 syscall addi $t0, $t0, 4 addi $t1, $t1, 1 j for end_for: addi $a0, $0, 10 li $v0, 11 syscall lw $a0, 0($sp) addi $sp, $sp, 4 jr $ra
21.767327
202
0.544235
21f3624465fd9a75eae39a6a1cd5c6a2220be76f
1,077
html
HTML
manuscript/page-83/body.html
marvindanig/a-florida-sketch-book
922efdf980e5019f559d2d7942cbf3e3e66061a4
[ "BlueOak-1.0.0", "CC-BY-4.0" ]
null
null
null
manuscript/page-83/body.html
marvindanig/a-florida-sketch-book
922efdf980e5019f559d2d7942cbf3e3e66061a4
[ "BlueOak-1.0.0", "CC-BY-4.0" ]
null
null
null
manuscript/page-83/body.html
marvindanig/a-florida-sketch-book
922efdf980e5019f559d2d7942cbf3e3e66061a4
[ "BlueOak-1.0.0", "CC-BY-4.0" ]
null
null
null
<div class="leaf flex"><div class="inner justify"><p class=" stretch-last-line ">On the 23d of February I was standing on the rear piazza of one of the cottages, when a jay flew into the oak and palmetto scrub close by. A second glance, and I saw that she was busy upon a nest. When she had gone, I moved nearer, and waited. She did not return, and I descended the steps and went to the edge of the thicket to inspect her work: a bulky affair,—nearly done, I thought,—loosely constructed of pretty large twigs. I had barely returned to the veranda before the bird appeared again. This time I was in a position to look squarely in upon her. She had some difficulty in edging her way through the dense bushes with a long, branching stick in her bill; but she accomplished the feat, fitted the new material into its place, readjusted the other twigs a bit here and there, and then, as she rose to depart, she looked me suddenly in the face and stopped, as much as to say, “Well, well! here’s a pretty go! A man spying upon me!” I wondered whether she would throw</p></div> </div>
1,077
1,077
0.76416
231a809a511f658243a0d58026fb9725970cdaf0
14,948
ps1
PowerShell
build.ps1
imfrancisd/PowerShell-Assert-Library
6f9294427d06d70676a02a094b5c70ab15ec8ddd
[ "MIT" ]
2
2015-08-18T18:23:15.000Z
2016-03-16T22:18:51.000Z
build.ps1
imfrancisd/PowerShell-Assert-Library
6f9294427d06d70676a02a094b5c70ab15ec8ddd
[ "MIT" ]
12
2015-03-23T02:06:46.000Z
2016-09-20T10:51:10.000Z
build.ps1
imfrancisd/PowerShell-Assert-Library
6f9294427d06d70676a02a094b5c70ab15ec8ddd
[ "MIT" ]
null
null
null
#requires -version 2 <# .Synopsis Create scripts, module, and docs from the files in the "src" directory. .Description Create scripts, module, and docs from the files in the "src" directory. .Example .\build.ps1 Create scripts and module and store them in the "Debug" directory. Use "-Configuration Release" to create scripts and module in the "Release" directory. .Example .\build.ps1 -Clean Remove the "Debug" directory. Use "-Configuration Release" to remove the "Release" directory. .Example .\build.ps1 -Target All -Configuration Release -Clean -WhatIf See which files and directories will be modified without actually modifying those files and directories. #> [CmdletBinding(SupportsShouldProcess=$true)] Param( #Create all, docs, script, or module. [Parameter(Mandatory = $false, Position = 0)] [ValidateSet('All', 'Docs', 'Module', 'Script')] [System.String] $Target = 'All', #Create all, script, or module, in "Debug" or "Release" directory. #The "docs" directory will only be updated with a "Release" configuration. [Parameter(Mandatory = $false)] [ValidateSet('Debug', 'Release')] [System.String] $Configuration = 'Debug', #Clean all, script, or module, in "Debug" or "Release" directory. #The "docs" directory will only be cleaned with a "Release" configuration. [Parameter(Mandatory = $false)] [System.Management.Automation.SwitchParameter] $Clean, #The tags applied to the module version of this library. #The tags help with module discovery in online galleries. [Parameter(Mandatory=$false)] [System.String[]] $LibraryTags = @('Assert', 'Test', 'List Processing', 'Combinatorial'), #The URL to the main website for this project. [Parameter(Mandatory=$false)] [System.Uri] $LibraryUri = 'https://github.com/imfrancisd/PowerShell-Assert-Library', #The version number to attach to the built script and module. [Parameter(Mandatory=$false)] [System.Version] $LibraryVersion = '1.7.8.0', #The minimum PowerShell version required by this library. [Parameter(Mandatory=$false)] [System.Version] $PowerShellVersion = '2.0', #Which version of Strict Mode should be used for this library. [Parameter(Mandatory=$false)] [ValidateSet('Off', '1.0', '2.0', 'Latest', 'Scope')] [System.String] $StrictMode = 'Off' ) $ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop $basePath = Split-Path -Path $MyInvocation.MyCommand.Path -Parent $buildDir = Join-Path -Path $basePath -ChildPath $(if ($Configuration -eq 'Release') {'Release'} else {'Debug'}) $buildScriptDir = Join-Path -Path $buildDir -ChildPath 'Script' $buildModuleDir = Join-Path -Path $buildDir -ChildPath 'Module\AssertLibrary' $githubDocsDir = Join-Path -Path $basePath -ChildPath 'docs' $licenseFile = Join-Path -Path $basePath -ChildPath 'LICENSE.txt' $scriptHelpDir = Join-Path -Path $basePath -ChildPath 'help\Script' $moduleHelpDir = Join-Path -Path $basePath -ChildPath 'help\Module' $suppressMsgDir = Join-Path -Path $basePath -ChildPath 'scriptanalyzer\suppressMessage' $functionFiles = @( Get-ChildItem -LiteralPath (Join-Path -Path $basePath -ChildPath 'src') -Filter *.ps1 -Recurse | Sort-Object -Property 'Name' ) function main { $action = if ($Clean) {'clean'} else {'build'} switch ("$action-$Target-$Configuration") { 'clean-All-Debug' {cleanBuild} 'clean-Docs-Debug' {throw "Docs can only be cleaned with a release configuration. Try: .\build.ps1 docs -configuration release -clean"} 'clean-Script-Debug' {cleanScript} 'clean-Module-Debug' {cleanModule} 'build-All-Debug' {cleanBuild; buildScript; buildModule} 'build-Docs-Debug' {throw "Docs can only be built with a release configuration. Try: .\build.ps1 docs -configuration release"} 'build-Script-Debug' {cleanScript; buildScript} 'build-Module-Debug' {cleanModule; buildModule} 'clean-All-Release' {cleanBuild; cleanDocs} 'clean-Docs-Release' {cleanDocs} 'clean-Script-Release' {cleanScript} 'clean-Module-Release' {cleanModule} 'build-All-Release' {cleanBuild; buildScript; buildModule; cleanDocs; buildDocs} 'build-Docs-Release' {cleanDocs; buildDocs} 'build-Script-Release' {cleanScript; buildScript} 'build-Module-Release' {cleanModule; buildModule} default {throw "Cannot $action unknown target: $target."} } } function cleanBuild { if (Test-Path -LiteralPath $buildDir) { Remove-Item -LiteralPath $buildDir -Recurse -Verbose:$VerbosePreference } } function cleanDocs { if (Test-Path -LiteralPath $githubDocsDir) { Remove-Item -LiteralPath $githubDocsDir -Recurse -Verbose:$VerbosePreference } } function cleanScript { if (Test-Path -LiteralPath $buildScriptDir) { Remove-Item -LiteralPath $buildScriptDir -Recurse -Verbose:$VerbosePreference } } function cleanModule { if (Test-Path -LiteralPath $buildModuleDir) { Remove-Item -LiteralPath $buildModuleDir -Recurse -Verbose:$VerbosePreference } } function buildDocs { $null = New-Item -Path $githubDocsDir -ItemType Directory -Force -Verbose:$VerbosePreference $scriptEnUs = Join-Path -Path $buildScriptDir -ChildPath 'AssertLibrary_en-US.ps1' $aboutTxt = Join-Path -Path $buildModuleDir -ChildPath (Join-Path -Path 'en-US' -ChildPath 'about_AssertLibrary.help.txt') $readmeTxt = Join-Path -Path $githubDocsDir -ChildPath 'README.txt' $command = @" `$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop `$PSDefaultParameterValues = @{'Disabled' = `$true} `$WhatIfPreference = `$$WhatIfPreference `$oldSize = `$Host.UI.RawUI.BufferSize try { if (`$oldSize.Width -ne 120) { try {`$Host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size -ArgumentList @(120, 9001)} catch {Write-Warning -Message 'Could not change the width of the PowerShell buffer to 120.`r`nDocs may change unnecessarily.'} } Set-Location -Path '$basePath' Remove-Module assertlibrary* & '$scriptEnUs' `$VerbosePreference = [System.Management.Automation.ActionPreference]::$VerbosePreference Copy-Item -Path '$aboutTxt' -Destination '$readmeTxt' -verbose:`$verbosepreference (Get-Module assertlibrary*).exportedfunctions.getenumerator() | ForEach-Object { `$githubDoc = Join-Path -Path '$githubDocsDir' -ChildPath (`$_.Key + '.txt') Get-Help `$_.Key -full | Out-File `$githubDoc -encoding utf8 -force -verbose:`$verbosepreference} } finally {try {`$Host.UI.RawUI.BufferSize = `$oldSize} catch{}} "@ powershell.exe -noprofile -noninteractive -executionpolicy remotesigned -command $command } function buildScript { $null = New-Item -Path $buildScriptDir -ItemType Directory -Force -Verbose:$VerbosePreference foreach ($dir in @(Get-ChildItem -LiteralPath $scriptHelpDir | Where-Object {$_.PSIsContainer})) { $scriptLocalizedHelpDir = Join-Path -Path $scriptHelpDir -ChildPath $dir.BaseName $lines = @(& { '<#' Get-Content -LiteralPath $licenseFile '#>' '' "#Assert Library version $($LibraryVersion.ToString())" "#$LibraryUri" '#' '#PowerShell requirements' "#requires -version $($PowerShellVersion.ToString(2))" '' '' '' Get-ChildItem -LiteralPath $suppressMsgDir -Filter '*.psd1' -Recurse | Get-Content | Sort-Object '[CmdletBinding()]' 'Param()' '' '' '' 'New-Module -Name {0} -ScriptBlock {{' -f "'AssertLibrary_$($dir.BaseName)_v$LibraryVersion'" '' "`$PSDefaultParameterValues = @{'Disabled' = `$true}" switch ($StrictMode) { 'Off' {'Microsoft.PowerShell.Core\Set-StrictMode -Off'} '1.0' {"Microsoft.PowerShell.Core\Set-StrictMode -Version '1.0'"} '2.0' {"Microsoft.PowerShell.Core\Set-StrictMode -Version '2.0'"} 'Latest' {"Microsoft.PowerShell.Core\Set-StrictMode -Version 'Latest'"} 'Scope' {'#WARNING: StrictMode setting is inherited from a higher scope.'} default {throw "Unknown Strict Mode '$StrictMode'."} } '' foreach ($item in $functionFiles) { '' if (-not $item.BaseName.StartsWith('_', [System.StringComparison]::OrdinalIgnoreCase)) { $scriptHelpFile = Join-Path -Path $scriptLocalizedHelpDir -ChildPath ($item.BaseName + '.psd1') if ((Test-Path -LiteralPath $scriptHelpFile)) { Get-Content -LiteralPath $scriptHelpFile } else { Write-Warning -Message "Missing help file: $scriptHelpFile" } } Get-Content -LiteralPath $item.PSPath '' } '' "Export-ModuleMember -Function '*-*'} | Import-Module" }) $ps1 = Join-Path -Path $buildScriptDir -ChildPath ('AssertLibrary_{0}.ps1' -f $dir.BaseName) $lines | Out-File -FilePath $ps1 -Encoding utf8 -Verbose:$VerbosePreference if ($dir.BaseName.Equals('en-US', [System.StringComparison]::OrdinalIgnoreCase)) { $ps1 = Join-Path -Path $buildScriptDir -ChildPath 'AssertLibrary.ps1' $lines | Out-File -FilePath $ps1 -Encoding utf8 -Verbose:$VerbosePreference } } } function buildModule { $psm1 = Join-Path -Path $buildModuleDir -ChildPath 'AssertLibrary.psm1' $psd1 = Join-Path -Path $buildModuleDir -ChildPath 'AssertLibrary.psd1' $null = New-Item -Path $buildModuleDir -ItemType Directory -Force -Verbose:$VerbosePreference $publicFunctions = New-Object -TypeName 'System.Collections.Generic.List[System.String]' Copy-Item -LiteralPath $licenseFile -Destination $buildModuleDir -Verbose:$VerbosePreference $(& { '<#' Get-Content -LiteralPath $licenseFile '#>' '' "#Assert Library version $($LibraryVersion.ToString())" "#$LibraryUri" '#' '#PowerShell requirements' "#requires -version $($PowerShellVersion.ToString(2))" '' '' '' Get-ChildItem -LiteralPath $suppressMsgDir -Filter '*.psd1' -Recurse | Get-Content | Sort-Object '[CmdletBinding()]' 'Param()' '' '' '' "`$PSDefaultParameterValues = @{'Disabled' = `$true}" switch ($StrictMode) { 'Off' {'Microsoft.PowerShell.Core\Set-StrictMode -Off'} '1.0' {"Microsoft.PowerShell.Core\Set-StrictMode -Version '1.0'"} '2.0' {"Microsoft.PowerShell.Core\Set-StrictMode -Version '2.0'"} 'Latest' {"Microsoft.PowerShell.Core\Set-StrictMode -Version 'Latest'"} 'Scope' {'#WARNING: StrictMode setting is inherited from a higher scope.'} default {throw "Unknown Strict Mode '$StrictMode'."} } '' foreach ($item in $functionFiles) { '' if (-not $item.BaseName.StartsWith('_', [System.StringComparison]::OrdinalIgnoreCase)) { $publicFunctions.Add($item.BaseName) '#.ExternalHelp AssertLibrary.psm1-help.xml' } Get-Content -LiteralPath $item.PSPath '' } '' "Export-ModuleMember -Function '*-*'" }) | Out-File -FilePath $psm1 -Encoding utf8 -Verbose:$VerbosePreference @( "@{" "" "# Script module or binary module file associated with this manifest." "ModuleToProcess = 'AssertLibrary.psm1'" "" "# Version number of this module." "ModuleVersion = '$($LibraryVersion.ToString())'" "" "# ID used to uniquely identify this module" "GUID = '7ddd1746-0d17-43b2-b6e6-83ef649e01b7'" "" "# Author of this module" "Author = 'Francis de la Cerna'" "" "# Copyright statement for this module" "Copyright = 'Copyright (c) 2015 Francis de la Cerna, licensed under the MIT License (MIT).'" "" "# Description of the functionality provided by this module" "Description = 'A library of PowerShell functions that gives testers complete control over the meaning of their assertions.'" "" "# Minimum version of the Windows PowerShell engine required by this module" "PowerShellVersion = '$($PowerShellVersion.ToString(2))'" "" "# Functions to export from this module" "FunctionsToExport = @($(@($publicFunctions | ForEach-Object {"'$_'"}) -join ', '))" "" "# Cmdlets to export from this module" "CmdletsToExport = @()" "" "# Variables to export from this module" "VariablesToExport = @()" "" "# Aliases to export from this module" "AliasesToExport = @()" "" "# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell." "PrivateData = @{" "" " PSData = @{" "" " # Tags applied to this module. These help with module discovery in online galleries." " Tags = @($(($LibraryTags | Where-Object {($null -ne $_) -and ('' -ne $_.Trim())} | ForEach-Object {"'$($_.Trim())'"}) -join ', '))" "" " # A URL to the main website for this project." " ProjectUri = '$LibraryUri'" "" " } # End of PSData hashtable" "" "} # End of PrivateData hashtable" "" "}" ) | Out-File -FilePath $psd1 -Encoding utf8 -Verbose:$VerbosePreference foreach ($item in (Get-ChildItem -LiteralPath $moduleHelpDir)) { if ($item.PSIsContainer) { $item | Copy-Item -Destination $buildModuleDir -Recurse -Verbose:$VerbosePreference } } } main
40.291105
181
0.599746
b6d07c3fe2735715b1d75323149459a29faf2e22
524
rb
Ruby
spec/models/user_spec.rb
akitasoftware/akibox-rails
01270327a5f97d45d197b20c731586e95b3e9c07
[ "Apache-2.0" ]
null
null
null
spec/models/user_spec.rb
akitasoftware/akibox-rails
01270327a5f97d45d197b20c731586e95b3e9c07
[ "Apache-2.0" ]
1
2021-07-15T21:52:58.000Z
2021-07-15T22:02:00.000Z
spec/models/user_spec.rb
akitasoftware/akibox-rails
01270327a5f97d45d197b20c731586e95b3e9c07
[ "Apache-2.0" ]
null
null
null
require 'rails_helper' # Test suite for the User model RSpec.describe User, type: :model do # Association test. # Ensure User model has a one-to-many relationship with the AkiFile model. it { should have_many(:aki_files).dependent(:destroy) } # Validation tests. # Ensure all fields are populated before saving. it { should validate_presence_of(:first_name) } it { should validate_presence_of(:last_name) } it { should validate_presence_of(:email) } it { should validate_presence_of(:phone_number) } end
32.75
76
0.748092
41814e60d72d3531b78526a47ec4b7a423e58fe2
12,007
h
C
libskrift.h
maandree/libskrift
9ada93e99ab3cdfc9542a5facbeacd582d2c5227
[ "0BSD" ]
6
2020-04-26T21:15:35.000Z
2021-11-27T20:07:12.000Z
libskrift.h
maandree/libskrift
9ada93e99ab3cdfc9542a5facbeacd582d2c5227
[ "0BSD" ]
null
null
null
libskrift.h
maandree/libskrift
9ada93e99ab3cdfc9542a5facbeacd582d2c5227
[ "0BSD" ]
1
2020-04-26T21:15:37.000Z
2020-04-26T21:15:37.000Z
/* See LICENSE file for copyright and license details. */ #ifndef LIBSKRIFT_H #define LIBSKRIFT_H 1 #include <math.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #if defined(__GNUC__) # define _LIBSKRIFT_GCC_ONLY(...) __VA_ARGS__ #else # define _LIBSKRIFT_GCC_ONLY(...) #endif #define LIBSKRIFT_RENDERING_STRUCT_VERSION 0 #define LIBSKRIFT_NONE 0 typedef struct libskrift_context LIBSKRIFT_CONTEXT; typedef struct libskrift_font LIBSKRIFT_FONT; typedef uint_least32_t libskrift_codepoint_t; enum libskrift_format { LIBSKRIFT_RAW, LIBSKRIFT_R8G8B8, LIBSKRIFT_X8R8G8B8, LIBSKRIFT_A8R8G8B8, LIBSKRIFT_R8G8B8A8, LIBSKRIFT_R16G16B16, LIBSKRIFT_X16R16G16B16, LIBSKRIFT_A16R16G16B16, LIBSKRIFT_R16G16B16A16, LIBSKRIFT_R32G32B32, LIBSKRIFT_X32R32G32B32, LIBSKRIFT_A32R32G32B32, LIBSKRIFT_R32G32B32A32, LIBSKRIFT_R64G64B64, LIBSKRIFT_X64R64G64B64, LIBSKRIFT_A64R64G64B64, LIBSKRIFT_R64G64B64A64, LIBSKRIFT_RGB_FLOAT, LIBSKRIFT_ARGB_FLOAT, LIBSKRIFT_RGBA_FLOAT, LIBSKRIFT_RGB_DOUBLE, LIBSKRIFT_ARGB_DOUBLE, LIBSKRIFT_RGBA_DOUBLE, LIBSKRIFT_RGB_LONG_DOUBLE, LIBSKRIFT_ARGB_LONG_DOUBLE, LIBSKRIFT_RGBA_LONG_DOUBLE }; enum libskrift_endian { LIBSKRIFT_HOST_PIXEL, LIBSKRIFT_NETWORK_PIXEL, LIBSKRIFT_REVERSE_NETWORK_PIXEL, LIBSKRIFT_HOST_SUBPIXEL, LIBSKRIFT_NETWORK_SUBPIXEL, LIBSKRIFT_REVERSE_NETWORK_SUBPIXEL #define LIBSKRIFT_BE_PIXEL LIBSKRIFT_NETWORK_PIXEL #define LIBSKRIFT_BE_SUBPIXEL LIBSKRIFT_NETWORK_SUBPIXEL #define LIBSKRIFT_LE_PIXEL LIBSKRIFT_REVERSE_NETWORK_PIXEL #define LIBSKRIFT_LE_SUBPIXEL LIBSKRIFT_REVERSE_NETWORK_SUBPIXEL }; enum libskrift_subpixel_order { LIBSKRIFT_OTHER, /* LIBSKRIFT_NONE */ LIBSKRIFT_RGB, LIBSKRIFT_BGR, LIBSKRIFT_VRGB, LIBSKRIFT_VBGR }; enum libskrift_smoothing { LIBSKRIFT_MONOCHROME, /* LIBSKRIFT_NONE */ LIBSKRIFT_GREYSCALE, LIBSKRIFT_SUBPIXEL }; enum libskrift_hinting { LIBSKRIFT_UNHINTED = 0, /* LIBSKRIFT_NONE */ LIBSKRIFT_SLIGHT = 25, LIBSKRIFT_MEDIUM = 50, LIBSKRIFT_FULL = 100 }; #define LIBSKRIFT_REMOVE_GAMMA UINT32_C(0x00000001) #define LIBSKRIFT_Y_INCREASES_UPWARDS UINT32_C(0x00000002) /* SFT_DOWNWARD_Y otherwise */ #define LIBSKRIFT_FLIP_TEXT UINT32_C(0x00000004) #define LIBSKRIFT_FLIP_CHARS UINT32_C(0x00000008) #define LIBSKRIFT_MIRROR_TEXT UINT32_C(0x00000010) #define LIBSKRIFT_MIRROR_CHARS UINT32_C(0x00000020) #define LIBSKRIFT_TRANSPOSE_TEXT UINT32_C(0x00000040) #define LIBSKRIFT_TRANSPOSE_CHARS UINT32_C(0x00000080) #define LIBSKRIFT_NO_LIGATURES UINT32_C(0x00000100) #define LIBSKRIFT_ADVANCE_CHAR_TO_GRID UINT32_C(0x00000200) #define LIBSKRIFT_REGRESS_CHAR_TO_GRID UINT32_C(0x00000400) /* Combine with LIBSKRIFT_ADVANCE_CHAR_TO_GRID for closest alternative */ #define LIBSKRIFT_ADVANCE_WORD_TO_GRID UINT32_C(0x00000800) #define LIBSKRIFT_REGRESS_WORD_TO_GRID UINT32_C(0x00001000) /* Combine with LIBSKRIFT_ADVANCE_WORD_TO_GRID for closest alternative */ #define LIBSKRIFT_USE_SUBPIXEL_GRID UINT32_C(0x00002000) #define LIBSKRIFT_VERTICAL_TEXT UINT32_C(0x00004000) #define LIBSKRIFT_AUTOHINTING UINT32_C(0x00008000) /* Use autohinter even if hint information exists */ #define LIBSKRIFT_NO_AUTOHINTING UINT32_C(0x00010000) /* Use autohinter if no hint information exist */ #define LIBSKRIFT_AUTOKERNING UINT32_C(0x00020000) /* Use autokerner even if kerning information exists */ #define LIBSKRIFT_NO_AUTOKERNING UINT32_C(0x00040000) /* Use autokerner if no kerning information exist */ #define LIBSKRIFT_IGNORE_IGNORABLE UINT32_C(0x00080000) /* Ignore ignorable unhandled codepoints, such as variant selectors */ struct libskrift_rendering { int struct_version; enum libskrift_subpixel_order subpixel_order; enum libskrift_smoothing smoothing; enum libskrift_hinting hinting; uint32_t flags; int grid_fineness; double horizontal_dpi; double vertical_dpi; double kerning; double interletter_spacing; double prestroke_transformation_rotation[4]; double left_transformation[6]; double right_transformation[6]; double top_transformation[6]; double bottom_transformation[6]; double poststroke_transformation_rotation[4]; double char_transformation[6]; double text_transformation[6]; }; struct libskrift_glyph { double advance; int16_t x; int16_t y; uint16_t width; uint16_t height; size_t size; uint8_t image[]; }; struct libskrift_saved_grapheme { int have_saved; libskrift_codepoint_t cp; size_t len; }; struct libskrift_image { enum libskrift_format format; enum libskrift_endian endian; int premultiplied; uint16_t width; uint16_t height; size_t hblanking; void (*preprocess)(struct libskrift_image *image, size_t x, size_t y, size_t width, size_t height); void (*postprocess)(struct libskrift_image *image, size_t x, size_t y, size_t width, size_t height); void *image; }; struct libskrift_colour { double opacity; /* [0, 1] */ double alpha; /* [0, .opacity] */ double red; /* [0, .alpha] */ double green; /* [0, .alpha] */ double blue; /* [0, .alpha] */ }; #define LIBSKRIFT_DEFAULT_RENDERING {\ .struct_version = LIBSKRIFT_RENDERING_STRUCT_VERSION,\ .subpixel_order = LIBSKRIFT_NONE,\ .smoothing = LIBSKRIFT_GREYSCALE,\ .hinting = LIBSKRIFT_FULL,\ .flags = 0,\ .grid_fineness = 1,\ .horizontal_dpi = (double)1920 * 254 / 5180,\ .vertical_dpi = (double)1200 * 254 / 3240,\ .kerning = 1,\ .interletter_spacing = 0,\ .prestroke_transformation_rotation = {1, 0, 0, 1},\ .left_transformation = {1, 0, 0, 0, 1, 0},\ .right_transformation = {1, 0, 0, 0, 1, 0},\ .top_transformation = {1, 0, 0, 0, 1, 0},\ .bottom_transformation = {1, 0, 0, 0, 1, 0},\ .poststroke_transformation_rotation = {1, 0, 0, 1},\ .char_transformation = {1, 0, 0, 0, 1, 0},\ .text_transformation = {1, 0, 0, 0, 1, 0},\ } #define LIBSKRIFT_NO_SAVED_GRAPHEME {0, 0, 0} #define LIBSKRIFT_PREMULTIPLY(OPACITY, ALPHA, RED, GREEN, BLUE)\ {(OPACITY),\ (ALPHA) * (OPACITY),\ (RED) * (ALPHA) * (OPACITY),\ (GREEN) * (ALPHA) * (OPACITY),\ (BLUE) * (ALPHA) * (OPACITY)} _LIBSKRIFT_GCC_ONLY(__attribute__((__const__, __warn_unused_result__))) inline double libskrift_calculate_dpi(double pixels, double millimeters) { return pixels * 254 / 10 / millimeters; } _LIBSKRIFT_GCC_ONLY(__attribute__((__const__, __warn_unused_result__))) inline double libskrift_inches_to_pixels(double inches, const struct libskrift_rendering *rendering) { return inches * rendering->vertical_dpi; } _LIBSKRIFT_GCC_ONLY(__attribute__((__const__, __warn_unused_result__))) inline double libskrift_millimeters_to_pixels(double millimeters, const struct libskrift_rendering *rendering) { return millimeters * 10 / 254 * rendering->vertical_dpi; } _LIBSKRIFT_GCC_ONLY(__attribute__((__const__, __warn_unused_result__))) inline double libskrift_points_to_pixels(double points, const struct libskrift_rendering *rendering) { return points / 72 * rendering->vertical_dpi; } _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_open_font_file(LIBSKRIFT_FONT **, const char *); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_open_font_mem(LIBSKRIFT_FONT **, const void *, size_t); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_open_font_adopt_mem(LIBSKRIFT_FONT **, void *, size_t); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_open_font_adopt_mmap(LIBSKRIFT_FONT **, void *, size_t); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_open_font_fd(LIBSKRIFT_FONT **, int); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_open_font_at(LIBSKRIFT_FONT **, int, const char *); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_open_font(LIBSKRIFT_FONT **, FILE *); void libskrift_close_font(LIBSKRIFT_FONT *); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__(1, 2)))) int libskrift_create_context(LIBSKRIFT_CONTEXT **, LIBSKRIFT_FONT **, size_t, double, const struct libskrift_rendering *, void *); void libskrift_free_context(LIBSKRIFT_CONTEXT *); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__, __warn_unused_result__, __const__))) const struct libskrift_rendering *libskrift_get_rendering_settings(LIBSKRIFT_CONTEXT *); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_get_grapheme_glyph(LIBSKRIFT_CONTEXT *, libskrift_codepoint_t, double, double, struct libskrift_glyph **); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__(1, 2, 7)))) ssize_t libskrift_get_cluster_glyph(LIBSKRIFT_CONTEXT *, const char *, size_t, struct libskrift_saved_grapheme *, double, double, struct libskrift_glyph **); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) int libskrift_merge_glyphs(LIBSKRIFT_CONTEXT *, const struct libskrift_glyph *, const struct libskrift_glyph *, struct libskrift_glyph **); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__(1, 2, 6)))) int libskrift_apply_glyph(LIBSKRIFT_CONTEXT *, const struct libskrift_glyph *, const struct libskrift_colour *, int16_t, int16_t, struct libskrift_image *); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__(1, 2, 7)))) int libskrift_draw_text(LIBSKRIFT_CONTEXT *, const char *, size_t, const struct libskrift_colour *, int16_t, int16_t, struct libskrift_image *); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) void libskrift_srgb_preprocess(struct libskrift_image *, size_t, size_t, size_t, size_t); _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) void libskrift_srgb_postprocess(struct libskrift_image *, size_t, size_t, size_t, size_t); inline void libskrift_add_transformation(double m[restrict 6], const double tm[restrict 6]) { double a = m[0], b = m[1], c = m[2]; double d = m[3], e = m[4], f = m[5]; m[0] = tm[0] * a + tm[1] * d; m[1] = tm[0] * b + tm[1] * e; m[2] = tm[0] * c + tm[1] * f + tm[2]; m[3] = tm[3] * a + tm[4] * d; m[4] = tm[3] * b + tm[4] * e; m[5] = tm[3] * c + tm[4] * f + tm[5]; } inline void libskrift_add_rotation(double m[6], double radians) { double c = cos(-radians), s = sin(-radians); libskrift_add_transformation(m, (double []){c, -s, 0, s, c, 0}); } inline void libskrift_add_rotation_degrees(double m[6], double degrees) { libskrift_add_rotation(m, degrees * (double)0.017453292519943295f); } inline void libskrift_add_90_degree_rotation(double m[6]) { double a = m[0], b = m[1], c = m[2]; m[0] = m[3], m[1] = m[4], m[2] = m[5]; m[3] = -a, m[4] = -b, m[5] = -c; } inline void libskrift_add_180_degree_rotation(double m[6]) { m[0] = -m[0], m[1] = -m[1], m[2] = -m[2]; m[3] = -m[3], m[4] = -m[4], m[5] = -m[5]; } inline void libskrift_add_270_degree_rotation(double m[6]) { double a = m[0], b = m[1], c = m[2]; m[0] = -m[3], m[1] = -m[4], m[2] = -m[5]; m[3] = a, m[4] = b, m[5] = c; } inline void libskrift_add_scaling(double m[6], double x, double y) { m[0] *= x, m[1] *= x, m[2] *= x; m[3] *= y, m[4] *= y, m[5] *= y; } inline void libskrift_add_transposition(double m[6]) { double a = m[0], b = m[1], c = m[2]; m[0] = m[3], m[1] = m[4], m[2] = m[5]; m[3] = a, m[4] = b, m[5] = c; } inline void libskrift_add_shear(double m[6], double x, double y) { double a = m[0], b = m[1], c = m[2]; double d = m[3], e = m[4], f = m[6]; m[0] += x * d, m[1] += x * e, m[2] += x * f; m[3] += y * a, m[4] += y * b, m[5] += y * c; } inline void libskrift_add_translation(double m[6], double x, double y) { m[2] += x; m[5] += y; } #endif
32.451351
133
0.710585
c46f198bcd798819104fca2004af07f419437cc7
2,085
lua
Lua
bin/ui/run.lua
MineWorldProgram/NewOS
d482a4b0f646105232a2200b90d331bc7decceed
[ "MIT" ]
3
2021-05-30T00:38:34.000Z
2021-06-02T15:41:21.000Z
bin/ui/run.lua
MineWorldProgram/NewOS
d482a4b0f646105232a2200b90d331bc7decceed
[ "MIT" ]
null
null
null
bin/ui/run.lua
MineWorldProgram/NewOS
d482a4b0f646105232a2200b90d331bc7decceed
[ "MIT" ]
1
2021-06-01T03:10:05.000Z
2021-06-01T03:10:05.000Z
local textbox = require("/lib/textbox") local w, h = term.getSize() local box = textbox.new(2, 4, w - 2) local function draw() local w, h = term.getSize() term.setBackgroundColor(colors.black) term.clear() term.setCursorPos(5, 2) term.setTextColor(colors.gray) term.write("path do programa") box.redraw() term.setCursorPos(2, 6) term.setBackgroundColor(colors.green) term.setTextColor(colors.gray) term.write(" run ") term.setCursorPos(9, 6) term.setBackgroundColor(colors.black) term.setTextColor(colors.red) term.write("*ainda em teste") local foregroundColor = colors.lightGray if wm.getSelectedProcessID() == id then foregroundColor = colors.lime end for i = 1, h - 1 do term.setCursorPos(1, i) term.setTextColor(foregroundColor) term.setBackgroundColor(colors.black) term.write("\149") end for i = 1, h - 1 do term.setCursorPos(w, i) term.setTextColor(colors.black) term.setBackgroundColor(foregroundColor) term.write("\149") end term.setCursorPos(2, h) term.setTextColor(colors.black) term.setBackgroundColor(foregroundColor) term.write(string.rep("\143", w - 2)) term.setCursorPos(1, h) term.setTextColor(colors.black) term.setBackgroundColor(foregroundColor) term.write("\138") term.setCursorPos(w, h) term.setTextColor(colors.black) term.setBackgroundColor(foregroundColor) term.write("\133") end draw() local content = "" while true do draw() local e = {os.pullEvent()} if e[1] == "mouse_click" then local m, x, y = e[2], e[3], e[4] if x >= 2 and x <= w - 2 and y == 4 then content = box.select() elseif x >= 2 and x <= 6 and y == 6 then local myId = id wm.selectProcess(wm.createProcess(content, { x = 2, y = 3, width = 5, height = 5 })) wm.endProcess(myId) break end end end
27.077922
56
0.595683
6988f399c32c8993ddddecde83af3ba85d2e06db
1,205
asm
Assembly
firmware/volumes/volumes.asm
QuorumComp/hc800
d108a9b2cdb8d920c60a9c2439e0703320156f97
[ "MIT" ]
2
2021-01-15T20:00:08.000Z
2021-02-05T07:44:35.000Z
firmware/volumes/volumes.asm
QuorumComp/hc800
d108a9b2cdb8d920c60a9c2439e0703320156f97
[ "MIT" ]
null
null
null
firmware/volumes/volumes.asm
QuorumComp/hc800
d108a9b2cdb8d920c60a9c2439e0703320156f97
[ "MIT" ]
null
null
null
INCLUDE "lowlevel/hc800.i" INCLUDE "lowlevel/math.i" INCLUDE "lowlevel/rc800.i" INCLUDE "lowlevel/stack.i" INCLUDE "stdlib/stream.i" INCLUDE "stdlib/string.i" INCLUDE "stdlib/syscall.i" SECTION "Volumes",CODE Entry:: MSetColor 1 MPrintString <"Volume Mount point Device \n"> MSetColor 0 jal listVolumes sys KExit listVolumes: pusha ld bc,volumeInfo ld d,0 .loop ld t,d sys KGetVolume j/ne .done jal printVolume add d,1 j .loop .done popa j (hl) printVolume: pusha ; print volume name (v?) ld bc,volumeInfo+volinf_Name jal StreamBssStringOut ld t,9 sys KCharacterOut ; print volume label add bc,volinf_Label-volinf_Name jal StreamBssStringOut ; add spaces ld t,(bc) sub t,17 neg t ; 17 - label length ld d,t .spaces ld t,' ' sys KCharacterOut dj d,.spaces ; print block device name, if block device add bc,volinf_BlockDevice-volinf_Label ld t,(bc) cmp t,$FF j/eq .done ld bc,deviceInfo sys KGetBlockDevice j/ne .done add bc,bdinf_Name jal StreamBssStringOut .done MNewLine popa j (hl) SECTION "Variables",BSS_S deviceInfo DS bdinf_SIZEOF volumeInfo DS volinf_SIZEOF
13.693182
54
0.687967
04fdeb81988d7aefa69c750563a528cc227d5735
8,467
java
Java
IDEtalk/src/jabber/generated/org/jivesoftware/smack/packet/Message.java
MadRatSRP/intellij-obsolete-plugins
e0d0f87a908dbb3147e3d115f94452a2da79b7eb
[ "Apache-2.0" ]
10
2019-11-21T16:35:34.000Z
2022-02-28T14:13:32.000Z
IDEtalk/src/jabber/generated/org/jivesoftware/smack/packet/Message.java
MadRatSRP/intellij-obsolete-plugins
e0d0f87a908dbb3147e3d115f94452a2da79b7eb
[ "Apache-2.0" ]
4
2019-12-04T10:43:12.000Z
2020-08-12T13:48:35.000Z
IDEtalk/src/jabber/generated/org/jivesoftware/smack/packet/Message.java
MadRatSRP/intellij-obsolete-plugins
e0d0f87a908dbb3147e3d115f94452a2da79b7eb
[ "Apache-2.0" ]
18
2019-10-30T21:30:30.000Z
2022-03-19T08:28:06.000Z
/** * $RCSfile$ * $Revision$ * $Date$ * * Copyright 2003-2004 Jive Software. * * 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. */ package org.jivesoftware.smack.packet; import org.jivesoftware.smack.util.StringUtils; /** * Represents XMPP message packets. A message can be one of several types: * * <ul> * <li>Message.Type.NORMAL -- (Default) a normal text message used in email like interface. * <li>Message.Type.CHAT -- a typically short text message used in line-by-line chat interfaces. * <li>Message.Type.GROUP_CHAT -- a chat message sent to a groupchat server for group chats. * <li>Message.Type.HEADLINE -- a text message to be displayed in scrolling marquee displays. * <li>Message.Type.ERROR -- indicates a messaging error. * </ul> * * For each message type, different message fields are typically used as follows: * <p> * <table border="1"> * <tr><td>&nbsp;</td><td colspan="5"><b>Message type</b></td></tr> * <tr><td><i>Field</i></td><td><b>Normal</b></td><td><b>Chat</b></td><td><b>Group Chat</b></td><td><b>Headline</b></td><td><b>XMPPError</b></td></tr> * <tr><td><i>subject</i></td> <td>SHOULD</td><td>SHOULD NOT</td><td>SHOULD NOT</td><td>SHOULD NOT</td><td>SHOULD NOT</td></tr> * <tr><td><i>thread</i></td> <td>OPTIONAL</td><td>SHOULD</td><td>OPTIONAL</td><td>OPTIONAL</td><td>SHOULD NOT</td></tr> * <tr><td><i>body</i></td> <td>SHOULD</td><td>SHOULD</td><td>SHOULD</td><td>SHOULD</td><td>SHOULD NOT</td></tr> * <tr><td><i>error</i></td> <td>MUST NOT</td><td>MUST NOT</td><td>MUST NOT</td><td>MUST NOT</td><td>MUST</td></tr> * </table> * * @author Matt Tucker */ public class Message extends Packet { private Type type = Type.NORMAL; private String subject = null; private String body = null; private String thread = null; /** * Creates a new, "normal" message. */ public Message() { } /** * Creates a new "normal" message to the specified recipient. * * @param to the recipient of the message. */ public Message(String to) { if (to == null) { throw new IllegalArgumentException("Parameter cannot be null"); } setTo(to); } /** * Creates a new message of the specified type to a recipient. * * @param to the user to send the message to. * @param type the message type. */ public Message(String to, Type type) { if (to == null || type == null) { throw new IllegalArgumentException("Parameters cannot be null."); } setTo(to); this.type = type; } /** * Returns the type of the message. * * @return the type of the message. */ public Type getType() { return type; } /** * Sets the type of the message. * * @param type the type of the message. */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException("Type cannot be null."); } this.type = type; } /** * Returns the subject of the message, or null if the subject has not been set. * The subject is a short description of message contents. * * @return the subject of the message. */ public String getSubject() { return subject; } /** * Sets the subject of the message. The subject is a short description of * message contents. * * @param subject the subject of the message. */ public void setSubject(String subject) { this.subject = subject; } /** * Returns the body of the message, or null if the body has not been set. The body * is the main message contents. * * @return the body of the message. */ public String getBody() { return body; } /** * Sets the body of the message. The body is the main message contents. * @param body */ public void setBody(String body) { this.body = body; } /** * Returns the thread id of the message, which is a unique identifier for a sequence * of "chat" messages. If no thread id is set, <tt>null</tt> will be returned. * * @return the thread id of the message, or <tt>null</tt> if it doesn't exist. */ public String getThread() { return thread; } /** * Sets the thread id of the message, which is a unique identifier for a sequence * of "chat" messages. * * @param thread the thread id of the message. */ public void setThread(String thread) { this.thread = thread; } public String toXML() { StringBuilder buf = new StringBuilder(); buf.append("<message"); if (getPacketID() != null) { buf.append(" id=\"").append(getPacketID()).append("\""); } if (getTo() != null) { buf.append(" to=\"").append(StringUtils.escapeForXML(getTo())).append("\""); } if (getFrom() != null) { buf.append(" from=\"").append(StringUtils.escapeForXML(getFrom())).append("\""); } if (type != Type.NORMAL) { buf.append(" type=\"").append(type).append("\""); } buf.append(">"); if (subject != null) { buf.append("<subject>").append(StringUtils.escapeForXML(subject)).append("</subject>"); } if (body != null) { buf.append("<body>").append(StringUtils.escapeForXML(body)).append("</body>"); } if (thread != null) { buf.append("<thread>").append(thread).append("</thread>"); } // Append the error subpacket if the message type is an error. if (type == Type.ERROR) { XMPPError error = getError(); if (error != null) { buf.append(error.toXML()); } } // Add packet extensions, if any are defined. buf.append(getExtensionsXML()); buf.append("</message>"); return buf.toString(); } /** * Represents the type of a message. */ public static class Type { /** * (Default) a normal text message used in email like interface. */ public static final Type NORMAL = new Type("normal"); /** * Typically short text message used in line-by-line chat interfaces. */ public static final Type CHAT = new Type("chat"); /** * Chat message sent to a groupchat server for group chats. */ public static final Type GROUP_CHAT = new Type("groupchat"); /** * Text message to be displayed in scrolling marquee displays. */ public static final Type HEADLINE = new Type("headline"); /** * indicates a messaging error. */ public static final Type ERROR = new Type("error"); /** * Converts a String value into its Type representation. * * @param type the String value. * @return the Type corresponding to the String. */ public static Type fromString(String type) { if (type == null) { return NORMAL; } type = type.toLowerCase(); if (CHAT.toString().equals(type)) { return CHAT; } else if (GROUP_CHAT.toString().equals(type)) { return GROUP_CHAT; } else if (HEADLINE.toString().equals(type)) { return HEADLINE; } else if (ERROR.toString().equals(type)) { return ERROR; } else { return NORMAL; } } private String value; private Type(String value) { this.value = value; } public String toString() { return value; } } }
31.014652
150
0.564899
396758b1b1fca0f47a73d577dbaa925d4f79ae15
1,638
html
HTML
index.html
wrafab/cheungk
56b43080267e02256faaac3dcc934044fa3ecd44
[ "MIT" ]
null
null
null
index.html
wrafab/cheungk
56b43080267e02256faaac3dcc934044fa3ecd44
[ "MIT" ]
null
null
null
index.html
wrafab/cheungk
56b43080267e02256faaac3dcc934044fa3ecd44
[ "MIT" ]
null
null
null
<html> <head> <title> Kai's Digital Fabrication Page </title> <body> <style> h1 {font.family:times-new-roman;font-size:300%;text-align:center;} p {font-family:times-new-roman;font-size:100%} a {font-family:helvetica;font-size:50%;text-align:center;} a:link {color: #000000;text-decoration: none;} a:active {color: #8B008B;text-decoration: none;} <!-- body {text-align:center;background-image:url('ds.png');background-repeat:repeat-y;background-position:left top;width="960";height="540";background-color:black;} --> </style> <img src="Kappa.png" style="width:250px;height:250px;"> <h1> Kai Cheung's Digital Fabrication 2018-2019 </hr> <br> <a href="index.html">Home</a> <br> <a href="bio.html">About Me</a> <br> <a href="r1.html">Principles of Digital Fabrication, Design Challenges and HTML</a> <br> <a href="r2.html">CAD, Fusion 360 and Design</a> <br> <a href="r3.html">Garment, Sublimation, UV Printing</a> <br> <a href="r4.html">Laser Cutting and Engraving and Woodshop</a> <br> <a href="r5.html">3D Printing/Scanning</a> <br> <a href="r7.html">Lamination, Vacuum Forming and CNC Milling</a> <br> <a href="r8.html">Soldering/Electronics</a> <br> <a href="r9.html">Sewing</a> <br> <a href="r10.html">Arduino</a> <br> <a href="r11.html">Final Project</a> <br> <p> Some of my orignial files are deleted. Enjoy it with images, unfortunately you can not download them and use it.</p> <br> <p>Listen to this while visiting my page</p> <iframe width="560" height="315" src="https://www.youtube.com/embed/FRPeYP6gS-s" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe><br> </body> </html>
31.5
170
0.699023
51a271e250043a0b5405416b88201e2b21831f6e
1,398
kt
Kotlin
mobile-ui/src/main/java/org/buffer/android/boilerplate/ui/injection/module/RemoteModule.kt
sampingantech/android-clean-architecture-mvi-boilerplate
ac296340b50ca7494d6b72753e1e88624e440fc4
[ "MIT" ]
3
2020-02-24T22:55:41.000Z
2020-05-05T04:15:11.000Z
mobile-ui/src/main/java/org/buffer/android/boilerplate/ui/injection/module/RemoteModule.kt
sampingantech/android-clean-architecture-mvi-boilerplate
ac296340b50ca7494d6b72753e1e88624e440fc4
[ "MIT" ]
7
2020-03-04T14:00:36.000Z
2020-07-20T04:00:52.000Z
mobile-ui/src/main/java/org/buffer/android/boilerplate/ui/injection/module/RemoteModule.kt
sampingantech/android-clean-architecture-mvi-boilerplate
ac296340b50ca7494d6b72753e1e88624e440fc4
[ "MIT" ]
null
null
null
package org.buffer.android.boilerplate.ui.injection.module import dagger.Binds import dagger.Module import dagger.Provides import org.buffer.android.boilerplate.data.repository.ArticleRemote import org.buffer.android.boilerplate.data.repository.BufferooRemote import org.buffer.android.boilerplate.remote.* import org.buffer.android.boilerplate.ui.BuildConfig /** * Module that provides all dependencies from the repository package/layer. */ @Module abstract class RemoteModule { /** * This companion object annotated as a module is necessary in order to provide dependencies * statically in case the wrapping module is an abstract class (to use binding) */ @Module companion object { @Provides @JvmStatic fun provideBufferooService(): BufferooService { return BufferooServiceFactory.makeBuffeoorService(BuildConfig.DEBUG) } @Provides @JvmStatic fun provideArticleService(): ArticleService { return ArticleServiceFactory.makeArticleService( BuildConfig.DEBUG, BuildConfig.API_KEY, BuildConfig.BASE_URL ) } } @Binds abstract fun bindBufferooRemote(bufferooRemoteImpl: BufferooRemoteImpl): BufferooRemote @Binds abstract fun bindArticleRemote(articleRemoteImpl: ArticleRemoteImpl): ArticleRemote }
31.066667
96
0.716023
b46dbe9c3f45a364712931198290e4dba5b83995
10,743
lua
Lua
HypeMan.lua
steveeso/sipman
ecd4d6a06f022fd54edeeb0a0c2f4ddcbb96721d
[ "MIT" ]
11
2020-01-02T09:06:18.000Z
2022-01-21T20:49:42.000Z
HypeMan.lua
MahdiMZ80913/HypeMan
a61886ef5ec051d5525d885e2276ea0654c9501a
[ "MIT" ]
8
2020-03-09T08:30:30.000Z
2022-02-03T07:20:51.000Z
HypeMan.lua
MahdiMZ80913/HypeMan
a61886ef5ec051d5525d885e2276ea0654c9501a
[ "MIT" ]
6
2020-01-15T19:41:13.000Z
2022-01-18T01:25:09.000Z
-- Instructions: include HypeMan in a mission either with a DO SCRIPT FILE, or a -- DO SCRIPT containing the following: -- assert(loadfile("C:/HypeMan/HypeMan.lua"))() -- -- The DO SCRIPT assert(loadfile())() is preferred because then HypeMan can be updated and modified -- and applied to all .miz files without having to modify each individually. -- HypeMan requires JSON.lua from here http://regex.info/blog/lua/json in C:\HypeMan -- TODO - can this be loaded with loadfile()? JSON = (loadfile "C:/HypeMan/JSON.lua")() -- one-time load of the routines HypeMan = {} -- Configuration Options local HypeManAnnounceTakeoffs = true local HypeManAnnounceLandings = true local HypeManAnnounceMissionStart = true local HypeManAnnounceMissionEnd = true local HypeManAnnounceAIPlanes = false local HypeManAnnouncePilotDead = true local HypeManAnnouncePilotEject = true local HypeManAnnounceKills = false local HypeManAnnounceHits = false local HypeManAnnounceCrash = true local HypeManAnnounceRefueling = false local HypeManMinimumFlightTime = 1800 -- minimum flight time to report in minutes package.path = package.path..";.\\LuaSocket\\?.lua;" package.cpath = package.cpath..";.\\LuaSocket\\?.dll;" local socket = require("socket") --function AIRBOSS:OnAfterLSOGrade(From, Event, To, playerData, myGrade) -- myGrade.messageType = 2 -- myGrade.callsign = playerData.callsign -- HypeMan.sendBotTable(myGrade) --end HypeMan.UDPSendSocket = socket.udp() HypeMan.UDPSendSocket:settimeout(0) -- Table to store takeoff times HypeManTakeOffTime = {} HypeManRefuelingTable = {} -- table to store hits on aircraft HypeManHitTable = {} -- This is the function that can be called in any mission to send a message to discord. -- From the Mission Editor add a Trigger and a DO SCRIPT action and enter as the script: -- HypeMan.sendBotMessage('Roses are Red. Violets are blue. I only wrote this poem to test my Discord Bot.') HypeMan.sendBotTable = function(tbl) -- env.info(msg) -- for debugging local tbl_json_txt = JSON:encode(tbl) socket.try(HypeMan.UDPSendSocket:sendto(tbl_json_txt, '127.0.0.1', 10081)) -- msg = nil -- setting to nil in attempt to debug why message queue seems to grow end HypeMan.sendBotMessage = function(msg) -- env.info(msg) -- for debugging --socket.try(HypeMan.UDPSendSocket:sendto(msg, '127.0.0.1', 10081)) messageTable = {} messageTable.messageType = 1 messageTable.messageString = msg HypeMan.sendBotTable(messageTable) msg = nil -- setting to nil in attempt to debug why message queue seems to grow end -- Mission Start announcement done by a function right in the script as the S_EVENT_MISSION_START event is -- nearly impossible to catch in a script as it gets sent the moment the mission is unpaused if HypeManAnnounceMissionStart then local theDate = mist.getDateString(true, true) local theTime = mist.getClockString() local theatre = env.mission.theatre HypeMan.sendBotMessage('$SERVERNAME - New mission launched in the ' .. theatre .. '. HypeMan standing by to stand by. Local mission time is ' .. theTime .. ', ' .. theDate) end local function HypeManGetName(initiator) if initiator == nil then return false, nil; end local statusflag, name = pcall(Unit.getPlayerName, initiator) if statusflag == false then return false, nil; end return true, name; end local function HypeManTakeOffHandler(event) -- TODO move this check below the timing code if HypeManAnnounceTakeoffs ~= true then return true end if event.id == world.event.S_EVENT_TAKEOFF then -- mist.utils.tableShow(event) --local name = Unit.getPlayerName(event.initiator) local statusflag, name = HypeManGetName(event.initiator) if statusflag == false then return end -- for debugging get the AI plane names if HypeManAnnounceAIPlanes and name == nil then name = Unit.getName(event.initiator) end if name == nil then return end -- env.info(_event.initiator:getPlayerName().."HIT! ".._event.target:getName().." with ".._event.weapon:getTypeName()) local airfieldName = Airbase.getName(event.place) if airfieldName == nil then airfieldName = 'Unknown Airstrip' end HypeMan.sendBotMessage(name .. " took off from " .. airfieldName .. " in a " .. Unit.getTypeName(event.initiator) .. " on $SERVERNAME") HypeManTakeOffTime[Unit.getID(event.initiator)]=timer.getAbsTime() end end local function HypeManLandingHandler(event) if event.id == world.event.S_EVENT_LAND then -- mist.utils.tableShow(event) -- local name = Unit.getPlayerName(event.initiator) local statusflag, name = HypeManGetName(event.initiator) if statusflag == false then return end -- for debugging get the AI plane names if HypeManAnnounceAIPlanes and name == nil then name = Unit.getName(event.initiator) end if name == nil then return end -- env.info(_event.initiator:getPlayerName().."HIT! ".._event.target:getName().." with ".._event.weapon:getTypeName()) local airfieldName = Airbase.getName(event.place) if airfieldName == nil then airfieldName = 'Unknown Airfield' end local t = HypeManTakeOffTime[Unit.getID(event.initiator)] HypeManTakeOffTime[Unit.getID(event.initiator)] = nil if t == nil then -- HypeMan.sendBotMessage("local t = TakeOffTime[Unit.getID(event.initiator)] was nil... wtf") HypeMan.sendBotMessage(name .. " landed their " .. Unit.getTypeName(event.initiator) .. " at " .. airfieldName .. " on $SERVERNAME") return end local cur = timer.getAbsTime() local tduration = cur - t local theTime = mist.getClockString(tduration) if tduration > HypeManMinimumFlightTime then HypeMan.sendBotMessage(name .. " landed their " .. Unit.getTypeName(event.initiator) .. " at " .. airfieldName .. " on $SERVERNAME. Total flight time was " .. theTime) end end end local function HypeManMissionEndHandler(event) if event.id == world.event.S_EVENT_MISSION_END then local theDate = mist.getDateString(true, true) local theTime = mist.getClockString() -- HypeMan.sendBotMessage('Server shutting down, Hypeman going watch some porn and hit the hay. Local time is ' .. theTime .. ', ' .. theDate) local timeInSec = mist.utils.round(timer.getAbsTime(), 0) -- local theTimeString = mist.getClockString(timeInSec) local DHMS = mist.time.getDHMS(mist.time.relativeToStart(timeInSec)) local dayStr if DHMS.d == 0 then dayStr = '' -- leave days portion blank else dayStr = DHMS.d .. ' days ' end local theTimeString = dayStr .. DHMS.h .. ' hours and ' .. DHMS.m .. ' minutes.' HypeMan.sendBotMessage('$SERVERNAME shutting down, mission ran for ' .. theTimeString .. ' Hypeman going watch TOPGUN again.'); end end local function HypeManBirthHandler(event) if event.id == world.event.S_EVENT_BIRTH then -- local name = Unit.getPlayerName(event.initiator) local statusflag, name = HypeManGetName(event.initiator) if statusflag == false then return end if name == nil then name = Unit.getName(event.initiator) end HypeManTakeOffTime[Unit.getID(event.initiator)]=nil -- HypeMan.sendBotMessage('S_EVENT_BIRTH UNIT.name = ' .. name) end end local function HypeManPilotDeadHandler(event) if event.id == world.event.S_EVENT_PILOT_DEAD then -- local name = Unit.getPlayerName(event.initiator) local statusflag, name = HypeManGetName(event.initiator) if statusflag == false then return end -- for debugging get the AI plane names if HypeManAnnounceAIPlanes and name == nil then name = Unit.getName(event.initiator) end if name == nil then return end -- if name == nil then -- name = Unit.getName(event.initiator) -- end local unitid = Unit.getID(event.initiator) if unitid ~= nil and event.iniator ~= nil then HypeManTakeOffTime[Unit.getID(event.initiator)]=nil end HypeMan.sendBotMessage('RIP ' .. name .. '. HypeMan pours out a little liquor for his homie.') end end local function HypeManPilotEjectHandler(event) if event.id == world.event.S_EVENT_EJECTION then -- local name = Unit.getPlayerName(event.initiator) local statusflag, name = HypeManGetName(event.initiator) if statusflag == false then return end -- for debugging get the AI plane names if HypeManAnnounceAIPlanes and name == nil then name = Unit.getName(event.initiator) end if name == nil then return end HypeManTakeOffTime[Unit.getID(event.initiator)]=nil HypeMan.sendBotMessage(name .. ' has EJECTED from their' .. Unit.getTypeName(event.initiator) .. ' on $SERVERNAME. Send in the rescue helos!') end end local function HypeManRefuelingHandler(event) if event.id == world.event. S_EVENT_REFUELING then local statusflag, name = HypeManGetName(event.initiator) if statusflag == false then return end if HypeManAnnounceAIPlanes and name == nil then name = Unit.getName(event.initiator) end if name == nil then return end local t = HypeManRefuelingTable[Unit.getID(event.initiator)] local sendMessage = false if t == nil then sendMessage = true else local cur = timer.getAbsTime() local tduration = cur - t if tduration < 600 then sendMessage = false else sendMessage = true end end HypeManRefuelingTable[Unit.getID(event.initiator)] = cur if sendMessage == true then HypeMan.sendBotMessage(' a\'ight, looks like ' .. name .. ' is getting a poke on the $SERVERNAME.') end end end if HypeManAnnounceRefueling then mist.addEventHandler(HypeManRefuelingHandler) end mist.addEventHandler(HypeManBirthHandler) --if HypeManAnnounceCrash then -- mist.addEventHandler(HypeManCrashHandler) --end --if HypeManAnnounceKills then -- mist.addEventHandler(HypeManHitHandler) -- mist.addEventHandler(HypeManDeadHandler) --end if HypeManAnnounceTakeoffs then mist.addEventHandler(HypeManTakeOffHandler) end if HypeManAnnounceLandings then mist.addEventHandler(HypeManLandingHandler) end if HypeManAnnouncePilotEject then mist.addEventHandler(HypeManPilotEjectHandler) end if HypeManAnnouncePilotDead then mist.addEventHandler(HypeManPilotDeadHandler) end if HypeManAnnounceMissionEnd then mist.addEventHandler(HypeManMissionEndHandler) end
29.676796
176
0.701387
d8eb4f902ea8f9b6039cf18f03a94c29c2993244
587
asm
Assembly
oeis/163/A163662.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/163/A163662.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/163/A163662.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A163662: A020988 written in base 2. ; 10,1010,101010,10101010,1010101010,101010101010,10101010101010,1010101010101010,101010101010101010,10101010101010101010,1010101010101010101010,101010101010101010101010,10101010101010101010101010,1010101010101010101010101010,101010101010101010101010101010,10101010101010101010101010101010,1010101010101010101010101010101010,101010101010101010101010101010101010,10101010101010101010101010101010101010,1010101010101010101010101010101010101010,101010101010101010101010101010101010101010 mov $1,100 pow $1,$0 div $1,99 mul $1,1000 add $1,10 mov $0,$1
58.7
484
0.897785
788c01bfdf327dbc53d8b4874955458e2be04460
1,007
ps1
PowerShell
scripts/install-android-ndk.ps1
Odirb/SkiaSharp
dbede37aa09aeac1b861e6cac21cb98013d98b29
[ "MIT" ]
null
null
null
scripts/install-android-ndk.ps1
Odirb/SkiaSharp
dbede37aa09aeac1b861e6cac21cb98013d98b29
[ "MIT" ]
null
null
null
scripts/install-android-ndk.ps1
Odirb/SkiaSharp
dbede37aa09aeac1b861e6cac21cb98013d98b29
[ "MIT" ]
null
null
null
Param( [string] $Version = "r15c" ) $ErrorActionPreference = 'Stop' Add-Type -AssemblyName System.IO.Compression.FileSystem if ($IsMacOS) { $platform = "darwin-x86_64" } elseif ($IsLinux) { $platform = "linux-x86_64" } else { $platform = "windows-x86_64" } $url = "https://dl.google.com/android/repository/android-ndk-${Version}-${platform}.zip" $ndk = "$HOME/android-ndk" $ndkTemp = "$HOME/android-ndk-temp" $install = "$ndkTemp/android-ndk.zip" # download Write-Host "Downloading NDK..." New-Item -ItemType Directory -Force -Path "$ndkTemp" | Out-Null (New-Object System.Net.WebClient).DownloadFile("$url", "$install") # extract Write-Host "Extracting NDK..." if ($IsMacOS -or $IsLinux) { # use the native command to preserve permissions unzip "$install" -d "$ndkTemp" }else { [System.IO.Compression.ZipFile]::ExtractToDirectory("$install", "$ndkTemp") } # move / rename Write-Host "Moving NDK..." Move-Item "${ndkTemp}\android-ndk-${Version}" "$ndk" exit $LASTEXITCODE
25.175
88
0.684211
71f99d7e02839f29f5ed806baceade5f1dfd4e1b
1,537
ts
TypeScript
src/shared/utilities/vsCodeUtils.ts
ejafarli/aws-toolkit-vscode
09de3278c3056acfaf78e47ba109eb4359ef6354
[ "Apache-2.0" ]
7
2021-12-18T05:49:26.000Z
2021-12-28T09:52:36.000Z
src/shared/utilities/vsCodeUtils.ts
rmillag/aws-toolkit-vscode
efd898f2fc95201c3fc627549cb14d8b2cf626c4
[ "Apache-2.0" ]
4
2021-05-09T13:15:03.000Z
2022-01-15T03:29:44.000Z
src/shared/utilities/vsCodeUtils.ts
Takuya-Miyazaki/aws-toolkit-vscode
1f3a3c75c6211aa789efe7f131a19f31d8c9bdbf
[ "Apache-2.0" ]
null
null
null
/*! * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import * as vscode from 'vscode' import * as nls from 'vscode-nls' import { ext } from '../../shared/extensionGlobals' // TODO: Consider NLS initialization/configuration here & have packages to import localize from here export const localize = nls.loadMessageBundle() export function isFileIconThemeSeti(): boolean { const iconTheme = vscode.workspace.getConfiguration('workbench').get('iconTheme') return !iconTheme || iconTheme === 'vs-seti' } export function fileIconPath(): vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri } { // Workaround for https://github.com/microsoft/vscode/issues/85654 // Once this is resolved, ThemeIcons can be used for seti as well if (isFileIconThemeSeti()) { return { dark: vscode.Uri.file(ext.iconPaths.dark.file), light: vscode.Uri.file(ext.iconPaths.light.file), } } else { return vscode.ThemeIcon.File } } export function folderIconPath(): vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri } { // Workaround for https://github.com/microsoft/vscode/issues/85654 // Once this is resolved, ThemeIcons can be used for seti as well if (isFileIconThemeSeti()) { return { dark: vscode.Uri.file(ext.iconPaths.dark.folder), light: vscode.Uri.file(ext.iconPaths.light.folder), } } else { return vscode.ThemeIcon.Folder } }
35.744186
100
0.676643
10a47cca47607b604019c2e01929eefae8b6dbb0
1,660
swift
Swift
FormValidation/Form.swift
Nickelfox/form-validation-ios
ec7144ef0e529c7f2d7fc7b437a8b060072b1dce
[ "MIT" ]
1
2019-05-07T11:01:48.000Z
2019-05-07T11:01:48.000Z
FormValidation/Form.swift
Nickelfox/FormValidation
ec7144ef0e529c7f2d7fc7b437a8b060072b1dce
[ "MIT" ]
null
null
null
FormValidation/Form.swift
Nickelfox/FormValidation
ec7144ef0e529c7f2d7fc7b437a8b060072b1dce
[ "MIT" ]
null
null
null
// // Form.swift // FormValidations // // Created by Vaibhav Parmar on 18/04/17. // Copyright © 2017 Nickelfox. All rights reserved. // import Foundation import UIKit public protocol ValidatableInput { var isOptional: Bool { get } var inputText: String? { get } var validator: ValidationProtocol? { get } } public class Form { public init() { } public var inputs: [ValidatableInput] = [] public func validate() -> (Bool, [String]) { var isValid = true var errors = [String]() for input in inputs { if !input.isOptional { if let text = input.inputText, let validator = input.validator { let (valid, error) = canValidate(text: text, validator: validator) if !valid, let err = error { isValid = valid errors.append(err) } } else { isValid = false errors.append("Can't validate Empty String") } } else { if let text = input.inputText, let validator = input.validator, text.count > 0 { let (valid, error) = canValidate(text: text, validator: validator) if !valid, let err = error { isValid = valid errors.append(err) } } } } return (isValid, errors) } func canValidate( text: String, validator: ValidationProtocol) -> (Bool, String?) { return validator.validate(text) } }
29.122807
96
0.500602
90a29ffd4497e3778e548cac2316416a48df6bfa
1,089
py
Python
models/dtl/wrt/loc_table.py
owenmwilliams/land_search
630e71672a5fff21c833d9905406b9ef70571b28
[ "MIT" ]
1
2020-11-20T22:33:01.000Z
2020-11-20T22:33:01.000Z
models/dtl/wrt/loc_table.py
owenmwilliams/land_search
630e71672a5fff21c833d9905406b9ef70571b28
[ "MIT" ]
49
2020-10-17T14:57:58.000Z
2021-01-09T15:46:56.000Z
models/dtl/wrt/loc_table.py
owenmwilliams/land_search
630e71672a5fff21c833d9905406b9ef70571b28
[ "MIT" ]
2
2020-10-26T18:20:47.000Z
2020-11-20T22:32:20.000Z
from dtl.api.dtl_loc import shp_get from est.db.cur import con_cur import json from io import StringIO import psycopg2 from psycopg2 import sql ### NEED TO COME BACK HERE TO FIGURE OUT HOW TO CONVERT ARCGIS RINGS INTO POSTGIS POLY def wrt_loc(a): y = shp_get() buffer = StringIO() y.to_csv(buffer, index_label='id', header=False, sep=';') buffer.seek(0) cur, con = con_cur() try: cur.execute( sql.SQL("""CREATE TABLE {} ( series_key serial, county_name varchar(80) NOT NULL, state_name varchar(80) NOT NULL, state varchar(20), county varchar(20), housing_units int, sqmi decimal, object_id int PRIMARY KEY, geom_poly polygon) """).format(sql.Identifier(a))) cur.copy_from(buffer, a, sep=";") except (Exception, psycopg2.DatabaseError) as error: print("Error: %s" % error) con.rollback() cur.close() con.commit() cur.close()
27.923077
86
0.56382
6582081ecdb2ff966f99be2a5311140e1392ff85
2,890
rs
Rust
runtime/src/genesis_utils.rs
vkomenda/solana
b7b71b31d333f66161cb8a5eb2f798e48fea260f
[ "Apache-2.0" ]
null
null
null
runtime/src/genesis_utils.rs
vkomenda/solana
b7b71b31d333f66161cb8a5eb2f798e48fea260f
[ "Apache-2.0" ]
null
null
null
runtime/src/genesis_utils.rs
vkomenda/solana
b7b71b31d333f66161cb8a5eb2f798e48fea260f
[ "Apache-2.0" ]
null
null
null
use solana_sdk::{ account::Account, fee_calculator::FeeCalculator, genesis_block::GenesisBlock, pubkey::Pubkey, signature::{Keypair, KeypairUtil}, system_program::{self, solana_system_program}, }; use solana_stake_api::stake_state; use solana_vote_api::vote_state; // The default stake placed with the bootstrap leader pub const BOOTSTRAP_LEADER_LAMPORTS: u64 = 42; pub struct GenesisBlockInfo { pub genesis_block: GenesisBlock, pub mint_keypair: Keypair, pub voting_keypair: Keypair, } pub fn create_genesis_block(mint_lamports: u64) -> GenesisBlockInfo { create_genesis_block_with_leader(mint_lamports, &Pubkey::new_rand(), 0) } pub fn create_genesis_block_with_leader( mint_lamports: u64, bootstrap_leader_pubkey: &Pubkey, bootstrap_leader_stake_lamports: u64, ) -> GenesisBlockInfo { let bootstrap_leader_lamports = BOOTSTRAP_LEADER_LAMPORTS; // TODO: pass this in as an argument? let mint_keypair = Keypair::new(); let voting_keypair = Keypair::new(); let staking_keypair = Keypair::new(); // TODO: de-duplicate the stake... passive staking is fully implemented let vote_account = vote_state::create_account( &voting_keypair.pubkey(), &bootstrap_leader_pubkey, 0, bootstrap_leader_stake_lamports, ); let stake_account = stake_state::create_account( &staking_keypair.pubkey(), &voting_keypair.pubkey(), &vote_account, bootstrap_leader_stake_lamports, ); let accounts = vec![ // the mint ( mint_keypair.pubkey(), Account::new(mint_lamports, 0, &system_program::id()), ), // node needs an account to issue votes and storage proofs from, this will require // airdrops at some point to cover fees... ( *bootstrap_leader_pubkey, Account::new(bootstrap_leader_lamports, 0, &system_program::id()), ), // where votes go to (voting_keypair.pubkey(), vote_account), // passive bootstrap leader stake, duplicates above temporarily (staking_keypair.pubkey(), stake_account), ]; // Bare minimum program set let native_instruction_processors = vec![ solana_system_program(), solana_bpf_loader_program!(), solana_vote_program!(), solana_stake_program!(), ]; let fee_calculator = FeeCalculator::new(0, 0); // most tests don't want fees let mut genesis_block = GenesisBlock { accounts, native_instruction_processors, fee_calculator, ..GenesisBlock::default() }; solana_stake_api::add_genesis_accounts(&mut genesis_block); solana_storage_api::rewards_pools::add_genesis_accounts(&mut genesis_block); GenesisBlockInfo { genesis_block, mint_keypair, voting_keypair, } }
31.075269
100
0.675087
50bbbbd619688e57a9ccebd5c2451bdcc1634191
8,260
go
Go
lib/bucket_policy.go
cn00/ossutil
ab25a2c16c028f91cce57d26e015d25fca00f37c
[ "MIT" ]
null
null
null
lib/bucket_policy.go
cn00/ossutil
ab25a2c16c028f91cce57d26e015d25fca00f37c
[ "MIT" ]
null
null
null
lib/bucket_policy.go
cn00/ossutil
ab25a2c16c028f91cce57d26e015d25fca00f37c
[ "MIT" ]
null
null
null
package lib import ( "bytes" "encoding/json" "fmt" "io/ioutil" "os" "strings" ) var specChineseBucketPolicy = SpecText{ synopsisText: "设置、查询或者删除bucket的policy配置", paramText: "bucket_url [local_json_file] [options]", syntaxText: ` ossutil bucket-policy --method put oss://bucket local_json_file [options] ossutil bucket-policy --method get oss://bucket [local_file] [options] ossuitl bucket-policy --method delete oss://bucket [options] `, detailHelpText: ` bucket-policy命令通过设置method选项值为put、get、delete,可以设置、查询或者删除bucket的policy配置 用法: 该命令有三种用法: 1) ossutil bucket-policy --method put oss://bucket local_json_file [options] 这个命令从配置文件local_json_file中读取policy配置,然后设置bucket的policy规则 配置文件是一个json格式的文件,举例如下 { "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "ram:ListObjects" ], "Principal": [ "1234567" ], "Resource": [ "*" ], "Condition": {} } ] } 2) ossutil bucket-policy --method get oss://bucket [local_json_file] [options] 这个命令查询bucket的policy配置,如果输入参数local_json_file,policy配置将输出到该文件,否则输出到屏幕上 3) ossutil bucket-policy --method delete oss://bucket [options] 这个命令删除bucket的policy配置 `, sampleText: ` 1) 设置bucket的policy配置 ossutil bucket-policy --method put oss://bucket local_json_file 2) 查询bucket的policy配置,结果输出到标准输出 ossutil bucket-policy --method get oss://bucket 3) 查询bucket的policy配置,结果输出到本地文件 ossutil bucket-policy --method get oss://bucket local_json_file 4) 删除bucket的policy配置 ossutil bucket-policy --method delete oss://bucket `, } var specEnglishBucketPolicy = SpecText{ synopsisText: "Set, get or delete bucket policy configuration", paramText: "bucket_url [local_json_file] [options]", syntaxText: ` ossutil bucket-policy --method put oss://bucket local_json_file [options] ossutil bucket-policy --method get oss://bucket [local_json_file] [options] ossuitl bucket-policy --method delete oss://bucket [options] `, detailHelpText: ` bucket-policy command can set, get and delete the policy configuration of the oss bucket by set method option value to put, get, delete Usage: There are three usages for this command: 1) ossutil bucket-policy --method put oss://bucket local_json_file [options] The command sets the policy configuration of bucket from local file local_json_file the local_json_file is xml format,for example { "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "ram:ListObjects" ], "Principal": [ "1234567" ], "Resource": [ "*" ], "Condition": {} } ] } 2) ossutil bucket-policy --method get oss://bucket [local_json_file] [options] The command gets the policy configuration of bucket If you input parameter local_json_file,the configuration will be output to local_json_file If you don't input parameter local_json_file,the configuration will be output to stdout 3) ossutil bucket-policy --method delete oss://bucket [options] The command deletes the policy configuration of bucket `, sampleText: ` 1) put bucket policy ossutil bucket-policy --method put oss://bucket local_json_file 2) get bucket policy configuration to stdout ossutil bucket-policy --method get oss://bucket 3) get bucket policy configuration to local file ossutil bucket-policy --method get oss://bucket local_json_file 4) delete bucket policy configuration ossutil bucket-policy --method delete oss://bucket `, } type bucketPolicyOptionType struct { bucketName string } type BucketPolicyCommand struct { command Command bpOption bucketPolicyOptionType } var bucketPolicyCommand = BucketPolicyCommand{ command: Command{ name: "bucket-policy", nameAlias: []string{"bucket-policy"}, minArgc: 1, maxArgc: 2, specChinese: specChineseBucketPolicy, specEnglish: specEnglishBucketPolicy, group: GroupTypeNormalCommand, validOptionNames: []string{ OptionConfigFile, OptionEndpoint, OptionAccessKeyID, OptionAccessKeySecret, OptionSTSToken, OptionProxyHost, OptionProxyUser, OptionProxyPwd, OptionLogLevel, OptionMethod, OptionPassword, }, }, } // function for FormatHelper interface func (bpc *BucketPolicyCommand) formatHelpForWhole() string { return bpc.command.formatHelpForWhole() } func (bpc *BucketPolicyCommand) formatIndependHelp() string { return bpc.command.formatIndependHelp() } // Init simulate inheritance, and polymorphism func (bpc *BucketPolicyCommand) Init(args []string, options OptionMapType) error { return bpc.command.Init(args, options, bpc) } // RunCommand simulate inheritance, and polymorphism func (bpc *BucketPolicyCommand) RunCommand() error { strMethod, _ := GetString(OptionMethod, bpc.command.options) if strMethod == "" { return fmt.Errorf("--method value is empty") } strMethod = strings.ToLower(strMethod) if strMethod != "put" && strMethod != "get" && strMethod != "delete" { return fmt.Errorf("--method value is not in the optional value:put|get|delete") } srcBucketUrL, err := GetCloudUrl(bpc.command.args[0], "") if err != nil { return err } bpc.bpOption.bucketName = srcBucketUrL.bucket if strMethod == "put" { err = bpc.PutBucketPolicy() } else if strMethod == "get" { err = bpc.GetBucketPolicy() } else if strMethod == "delete" { err = bpc.DeleteBucketPolicy() } return err } func (bpc *BucketPolicyCommand) PutBucketPolicy() error { if len(bpc.command.args) < 2 { return fmt.Errorf("put bucket policy need at least 2 parameters,the local json file is empty") } jsonFile := bpc.command.args[1] fileInfo, err := os.Stat(jsonFile) if err != nil { return err } if fileInfo.IsDir() { return fmt.Errorf("%s is dir,not the expected file", jsonFile) } if fileInfo.Size() == 0 { return fmt.Errorf("%s is empty file", jsonFile) } // parsing the xml file file, err := os.Open(jsonFile) if err != nil { return err } defer file.Close() text, err := ioutil.ReadAll(file) if err != nil { return err } // put bucket policy client, err := bpc.command.ossClient(bpc.bpOption.bucketName) if err != nil { return err } return client.SetBucketPolicy(bpc.bpOption.bucketName, string(text)) } func (bpc *BucketPolicyCommand) confirm(str string) bool { var val string fmt.Printf(getClearStr(fmt.Sprintf("bucket policy: overwrite \"%s\"(y or N)? ", str))) if _, err := fmt.Scanln(&val); err != nil || (strings.ToLower(val) != "yes" && strings.ToLower(val) != "y") { return false } return true } func (bpc *BucketPolicyCommand) GetBucketPolicy() error { client, err := bpc.command.ossClient(bpc.bpOption.bucketName) if err != nil { return err } policyRes, err := client.GetBucketPolicy(bpc.bpOption.bucketName) if err != nil { return err } var outFile *os.File if len(bpc.command.args) >= 2 { fileName := bpc.command.args[1] _, err = os.Stat(fileName) if err == nil { bConitnue := bpc.confirm(fileName) if !bConitnue { return nil } } outFile, err = os.OpenFile(fileName, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0660) if err != nil { return err } defer outFile.Close() } else { outFile = os.Stdout } var jsonText bytes.Buffer _ = json.Indent(&jsonText, []byte(policyRes), "", " ") outFile.Write(jsonText.Bytes()) fmt.Printf("\n\n") return nil } func (bpc *BucketPolicyCommand) DeleteBucketPolicy() error { // delete bucket policy client, err := bpc.command.ossClient(bpc.bpOption.bucketName) if err != nil { return err } return client.DeleteBucketPolicy(bpc.bpOption.bucketName) }
26.731392
110
0.649153
0fd068272c196db198bee1c43d8cc8fa3eef543a
307
kt
Kotlin
server-app/email.notification/src/main/kotlin/com/github/akraskovski/fes/email/notification/EmailService.kt
akraskovski/freight-exchange-system
b4d99ea9aa462110c024eaafb804030bd5186ea8
[ "Apache-2.0" ]
2
2018-10-28T19:29:36.000Z
2022-02-16T23:25:38.000Z
server-app/email.notification/src/main/kotlin/com/github/akraskovski/fes/email/notification/EmailService.kt
akraskovski/freight-exchange-system
b4d99ea9aa462110c024eaafb804030bd5186ea8
[ "Apache-2.0" ]
null
null
null
server-app/email.notification/src/main/kotlin/com/github/akraskovski/fes/email/notification/EmailService.kt
akraskovski/freight-exchange-system
b4d99ea9aa462110c024eaafb804030bd5186ea8
[ "Apache-2.0" ]
1
2019-03-24T18:29:06.000Z
2019-03-24T18:29:06.000Z
package com.github.akraskovski.fes.email.notification /** * Common email notification process service. */ interface EmailService { /** * Sends email to the given receiver email with a predefined template. */ fun send(receiver: String, templateId: Int, variables: Map<String, String>) }
25.583333
79
0.713355
7ff0bfe27c35d1a6e9f391824096e059607b09e7
478
go
Go
controllers/admin.go
kimtaek/gapi
467e6fcd817c61fd5a4a7db5337b3b35796d2a8f
[ "MIT" ]
3
2019-09-26T06:42:01.000Z
2020-11-04T07:41:13.000Z
controllers/admin.go
kimtaek/gapi
467e6fcd817c61fd5a4a7db5337b3b35796d2a8f
[ "MIT" ]
null
null
null
controllers/admin.go
kimtaek/gapi
467e6fcd817c61fd5a4a7db5337b3b35796d2a8f
[ "MIT" ]
null
null
null
package controllers import ( "gapi/lib" "gapi/models" "github.com/gin-gonic/gin" "strings" ) type Admin struct { models.Admin } func (_ *Admin) Me(c *gin.Context) { var response = lib.Data{} authorization := c.GetHeader("Authorization") token := strings.Split(authorization, "Bearer ")[1] claims, err := lib.ParseToken(token, c) if err == nil { model := new(models.Admin) user := model.Find(claims.Auth.Id) response.Data = user } lib.Respond(c, response) }
18.384615
52
0.675732