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
1cd841a2624ef617bccc406bbc78759d18f15304
1,690
sql
SQL
Dump/ci4app.sql
NathandeNascimento/CadastroAlunoCodeignaiter4
312148b5f19a6bd98004c12ed37fda8fda9e9725
[ "MIT" ]
null
null
null
Dump/ci4app.sql
NathandeNascimento/CadastroAlunoCodeignaiter4
312148b5f19a6bd98004c12ed37fda8fda9e9725
[ "MIT" ]
null
null
null
Dump/ci4app.sql
NathandeNascimento/CadastroAlunoCodeignaiter4
312148b5f19a6bd98004c12ed37fda8fda9e9725
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 03-Fev-2022 às 09:14 -- Versão do servidor: 10.4.22-MariaDB -- versão do PHP: 8.0.13 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Banco de dados: `ci4app` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `categoria` -- CREATE TABLE `categoria` ( `id` int(11) NOT NULL, `nome` varchar(100) NOT NULL, `endereco` varchar(100) NOT NULL, `foto` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Extraindo dados da tabela `categoria` -- INSERT INTO `categoria` (`id`, `nome`, `endereco`, `foto`) VALUES (1, 'Nathan Oliveira do Nascimento', 'rua 4 , 265, jd planalto', '1643876026_63247618d636369d1157.jpg'), (2, 'Saiery Daianne Dos Santos', 'rua 4 , 265, jd planalto', '1643876037_1a6f6f7fa188398a3d70.jpg'); -- -- Índices para tabelas despejadas -- -- -- Índices para tabela `categoria` -- ALTER TABLE `categoria` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT de tabelas despejadas -- -- -- AUTO_INCREMENT de tabela `categoria` -- ALTER TABLE `categoria` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
24.492754
104
0.686391
258bc87e745ec2094c9d19a33d4c2ad60f4628ca
1,612
cs
C#
src/Trakx.Coinbase.Custody.Client/Models/AddressResponse.cs
fakecoinbase/trakxslashtrakx-tools
69b8be79d5218bb44dcc997237da5ccfe79ec9dd
[ "MIT" ]
null
null
null
src/Trakx.Coinbase.Custody.Client/Models/AddressResponse.cs
fakecoinbase/trakxslashtrakx-tools
69b8be79d5218bb44dcc997237da5ccfe79ec9dd
[ "MIT" ]
null
null
null
src/Trakx.Coinbase.Custody.Client/Models/AddressResponse.cs
fakecoinbase/trakxslashtrakx-tools
69b8be79d5218bb44dcc997237da5ccfe79ec9dd
[ "MIT" ]
null
null
null
using System; using System.Text.Json.Serialization; using Newtonsoft.Json; namespace Trakx.Coinbase.Custody.Client.Models { public class AddressResponse { #nullable disable [JsonPropertyName("address")] public string Address { get; set; } /// <summary> /// State can be compared using <see cref="AddressState"/> /// </summary> [JsonPropertyName("state")] public string State { get; set; } [JsonPropertyName("balance")] public long Balance { get; set; } [JsonProperty("blockchain_link")] [JsonPropertyName("blockchain_link")] public Uri BlockchainLink { get; set; } [JsonProperty("created_at")] [JsonPropertyName("created_at")] public DateTimeOffset CreatedAt { get; set; } [JsonProperty("updated_at")] [JsonPropertyName("updated_at")] public DateTimeOffset UpdatedAt { get; set; } [JsonPropertyName("currency")] public string Currency { get; set; } #nullable restore } public static class AddressState { /// <summary> /// Address is secured in offline storage /// </summary> public static readonly string Cold = "cold"; /// <summary> /// Address is in-progress of being brought online /// </summary> public static readonly string RestoreInProgress = "restore_in_progress"; /// <summary> /// Address has been brought online /// </summary> public static readonly string Restored = "restored"; } }
28.280702
80
0.597395
8ba4a511637d2448ba6440eb90f5ea3ddaa4a467
734
rb
Ruby
app/controllers/explore/posts_controller.rb
hahaluckyme/e621ng
7c667897ce3a9bfecea073222aa02000e5f9b933
[ "BSD-2-Clause-FreeBSD" ]
115
2019-02-02T23:07:11.000Z
2022-03-17T21:18:51.000Z
app/controllers/explore/posts_controller.rb
hahaluckyme/e621ng
7c667897ce3a9bfecea073222aa02000e5f9b933
[ "BSD-2-Clause-FreeBSD" ]
232
2019-02-06T00:38:49.000Z
2022-03-28T13:44:26.000Z
app/controllers/explore/posts_controller.rb
hahaluckyme/e621ng
7c667897ce3a9bfecea073222aa02000e5f9b933
[ "BSD-2-Clause-FreeBSD" ]
49
2019-02-16T22:39:09.000Z
2022-03-25T04:44:31.000Z
module Explore class PostsController < ApplicationController respond_to :html, :json before_action :set_date, only: [:searches] def popular @post_set = PostSets::Popular.new(params[:date], params[:scale]) @posts = @post_set.posts respond_with(@posts) end def searches @search_service = PopularSearchService.new(@date) end def missed_searches @search_service = MissedSearchService.new end def intro @presenter = IntroPresenter.new render :layout => "blank" end private def set_date @date = params[:date] ? Date.parse(params[:date]) : Date.today end def allowed_readonly_actions super + ["popular"] end end end
20.388889
70
0.649864
ea3e7ed5f87147247776cc081a8c9e163ddaa739
616
swift
Swift
Sources/HTTP/Responder/Responder.swift
dequelabs/HTTP
d663a6aa06a8cba890e40b5dbd147fa6c5eabfba
[ "MIT" ]
38
2015-11-28T11:30:17.000Z
2016-10-26T06:32:10.000Z
Sources/HTTP/Responder/Responder.swift
dequelabs/HTTP
d663a6aa06a8cba890e40b5dbd147fa6c5eabfba
[ "MIT" ]
9
2015-12-23T01:31:42.000Z
2016-10-20T19:10:37.000Z
Sources/HTTP/Responder/Responder.swift
Zewo/HTTP
d663a6aa06a8cba890e40b5dbd147fa6c5eabfba
[ "MIT" ]
27
2015-12-02T19:24:39.000Z
2017-04-21T17:26:06.000Z
public protocol Responder : ResponderRepresentable { func respond(to request: Request) throws -> Response } extension Responder { public var responder: Responder { return self } } public protocol ResponderRepresentable { var responder: Responder { get } } public typealias Respond = (_ to: Request) throws -> Response public struct BasicResponder : Responder { let respond: Respond public init(_ respond: @escaping Respond) { self.respond = respond } public func respond(to request: Request) throws -> Response { return try self.respond(request) } }
22
65
0.688312
259054b42751383304bb607ecc3690be6cda40f2
6,319
swift
Swift
Connect/NetworkClient/ConnectApiClient.swift
higish/connect-ios-sdk
cf95607b3ae9ae0177378e50e67a8fdf88812203
[ "Apache-2.0" ]
null
null
null
Connect/NetworkClient/ConnectApiClient.swift
higish/connect-ios-sdk
cf95607b3ae9ae0177378e50e67a8fdf88812203
[ "Apache-2.0" ]
null
null
null
Connect/NetworkClient/ConnectApiClient.swift
higish/connect-ios-sdk
cf95607b3ae9ae0177378e50e67a8fdf88812203
[ "Apache-2.0" ]
1
2021-06-08T15:54:24.000Z
2021-06-08T15:54:24.000Z
/* * Copyright (c) 2018 Zendesk. All rights reserved. * * By downloading or using the Zendesk Mobile SDK, You agree to the Zendesk Master * Subscription Agreement https://www.zendesk.com/company/customers-partners/master-subscription-agreement and Application Developer and API License * Agreement https://www.zendesk.com/company/customers-partners/application-developer-api-license-agreement and * acknowledge that such terms govern Your use of and access to the Mobile SDK. * */ import Foundation let OutboundHostDomain = "api.outbound.io" let PlatformString = "ios" let NoNetworkLog = "No network. Can't send {queue} queue, skipping network call." let ConfigFetchInterval = 3600 extension Data { var hexString: String { let hexString = map { String(format: "%02.2hhx", $0) }.joined() return hexString } } typealias ConfigUpdateHandler = (Result<Config>) -> Void protocol ConnectApi { func register(_ token: Data, for userId: String) func disable(_ token: Data, for userId: String) func flush(_ eventQueue: Queue<Event>) func flush(_ identifyQueue: Queue<User>) func scheduleConfigFetch(start: DispatchWallTime, reapeatFrequency: DispatchTimeInterval, leeway: DispatchTimeInterval, handler: @escaping ConfigUpdateHandler) } extension ConnectApi { func scheduleConfigFetch(start: DispatchWallTime, reapeatFrequency: DispatchTimeInterval = .seconds(ConfigFetchInterval), leeway: DispatchTimeInterval = .seconds(1), handler: @escaping ConfigUpdateHandler) { return scheduleConfigFetch(start: start, reapeatFrequency: reapeatFrequency, leeway: leeway, handler: handler) } } class ConnectApiClient: ConnectApi { private let dispatchGroup: DispatchGroup private let operationQueue: OperationQueue private let client: Client private let eventProvider: EventProvider private let identifyProvider: IdentifyProvider private let pushProvider: PushProvider private let configProvider: ConfigProvider private var configTimer: DispatchSourceTimer? init(client: Client, dispatchGroup: DispatchGroup = DispatchGroup()) { self.client = client self.dispatchGroup = dispatchGroup // Inject? eventProvider = EventProvider(with: client) identifyProvider = IdentifyProvider(with: client) pushProvider = PushProvider(with: client) configProvider = ConfigProvider(with: client) operationQueue = OperationQueue() operationQueue.name = "com.zendesk.connect.queue" operationQueue.maxConcurrentOperationCount = 1 operationQueue.qualityOfService = .background } func scheduleConfigFetch(start: DispatchWallTime, reapeatFrequency: DispatchTimeInterval = .seconds(ConfigFetchInterval), leeway: DispatchTimeInterval = .seconds(1), handler: @escaping ConfigUpdateHandler) { guard configTimer == nil else { return } let timer = DispatchSource.makeTimerSource() timer.schedule(wallDeadline: start, repeating: reapeatFrequency, leeway: leeway) timer.setEventHandler { [configProvider] in configProvider.config(platform: PlatformString, version: ConnectVersionString, completion: handler) } timer.resume() configTimer = timer } func register(_ token: Data, for userId: String) { let body = PushRegistration(timestamp: Date().timeIntervalSince1970, userId: userId, token: token.hexString) pushProvider.register(body: body) { (result) in switch result { case .success(_): Logger.debug("Push registration success: registered token: \(token.hexString) , against user ID \(userId)") case .failure(let error): Logger.debug("Push registration failed: \(error.localizedDescription)") } } } func disable(_ token: Data, for userId: String) { let body = PushRegistration(timestamp: Date().timeIntervalSince1970, userId: userId, token: token.hexString) pushProvider.unregister(body: body) { (result) in switch result { case .success(_): Logger.debug("Disable token success: disabled token: \(token.hexString) , against user ID \(userId)") case .failure(let error): Logger.debug("Disable token failed: \(error.localizedDescription)") } } } func flush(_ eventQueue: Queue<Event>) { guard Reachability.status(for: OutboundHostDomain) else { Logger.debug(NoNetworkLog.replacingOccurrences(of: "{queue}", with: "event")) return } guard eventQueue.size > 0 else { return } let eventOperation = EventOperation(provider: eventProvider, queue: eventQueue, group: dispatchGroup) operationQueue.addOperation(eventOperation) } func flush(_ identifyQueue: Queue<User>) { guard Reachability.status(for: OutboundHostDomain) else { Logger.debug(NoNetworkLog.replacingOccurrences(of: "{queue}", with: "identify")) return } guard identifyQueue.size > 0 else { return } let identifyOperation = IdentifyOperation(provider: identifyProvider, queue: identifyQueue, group: dispatchGroup) operationQueue.addOperation(identifyOperation) } }
39.006173
149
0.589967
e21d75679132d74b39bcae22491423a3a35bb4b5
1,937
py
Python
ngs_tools/chemistry/__init__.py
Lioscro/ngsutils
8896e26213704de4e20bb27443f53bc655fd2bc2
[ "MIT" ]
1
2021-12-16T14:07:34.000Z
2021-12-16T14:07:34.000Z
ngs_tools/chemistry/__init__.py
Lioscro/ngsutils
8896e26213704de4e20bb27443f53bc655fd2bc2
[ "MIT" ]
10
2021-05-27T01:39:35.000Z
2022-03-28T13:20:50.000Z
ngs_tools/chemistry/__init__.py
Lioscro/ngsutils
8896e26213704de4e20bb27443f53bc655fd2bc2
[ "MIT" ]
null
null
null
import re from .Chemistry import ( SubSequenceDefinition, SubSequenceDefinitionError, SubSequenceParser, SubSequenceParserError, Chemistry, ChemistryError, ) from .SingleCellChemistry import ( SingleCellChemistry, SingleCellChemistryError, SINGLE_CELL_CHEMISTRIES, ) from .SpatialChemistry import ( SpatialChemistry, SPATIAL_CHEMISTRIES, ) VERSION_PARSER = re.compile(r'v?\d+$') CHEMISTRIES = SINGLE_CELL_CHEMISTRIES + SPATIAL_CHEMISTRIES def _clean_name(name: str): """Internal helper function to clean chemistry names. Args: name: String name of the chemistry. Returns: Cleaned name """ name = name.lower().replace('-', '') version = 1 base_name = name version_search = VERSION_PARSER.search(name) if version_search: version_suffix = name[version_search.start(0):] version = int( version_suffix[1:] if version_suffix[0] == 'v' else version_suffix ) base_name = name[:version_search.start(0)] # Cleaned name is of the form {base_name}-{version}. return f'{base_name}-{version}' def get_chemistry(name: str): """Fetch a :class:`Chemistry` definition by name. Uses some regex magic to correctly deal with chemistry versioning at the end of the name. For instance, ``10x2`` is interpreted the same as ``10xv2``. See :mod:`.SingleCellChemistry` and :mod:`.SpatialChemistry` for available chemistries. Args: name: String name of the chemistry. Any dashes (`-`) or capitalization are ignored. Returns: The matching chemistry. Raises: ChemistryError: If the chemistry could not be found. """ cleaned_name = _clean_name(name) for chemistry in CHEMISTRIES: if cleaned_name == _clean_name(chemistry.name): return chemistry raise ChemistryError(f'Chemistry `{name}` not found')
25.486842
82
0.674239
74a44945dda2dd5256720bf1d019621a10af10a5
3,249
css
CSS
src/assets/style/iconfont.css
gaoyakang/blog
43d9860a281f3ef3177eb9eda611f6a6439f69d2
[ "MIT" ]
null
null
null
src/assets/style/iconfont.css
gaoyakang/blog
43d9860a281f3ef3177eb9eda611f6a6439f69d2
[ "MIT" ]
5
2021-03-09T14:22:12.000Z
2022-02-26T16:15:47.000Z
src/assets/style/iconfont.css
gaoyakang/blog
43d9860a281f3ef3177eb9eda611f6a6439f69d2
[ "MIT" ]
null
null
null
@font-face {font-family: "iconfont"; src: url('../iconfont/iconfont.eot?t=1565772508803'); /* IE9 */ src: url('../iconfont/iconfont.eot?t=1565772508803#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAZIAAsAAAAADJgAAAX6AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEAgqLHIhrATYCJAMkCxQABCAFhG0HexuKClGUT06B7CtsynAvUiQ7zjE2BAAXAEQhAVgA0wIvcFfjH+aRB+Lh+/3+t/bZ5+rDxCM+XTX9hFUaVXw6lEalZMtewv3fNc0VaW4qz5flgFAe/qTpQe64rRq6GQ2szOZIbcJt+N+WD65KBeUiuodbw9b2VYqrCONrUR3m6ccQWE6OP9wv9aKpPZ99O5fKXGTb0QpoQBFtVSKRPFGdiXj1uhdSTsybxxMYbVAnnF/ZOkIZFakD1R4yKqNMzqK20EKvb2u2reK9Rl9elJuQd+HHx3/dyFA0iU50YW5ZQ3O/xgd5NuHu5Jnn23NhsBOJfZBKfKz1vJZxZp+4cVa2egBZpFxxtvX6+QtX+mb/ejBNJYJPW6mJtaRA1zxIe5b/8HpF6jREizTzgH+a7fk1GoSWX/MRgl8LESq/Vkq42uMwKdCegElCewUmHbQPILnzHga3zRLIJii+UNYiw/kj0sUzKVb0MgZ2ca3/o6i2ubY2gxaqaGRkMNJf6DPL8FPkHjZFHAVQfu9CMH6MlLB3EycBNHS2bK27SEECW2KntyAGUENHJYZmiaBrlclLaiF1EvZpwr6aI8CFzBox6SSZq6irpdhnSIcarhAXoNXLhOPo8vukL/SFL3MUr41ErwqkUkKeS9135PFYfD524VChIGU54nMOXC6Tgy7frZVKs2VDYc1L58nl+ZfllnOKuEsyi2lpWXBUBZfEqiJCw8IreQRaHgmonaqWSJsKMW5fPk/YVi7POFQskHZVkjlHDhpMxMsebjykTSwDGBdrFUkJFGdTNTOGPiz8W0ZKIqoolzePZnOEzBzuEpbHF7Vzrywvb8yu7oQsJGeXNLh6XvPk9nReNkfMzCGxuqUpw1zqsHU1p4NGUJcIVU3jy7naiymmqGyyZgB24+KKwbWkoro8dLzOae7gSWN44tRFrXXGTGnytGYBCn4Ry8WA65cDU3MhBlTR1IVhepFwKsTSwO/bwZWnwqPDT2GA1TOyAOR9ea0RrACNGc2Uhyngazc0r5Vfnb/nsWMPF43XTviFPP0iq1nARnvtxrW15D4/lnCDySN0+wF46jUC05FIhoZ0iaxG14gcg+hZguTw6cT56fjkyCVaQXSDNzJgXR2eGDWXdFgL5QH5FxKsB5AEcRxcPJ4ASsqhWCFBKrHrCiUiFCfESmWxVu5R0QjDqNzDjRn0qBhQb9Xa2vfusvXl8N0oqXuTeaN3raXV3tV9Xz/7bOVxblTCco8p52LcWV5W85JWOVUZ/PbJJ3tBKwY7zJ2RDYgTuh5xRgSoEyI8dtMZWQ/X4Q0IROE+1rsXfFvx+q8VX1dMvvnq99txqG2zWQZD3CqCWrjaS4KoG3Z/ji/om1xRqs5cO/1bvXS/L9iE9T/3YfgX/U8mSnc/Q/m1aYZuad/LO+HnJ9MNe+99dESEtkLEpRgHdLEgg9Y9kAC0rtCrrqBQX639SRYtlJb1pDxcd4aWrTfpOEW7KcxA71vKLcWSoeAjbkfBJ7QCB7Roni23gQkvn4mDkkcbkF/KNAATlT+ZKzi38kL6ok83jUWAxOGnH9tyzoReuSvTC/7Za/3/Jn1T49n/n9I14ZVp4aegxZb+tKRBrzqXk2pYDImRrOEbXP+4pgpGNYqfVGCJv+3qlrM1fsG65SkUnfWQetvQFb8PGjPHoNU7BaO9VneeWcoVF3XAHtcCwiJvUCzwFdIiH+iK/4XGCv/QWhRxGF2LsX3O7AiWW3RB9kHDyhAzlVtE2/1cVP0AaGDIblYesk/A9Vgcd5rtYn4VLHC3sYEX0q7vE0xcbuIVcTIwDI5tl/dB9Zs937cnWi1Sd0NNlZso5xwXkPmABlMMYYyKsxBX2pcrvf8BQAUMMrel3ZngCeDysLljHU1tBnpVY7HaPZa6nhDV5UsXgU1TF2fCVqQLGCrDYXb9Un1A5WvqrZGyTWjJ/ghX09y/znysZ8GInmaIEhk1mmijiz6GGLVzYBnA4qOAx4c8SA9lq88sWqIB02SLDphVmlVGCn5hLeApIitM5iW1B+OQG/H9czcQAgAA') format('woff2'), url('../iconfont/iconfont.woff?t=1565772508803') format('woff'), url('../iconfont/iconfont.ttf?t=1565772508803') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url('../iconfont/iconfont.svg?t=1565772508803#iconfont') format('svg'); /* iOS 4.1- */ } .iconfont { font-family: "iconfont" !important; font-size: 16px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .iconfenlei:before { content: "\e60d"; } .iconzuo:before { content: "\e635"; } .iconyou:before { content: "\e636"; } .iconyanjing:before { content: "\e60f"; } .iconguidangxiangmu:before { content: "\e660"; } .icongengduo:before { content: "\e60a"; } .iconfabiao:before { content: "\e654"; } .iconchangyongicon-:before { content: "\e617"; }
64.98
2,221
0.864266
46cc8b9783d0035dde25620fe1b0d132709e4bd9
1,617
py
Python
galho/main.py
joaopalmeiro/galho
ad68d760ccb8200ec547a151408a53c4a30435c6
[ "MIT" ]
null
null
null
galho/main.py
joaopalmeiro/galho
ad68d760ccb8200ec547a151408a53c4a30435c6
[ "MIT" ]
1
2020-09-05T17:17:09.000Z
2020-09-05T17:17:09.000Z
galho/main.py
joaopalmeiro/galho
ad68d760ccb8200ec547a151408a53c4a30435c6
[ "MIT" ]
null
null
null
# main.py from pathlib import Path from .utils import clean_terminal SPACE = " " * 4 ONE_PART = "│ " TWO_PARTS = "└── " THREE_PARTS = "├── " def tree_generator(root, pre_indentation_line): """ Based on: https://stackoverflow.com/questions/9727673/list-directory-tree-structure-in-python """ file_and_dir_names = sorted(root.iterdir()) indentation_lines = [THREE_PARTS] * (len(file_and_dir_names) - 1) + [TWO_PARTS] # Using `zip` (instead of comparing each element to the last one on a list, # for example) is important to abstract the possible names of files and folders # from which indentation lines they should have. branches = zip(indentation_lines, file_and_dir_names) for indentation_line, path in branches: yield pre_indentation_line + indentation_line + path.name if path.is_dir(): new_pre_indentation_line = ( ONE_PART if indentation_line == THREE_PARTS else SPACE ) yield from tree_generator( path, pre_indentation_line + new_pre_indentation_line ) def get_root_representation(root, root_representation): if root_representation == "name": return root.name elif root_representation == "dot": return "." else: return "" def main(root=Path.cwd(), pre_indentation_line="", root_representation="dot"): clean_terminal() # tree_wo_indentation_lines() print(get_root_representation(root, root_representation)) for branch in tree_generator(root, ""): print(branch) if __name__ == "__main__": main()
28.368421
97
0.670996
dd82a07e89da9b0f12b31c133bb4f4c1f90290f4
11,163
java
Java
src/org/opensha/gem/GEM1/calc/gemModelParsers/gscFrisk/canada/GscFriskSourceData02.java
opensha/opensha-svn-archive
77203dab6745320a5130fda85978ebe1a4e097c8
[ "Apache-2.0" ]
null
null
null
src/org/opensha/gem/GEM1/calc/gemModelParsers/gscFrisk/canada/GscFriskSourceData02.java
opensha/opensha-svn-archive
77203dab6745320a5130fda85978ebe1a4e097c8
[ "Apache-2.0" ]
null
null
null
src/org/opensha/gem/GEM1/calc/gemModelParsers/gscFrisk/canada/GscFriskSourceData02.java
opensha/opensha-svn-archive
77203dab6745320a5130fda85978ebe1a4e097c8
[ "Apache-2.0" ]
null
null
null
package org.opensha.gem.GEM1.calc.gemModelParsers.gscFrisk.canada; import java.io.BufferedReader; import java.util.ArrayList; import org.opensha.sha.earthquake.rupForecastImpl.GEM1.SourceData.GEMAreaSourceData; import org.opensha.commons.data.function.ArbitrarilyDiscretizedFunc; import org.opensha.commons.geo.Region; import org.opensha.gem.GEM1.calc.gemModelParsers.GemFileParser; import org.opensha.sha.earthquake.FocalMechanism; import org.opensha.sha.earthquake.griddedForecast.MagFreqDistsForFocalMechs; import org.opensha.sha.earthquake.rupForecastImpl.GEM1.SourceData.GEMFaultSourceData; import org.opensha.sha.earthquake.rupForecastImpl.GEM1.SourceData.GEMSourceData; import org.opensha.sha.faultSurface.FaultTrace; import org.opensha.sha.magdist.IncrementalMagFreqDist; import org.opensha.sha.magdist.SummedMagFreqDist; import org.opensha.sha.util.TectonicRegionType; public class GscFriskSourceData02 extends GemFileParser { private static boolean INFO = false; private static double MMIN = 4.5; private static double MWDT = 0.1; public GscFriskSourceData02 (BufferedReader file, boolean skipComm) { // public GscFriskSourceData01 (FileReader file, boolean skipComm) { ArrayList<GEMSourceData> srclst = new ArrayList<GEMSourceData>(); SummedMagFreqDist sumMfd = null; Region reg = null; FaultTrace trace = null; // ----------------------------------------------------------------------------------------- // Reads the file GscFriskInputFile gscif = new GscFriskInputFile(file,skipComm); // ----------------------------------------------------------------------------------------- // Get the information contained in the header GscFriskInputHeader head = gscif.getHeader(); // Info: number of global alternatives contained in the input file System.out.printf("Number of global alternatives: %d\n",+head.nGloAlt); // ----------------------------------------------------------------------------------------- // Processing global alternatives for (int gaIdx=0; gaIdx<head.nGloAlt; gaIdx++) { System.out.printf("Global alternative %d of %d\n",gaIdx,head.nGloAlt); // Get the 'gaIdx' global alternative GscFriskInputAlternative ga = gscif.getGlobalAlternatives().get(gaIdx); int srcSetIdx = 0; // ------------------------------------------------------------------------------------- // Processing the sources into one global alternative for (int srcIdx=0; srcIdx<ga.getSourceSet(0).getNumberOfSources(); srcIdx++){ // for (int srcIdx=0; srcIdx<1; srcIdx++){ // if (srcIdx > 0) System.exit(0); // This contains all the information relative to the current source GscFriskInputSource src = ga.getSourceSet(srcSetIdx).getSource(srcIdx); // Repeat for all the geometries for (int geomIdx=0; geomIdx < src.geomNum; geomIdx++) { System.out.println("---------"+src.name); // ----------------------------------------------------------------------------- // Area sources if (src.geomTyp[geomIdx].matches("area")) { // This is the source region reg = new Region(src.coords.get(geomIdx),null); // Repeat for all the depths for (int depIdx=0; depIdx < src.geomDepth[geomIdx].length; depIdx++){ // Find the maximum magnitude double mmaxlg = -1e10; double mminlg = MMIN; for (int i=0; i < src.mMax[geomIdx].length; i++) if (mmaxlg < src.mMax[geomIdx][i]) mmaxlg = src.mMax[geomIdx][i]; double magDelta = 2.0; mmaxlg = mmaxlg + magDelta; mminlg = mminlg - magDelta; int num = (int) Math.round((mmaxlg-mminlg)/MWDT); // Create the summed Mfd sumMfd = createMfd(ga, src, geomIdx, depIdx, num, magDelta, mminlg); // Convert the distribution from Mlg to Mo IncrementalMagFreqDist mfdMo = mfdMlgTomfdMo(sumMfd,mmaxlg, magDelta); // Creates the hash map with depths ArbitrarilyDiscretizedFunc depTopRup = new ArbitrarilyDiscretizedFunc(); depTopRup.set(6.0,src.geomDepth[geomIdx][depIdx]); // Creates the final arrays requested to create the MagFreqDistsForFocalMechs FocalMechanism[] fmArr = new FocalMechanism[1]; IncrementalMagFreqDist[] mfArr = new IncrementalMagFreqDist[1]; mfArr[0] = mfdMo; fmArr[0] = new FocalMechanism(); MagFreqDistsForFocalMechs mfdffm = new MagFreqDistsForFocalMechs(mfArr,fmArr); // --------------------------------------------------------------------- // Creating the GEMAreaSourceData object GEMAreaSourceData srcGem = new GEMAreaSourceData( String.format("%d",srcIdx), src.geomName[geomIdx], TectonicRegionType.STABLE_SHALLOW, reg, mfdffm, depTopRup,src.geomDepth[geomIdx][depIdx]); srclst.add(srcGem); System.out.printf(" Adding source %3d - Tot. rate: %7.4e avg depth: %6.2f \n", srclst.size(),mfdffm.getMagFreqDist(0).getTotalIncrRate(), srcGem.getAveHypoDepth()); } // ----------------------------------------------------------------------------- // Fault sources } else if (src.geomTyp[geomIdx].matches("fault")){ trace = new FaultTrace("trace"); trace.addAll(src.coords.get(geomIdx)); // Repeat for all the fault dip values for (int depIdx=0; depIdx < src.geomDip1[geomIdx].length; depIdx++){ // Find the maximum magnitude double mmaxlg = -1e10; double mminlg = MMIN; for (int i=0; i < src.mMax[geomIdx].length; i++) if (mmaxlg < src.mMax[geomIdx][i]) mmaxlg = src.mMax[geomIdx][i]; double magDelta = 2.0; mmaxlg = mmaxlg + magDelta; mminlg = mminlg - magDelta; int num = (int) Math.round((mmaxlg-mminlg)/MWDT); // Create the summed Mfd sumMfd = createMfd(ga, src, geomIdx, depIdx, num, magDelta, mminlg); // Convert the distribution from Mlg to Mo IncrementalMagFreqDist mfdMo = mfdMlgTomfdMo(sumMfd,mmaxlg, magDelta); GEMFaultSourceData srcGem = new GEMFaultSourceData( String.format("%d",srcIdx), src.geomName[geomIdx], TectonicRegionType.SUBDUCTION_INTERFACE, mfdMo, trace, (src.geomDip1[geomIdx][depIdx]+src.geomDip2[geomIdx][depIdx])/2, // average dip 90.0,// rake src.geomZ1[geomIdx][depIdx], src.geomZ3[geomIdx][depIdx], true); // String.format("%d",srcIdx), // src.geomName[geomIdx], // TectonicRegionType.STABLE_SHALLOW, // reg, // mfdffm, // depTopRup,src.geomDepth[geomIdx][depIdx]); srclst.add(srcGem); } } else { System.err.println("Source model: unsupported option"); throw new RuntimeException(""); } } } } this.setList(srclst); } private double mlg2mo(double mlg) { double mo; mo = 2.689 - 0.252*mlg + 0.127*mlg*mlg; // mo = 1.12*mlg - 1.00; return mo; } /** * * @param ga * @param src * @param geomIdx * @param depIdx * @param magDelta * @param mminlg */ private SummedMagFreqDist createMfd(GscFriskInputAlternative ga, GscFriskInputSource src, int geomIdx, int depIdx, int numMfd, double magDelta, double mminlg){ double sumWei = 0.0; SummedMagFreqDist sumMfd = new SummedMagFreqDist(mminlg+MWDT/2,numMfd,MWDT); for (int mmaxIdx=0; mmaxIdx<src.mMax[geomIdx].length; mmaxIdx++){ double tmpMMax = src.mMax[geomIdx][mmaxIdx]+magDelta; // Repeat for nu-beta couples for (int nubIdx=0; nubIdx<src.beta[geomIdx].length; nubIdx++){ // Compute the number of intervals int num = (int) Math.round((tmpMMax-mminlg)/MWDT); IncrementalMagFreqDist mfdLg = new IncrementalMagFreqDist( mminlg+MWDT/2,tmpMMax-MWDT/2,num); // Parameters of the Gutenberg-Richter distribution double betaGR = src.beta[geomIdx][nubIdx]; double alphaGR = Math.log(src.nu[geomIdx][nubIdx]); // Filling the mfd distribution - This is the Mlg mfd double mup = mminlg + MWDT; int idx = 0; while (mup <= src.mMax[geomIdx][mmaxIdx]-MWDT/2+magDelta) { // double occ = Math.exp(alphaGR-betaGR*(mup-MWDT))- // Math.exp(alphaGR-betaGR*mup); double occ = Math.exp(alphaGR-betaGR*(mup-MWDT)); if (INFO) System.out.printf("%7.4e %5.2f: %5.2f-%5.2f: %8.4e\n", alphaGR,betaGR,mup-MWDT,mup,occ); mup += MWDT; mfdLg.add(idx,occ); idx++; } double oldrate = mfdLg.getTotalIncrRate(); // Compute the scaled value of the total moment rate double moRate = mfdLg.getTotalMomentRate() * ga.getNuBetaWeights()[nubIdx] * ga.getMaxMagWeights()[mmaxIdx] * ga.getDepthsWeights()[depIdx]; sumWei += ga.getNuBetaWeights()[nubIdx] * ga.getMaxMagWeights()[mmaxIdx] * ga.getDepthsWeights()[depIdx]; // Scaling the mfd given the Tot. Moment Rate mfdLg.scaleToTotalMomentRate(moRate); // Updating the final mfd sumMfd.addResampledMagFreqDist(mfdLg,true); if (INFO) System.out.printf("old %7.4e scaled %7.4e (sum tot Mo: %7.4e)\n", oldrate, mfdLg.getTotalIncrRate(), sumMfd.getTotalMomentRate()); } } // return sumMfd; } /** * This method converts an input mfd in terms of Mlg into a mfd in terms of Mo. * * @param sumMfd * @param mmaxlg * @param magDelta */ private IncrementalMagFreqDist mfdMlgTomfdMo(SummedMagFreqDist sumMfd, double mmaxlg, double magDelta) { // Fixing minimum an double mminMo = MMIN; double mmaxMo = Math.ceil(mlg2mo(mmaxlg-magDelta)/MWDT)*MWDT; int numMo = (int) Math.round((mmaxMo-mminMo)/MWDT); if (INFO) System.out.printf("-------Maximum magnitude (orig: %5.2f) %5.2f",mmaxlg-magDelta,mmaxMo); // New mfd for moment magnitude IncrementalMagFreqDist mfdMo = new IncrementalMagFreqDist(mminMo+MWDT/2, numMo,MWDT); // Mfd used for the conversion ArbitrarilyDiscretizedFunc mfdMoOriginal = new ArbitrarilyDiscretizedFunc(); // Populating the mfd used for conversion for (int i=0; i < sumMfd.size(); i++){ mfdMoOriginal.set(mlg2mo(sumMfd.getX(i)),sumMfd.getY(i)); } // Populating the mfd for moment magnitude for (int i=0; i < mfdMo.size(); i++){ double rate = mfdMoOriginal.getInterpolatedY(mfdMo.getX(i)-MWDT/2) - mfdMoOriginal.getInterpolatedY(mfdMo.getX(i)+MWDT/2); mfdMo.set(i,rate); if (INFO) { System.out.printf("%6.2f %6.2f %6.2e \n", mfdMo.getX(i)-MWDT/2, mfdMo.getX(i)+MWDT/2, rate ); } } return mfdMo; } }
35.664537
107
0.595539
9fec2a5997ad717ca0080f1dbd00ec25ea248e76
7,307
py
Python
descarteslabs/common/proto/visualization/visualization_pb2.py
descarteslabs/descarteslabs-python
efc874d6062603dc424c9646287a9b1f8636e7ac
[ "Apache-2.0" ]
167
2017-03-23T22:16:58.000Z
2022-03-08T09:19:30.000Z
descarteslabs/common/proto/visualization/visualization_pb2.py
descarteslabs/descarteslabs-python
efc874d6062603dc424c9646287a9b1f8636e7ac
[ "Apache-2.0" ]
93
2017-03-23T22:11:40.000Z
2021-12-13T18:38:53.000Z
descarteslabs/common/proto/visualization/visualization_pb2.py
descarteslabs/descarteslabs-python
efc874d6062603dc424c9646287a9b1f8636e7ac
[ "Apache-2.0" ]
46
2017-03-25T19:12:14.000Z
2021-08-15T18:04:29.000Z
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: descarteslabs/common/proto/visualization/visualization.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='descarteslabs/common/proto/visualization/visualization.proto', package='descarteslabs.workflows', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n<descarteslabs/common/proto/visualization/visualization.proto\x12\x17\x64\x65scarteslabs.workflows\"\xa2\x02\n\tVizOption\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n\x05\x62\x61nds\x18\x02 \x03(\tR\x05\x62\x61nds\x12\"\n\x0c\x63heckerboard\x18\x03 \x01(\x08R\x0c\x63heckerboard\x12\x1a\n\x08\x63olormap\x18\x04 \x01(\tR\x08\x63olormap\x12\x1c\n\treduction\x18\x05 \x01(\tR\treduction\x12\x41\n\x06scales\x18\x06 \x03(\x0b\x32).descarteslabs.workflows.VizOption.ScalesR\x06scales\x12 \n\x0b\x64\x65scription\x18\x07 \x01(\tR\x0b\x64\x65scription\x1a,\n\x06Scales\x12\x10\n\x03min\x18\x01 \x01(\x01R\x03min\x12\x10\n\x03max\x18\x02 \x01(\x01R\x03maxb\x06proto3' ) _VIZOPTION_SCALES = _descriptor.Descriptor( name='Scales', full_name='descarteslabs.workflows.VizOption.Scales', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='min', full_name='descarteslabs.workflows.VizOption.Scales.min', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='min', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='max', full_name='descarteslabs.workflows.VizOption.Scales.max', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='max', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=336, serialized_end=380, ) _VIZOPTION = _descriptor.Descriptor( name='VizOption', full_name='descarteslabs.workflows.VizOption', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='id', full_name='descarteslabs.workflows.VizOption.id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='id', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='bands', full_name='descarteslabs.workflows.VizOption.bands', index=1, number=2, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='bands', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='checkerboard', full_name='descarteslabs.workflows.VizOption.checkerboard', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='checkerboard', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='colormap', full_name='descarteslabs.workflows.VizOption.colormap', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='colormap', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='reduction', full_name='descarteslabs.workflows.VizOption.reduction', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='reduction', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='scales', full_name='descarteslabs.workflows.VizOption.scales', index=5, number=6, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='scales', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='description', full_name='descarteslabs.workflows.VizOption.description', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='description', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[_VIZOPTION_SCALES, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=90, serialized_end=380, ) _VIZOPTION_SCALES.containing_type = _VIZOPTION _VIZOPTION.fields_by_name['scales'].message_type = _VIZOPTION_SCALES DESCRIPTOR.message_types_by_name['VizOption'] = _VIZOPTION _sym_db.RegisterFileDescriptor(DESCRIPTOR) VizOption = _reflection.GeneratedProtocolMessageType('VizOption', (_message.Message,), { 'Scales' : _reflection.GeneratedProtocolMessageType('Scales', (_message.Message,), { 'DESCRIPTOR' : _VIZOPTION_SCALES, '__module__' : 'descarteslabs.common.proto.visualization.visualization_pb2' # @@protoc_insertion_point(class_scope:descarteslabs.workflows.VizOption.Scales) }) , 'DESCRIPTOR' : _VIZOPTION, '__module__' : 'descarteslabs.common.proto.visualization.visualization_pb2' # @@protoc_insertion_point(class_scope:descarteslabs.workflows.VizOption) }) _sym_db.RegisterMessage(VizOption) _sym_db.RegisterMessage(VizOption.Scales) # @@protoc_insertion_point(module_scope)
45.385093
684
0.76023
ef09c9c4df748fbd4bcb110543f8a1bc877ada42
6,003
c
C
SampleCode/StdDriver/USBD_MassStorage_SDCard/main.c
OpenNuvoton/NUC1262BSP
ccaf69bcfadad314a3c9b78147c6dbfeedef4b3f
[ "Apache-2.0" ]
null
null
null
SampleCode/StdDriver/USBD_MassStorage_SDCard/main.c
OpenNuvoton/NUC1262BSP
ccaf69bcfadad314a3c9b78147c6dbfeedef4b3f
[ "Apache-2.0" ]
null
null
null
SampleCode/StdDriver/USBD_MassStorage_SDCard/main.c
OpenNuvoton/NUC1262BSP
ccaf69bcfadad314a3c9b78147c6dbfeedef4b3f
[ "Apache-2.0" ]
null
null
null
/****************************************************************************** * @file main.c * @version V3.00 * @brief * Use SD card as storage to implement a USB mass storage device. * @note * @copyright SPDX-License-Identifier: Apache-2.0 * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved. ******************************************************************************/ #include <stdio.h> #include "NuMicro.h" #include "massstorage.h" #include "SDCARD.h" /* If crystal-less is enabled, system won't use any crystal as clock source If using crystal-less, system will be 48MHz, otherwise, system is 72MHz */ #define CRYSTAL_LESS 1 #define HIRC_AUTO_TRIM 0x611 /* Use USB signal to fine tune HIRC 48MHz */ #define TRIM_INIT (SYS_BASE+0x110) void SYS_Init(void) { /*---------------------------------------------------------------------------------------------------------*/ /* Init System Clock */ /*---------------------------------------------------------------------------------------------------------*/ /* Enable HIRC clock */ CLK_EnableXtalRC(CLK_PWRCTL_HIRCEN_Msk); /* Wait for HIRC clock ready */ CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk); #if (!CRYSTAL_LESS) /* Enable GPIO Port F module clock */ CLK_EnableModuleClock(GPIOF_MODULE); /* Set XT1_OUT(PF.2) and XT1_IN(PF.3) as input mode to use HXT */ GPIO_SetMode(PF, BIT2|BIT3, GPIO_MODE_INPUT); /* Enable HXT clock */ CLK_EnableXtalRC(CLK_PWRCTL_HXTEN_Msk); /* Wait for HXT clock ready */ CLK_WaitClockReady(CLK_STATUS_HXTSTB_Msk); /* Set core clock to 72MHz */ CLK_SetCoreClock(72000000); /* Select USB clock source as PLL and USB clock divider as 3 */ CLK_SetModuleClock(USBD_MODULE, CLK_CLKSEL3_USBDSEL_PLL, CLK_CLKDIV0_USB(3)); #else /* Select HCLK clock source to HIRC and HCLK clock divider as 1 */ CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HIRC, CLK_CLKDIV0_HCLK(1)); /* Select USB clock source as HIRC and USB clock divider as 1 */ CLK_SetModuleClock(USBD_MODULE, CLK_CLKSEL3_USBDSEL_HIRC, CLK_CLKDIV0_USB(1)); #endif /* Enable UART0 module clock */ CLK_EnableModuleClock(UART0_MODULE); /* Select UART0 module clock source as HIRC/2 and UART0 module clock divider as 1 */ CLK_SetModuleClock(UART0_MODULE, CLK_CLKSEL1_UART0SEL_HIRC_DIV2, CLK_CLKDIV0_UART0(1)); /* Enable USBD module clock */ CLK_EnableModuleClock(USBD_MODULE); /* Enable SPI1 module clock */ CLK_EnableModuleClock(SPI1_MODULE); /* Select SPI1 module clock source as PCLK0 */ CLK_SetModuleClock(SPI1_MODULE, CLK_CLKSEL2_SPI1SEL_PCLK0, MODULE_NoMsk); /*---------------------------------------------------------------------------------------------------------*/ /* Init I/O Multi-function */ /*---------------------------------------------------------------------------------------------------------*/ /* Set PB multi-function pins for UART0 RXD and TXD */ SYS->GPB_MFPH = (SYS->GPB_MFPH & (~(UART0_RXD_PB12_Msk | UART0_TXD_PB13_Msk))) | UART0_RXD_PB12 | UART0_TXD_PB13; /* Set SPI1 multi-function pins */ SYS->GPC_MFPL &= ~(SYS_GPC_MFPL_PC1MFP_Msk | SYS_GPC_MFPL_PC2MFP_Msk | SYS_GPC_MFPL_PC3MFP_Msk); SYS->GPC_MFPL |= SYS_GPC_MFPL_PC1MFP_SPI1_CLK | SYS_GPC_MFPL_PC2MFP_SPI1_MOSI | SYS_GPC_MFPL_PC3MFP_SPI1_MISO; GPIO_SetMode(PC, BIT5, GPIO_MODE_OUTPUT); GPIO_SetMode(PC, BIT4, GPIO_MODE_OUTPUT); } /*---------------------------------------------------------------------------------------------------------*/ /* Main Function */ /*---------------------------------------------------------------------------------------------------------*/ int32_t main(void) { #if CRYSTAL_LESS uint32_t u32TrimInit; #endif /* Unlock protected registers */ SYS_UnlockReg(); /* Init system and multi-function I/O */ SYS_Init(); /* Configure UART0: 115200, 8-bit word, no parity bit, 1 stop bit. */ UART_Open(UART0, 115200); printf("+-------------------------------------------------------+\n"); printf("| NuMicro USB MassStorage Sample Code |\n"); printf("+-------------------------------------------------------+\n"); SDCARD_Open(); /* Open USB controller */ USBD_Open(&gsInfo, MSC_ClassRequest, NULL); USBD_SetConfigCallback(MSC_SetConfig); /* Endpoint configuration */ MSC_Init(); /* Start USB device */ USBD_Start(); /* Enable USB device interrupt */ NVIC_EnableIRQ(USBD_IRQn); #if CRYSTAL_LESS /* Backup default trim */ u32TrimInit = M32(TRIM_INIT); #endif /* Clear SOF */ USBD->INTSTS = USBD_INTSTS_SOFIF_Msk; while(1) { #if CRYSTAL_LESS /* Start USB trim if it is not enabled. */ if((SYS->IRCTCTL & SYS_IRCTCTL_FREQSEL_Msk) != 1) { /* Start USB trim only when SOF */ if(USBD->INTSTS & USBD_INTSTS_SOFIF_Msk) { /* Clear SOF */ USBD->INTSTS = USBD_INTSTS_SOFIF_Msk; /* Re-enable crystal-less */ SYS->IRCTCTL = HIRC_AUTO_TRIM | (8 << SYS_IRCTCTL_BOUNDARY_Pos); } } /* Disable USB Trim when error */ if(SYS->IRCTISTS & (SYS_IRCTISTS_CLKERRIF_Msk | SYS_IRCTISTS_TFAILIF_Msk)) { /* Init TRIM */ M32(TRIM_INIT) = u32TrimInit; /* Disable crystal-less */ SYS->IRCTCTL = 0; /* Clear error flags */ SYS->IRCTISTS = SYS_IRCTISTS_CLKERRIF_Msk | SYS_IRCTISTS_TFAILIF_Msk; /* Clear SOF */ USBD->INTSTS = USBD_INTSTS_SOFIF_Msk; } #endif MSC_ProcessCmd(); } }
35.105263
117
0.523238
a016503ed30e5ba1999c9a0e16fdb221a6993803
1,543
rs
Rust
guessing_game/src/main.rs
qgervacio/rust-learn
de7515ddd2679bf76a6e4c643cf7145329e8220c
[ "MIT" ]
null
null
null
guessing_game/src/main.rs
qgervacio/rust-learn
de7515ddd2679bf76a6e4c643cf7145329e8220c
[ "MIT" ]
null
null
null
guessing_game/src/main.rs
qgervacio/rust-learn
de7515ddd2679bf76a6e4c643cf7145329e8220c
[ "MIT" ]
null
null
null
use std::io; use rand::Rng; use std::cmp::Ordering; fn main() { println!("----------------"); println!("Guess the number"); println!("----------------\n"); // able to infer that secret_number is a type of integer let secret_number = rand::thread_rng().gen_range(1, 6); loop { println!("Please input your guess (between 1-5 inclusive)"); // new, like in Java is a static method. // in Rust it is called a associated function. // mut means mutable. by default in Rust, variables // are immutable. let mut guess = String::new(); // if not for line #1, this would have been std::io::stdin() io::stdin() .read_line(&mut guess) .expect("Failed to read line"); print!("You guessed: {}", guess); // convert to integer. Rust allow you to "shadow" guess // with a new one. this is to allow you to change the type of // guess instead of creating a new one perhaps called guess_str let guess:u32 = match guess.trim().parse() { Ok(num) => num, Err(_) => { println!("Not a number!"); continue; }, }; match guess.cmp(&secret_number) { Ordering::Greater => println!("Too big!"), Ordering::Less => println!("Too small!"), Ordering::Equal => { println!("You win! The secret number is {}", secret_number); break; } } } }
31.489796
76
0.515878
af20abd1f16cef13ab282cc8b087377465786388
4,780
py
Python
armor.py
brodyhill9/dnd-ascension-api
dd1a31f52fe4fa696a792b21442d498d9b5aad1e
[ "MIT" ]
null
null
null
armor.py
brodyhill9/dnd-ascension-api
dd1a31f52fe4fa696a792b21442d498d9b5aad1e
[ "MIT" ]
null
null
null
armor.py
brodyhill9/dnd-ascension-api
dd1a31f52fe4fa696a792b21442d498d9b5aad1e
[ "MIT" ]
null
null
null
import mysql_connector import json def handler(event, context): q = """ select armor_id, armor_name, armor_desc, armor_type, cost, armor_class, strength, IF(stealth_dis, 'true', 'false') stealth_dis, weight, created_by from armor where 1=1 """ try: httpMethod = event["httpMethod"] if httpMethod == "GET": params = event["queryStringParameters"] if params != None and "armor_id" in params: q += " and armor_id = %s" params = (params["armor_id"]) return mysql_connector.single_query(q, params) else: return mysql_connector.query(q, params) elif httpMethod == "POST": try: sql = """ INSERT INTO armor ( armor_name, armor_desc, armor_type, cost, armor_class, strength, stealth_dis, weight, created_by, created_date, updated_by, updated_date ) VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, SYSDATE(), %s, SYSDATE()); """ data = json.loads(event["body"]) params = ( data.get("armor_name",""), data.get("armor_desc",""), data.get("armor_type",""), data.get("cost",""), data.get("armor_class",""), data.get("strength",""), (1 if str(data.get("stealth_dis","")).lower() == "true" else 0), data.get("weight",""), mysql_connector.get_username(event), mysql_connector.get_username(event) ) mysql_connector.execute(sql, params) q += """ and armor_id = LAST_INSERT_ID()""" return mysql_connector.single_query(q) except: return mysql_connector.client_error("Invalid POST data") elif httpMethod == "PUT": try: sql = """ UPDATE armor SET armor_name = %s, armor_desc = %s, armor_type = %s, cost = %s, armor_class = %s, strength = %s, stealth_dis = %s, weight = %s, updated_by = %s, updated_date = SYSDATE() WHERE armor_id = %s """ data = json.loads(event["body"]) params = ( data.get("armor_name",""), data.get("armor_desc",""), data.get("armor_type",""), data.get("cost",""), data.get("armor_class",""), data.get("strength",""), (1 if str(data.get("stealth_dis","")).lower() == "true" else 0), data.get("weight",""), mysql_connector.get_username(event), data.get("armor_id","") ) mysql_connector.execute(sql, params) params = ( data.get("armor_id","") ) q += """ and armor_id = %s""" return mysql_connector.single_query(q, params) except: return mysql_connector.client_error("Invalid PUT data") elif httpMethod == "DELETE": try: sql = """ DELETE FROM armor WHERE armor_id = %s """ params = event["queryStringParameters"] params = (params["armor_id"]) return mysql_connector.execute(sql, params) except: return mysql_connector.client_error("Invalid DELETE data") else: return mysql_connector.client_error("Invalid HTTP Method") except: return mysql_connector.server_error("Unknown server error")
34.890511
84
0.380126
a442568abba6408c5aad26a4438899e4baa0230f
3,293
php
PHP
resources/views/client/layouts/footer.blade.php
vanhieu20/doancuoicap
a56ab641276293762996e1ab70f81f37a65363a6
[ "MIT" ]
null
null
null
resources/views/client/layouts/footer.blade.php
vanhieu20/doancuoicap
a56ab641276293762996e1ab70f81f37a65363a6
[ "MIT" ]
null
null
null
resources/views/client/layouts/footer.blade.php
vanhieu20/doancuoicap
a56ab641276293762996e1ab70f81f37a65363a6
[ "MIT" ]
null
null
null
<footer class="footer-section"> <div class="container"> <div class="partner-logo owl-carousel"> <a href="#" class="pl-table"> <div class="pl-tablecell"> <img src="{{ asset('themes/clients/img/partner-logo/logo-1.png') }}" alt=""> </div> </a> <a href="#" class="pl-table"> <div class="pl-tablecell"> <img src="{{ asset('themes/clients/img/partner-logo/logo-2.png') }}" alt=""> </div> </a> <a href="#" class="pl-table"> <div class="pl-tablecell"> <img src="{{ asset('themes/clients/img/partner-logo/logo-3.png') }}" alt=""> </div> </a> <a href="#" class="pl-table"> <div class="pl-tablecell"> <img src="{{ asset('themes/clients/img/partner-logo/logo-4.png') }}" alt=""> </div> </a> <a href="#" class="pl-table"> <div class="pl-tablecell"> <img src="{{ asset('themes/clients/img/partner-logo/logo-5.png') }}" alt=""> </div> </a> <a href="#" class="pl-table"> <div class="pl-tablecell"> <img src="{{ asset('themes/clients/img/partner-logo/logo-6.png') }}" alt=""> </div> </a> </div> <div class="row"> <div class="col-lg-12"> <div class="footer-text"> <div class="ft-logo"> <a href="#" class="footer-logo"><img src="{{ asset('themes/clients/img/footer-logo.png') }}" alt=""></a> </div> <ul> <li><a href="#">Trang chủ</a></li> <li><a href="#">Khóa học</a></li> <li><a href="#">Mở rộng</a></li> <li><a href="#">Giới thiệu</a></li> </ul> <div class="copyright-text"><p><!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. --> Copyright &copy;<script>document.write(new Date().getFullYear());</script> All rights reserved | Thực hiện bởi <i class="fa fa-heart" aria-hidden="true"></i> by <a href="https://colorlib.com" target="_blank">vo van hieu</a> <!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. --></p></div> <div class="ft-social"> <a href="#"><i class="fa fa-facebook"></i></a> <a href="#"><i class="fa fa-twitter"></i></a> <a href="#"><i class="fa fa-linkedin"></i></a> <a href="#"><i class="fa fa-instagram"></i></a> <a href="#"><i class="fa fa-youtube-play"></i></a> </div> </div> </div> </div> </div> </footer>
53.983607
249
0.387792
e2a2928092d3720ae862fb2a05e898206e178ec6
1,584
py
Python
setup.py
UCBerkeleySETI/blipss
dba5c6724701abcc95b59aa016adf2582ecc69f3
[ "MIT" ]
null
null
null
setup.py
UCBerkeleySETI/blipss
dba5c6724701abcc95b59aa016adf2582ecc69f3
[ "MIT" ]
null
null
null
setup.py
UCBerkeleySETI/blipss
dba5c6724701abcc95b59aa016adf2582ecc69f3
[ "MIT" ]
null
null
null
""" setup.py -- setup script for installation and use of packages """ import os from setuptools import setup, find_packages, Command from setuptools.command import install __version__ = '0.1.0' class CleanCommand(Command): """Custom clean command to tidy up the project root.""" user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info') install_requires = [ 'astropy>=4.0', 'blimpy>=2.0.0', 'matplotlib>=3.1.0', 'mpi4py>=3.1.1', 'numpy>=1.18.1', 'pandas>=1.3.4', 'riptide-ffa>=0.2.4', 'scipy>=1.6.0', 'tqdm>=4.32.1' ] with open("README.md", "r") as fh: long_description = fh.read() setup(name='blipss', version=__version__, author='Akshay Suresh', author_email='as3655@cornell.edu', description='Breakthrough Listen Investigation for Periodic Spectral Signals', long_description=long_description, long_description_content_type="text/markdown", url='https://github.com/UCBerkeleySETI/blipss', install_requires=install_requires, packages=find_packages(), license='MIT License', classifiers=[ "Programming Language :: Python :: 3", "Operating System :: Unix", "Operating System :: MacOS :: MacOS X", "License :: OSI Approved :: BSD 3-Clause License", "Topic :: Scientific/Engineering :: Astronomy" ], cmdclass={'clean': CleanCommand} )
28.8
84
0.616793
c97730bbb2fb02c043b97cddcb073001bc9b89d2
439
ts
TypeScript
packages/line/src/components/popover/popover-interface.ts
zeng450026937/skyline
780e26197d8a6cc5cc410cdc7e1bdd8fbeecb0e6
[ "MIT" ]
null
null
null
packages/line/src/components/popover/popover-interface.ts
zeng450026937/skyline
780e26197d8a6cc5cc410cdc7e1bdd8fbeecb0e6
[ "MIT" ]
8
2020-04-06T13:53:42.000Z
2021-06-16T09:32:45.000Z
packages/line/src/components/popover/popover-interface.ts
zeng450026937/line-ui
780e26197d8a6cc5cc410cdc7e1bdd8fbeecb0e6
[ "MIT" ]
null
null
null
import { Mode } from '@line-ui/line/src/types'; import { AnimationBuilder } from '@line-ui/line/src/utils/animation'; export interface PopoverOptions { showBackdrop?: boolean; backdropDismiss?: boolean; translucent?: boolean; cssClass?: string | string[]; event?: Event; animated?: boolean; mode?: Mode; keyboardClose?: boolean; id?: string; enterAnimation?: AnimationBuilder; leaveAnimation?: AnimationBuilder; }
23.105263
69
0.715262
a9e5ae083542d2c9615509d06f8f9cc53c25c9ae
35,856
php
PHP
wp-content/plugins/give/includes/admin/forms/class-metabox-form-data.php
5ctechforgood/projectcaring
e902e4924d0673648528da0c53e7417bf83f6b3f
[ "MIT" ]
null
null
null
wp-content/plugins/give/includes/admin/forms/class-metabox-form-data.php
5ctechforgood/projectcaring
e902e4924d0673648528da0c53e7417bf83f6b3f
[ "MIT" ]
null
null
null
wp-content/plugins/give/includes/admin/forms/class-metabox-form-data.php
5ctechforgood/projectcaring
e902e4924d0673648528da0c53e7417bf83f6b3f
[ "MIT" ]
null
null
null
<?php /** * Donation Form Data * * Displays the form data box, tabbed, with several panels. * * @package Give * @subpackage Classes/Give_MetaBox_Form_Data * @copyright Copyright (c) 2016, WordImpress * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License * @since 1.8 */ /** * Give_Meta_Box_Form_Data Class. */ class Give_MetaBox_Form_Data { /** * Meta box settings. * * @since 1.8 * @var array */ private $settings = array(); /** * Metabox ID. * * @since 1.8 * @var string */ private $metabox_id; /** * Metabox Label. * * @since 1.8 * @var string */ private $metabox_label; /** * Give_MetaBox_Form_Data constructor. */ function __construct() { $this->metabox_id = 'give-metabox-form-data'; $this->metabox_label = __( 'Donation Form Options', 'give' ); // Setup. add_action( 'admin_init', array( $this, 'setup' ) ); // Add metabox. add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ), 10 ); // Save form meta. add_action( 'save_post_give_forms', array( $this, 'save' ), 10, 2 ); // cmb2 old setting loaders. // add_filter( 'give_metabox_form_data_settings', array( $this, 'cmb2_metabox_settings' ) ); // Add offline donations options. add_filter( 'give_metabox_form_data_settings', array( $this, 'add_offline_donations_setting_tab' ), 0, 1 ); // Maintain active tab query parameter after save. add_filter( 'redirect_post_location', array( $this, 'maintain_active_tab' ), 10, 2 ); } /** * Setup metabox related data. * * @since 1.8 * @return void */ function setup() { $this->settings = $this->get_settings(); } /** * Get metabox settings * * @since 1.8 * @return array */ function get_settings() { $post_id = give_get_admin_post_id(); $price = give_get_form_price( $post_id ); $custom_amount_minimum = give_get_form_minimum_price( $post_id ); $goal = give_format_amount( give_get_form_goal( $post_id ), array( 'sanitize' => false ) ); $price_placeholder = give_format_decimal( '1.00', false, false ); // No empty prices - min. 1.00 for new forms if ( empty( $price ) && is_null( $post_id ) ) { $price = '1.00'; } // Min. $1.00 for new forms if ( empty( $custom_amount_minimum ) ) { $custom_amount_minimum = '1.00'; } // Format amounts. $price = give_format_amount( $price, array( 'sanitize' => false ) ); $custom_amount_minimum = give_format_amount( $custom_amount_minimum, array( 'sanitize' => false ) ); // Start with an underscore to hide fields from custom fields list $prefix = '_give_'; $settings = array( /** * Repeatable Field Groups */ 'form_field_options' => apply_filters( 'give_forms_field_options', array( 'id' => 'form_field_options', 'title' => __( 'Donation Options', 'give' ), 'icon-html' => '<span class="give-icon give-icon-heart"></span>', 'fields' => apply_filters( 'give_forms_donation_form_metabox_fields', array( // Donation Option array( 'name' => __( 'Donation Option', 'give' ), 'description' => __( 'Do you want this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ), 'id' => $prefix . 'price_option', 'type' => 'radio_inline', 'default' => 'set', 'options' => apply_filters( 'give_forms_price_options', array( 'set' => __( 'Set Donation', 'give' ), 'multi' => __( 'Multi-level Donation', 'give' ), ) ), ), array( 'name' => __( 'Set Donation', 'give' ), 'description' => __( 'This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give' ), 'id' => $prefix . 'set_price', 'type' => 'text_small', 'data_type' => 'price', 'attributes' => array( 'placeholder' => $price_placeholder, 'value' => $price, 'class' => 'give-money-field', ), ), // Display Style array( 'name' => __( 'Display Style', 'give' ), 'description' => __( 'Set how the donations levels will display on the form.', 'give' ), 'id' => $prefix . 'display_style', 'type' => 'radio_inline', 'default' => 'buttons', 'options' => array( 'buttons' => __( 'Buttons', 'give' ), 'radios' => __( 'Radios', 'give' ), 'dropdown' => __( 'Dropdown', 'give' ), ), 'wrapper_class' => 'give-hidden', ), // Custom Amount array( 'name' => __( 'Custom Amount', 'give' ), 'description' => __( 'Do you want the user to be able to input their own donation amount?', 'give' ), 'id' => $prefix . 'custom_amount', 'type' => 'radio_inline', 'default' => 'disabled', 'options' => array( 'enabled' => __( 'Enabled', 'give' ), 'disabled' => __( 'Disabled', 'give' ), ), ), array( 'name' => __( 'Minimum Amount', 'give' ), 'description' => __( 'Enter the minimum custom donation amount.', 'give' ), 'id' => $prefix . 'custom_amount_minimum', 'type' => 'text_small', 'data_type' => 'price', 'attributes' => array( 'placeholder' => $price_placeholder, 'value' => $custom_amount_minimum, 'class' => 'give-money-field', ), 'wrapper_class' => 'give-hidden', ), array( 'name' => __( 'Custom Amount Text', 'give' ), 'description' => __( 'This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give' ), 'id' => $prefix . 'custom_amount_text', 'type' => 'text_medium', 'attributes' => array( 'rows' => 3, 'placeholder' => esc_attr__( 'Give a Custom Amount', 'give' ), ), 'wrapper_class' => 'give-hidden', ), // Donation Levels: Repeatable CMB2 Group array( 'id' => $prefix . 'donation_levels', 'type' => 'group', 'options' => array( 'add_button' => __( 'Add Level', 'give' ), 'header_title' => __( 'Donation Level', 'give' ), 'remove_button' => '<span class="dashicons dashicons-no"></span>', ), 'wrapper_class' => 'give-hidden', // Fields array works the same, except id's only need to be unique for this group. // Prefix is not needed. 'fields' => apply_filters( 'give_donation_levels_table_row', array( array( 'name' => __( 'ID', 'give' ), 'id' => $prefix . 'id', 'type' => 'levels_id', ), array( 'name' => __( 'Amount', 'give' ), 'id' => $prefix . 'amount', 'type' => 'text_small', 'data_type' => 'price', 'attributes' => array( 'placeholder' => $price_placeholder, 'class' => 'give-money-field', ), ), array( 'name' => __( 'Text', 'give' ), 'id' => $prefix . 'text', 'type' => 'text', 'attributes' => array( 'placeholder' => __( 'Donation Level', 'give' ), 'class' => 'give-multilevel-text-field', ), ), array( 'name' => __( 'Default', 'give' ), 'id' => $prefix . 'default', 'type' => 'give_default_radio_inline', ), ) ), ), array( 'name' => 'donation_options_docs', 'type' => 'docs_link', 'url' => 'http://docs.givewp.com/form-donation-options', 'title' => __( 'Donation Options', 'give' ), ), ), $post_id ), ) ), /** * Display Options */ 'form_display_options' => apply_filters( 'give_form_display_options', array( 'id' => 'form_display_options', 'title' => __( 'Form Display', 'give' ), 'icon-html' => '<span class="give-icon give-icon-display"></span>', 'fields' => apply_filters( 'give_forms_display_options_metabox_fields', array( array( 'name' => __( 'Display Options', 'give' ), 'desc' => sprintf( __( 'How would you like to display donation information for this form?', 'give' ), '#' ), 'id' => $prefix . 'payment_display', 'type' => 'radio_inline', 'options' => array( 'onpage' => __( 'All Fields', 'give' ), 'modal' => __( 'Modal', 'give' ), 'reveal' => __( 'Reveal', 'give' ), 'button' => __( 'Button', 'give' ), ), 'default' => 'onpage', ), array( 'id' => $prefix . 'reveal_label', 'name' => __( 'Continue Button', 'give' ), 'desc' => __( 'The button label for displaying the additional payment fields.', 'give' ), 'type' => 'text_small', 'attributes' => array( 'placeholder' => esc_attr__( 'Donate Now', 'give' ), ), 'wrapper_class' => 'give-hidden', ), array( 'id' => $prefix . 'checkout_label', 'name' => __( 'Submit Button', 'give' ), 'desc' => __( 'The button label for completing a donation.', 'give' ), 'type' => 'text_small', 'attributes' => array( 'placeholder' => __( 'Donate Now', 'give' ), ), ), array( 'name' => __( 'Default Gateway', 'give' ), 'desc' => __( 'By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give' ), 'id' => $prefix . 'default_gateway', 'type' => 'default_gateway', ), array( 'name' => __( 'Guest Donations', 'give' ), 'desc' => __( 'Do you want to allow non-logged-in users to make donations?', 'give' ), 'id' => $prefix . 'logged_in_only', 'type' => 'radio_inline', 'default' => 'enabled', 'options' => array( 'enabled' => __( 'Enabled', 'give' ), 'disabled' => __( 'Disabled', 'give' ), ), ), array( 'name' => __( 'Registration', 'give' ), 'desc' => __( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ), 'id' => $prefix . 'show_register_form', 'type' => 'radio', 'options' => array( 'none' => __( 'None', 'give' ), 'registration' => __( 'Registration', 'give' ), 'login' => __( 'Login', 'give' ), 'both' => __( 'Registration + Login', 'give' ), ), 'default' => 'none', ), array( 'name' => __( 'Floating Labels', 'give' ), /* translators: %s: forms http://docs.givewp.com/form-floating-labels */ 'desc' => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form. Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ), 'id' => $prefix . 'form_floating_labels', 'type' => 'radio_inline', 'options' => array( 'global' => __( 'Global Option', 'give' ), 'enabled' => __( 'Enabled', 'give' ), 'disabled' => __( 'Disabled', 'give' ), ), 'default' => 'global', ), array( 'name' => 'form_display_docs', 'type' => 'docs_link', 'url' => 'http://docs.givewp.com/form-display-options', 'title' => __( 'Form Display', 'give' ), ), ), $post_id ), ) ), /** * Donation Goals */ 'donation_goal_options' => apply_filters( 'give_donation_goal_options', array( 'id' => 'donation_goal_options', 'title' => __( 'Donation Goal', 'give' ), 'icon-html' => '<span class="give-icon give-icon-target"></span>', 'fields' => apply_filters( 'give_forms_donation_goal_metabox_fields', array( // Goals array( 'name' => __( 'Donation Goal', 'give' ), 'description' => __( 'Do you want to set a donation goal for this form?', 'give' ), 'id' => $prefix . 'goal_option', 'type' => 'radio_inline', 'default' => 'disabled', 'options' => array( 'enabled' => __( 'Enabled', 'give' ), 'disabled' => __( 'Disabled', 'give' ), ), ), array( 'name' => __( 'Goal Amount', 'give' ), 'description' => __( 'This is the monetary goal amount you want to reach for this form.', 'give' ), 'id' => $prefix . 'set_goal', 'type' => 'text_small', 'data_type' => 'price', 'attributes' => array( 'placeholder' => give_format_decimal( '0.00', false, false ), 'value' => $goal, 'class' => 'give-money-field', ), 'wrapper_class' => 'give-hidden', ), array( 'name' => __( 'Goal Format', 'give' ), 'description' => __( 'Do you want to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ), 'id' => $prefix . 'goal_format', 'type' => 'radio_inline', 'default' => 'amount', 'options' => array( 'amount' => __( 'Amount', 'give' ), 'percentage' => __( 'Percentage', 'give' ), ), 'wrapper_class' => 'give-hidden', ), array( 'name' => __( 'Progress Bar Color', 'give' ), 'desc' => __( 'Customize the color of the goal progress bar.', 'give' ), 'id' => $prefix . 'goal_color', 'type' => 'colorpicker', 'default' => '#2bc253', 'wrapper_class' => 'give-hidden', ), array( 'name' => __( 'Close Form', 'give' ), 'desc' => __( 'Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give' ), 'id' => $prefix . 'close_form_when_goal_achieved', 'type' => 'radio_inline', 'default' => 'disabled', 'options' => array( 'enabled' => __( 'Enabled', 'give' ), 'disabled' => __( 'Disabled', 'give' ), ), 'wrapper_class' => 'give-hidden', ), array( 'name' => __( 'Goal Achieved Message', 'give' ), 'desc' => __( 'Do you want to display a custom message when the goal is closed?', 'give' ), 'id' => $prefix . 'form_goal_achieved_message', 'type' => 'wysiwyg', 'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ), 'wrapper_class' => 'give-hidden', ), array( 'name' => 'donation_goal_docs', 'type' => 'docs_link', 'url' => 'http://docs.givewp.com/form-donation-goal', 'title' => __( 'Donation Goal', 'give' ), ), ), $post_id ), ) ), /** * Content Field */ 'form_content_options' => apply_filters( 'give_forms_content_options', array( 'id' => 'form_content_options', 'title' => __( 'Form Content', 'give' ), 'icon-html' => '<span class="give-icon give-icon-edit"></span>', 'fields' => apply_filters( 'give_forms_content_options_metabox_fields', array( // Donation content. array( 'name' => __( 'Display Content', 'give' ), 'description' => __( 'Do you want to add custom content to this form?', 'give' ), 'id' => $prefix . 'display_content', 'type' => 'radio_inline', 'options' => array( 'enabled' => __( 'Enabled', 'give' ), 'disabled' => __( 'Disabled', 'give' ), ), 'default' => 'disabled', ), // Content placement. array( 'name' => __( 'Content Placement', 'give' ), 'description' => __( 'This option controls where the content appears within the donation form.', 'give' ), 'id' => $prefix . 'content_placement', 'type' => 'radio_inline', 'options' => apply_filters( 'give_forms_content_options_select', array( 'give_pre_form' => __( 'Above fields', 'give' ), 'give_post_form' => __( 'Below fields', 'give' ), ) ), 'default' => 'give_pre_form', 'wrapper_class' => 'give-hidden', ), array( 'name' => __( 'Content', 'give' ), 'description' => __( 'This content will display on the single give form page.', 'give' ), 'id' => $prefix . 'form_content', 'type' => 'wysiwyg', 'wrapper_class' => 'give-hidden', ), array( 'name' => 'form_content_docs', 'type' => 'docs_link', 'url' => 'http://docs.givewp.com/form-content', 'title' => __( 'Form Content', 'give' ), ), ), $post_id ), ) ), /** * Terms & Conditions */ 'form_terms_options' => apply_filters( 'give_forms_terms_options', array( 'id' => 'form_terms_options', 'title' => __( 'Terms & Conditions', 'give' ), 'icon-html' => '<span class="give-icon give-icon-checklist"></span>', 'fields' => apply_filters( 'give_forms_terms_options_metabox_fields', array( // Donation Option array( 'name' => __( 'Terms and Conditions', 'give' ), 'description' => __( 'Do you want to require the donor to accept terms prior to being able to complete their donation?', 'give' ), 'id' => $prefix . 'terms_option', 'type' => 'radio_inline', 'options' => apply_filters( 'give_forms_content_options_select', array( 'global' => __( 'Global Option', 'give' ), 'enabled' => __( 'Customize', 'give' ), 'disabled' => __( 'Disable', 'give' ), ) ), 'default' => 'global', ), array( 'id' => $prefix . 'agree_label', 'name' => __( 'Agreement Label', 'give' ), 'desc' => __( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give' ), 'type' => 'text', 'size' => 'regular', 'attributes' => array( 'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ), ), 'wrapper_class' => 'give-hidden', ), array( 'id' => $prefix . 'agree_text', 'name' => __( 'Agreement Text', 'give' ), 'desc' => __( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ), 'default' => give_get_option( 'agreement_text' ), 'type' => 'wysiwyg', 'wrapper_class' => 'give-hidden', ), array( 'name' => 'terms_docs', 'type' => 'docs_link', 'url' => 'http://docs.givewp.com/form-terms', 'title' => __( 'Terms and Conditions', 'give' ), ), ), $post_id ), ) ), ); /** * Filter the metabox tabbed panel settings. */ $settings = apply_filters( 'give_metabox_form_data_settings', $settings, $post_id ); // Output. return $settings; } /** * Add metabox. * * @since 1.8 * @return void */ public function add_meta_box() { add_meta_box( $this->get_metabox_ID(), $this->get_metabox_label(), array( $this, 'output' ), array( 'give_forms' ), 'normal', 'high' ); } /** * Enqueue scripts. * * @since 1.8 * @return void */ function enqueue_script() { global $post; if ( is_object( $post ) && 'give_forms' === $post->post_type ) { } } /** * Get metabox id. * * @since 1.8 * @return string */ function get_metabox_ID() { return $this->metabox_id; } /** * Get metabox label. * * @since 1.8 * @return string */ function get_metabox_label() { return $this->metabox_label; } /** * Get metabox tabs. * * @since 1.8 * @return array */ public function get_tabs() { $tabs = array(); if ( ! empty( $this->settings ) ) { foreach ( $this->settings as $setting ) { if ( ! isset( $setting['id'] ) || ! isset( $setting['title'] ) ) { continue; } $tab = array( 'id' => $setting['id'], 'label' => $setting['title'], 'icon-html' => ( ! empty( $setting['icon-html'] ) ? $setting['icon-html'] : '' ), ); if ( $this->has_sub_tab( $setting ) ) { if ( empty( $setting['sub-fields'] ) ) { $tab = array(); } else { foreach ( $setting['sub-fields'] as $sub_fields ) { $tab['sub-fields'][] = array( 'id' => $sub_fields['id'], 'label' => $sub_fields['title'], 'icon-html' => ( ! empty( $sub_fields['icon-html'] ) ? $sub_fields['icon-html'] : '' ), ); } } } if ( ! empty( $tab ) ) { $tabs[] = $tab; } } } return $tabs; } /** * Output metabox settings. * * @since 1.8 * @return void */ public function output() { // Bailout. if ( $form_data_tabs = $this->get_tabs() ) : $active_tab = ! empty( $_GET['give_tab'] ) ? give_clean( $_GET['give_tab'] ) : 'form_field_options'; wp_nonce_field( 'give_save_form_meta', 'give_form_meta_nonce' ); ?> <input id="give_form_active_tab" type="hidden" name="give_form_active_tab"> <div class="give-metabox-panel-wrap"> <ul class="give-form-data-tabs give-metabox-tabs"> <?php foreach ( $form_data_tabs as $index => $form_data_tab ) : ?> <?php // Determine if current tab is active. $is_active = $active_tab === $form_data_tab['id'] ? true : false; ?> <li class="<?php echo "{$form_data_tab['id']}_tab" . ( $is_active ? ' active' : '' ) . ( $this->has_sub_tab( $form_data_tab ) ? ' has-sub-fields' : '' ); ?>"> <a href="#<?php echo $form_data_tab['id']; ?>" data-tab-id="<?php echo $form_data_tab['id']; ?>"> <?php if ( ! empty( $form_data_tab['icon-html'] ) ) : ?> <?php echo $form_data_tab['icon-html']; ?> <?php else : ?> <span class="give-icon give-icon-default"></span> <?php endif; ?> <span class="give-label"><?php echo $form_data_tab['label']; ?></span> </a> <?php if ( $this->has_sub_tab( $form_data_tab ) ) : ?> <ul class="give-metabox-sub-tabs give-hidden"> <?php foreach ( $form_data_tab['sub-fields'] as $sub_tab ) : ?> <li class="<?php echo "{$sub_tab['id']}_tab"; ?>"> <a href="#<?php echo $sub_tab['id']; ?>" data-tab-id="<?php echo $sub_tab['id']; ?>"> <?php if ( ! empty( $sub_tab['icon-html'] ) ) : ?> <?php echo $sub_tab['icon-html']; ?> <?php else : ?> <span class="give-icon give-icon-default"></span> <?php endif; ?> <span class="give-label"><?php echo $sub_tab['label']; ?></span> </a> </li> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> <?php foreach ( $this->settings as $setting ) : ?> <?php if ( ! $this->has_sub_tab( $setting ) ) : ?> <?php do_action( "give_before_{$setting['id']}_settings" ); ?> <?php // Determine if current panel is active. $is_active = $active_tab === $setting['id'] ? true : false; ?> <div id="<?php echo $setting['id']; ?>" class="panel give_options_panel<?php echo( $is_active ? ' active' : '' ); ?>"> <?php if ( ! empty( $setting['fields'] ) ) : ?> <?php foreach ( $setting['fields'] as $field ) : ?> <?php give_render_field( $field ); ?> <?php endforeach; ?> <?php endif; ?> </div> <?php do_action( "give_after_{$setting['id']}_settings" ); ?> <?php else : ?> <?php if ( $this->has_sub_tab( $setting ) ) : ?> <?php if ( ! empty( $setting['sub-fields'] ) ) : ?> <?php foreach ( $setting['sub-fields'] as $index => $sub_fields ) : ?> <div id="<?php echo $sub_fields['id']; ?>" class="panel give_options_panel give-hidden"> <?php if ( ! empty( $sub_fields['fields'] ) ) : ?> <?php foreach ( $sub_fields['fields'] as $sub_field ) : ?> <?php give_render_field( $sub_field ); ?> <?php endforeach; ?> <?php endif; ?> </div> <?php endforeach; ?> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php endforeach; ?> </div> <?php endif; // End if(). } /** * Check if setting field has sub tabs/fields * * @since 1.8 * * @param $field_setting * * @return bool */ private function has_sub_tab( $field_setting ) { $has_sub_tab = false; if ( array_key_exists( 'sub-fields', $field_setting ) ) { $has_sub_tab = true; } return $has_sub_tab; } /** * CMB2 settings loader. * * @since 1.8 * @return array */ function cmb2_metabox_settings() { $all_cmb2_settings = apply_filters( 'cmb2_meta_boxes', array() ); $give_forms_settings = $all_cmb2_settings; // Filter settings: Use only give forms related settings. foreach ( $all_cmb2_settings as $index => $setting ) { if ( ! in_array( 'give_forms', $setting['object_types'] ) ) { unset( $give_forms_settings[ $index ] ); } } return $give_forms_settings; } /** * Check if we're saving, the trigger an action based on the post type. * * @since 1.8 * * @param int $post_id * @param object $post * * @return void */ public function save( $post_id, $post ) { // $post_id and $post are required. if ( empty( $post_id ) || empty( $post ) ) { return; } // Don't save meta boxes for revisions or autosaves. if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) { return; } // Check the nonce. if ( empty( $_POST['give_form_meta_nonce'] ) || ! wp_verify_nonce( $_POST['give_form_meta_nonce'], 'give_save_form_meta' ) ) { return; } // Check the post being saved == the $post_id to prevent triggering this call for other save_post events. if ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) { return; } // Check user has permission to edit. if ( ! current_user_can( 'edit_post', $post_id ) ) { return; } // Fire action before saving form meta. do_action( 'give_pre_process_give_forms_meta', $post_id, $post ); /** * Filter the meta key to save. * Third party addon developer can remove there meta keys from this array to handle saving data on there own. */ $form_meta_keys = apply_filters( 'give_process_form_meta_keys', $this->get_meta_keys_from_settings() ); // Save form meta data. if ( ! empty( $form_meta_keys ) ) { foreach ( $form_meta_keys as $form_meta_key ) { // Set default value for checkbox fields. if ( ! isset( $_POST[ $form_meta_key ] ) && ( 'checkbox' === $this->get_field_type( $form_meta_key ) ) ) { $_POST[ $form_meta_key ] = ''; } if ( isset( $_POST[ $form_meta_key ] ) ) { $setting_field = $this->get_setting_field( $form_meta_key ); if ( ! empty( $setting_field['type'] ) ) { switch ( $setting_field['type'] ) { case 'textarea': case 'wysiwyg': $form_meta_value = wp_kses_post( $_POST[ $form_meta_key ] ); break; case 'group': $form_meta_value = array(); foreach ( $_POST[ $form_meta_key ] as $index => $group ) { // Do not save template input field values. if ( '{{row-count-placeholder}}' === $index ) { continue; } $group_meta_value = array(); foreach ( $group as $field_id => $field_value ) { switch ( $this->get_field_type( $field_id, $form_meta_key ) ) { case 'wysiwyg': $group_meta_value[ $field_id ] = wp_kses_post( $field_value ); break; default: $group_meta_value[ $field_id ] = give_clean( $field_value ); } } if ( ! empty( $group_meta_value ) ) { $form_meta_value[ $index ] = $group_meta_value; } } // Arrange repeater field keys in order. $form_meta_value = array_values( $form_meta_value ); break; default: $form_meta_value = give_clean( $_POST[ $form_meta_key ] ); }// End switch(). /** * Filter the form meta value before saving * * @since 1.8.9 */ $form_meta_value = apply_filters( 'give_pre_save_form_meta_value', $this->sanitize_form_meta( $form_meta_value, $setting_field ), $form_meta_key, $this, $post_id ); // Save data. give_update_meta( $post_id, $form_meta_key, $form_meta_value ); // Fire after saving form meta key. do_action( "give_save_{$form_meta_key}", $form_meta_key, $form_meta_value, $post_id, $post ); }// End if(). }// End if(). }// End foreach(). }// End if(). // Fire action after saving form meta. do_action( 'give_post_process_give_forms_meta', $post_id, $post ); } /** * Get field ID. * * @since 1.8 * * @param array $field * * @return string */ private function get_field_id( $field ) { $field_id = ''; if ( array_key_exists( 'id', $field ) ) { $field_id = $field['id']; } return $field_id; } /** * Get fields ID. * * @since 1.8 * * @param $setting * * @return array */ private function get_fields_id( $setting ) { $meta_keys = array(); if ( ! empty( $setting ) ) { foreach ( $setting['fields'] as $field ) { if ( $field_id = $this->get_field_id( $field ) ) { $meta_keys[] = $field_id; } } } return $meta_keys; } /** * Get sub fields ID. * * @since 1.8 * * @param $setting * * @return array */ private function get_sub_fields_id( $setting ) { $meta_keys = array(); if ( $this->has_sub_tab( $setting ) && ! empty( $setting['sub-fields'] ) ) { foreach ( $setting['sub-fields'] as $fields ) { if ( ! empty( $fields['fields'] ) ) { foreach ( $fields['fields'] as $field ) { if ( $field_id = $this->get_field_id( $field ) ) { $meta_keys[] = $field_id; } } } } } return $meta_keys; } /** * Get all setting field ids. * * @since 1.8 * @return array */ private function get_meta_keys_from_settings() { $meta_keys = array(); foreach ( $this->settings as $setting ) { if ( $this->has_sub_tab( $setting ) ) { $meta_key = $this->get_sub_fields_id( $setting ); } else { $meta_key = $this->get_fields_id( $setting ); } $meta_keys = array_merge( $meta_keys, $meta_key ); } return $meta_keys; } /** * Get field type. * * @since 1.8 * * @param string $field_id * @param string $group_id * * @return string */ function get_field_type( $field_id, $group_id = '' ) { $field = $this->get_setting_field( $field_id, $group_id ); $type = array_key_exists( 'type', $field ) ? $field['type'] : ''; return $type; } /** * Get Field * * @since 1.8 * * @param array $setting * @param string $field_id * * @return array */ private function get_field( $setting, $field_id ) { $setting_field = array(); if ( ! empty( $setting['fields'] ) ) { foreach ( $setting['fields'] as $field ) { if ( array_key_exists( 'id', $field ) && $field['id'] === $field_id ) { $setting_field = $field; break; } } } return $setting_field; } /** * Get Sub Field * * @since 1.8 * * @param array $setting * @param string $field_id * * @return array */ private function get_sub_field( $setting, $field_id ) { $setting_field = array(); if ( ! empty( $setting['sub-fields'] ) ) { foreach ( $setting['sub-fields'] as $fields ) { if ( $field = $this->get_field( $fields, $field_id ) ) { $setting_field = $field; break; } } } return $setting_field; } /** * Get setting field. * * @since 1.8 * * @param string $field_id * @param string $group_id Get sub field from group. * * @return array */ function get_setting_field( $field_id, $group_id = '' ) { $setting_field = array(); $_field_id = $field_id; $field_id = empty( $group_id ) ? $field_id : $group_id; if ( ! empty( $this->settings ) ) { foreach ( $this->settings as $setting ) { if ( ( $this->has_sub_tab( $setting ) && ( $setting_field = $this->get_sub_field( $setting, $field_id ) ) ) || ( $setting_field = $this->get_field( $setting, $field_id ) ) ) { break; } } } // Get field from group. if ( ! empty( $group_id ) ) { foreach ( $setting_field['fields'] as $field ) { if ( array_key_exists( 'id', $field ) && $field['id'] === $_field_id ) { $setting_field = $field; } } } return $setting_field; } /** * Add offline donations setting tab to donation form options metabox. * * @since 1.8 * * @param array $settings List of form settings. * * @return mixed */ function add_offline_donations_setting_tab( $settings ) { if ( give_is_gateway_active( 'offline' ) ) { $settings['offline_donations_options'] = apply_filters( 'give_forms_offline_donations_options', array( 'id' => 'offline_donations_options', 'title' => __( 'Offline Donations', 'give' ), 'icon-html' => '<span class="give-icon give-icon-purse"></span>', 'fields' => apply_filters( 'give_forms_offline_donations_metabox_fields', array() ), ) ); } return $settings; } /** * Sanitize form meta values before saving. * * @since 1.8.9 * @access public * * @param mixed $meta_value * @param array $setting_field * * @return mixed */ function sanitize_form_meta( $meta_value, $setting_field ) { switch ( $setting_field['type'] ) { case 'group': if ( ! empty( $setting_field['fields'] ) ) { foreach ( $setting_field['fields'] as $field ) { if ( empty( $field['data_type'] ) || 'price' !== $field['data_type'] ) { continue; } foreach ( $meta_value as $index => $meta_data ) { if ( ! isset( $meta_value[ $index ][ $field['id'] ] ) ) { continue; } $meta_value[ $index ][ $field['id'] ] = ! empty( $meta_value[ $index ][ $field['id'] ] ) ? give_sanitize_amount_for_db( $meta_value[ $index ][ $field['id'] ] ) : 0; } } } break; default: if ( ! empty( $setting_field['data_type'] ) && 'price' === $setting_field['data_type'] ) { $meta_value = $meta_value ? give_sanitize_amount_for_db( $meta_value ) : 0; } } return $meta_value; } /** * Maintain the active tab after save. * * @since 1.8.13 * @access public * * @param string $location The destination URL. * @param int $post_id The post ID. * * @return string The URL after redirect. */ public function maintain_active_tab( $location, $post_id ) { if ( 'give_forms' === get_post_type( $post_id ) && ! empty( $_POST['give_form_active_tab'] ) ) { $location = add_query_arg( 'give_tab', give_clean( $_POST['give_form_active_tab'] ), $location ); } return $location; } } new Give_MetaBox_Form_Data();
30.080537
306
0.536423
b08d228841050c6dbf17dec8426a650d2bf8cba3
3,999
py
Python
utils.py
sisl/terminal-airspace-models
212d7daeac8606e16b3eb3a1593a71845bbcc749
[ "MIT" ]
12
2018-05-14T05:39:48.000Z
2022-01-21T09:45:33.000Z
utils.py
sisl/terminal-airspace-models
212d7daeac8606e16b3eb3a1593a71845bbcc749
[ "MIT" ]
null
null
null
utils.py
sisl/terminal-airspace-models
212d7daeac8606e16b3eb3a1593a71845bbcc749
[ "MIT" ]
3
2018-06-30T06:17:54.000Z
2020-03-11T10:57:11.000Z
""" utils.py Author: Shane Barratt This script provides coordinate transformations from Geodetic -> ECEF, ECEF -> ENU and Geodetic -> ENU (the composition of the two previous functions). Running the script by itself runs tests. based on https://gist.github.com/govert/1b373696c9a27ff4c72a. It also provides some other useful functions. """ import math from sklearn.utils import shuffle import numpy as np def train_test_split(data, fraction_val): data_shuffled = shuffle(data) n_val = int(data.shape[0]*fraction_val) return data_shuffled[n_val:], data_shuffled[:n_val] a = 6378137 b = 6356752.3142 f = (a - b) / a e_sq = f * (2-f) def geodetic_to_ecef(lat, lon, h): # (lat, lon) in WSG-84 degrees # h in meters lamb = math.radians(lat) phi = math.radians(lon) s = math.sin(lamb) N = a / math.sqrt(1 - e_sq * s * s) sin_lambda = math.sin(lamb) cos_lambda = math.cos(lamb) sin_phi = math.sin(phi) cos_phi = math.cos(phi) x = (h + N) * cos_lambda * cos_phi y = (h + N) * cos_lambda * sin_phi z = (h + (1 - e_sq) * N) * sin_lambda return x, y, z def ecef_to_enu(x, y, z, lat0, lon0, h0): lamb = math.radians(lat0) phi = math.radians(lon0) s = math.sin(lamb) N = a / math.sqrt(1 - e_sq * s * s) sin_lambda = math.sin(lamb) cos_lambda = math.cos(lamb) sin_phi = math.sin(phi) cos_phi = math.cos(phi) x0 = (h0 + N) * cos_lambda * cos_phi y0 = (h0 + N) * cos_lambda * sin_phi z0 = (h0 + (1 - e_sq) * N) * sin_lambda xd = x - x0 yd = y - y0 zd = z - z0 xEast = -sin_phi * xd + cos_phi * yd yNorth = -cos_phi * sin_lambda * xd - sin_lambda * sin_phi * yd + cos_lambda * zd zUp = cos_lambda * cos_phi * xd + cos_lambda * sin_phi * yd + sin_lambda * zd return xEast, yNorth, zUp def geodetic_to_enu(lat, lon, h, lat_ref, lon_ref, h_ref): x, y, z = geodetic_to_ecef(lat, lon, h) return ecef_to_enu(x, y, z, lat_ref, lon_ref, h_ref) def log_probability(means, covs, cluster_probs, X_val): # Iterate over validation data and calculate probability of each one under model n_clusters = len(means) cov_pinvs = [] for j in range(n_clusters): u, s, v = covs[j] pinv = np.matmul(v.T, np.matmul(np.diag(1./s), u.T)) cov_pinvs.append(pinv) x = 0.0 for traj in X_val: possibilities = [] for j in range(n_clusters): u, s, v = covs[j] mean = means[j] cov_pinv = cov_pinvs[j] dev = (traj - mean)[:, np.newaxis] log_2pi_pseudo_det = np.sum(np.log(2*np.pi*s)) maha = np.dot(traj.T, np.dot(cov_pinv, traj)) prob = -.5 * (log_2pi_pseudo_det + maha) + np.log(cluster_probs[j]) # prob = cluster_probs[j] * np.exp(log_2pi_pseudo_det)**(-.5)*np.exp(-.5*maha) possibilities.append(prob) x += np.max(possibilities) return x def generate(mean, cov, r=1.): u, s, vt = cov z = np.random.normal(size=vt.shape[1]) traj = mean + np.dot(vt.T, np.dot(np.diag(r*s**.5), np.dot(vt, z))) return traj if __name__ == '__main__': def are_close(a, b): return abs(a-b) < 1e-4 latLA = 34.00000048 lonLA = -117.3335693 hLA = 251.702 x0, y0, z0 = geodetic_to_ecef(latLA, lonLA, hLA) x = x0 + 1 y = y0 z = z0 xEast, yNorth, zUp = ecef_to_enu(x, y, z, latLA, lonLA, hLA) assert are_close(0.88834836, xEast) assert are_close(0.25676467, yNorth) assert are_close(-0.38066927, zUp) x = x0 y = y0 + 1 z = z0 xEast, yNorth, zUp = ecef_to_enu(x, y, z, latLA, lonLA, hLA) assert are_close(-0.45917011, xEast) assert are_close(0.49675810, yNorth) assert are_close(-0.73647416, zUp) x = x0 y = y0 z = z0 + 1 xEast, yNorth, zUp = ecef_to_enu(x, y, z, latLA, lonLA, hLA) assert are_close(0.00000000, xEast) assert are_close(0.82903757, yNorth) assert are_close(0.55919291, zUp)
28.564286
90
0.606152
146da4a84dc0441d1f058226fabf14449b546ea9
1,089
ts
TypeScript
example/app/src/reducers/todo.ts
4074/redux-use
5e1df39d478641df861dc9f1a53141b2a97688bc
[ "MIT" ]
6
2021-05-01T04:46:41.000Z
2022-03-24T04:00:34.000Z
example/app/src/reducers/todo.ts
4074/redux-use
5e1df39d478641df861dc9f1a53141b2a97688bc
[ "MIT" ]
null
null
null
example/app/src/reducers/todo.ts
4074/redux-use
5e1df39d478641df861dc9f1a53141b2a97688bc
[ "MIT" ]
null
null
null
import reduxu, { PayloadAction } from 'redux-use' import createRequest from './createRequest' const add = reduxu.async(createRequest<any, any>('todos', 'POST')) export const useTodoAdd = add.hook export const updateFetcher = createRequest<any, any>('todos', 'PATCH') const update = reduxu.async(updateFetcher) export const useTodoUpdate = update.hook export const useTodo = reduxu.async(createRequest<any[]>('todos'), { extraReducers: (builder) => { builder.addCase(add.thunk.fulfilled, (state, { payload }) => { state.data?.push(payload) }) builder.addCase(update.thunk.fulfilled, (state, { payload }) => { if (state.data) { const index = state.data.findIndex(item => item.id === payload.id) if (index >= 0) state.data[index] = payload } }) } }).hook interface TodoFilter { type: 'all' | 'done' } export const useTodoFilter = reduxu.sync({ name: 'useTodoFilter', initialState: { type: 'all' } as TodoFilter, reducers: { set: (state, { payload }: PayloadAction<TodoFilter>) => { return payload } } }).hook
28.657895
74
0.656566
e344be8a8fb0352c01664b7c665103da7ca23fe7
1,404
rb
Ruby
test/requests/compute/test_redeploy_virtual_machine.rb
marcosteixeira/fog-azure-rm
3f037f0d69ec8a70a65aed376f4ec6acabe1eeec
[ "MIT" ]
null
null
null
test/requests/compute/test_redeploy_virtual_machine.rb
marcosteixeira/fog-azure-rm
3f037f0d69ec8a70a65aed376f4ec6acabe1eeec
[ "MIT" ]
null
null
null
test/requests/compute/test_redeploy_virtual_machine.rb
marcosteixeira/fog-azure-rm
3f037f0d69ec8a70a65aed376f4ec6acabe1eeec
[ "MIT" ]
null
null
null
require File.expand_path '../../test_helper', __dir__ # Test class for Redeploy Virtual Machine Request class TestRedeployVirtualMachine < Minitest::Test def setup @service = Fog::AzureRM::Compute.new(credentials) compute_client = @service.instance_variable_get(:@compute_mgmt_client) @virtual_machines = compute_client.virtual_machines end def test_redeploy_virtual_machine_success @virtual_machines.stub :redeploy, true do assert @service.redeploy_virtual_machine('fog-test-rg', 'fog-test-server', false) end async_response = Concurrent::Promise.execute { 10 } @virtual_machines.stub :redeploy_async, async_response do assert @service.redeploy_virtual_machine('fog-test-rg', 'fog-test-server', true), async_response end end def test_redeploy_virtual_machine_failure response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @virtual_machines.stub :redeploy, response do assert_raises(MsRestAzure::AzureOperationError) { @service.redeploy_virtual_machine('fog-test-rg', 'fog-test-server', false) } end async_response = Concurrent::Promise.execute { 10 } @virtual_machines.stub :redeploy_async, response do assert_raises(MsRestAzure::AzureOperationError) { @service.redeploy_virtual_machine('fog-test-rg', 'fog-test-server', true) } end end end
41.294118
132
0.748575
1f48f37f852529e19b3cd8dc50d920bb61ca2ed1
1,073
cs
C#
Alpaca.Markets/Messages/JsonClock.cs
Dav-id/alpaca-trade-api-csharp
fc31b3605ca5ee4e6920bc9522affb2d83f5d0ad
[ "Apache-2.0" ]
179
2018-08-15T00:41:55.000Z
2022-03-24T10:30:23.000Z
Alpaca.Markets/Messages/JsonClock.cs
Dav-id/alpaca-trade-api-csharp
fc31b3605ca5ee4e6920bc9522affb2d83f5d0ad
[ "Apache-2.0" ]
388
2018-07-17T12:46:56.000Z
2022-03-30T16:29:09.000Z
Alpaca.Markets/Messages/JsonClock.cs
Dav-id/alpaca-trade-api-csharp
fc31b3605ca5ee4e6920bc9522affb2d83f5d0ad
[ "Apache-2.0" ]
72
2018-11-01T22:29:30.000Z
2022-03-29T03:17:33.000Z
using System; using System.Diagnostics.CodeAnalysis; using Newtonsoft.Json; namespace Alpaca.Markets { [SuppressMessage( "Microsoft.Performance", "CA1812:Avoid uninstantiated internal classes", Justification = "Object instances of this class will be created by Newtonsoft.JSON library.")] internal sealed class JsonClock : IClock { [JsonProperty(PropertyName = "timestamp", Required = Required.Always)] [JsonConverter(typeof(AssumeUtcIsoDateTimeConverter))] public DateTime TimestampUtc { get; set; } [JsonProperty(PropertyName = "is_open", Required = Required.Always)] public Boolean IsOpen { get; set; } [JsonProperty(PropertyName = "next_open", Required = Required.Always)] [JsonConverter(typeof(AssumeUtcIsoDateTimeConverter))] public DateTime NextOpenUtc { get; set; } [JsonProperty(PropertyName = "next_close", Required = Required.Always)] [JsonConverter(typeof(AssumeUtcIsoDateTimeConverter))] public DateTime NextCloseUtc { get; set; } } }
38.321429
102
0.701771
5eef2072cb18c61bb006569da68e5ba9b918075c
805
php
PHP
action/login.php
JoseLuisIc/VerificacionVehiculos
bb0e39e5c213c17c000185f46fc3f11979f6c760
[ "MIT" ]
null
null
null
action/login.php
JoseLuisIc/VerificacionVehiculos
bb0e39e5c213c17c000185f46fc3f11979f6c760
[ "MIT" ]
null
null
null
action/login.php
JoseLuisIc/VerificacionVehiculos
bb0e39e5c213c17c000185f46fc3f11979f6c760
[ "MIT" ]
null
null
null
<?php session_start(); if (isset($_POST['token']) && $_POST['token']!=='') { //Contiene las variables de configuracion para conectar a la base de datos include "../config/config.php"; $email=mysqli_real_escape_string($con,(strip_tags($_POST["email"],ENT_QUOTES))); $password=sha1(md5(mysqli_real_escape_string($con,(strip_tags($_POST["password"],ENT_QUOTES))))); $query = mysqli_query($con,"SELECT * FROM user WHERE email =\"$email\" OR username=\"$email\" AND password = \"$password\";"); if ($row = mysqli_fetch_array($query)) { $_SESSION['user_id'] = $row['id']; header("location: ../dashboard.php"); }else{ $invalid=sha1(md5("contrasena y email invalido")); header("location: ../index.php?invalid=$invalid"); } }else{ header("location: ../"); } ?>
27.758621
130
0.643478
da1ddfb96a0ec556bd487d698c9a07e747eca8f7
2,229
php
PHP
src/Metadata/Driver/AnnotationDriver.php
eikona-media/open-graph
113f6f5ccd8db0492da17c99d3df158f63fad9b3
[ "MIT" ]
null
null
null
src/Metadata/Driver/AnnotationDriver.php
eikona-media/open-graph
113f6f5ccd8db0492da17c99d3df158f63fad9b3
[ "MIT" ]
null
null
null
src/Metadata/Driver/AnnotationDriver.php
eikona-media/open-graph
113f6f5ccd8db0492da17c99d3df158f63fad9b3
[ "MIT" ]
null
null
null
<?php namespace Novaway\Component\OpenGraph\Metadata\Driver; use Doctrine\Common\Annotations\Reader; use Metadata\Driver\DriverInterface; use Novaway\Component\OpenGraph\Annotation\GraphNode; use Novaway\Component\OpenGraph\Annotation\NamespaceNode; use Novaway\Component\OpenGraph\Metadata\ClassMetadata; use Novaway\Component\OpenGraph\Metadata\MetadataValue; use Novaway\Component\OpenGraph\Metadata\MethodMetadata; use Novaway\Component\OpenGraph\Metadata\PropertyMetadata; class AnnotationDriver implements DriverInterface { /** @var Reader */ private $reader; /** * Constructor * * @param Reader $reader */ public function __construct(Reader $reader) { $this->reader = $reader; } /** * Load metadata class * * @param \ReflectionClass $class * @return ClassMetadata */ public function loadMetadataForClass(\ReflectionClass $class): ?\Metadata\ClassMetadata { $classMetadata = new ClassMetadata($class->name); $classMetadata->fileResources[] = $class->getFileName(); foreach ($this->reader->getClassAnnotations($class) as $annotation) { if ($annotation instanceof NamespaceNode) { $classMetadata->addGraphNamespace($annotation); } if ($annotation instanceof GraphNode) { $classMetadata->addGraphMetadata($annotation, new MetadataValue($annotation->value)); } } foreach ($class->getProperties() as $property) { foreach ($this->reader->getPropertyAnnotations($property) as $annotation) { if ($annotation instanceof GraphNode) { $classMetadata->addGraphMetadata($annotation, new PropertyMetadata($class->name, $property->name)); } } } foreach ($class->getMethods() as $method) { foreach ($this->reader->getMethodAnnotations($method) as $annotation) { if ($annotation instanceof GraphNode) { $classMetadata->addGraphMetadata($annotation, new MethodMetadata($class->name, $method->name)); } } } return $classMetadata; } }
31.842857
119
0.638403
dd30dac90072a2279586525f004b00a091ea40c4
287
swift
Swift
LeetCode/PlusOne/PlusOneTest.swift
z251257144/Leetcode_Swift
2823b81fb15fceb52099399bdaf9585b6127df2e
[ "Apache-2.0" ]
null
null
null
LeetCode/PlusOne/PlusOneTest.swift
z251257144/Leetcode_Swift
2823b81fb15fceb52099399bdaf9585b6127df2e
[ "Apache-2.0" ]
null
null
null
LeetCode/PlusOne/PlusOneTest.swift
z251257144/Leetcode_Swift
2823b81fb15fceb52099399bdaf9585b6127df2e
[ "Apache-2.0" ]
null
null
null
// // PlusOneTest.swift // LeetCode // // Created by zhoumin on 2019/11/22. // Copyright © 2019 ZhouMin. All rights reserved. // import Cocoa class PlusOneTest: NSObject { override init() { let arr = [9] let a = PlusOne2().plusOne(arr) print(a) } }
15.944444
50
0.58885
7f48ae1d883348c5de00ada7e1e05e9c008a6e98
2,671
php
PHP
resources/views/admin/pages/blog/index.blade.php
andv95/web-shopping
085918b5fa5f53ee0653053a71e406e638fc4c52
[ "MIT" ]
null
null
null
resources/views/admin/pages/blog/index.blade.php
andv95/web-shopping
085918b5fa5f53ee0653053a71e406e638fc4c52
[ "MIT" ]
null
null
null
resources/views/admin/pages/blog/index.blade.php
andv95/web-shopping
085918b5fa5f53ee0653053a71e406e638fc4c52
[ "MIT" ]
1
2021-04-02T09:42:17.000Z
2021-04-02T09:42:17.000Z
@extends('admin.layouts.full_content') @section('content') <div class="card"> <div class="card-header"> <h3 class="card-title">Danh sách thuộc tính</h3> {{--<input type="text" id="search_name">--}} <a href="{{ @$routeAdd }}" class="btn btn-success float-right">Thêm mới</a> </div> <!-- /.card-header --> <div class="card-body"> <div id="admin_datatable_wrapper" class="dataTables_wrapper dt-bootstrap4"> <div class="row"> <div class="col-sm-12"> <table id="admin_datatable" class="table table-bordered table-striped dataTable" data-route="{{ @$routeList }}" data-token="{{ csrf_token() }}"> <thead> <tr role="row"> <th class="sorting_asc" aria-sort="ascending" style="width: 283px;"> Tên </th> <th class="sorting" style="width: 359px;"> Name </th> <th class="sorting" style="width: 359px;"> Ngôn ngữ </th> <th class="sorting" style="width: 359px;"> Danh mục </th> <th class="sorting" style="width: 359px;"> Ảnh </th> <th class="sorting_asc" aria-sort="ascending" style="width: 283px;"> Hành động </th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> <!-- /.card-body --> </div> @endsection @section('script') <script> var columns = [ {data: 'title', name: 'title'}, {data: 'slug', name: 'slug'}, {data: 'lang', name: 'lang'}, {data: 'categories', name: 'categories'}, {data: 'image', name: 'image'}, {data: 'action', name: 'action'}, ]; var table = adminBase.helpers.datatable(columns); $(document).on('keyup', '#search_name', function () { table.draw(); }); </script> @endsection
40.469697
104
0.366529
6b19cf8f845a3523308e5dcf44ee967374f85273
1,334
js
JavaScript
resources/js/network/request.js
CleanFeather/paubo
bcfe3fdc177d008f88fc13bc52fcf1afe22c2da4
[ "MIT" ]
null
null
null
resources/js/network/request.js
CleanFeather/paubo
bcfe3fdc177d008f88fc13bc52fcf1afe22c2da4
[ "MIT" ]
null
null
null
resources/js/network/request.js
CleanFeather/paubo
bcfe3fdc177d008f88fc13bc52fcf1afe22c2da4
[ "MIT" ]
null
null
null
import axios from 'axios'; export const request = config => { let instance = axios.create({ baseURL: '/api', timeout: 5000, headers: { 'Authorization': localStorage.getItem('access_token') } }) instance.interceptors.response.use(response => { if ('authorization' in response.headers) { localStorage.setItem('access_token', response.headers.authorization); } return response; }, error => { if ('authorization' in error.response.headers) { localStorage.setItem('access_token', error.response.headers.authorization); } switch (error.response.status) { case 401: _app.$store.commit('clear'); _app.$message.error('请登录'); _app.$router.push({ name: 'login' }); break; case 403: if (error.response.data.message == 'This action is unauthorized.'){ _app.$message.error('您没有权限做此操作'); setTimeout(function (){ _app.$router.go(-1); },1000); } break; default: _app.$message.error('操作失败'); } return Promise.reject(error); }); return instance(config); };
33.35
87
0.509745
ef625e3ba92c59f8fba497d163091e0739abe852
3,529
js
JavaScript
mobile/App/Components/Welcome.js
DimitriMikadze/react-native-game
e6dc55aaf02e30bd04bd1e7da826ed3d96e996ee
[ "MIT" ]
115
2015-12-15T20:28:17.000Z
2018-02-28T12:54:16.000Z
mobile/App/Components/Welcome.js
DimitriMikadze/react-native-game
e6dc55aaf02e30bd04bd1e7da826ed3d96e996ee
[ "MIT" ]
null
null
null
mobile/App/Components/Welcome.js
DimitriMikadze/react-native-game
e6dc55aaf02e30bd04bd1e7da826ed3d96e996ee
[ "MIT" ]
34
2015-12-16T15:06:15.000Z
2018-02-28T12:54:18.000Z
var React = require('react-native'); var Choose = require('./Choose'); var { StyleSheet, Text, View, TouchableHighlight, TextInput, ActivityIndicatorIOS } = React; class Welcome extends React.Component { constructor(props) { super(props); this.state = { player: '', error: '', isLoading: false }; } _handleChange(event) { this.setState({ error: '', player: event.nativeEvent.text }); } _handleSubmit() { this.setState({ isLoading: true }); var player = this.state.player; this.setState({ player: '' }); if(! player) { this.setState({ error: 'Player name is required', isLoading: false }); } else { this.props.navigator.push({ component: Choose, name: 'Choose', passProps: { player: player } }); this.setState({ error: '', isLoading: false }); } } render() { var showError = ( this.state.error ? <View style={styles.errorContainer}><Text style={styles.error}>{this.state.error}</Text></View> : <View></View> ); return ( <View style={styles.container}> <Text style={styles.heading}>Guess Famous People</Text> <TextInput style={styles.playerInput} value={this.state.player} onChange={this._handleChange.bind(this)} placeholder="Type Your Name" placeholderTextColor="#fff" maxLength={20} /> <TouchableHighlight underlayColor="#ccc" style={styles.button} onPress={this._handleSubmit.bind(this)}> <Text style={styles.buttonText}>Start Game</Text> </TouchableHighlight> { showError } <ActivityIndicatorIOS animating={this.state.isLoading} color="#fff" size="large" /> </View> ) } } var styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#7d669e', justifyContent: 'center', alignItems: 'center', }, heading: { color: '#fff', fontSize: 20, marginBottom: 50, fontFamily: 'Helvetica', }, playerInput: { height: 60, padding: 10, fontSize: 18, color: '#fff', borderWidth: 2, borderColor: '#fff', margin: 10, borderRadius: 10 }, button: { height: 60, backgroundColor: '#fff', alignSelf: 'stretch', justifyContent: 'center', alignItems: 'center', margin: 10, borderRadius: 10, }, buttonText: { color: '#7d669e', fontSize: 16, fontFamily: 'Helvetica', }, errorContainer: { justifyContent: 'center', alignItems: 'center', alignSelf: 'stretch', margin: 10, borderRadius: 10, height: 60, backgroundColor: '#e15258', }, error: { color: '#fff', fontSize: 14, fontFamily: 'Helvetica', } }); module.exports = Welcome;
24.506944
142
0.465004
864bb3805502571adc06988234ece13133d8c44a
98
sql
SQL
5.2.3/Database/Indexes/AFW_17_SMS_TWILI_FK1.sql
lgcarrier/AFW
a58ef2a26cb78bb0ff9b4db725df5bd4118e4945
[ "MIT" ]
1
2017-07-06T14:53:28.000Z
2017-07-06T14:53:28.000Z
5.2.3/Database/Indexes/AFW_17_SMS_TWILI_FK1.sql
lgcarrier/AFW
a58ef2a26cb78bb0ff9b4db725df5bd4118e4945
[ "MIT" ]
null
null
null
5.2.3/Database/Indexes/AFW_17_SMS_TWILI_FK1.sql
lgcarrier/AFW
a58ef2a26cb78bb0ff9b4db725df5bd4118e4945
[ "MIT" ]
null
null
null
SET DEFINE OFF; CREATE INDEX AFW_17_SMS_TWILI_FK1 ON AFW_17_SMS_TWILI (REF_COMPT_TWILI) LOGGING /
16.333333
53
0.846939
ed0c3c03fbb67cff0ee1388b756b66c43544abc8
2,403
c
C
watch/src/Puddle.c
jonspeicher/Puddle
10713f7afd24dd68501fe357eb749d79e14e31d9
[ "MIT" ]
null
null
null
watch/src/Puddle.c
jonspeicher/Puddle
10713f7afd24dd68501fe357eb749d79e14e31d9
[ "MIT" ]
null
null
null
watch/src/Puddle.c
jonspeicher/Puddle
10713f7afd24dd68501fe357eb749d79e14e31d9
[ "MIT" ]
null
null
null
// TBD: Screen is 144 px wide x 168 px tall, status bar is 16 px tall #include <pebble_os.h> #include <pebble_app.h> #include <pebble_fonts.h> #include "forecast.h" #include "forecast_bridge.h" PBL_APP_INFO(FORECAST_BRIDGE_APP_UUID, "Puddle", "Jon Speicher", 0, 1, /* App version */ DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP); Window window; TextLayer debugLayer; void select_single_click_handler(ClickRecognizerRef recognizer, Window *window) { bool success = forecast_bridge_request_forecast(); if (!success) { text_layer_set_text(&debugLayer, "request failed"); } } void up_single_click_handler(ClickRecognizerRef recognizer, Window *window) { text_layer_set_text(&debugLayer, "reset"); } void click_config_provider(ClickConfig **config, Window *window) { config[BUTTON_ID_SELECT]->click.handler = (ClickHandler) select_single_click_handler; config[BUTTON_ID_UP]->click.handler = (ClickHandler) up_single_click_handler; } void forecast_request_failure_handler() { text_layer_set_text(&debugLayer, "response failed"); } // TBD: This is still a mess of course - J. Speicher (8/6/13) static char label[60]; void forecast_request_success_handler(Forecast* forecast) { snprintf(label, 60, "%d,%d,%s", forecast->dummy_integer, forecast->another_dummy_integer, forecast->dummy_string); text_layer_set_text(&debugLayer, label); } void handle_init(AppContextRef ctx) { window_init(&window, "Puddle Main"); window_stack_push(&window, true /* Animated */); text_layer_init(&debugLayer, window.layer.frame); text_layer_set_text_alignment(&debugLayer, GTextAlignmentCenter); text_layer_set_text(&debugLayer, "Debug Layer"); text_layer_set_font(&debugLayer, fonts_get_system_font(FONT_KEY_ROBOTO_CONDENSED_21)); layer_add_child(&window.layer, &debugLayer.layer); window_set_click_config_provider(&window, (ClickConfigProvider) click_config_provider); ForecastCallbacks callbacks = { .success = forecast_request_success_handler, .failure = forecast_request_failure_handler }; forecast_bridge_register_callbacks(callbacks, (void*) ctx); } void pbl_main(void *params) { PebbleAppHandlers handlers = { .init_handler = &handle_init, .messaging_info = { .buffer_sizes = { .inbound = 124, .outbound = 256, } } }; app_event_loop(params, &handlers); }
30.0375
89
0.737828
bb133494f1b834f650a27d1f7826ab1e6a6040cb
4,439
cs
C#
System.Windows.Controls.WPFPropertyGrid/WPFPropertyGrid.cs
ferventdesert/WPFPropertyGrid
ebf2be56ff311ea54d49c041df775233d25c7164
[ "Apache-2.0" ]
5
2019-01-28T09:57:00.000Z
2022-03-29T03:31:40.000Z
System.Windows.Controls.WPFPropertyGrid/WPFPropertyGrid.cs
ferventdesert/WPFPropertyGrid
ebf2be56ff311ea54d49c041df775233d25c7164
[ "Apache-2.0" ]
null
null
null
System.Windows.Controls.WPFPropertyGrid/WPFPropertyGrid.cs
ferventdesert/WPFPropertyGrid
ebf2be56ff311ea54d49c041df775233d25c7164
[ "Apache-2.0" ]
5
2018-04-24T13:14:57.000Z
2021-11-13T13:35:55.000Z
using System.Windows.Controls.WpfPropertyGrid.Design; using System.Windows.Media; namespace System.Windows.Controls.WpfPropertyGrid { /// <summary> /// 属性工厂 /// </summary> public class PropertyGridFactory { private static ResourceDictionary dictionary; /// <summary> /// 获取一个实例 /// </summary> /// <returns></returns> public static WPFPropertyGrid GetInstance() { if (dictionary == null) { var path = "System.Windows.Controls.WpfPropertyGrid;component"; dictionary = new ResourceDictionary(); dictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(path + "/Design/AlphabeticalLayout.xaml", UriKind.RelativeOrAbsolute) }); dictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(path + "/Design/CategorizedLayout.xaml", UriKind.RelativeOrAbsolute) }); dictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(path + "/Design/TabbedLayout.xaml", UriKind.RelativeOrAbsolute) }); dictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(path + "/Themes/DoubleEditor.xaml", UriKind.RelativeOrAbsolute) }); dictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(path + "/Themes/EditorResources.xaml", UriKind.RelativeOrAbsolute) }); dictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(path + "/Themes/PropertyGrid.xaml", UriKind.RelativeOrAbsolute) }); dictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(path + "/Themes/SearchTextBox.xaml", UriKind.RelativeOrAbsolute) }); Application.Current.Resources.MergedDictionaries.Add(dictionary); } var property = new WPFPropertyGrid(); return property; } public static Window GetWindow() { var window = new Window { Title = "设置属性值", Background = Application.Current.TryFindResource("NormalBrush") as Brush, Width = 400 }; return window; } public static WPFPropertyGrid GetInstance(object selectObject) { var property = GetInstance(); property.SetObjectView(selectObject); return property; } public static Window GetPropertyWindow(object item) { var prop = GetInstance(item); var window = new Window { Title = "设置属性值", Content = prop, Background = Application.Current.TryFindResource("NormalBrush") as Brush, Width = 400 }; return window; } } public class WPFPropertyGrid : UserControl { private readonly PropertyGrid propertyGrid; public WPFPropertyGrid() { Brush itemBrush; propertyGrid = new PropertyGrid { PropertyFilterVisibility = Visibility.Collapsed, ShowReadOnlyProperties = true, Layout = new CategorizedLayout() }; itemBrush = Application.Current.TryFindResource("TextBrush") as Brush; if (itemBrush != null) { propertyGrid.ItemsForeground = itemBrush; } Content = propertyGrid; } public bool ShowReadOnlyProperties { get { return propertyGrid.ShowReadOnlyProperties; } set { propertyGrid.ShowReadOnlyProperties = value; } } public Visibility PropertyFilterVisibility { get { return propertyGrid.PropertyFilterVisibility; } set { propertyGrid.PropertyFilterVisibility = value; } } public void SetObjectView(object obj) { propertyGrid.SelectedObject = obj; } } }
31.041958
106
0.543366
4593a3ffcee1627c3cdcaa7160acb77dddadb4ac
2,158
py
Python
leetcode/1220.py
GihwanKim/Baekjoon
52eb2bf80bb1243697858445e5b5e2d50d78be4e
[ "MIT" ]
null
null
null
leetcode/1220.py
GihwanKim/Baekjoon
52eb2bf80bb1243697858445e5b5e2d50d78be4e
[ "MIT" ]
null
null
null
leetcode/1220.py
GihwanKim/Baekjoon
52eb2bf80bb1243697858445e5b5e2d50d78be4e
[ "MIT" ]
null
null
null
""" File: 1220.py Title: Count Vowels Permutation Difficulty: Hard URL: https://leetcode.com/problems/count-vowels-permutation/ """ import unittest from collections import defaultdict class Solution: MOD = 10**9 + 7 def __init__(self): self.cache = defaultdict(dict) def countVowelPermutation(self, n: int) -> int: return self.count(n) def count(self, n: int, vowel: str = None) -> int: if n == 0: return 1 if vowel in self.cache[n]: return self.cache[n][vowel] count = 0 if vowel == 'a': count = self.count(n - 1, 'e') elif vowel == 'e': count = self.count(n - 1, 'a') count += self.count(n - 1, 'i') elif vowel == 'i': count = self.count(n - 1, 'a') count += self.count(n - 1, 'e') count += self.count(n - 1, 'o') count += self.count(n - 1, 'u') elif vowel == 'o': count = self.count(n - 1, 'i') count += self.count(n - 1, 'u') elif vowel == 'u': count = self.count(n - 1, 'a') elif vowel is None: count = self.count(n - 1, 'a') count += self.count(n - 1, 'e') count += self.count(n - 1, 'i') count += self.count(n - 1, 'o') count += self.count(n - 1, 'u') count %= self.MOD self.cache[n][vowel] = count return count class SolutionTestCase(unittest.TestCase): def test_example1(self): # Input n = 1 # Output output = 5 solution = Solution() self.assertEqual(solution.countVowelPermutation(n), output) def test_example2(self): # Input n = 2 # Output output = 10 solution = Solution() self.assertEqual(solution.countVowelPermutation(n), output) def test_example3(self): # Input n = 5 # Output output = 68 solution = Solution() self.assertEqual(solution.countVowelPermutation(n), output) if __name__ == "__main__": unittest.main()
24.247191
67
0.507414
c692d18861e644fb677d567ff36aadbc1246048e
424
py
Python
2020-05-17-python-pytest/examples/test_code.py
Cheukting/python02hero
da6f0f0c1455237b47923a9a1ac6f10562034f9f
[ "MIT" ]
12
2020-05-12T06:56:00.000Z
2021-07-06T11:43:46.000Z
2020-05-17-python-pytest/examples/test_code.py
Cheukting/python02hero
da6f0f0c1455237b47923a9a1ac6f10562034f9f
[ "MIT" ]
1
2021-01-30T16:48:42.000Z
2021-04-03T00:40:12.000Z
2020-05-17-python-pytest/examples/test_code.py
Cheukting/python02hero
da6f0f0c1455237b47923a9a1ac6f10562034f9f
[ "MIT" ]
3
2020-04-27T07:02:19.000Z
2021-07-06T11:43:48.000Z
import pytest from .code import * class TestPub: def test_serve_beer_legal(self): adult = 25 assert serve_beer(adult) == "Have beer" def test_serve_beer_illegal(self): child = 10 assert serve_beer(child) == "No beer" def test_serve_beer_no_age(self): with pytest.raises(ValueError, match="Tell me your age"): age = None serve_beer(age)
23.555556
65
0.610849
4b7415838596cae7fdb9101e92160b495319b9b4
570
cpp
C++
13-stencil-buffered/project/src/stencil.cpp
walkieq/fccm2021-tutorial
f0eb2976a657f5a7c5a54be0ebb5d19b79fe93ee
[ "Apache-2.0" ]
2
2021-05-07T22:12:42.000Z
2021-05-09T04:36:28.000Z
13-stencil-buffered/project/src/stencil.cpp
yluo39github/fccm2021-tutorial
af341027d6302deead2a6666254c60d3a46dc6d2
[ "Apache-2.0" ]
null
null
null
13-stencil-buffered/project/src/stencil.cpp
yluo39github/fccm2021-tutorial
af341027d6302deead2a6666254c60d3a46dc6d2
[ "Apache-2.0" ]
2
2021-05-09T14:42:51.000Z
2021-12-05T22:32:10.000Z
#define DATA_SIZE 1024 #define STENCIL_SIZE 16 extern "C" { void stencil(int *in1, int *out) { int buffer[STENCIL_SIZE]; for(unsigned int i = 0; i < (STENCIL_SIZE - 1); i++) buffer[i + 1] = in1[i]; for(unsigned int i = 0; i < DATA_SIZE; i++) { for(unsigned int j = 0; j < (STENCIL_SIZE - 1); j++) buffer[j] = buffer[j + 1]; buffer[STENCIL_SIZE - 1] = in1[i + STENCIL_SIZE - 1]; int acc = 0; for(unsigned int j = 0; j < STENCIL_SIZE; j++) acc += buffer[j]; out[i] = acc; } } }
22.8
61
0.519298
970d2233cadbdbb49c2c6e8d54be64f5c1e4407a
741
dart
Dart
lib/models/movie_video_response.dart
Edsan7/movies-app-flutter
1b92014d59e717dfc46e1da36fbd1df23ab66c67
[ "MIT" ]
1
2021-07-13T18:32:04.000Z
2021-07-13T18:32:04.000Z
lib/models/movie_video_response.dart
Edsan7/movies-app-flutter
1b92014d59e717dfc46e1da36fbd1df23ab66c67
[ "MIT" ]
null
null
null
lib/models/movie_video_response.dart
Edsan7/movies-app-flutter
1b92014d59e717dfc46e1da36fbd1df23ab66c67
[ "MIT" ]
null
null
null
import 'dart:convert'; import 'movie_video_model.dart'; class MovieVideoResponse { MovieVideoResponse({ this.id, this.movieVideos, }); final int id; final List<MovieVideoModel> movieVideos; factory MovieVideoResponse.fromJson(String str) => MovieVideoResponse.fromMap(json.decode(str)); String toJson() => json.encode(toMap()); factory MovieVideoResponse.fromMap(Map<String, dynamic> json) => MovieVideoResponse( id: json["id"], movieVideos: List<MovieVideoModel>.from(json["results"].map((x) => MovieVideoModel.fromMap(x))), ); Map<String, dynamic> toMap() => { "id": id, "results": List<dynamic>.from(movieVideos.map((x) => x.toMap())), }; }
24.7
104
0.642375
267234b8075b8dbbf707d9147e9098b4bcaf7da6
2,776
dart
Dart
lib/screens/member/detailsmember.dart
JefryMiftakhul/admin-panel-perpus
061e5a394041f6377335ed00d4800f00eebb7c6f
[ "MIT" ]
null
null
null
lib/screens/member/detailsmember.dart
JefryMiftakhul/admin-panel-perpus
061e5a394041f6377335ed00d4800f00eebb7c6f
[ "MIT" ]
null
null
null
lib/screens/member/detailsmember.dart
JefryMiftakhul/admin-panel-perpus
061e5a394041f6377335ed00d4800f00eebb7c6f
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import '/networkapi.dart'; import '/models/Member.dart'; import './editmember.dart'; class Detailsmember extends StatefulWidget { final Member member; Detailsmember({this.member}); @override _DetailsmemberState createState() => _DetailsmemberState(); } class _DetailsmemberState extends State<Detailsmember> { void deleteMember(context) async { /*await http.post( "${Env.URL_PREFIX}/delete.php",*/ await http.post( Uri.parse('$MEMBER'), body: { 'id': widget.member.id.toString(), }, ); // Navigator.pop(context); Navigator.of(context) .pushNamedAndRemoveUntil('/', (Route<dynamic> route) => false); } void confirmDelete(context) { showDialog( context: context, builder: (BuildContext context) { return AlertDialog( content: Text('Are you sure you want to delete this?'), actions: <Widget>[ RaisedButton( child: Icon(Icons.cancel), color: Colors.red, textColor: Colors.white, onPressed: () => Navigator.of(context).pop(), ), RaisedButton( child: Icon(Icons.check_circle), color: Colors.blue, textColor: Colors.white, onPressed: () => deleteMember(context), ), ], ); }, ); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Details'), actions: <Widget>[ IconButton( icon: Icon(Icons.delete), onPressed: () => confirmDelete(context), ), ], ), body: Container( height: 270.0, padding: const EdgeInsets.all(35), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( "Name : ${widget.member.name}", style: TextStyle(fontSize: 20), ), Text( "Tanggal Lahir : ${widget.member.tanggal_lahir}", style: TextStyle(fontSize: 20), ), Text( "Alamat : ${widget.member.alamat}", style: TextStyle(fontSize: 20), ), Padding( padding: EdgeInsets.all(10), ), ], ), ), floatingActionButton: FloatingActionButton( child: Icon(Icons.edit), onPressed: () => Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) => Editmember(member: widget.member), ), ), ), ); } }
26.692308
81
0.530259
c6db42c6c3df830350c47907f3379aa11436da4b
123
py
Python
core/slack/util/__init__.py
ryanolee/pager-duty-sync
1fd88634e461b5db647d856bc6b59f990944685e
[ "MIT" ]
null
null
null
core/slack/util/__init__.py
ryanolee/pager-duty-sync
1fd88634e461b5db647d856bc6b59f990944685e
[ "MIT" ]
2
2020-09-27T18:19:17.000Z
2021-06-29T09:21:04.000Z
core/slack/util/__init__.py
ryanolee/pager-duty-sync
1fd88634e461b5db647d856bc6b59f990944685e
[ "MIT" ]
null
null
null
from .text_utils import get_all_users_from_blocks, get_date_range_from_string from .user_utils import get_all_user_profiles
61.5
77
0.910569
46ba5ea6591710db9adbee61624bad374c2a3527
3,225
dart
Dart
test/streams/from_callable_test.dart
tlb-miyagiyuki/rxdart
ce05687703ae269ac65108fc1196145c20c705c3
[ "Apache-2.0" ]
3,159
2017-02-07T20:00:14.000Z
2022-03-31T14:26:38.000Z
test/streams/from_callable_test.dart
tlb-miyagiyuki/rxdart
ce05687703ae269ac65108fc1196145c20c705c3
[ "Apache-2.0" ]
576
2017-02-07T19:02:13.000Z
2022-03-01T16:48:34.000Z
test/streams/from_callable_test.dart
tlb-miyagiyuki/rxdart
ce05687703ae269ac65108fc1196145c20c705c3
[ "Apache-2.0" ]
293
2017-02-07T23:50:02.000Z
2022-03-29T00:16:27.000Z
import 'package:rxdart/rxdart.dart'; import 'package:test/test.dart'; void main() { test('Rx.fromCallable.sync', () { var called = false; var stream = Rx.fromCallable(() { called = true; return 2; }); expect(called, false); expectLater(stream, emitsInOrder(<dynamic>[2, emitsDone])); expect(called, true); }); test('Rx.fromCallable.async', () { var called = false; var stream = FromCallableStream(() async { called = true; await Future<void>.delayed(const Duration(milliseconds: 10)); return 2; }); expect(called, false); expectLater(stream, emitsInOrder(<dynamic>[2, emitsDone])); expect(called, true); }); test('Rx.fromCallable.reusable', () { var stream = Rx.fromCallable(() => 2, reusable: true); expect(stream.isBroadcast, isTrue); stream.listen(null); stream.listen(null); expect(true, true); }); test('Rx.fromCallable.singleSubscription', () { { var stream = Rx.fromCallable(() => Future.delayed(const Duration(milliseconds: 10), () => 'Value')); expect(stream.isBroadcast, isFalse); stream.listen(null); expect(() => stream.listen(null), throwsStateError); } { var stream = Rx.fromCallable(() => Future<String>.error(Exception())); expect(stream.isBroadcast, isFalse); stream.listen(null, onError: (Object e) {}); expect( () => stream.listen(null, onError: (Object e) {}), throwsStateError); } }); test('Rx.fromCallable.asBroadcastStream', () async { final stream = Rx.fromCallable(() => 2).asBroadcastStream(); // listen twice on same stream stream.listen(null); stream.listen(null); // code should reach here await expectLater(stream.isBroadcast, isTrue); }); test('Rx.fromCallable.sync.shouldThrow', () { var stream = Rx.fromCallable<String>(() => throw Exception()); expectLater( stream, emitsInOrder(<dynamic>[emitsError(isException), emitsDone]), ); }); test('Rx.fromCallable.async.shouldThrow', () { { var stream = Rx.fromCallable<String>(() async => throw Exception()); expectLater( stream, emitsInOrder(<dynamic>[emitsError(isException), emitsDone]), ); } { var stream = Rx.fromCallable<String>(() => Future.error(Exception())); expectLater( stream, emitsInOrder(<dynamic>[emitsError(isException), emitsDone]), ); } }); test('Rx.fromCallable.sync.pause.resume', () { var stream = Rx.fromCallable(() => 'Value'); stream .listen( expectAsync1( (v) => expect(v, 'Value'), count: 1, ), ) .pause(Future<void>.delayed(const Duration(milliseconds: 50))); }); test('Rx.fromCallable.async.pause.resume', () { var stream = Rx.fromCallable(() async { await Future<void>.delayed(const Duration(milliseconds: 10)); return 'Value'; }); stream .listen( expectAsync1( (v) => expect(v, 'Value'), count: 1, ), ) .pause(Future<void>.delayed(const Duration(milliseconds: 50))); }); }
24.618321
79
0.584496
b601da2fd91c8acb5f80fcb4b07d73ddd8a83356
487
rb
Ruby
peerstreet-client/lib/peerstreet/client.rb
beppu/peerstreet-server
af5c4b7213fba90d464fc9e3c0f4773b5274d0ac
[ "MIT" ]
1
2018-12-26T11:44:38.000Z
2018-12-26T11:44:38.000Z
peerstreet-client/lib/peerstreet/client.rb
beppu/peerstreet-server
af5c4b7213fba90d464fc9e3c0f4773b5274d0ac
[ "MIT" ]
null
null
null
peerstreet-client/lib/peerstreet/client.rb
beppu/peerstreet-server
af5c4b7213fba90d464fc9e3c0f4773b5274d0ac
[ "MIT" ]
1
2020-03-04T04:58:02.000Z
2020-03-04T04:58:02.000Z
require 'httparty' require_relative 'version' DEFAULT_BASE_URI = 'http://peerstreet.bavl.org' class PeerStreet::Client include HTTParty #base_uri 'https://peerstreet.bavl.org' attr_accessor :base_uri def initialize(options={ :base_uri => DEFAULT_BASE_URI }) if options[:base_uri] self.base_uri = options[:base_uri] end end def url_for(route) @base_uri + route end def msa zip self.class.get(url_for('/msa'), { query: { zip: zip } }) end end
18.730769
60
0.687885
16155a09591490b060551293658463468b28d5d6
2,142
swift
Swift
Tests/FilesystemTests/FileOutputStreamerTests.swift
swixbase/filesystem
7d68a7f818fe1eeb12eb94c217edf64e481c1d83
[ "Apache-2.0" ]
null
null
null
Tests/FilesystemTests/FileOutputStreamerTests.swift
swixbase/filesystem
7d68a7f818fe1eeb12eb94c217edf64e481c1d83
[ "Apache-2.0" ]
null
null
null
Tests/FilesystemTests/FileOutputStreamerTests.swift
swixbase/filesystem
7d68a7f818fe1eeb12eb94c217edf64e481c1d83
[ "Apache-2.0" ]
null
null
null
/// Copyright 2017 Sergei Egorov /// /// 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. import XCTest import Foundation @testable import Filesystem class FileOutputStreamerTests: XCTestCase { let fsManager = FileSystem.default let fileHandler = FileHandler.default static var allTests : [(String, (FileOutputStreamerTests) -> () throws -> Void)] { return [ ("testWriteData", testWriteData) ] } // MARK: - Helpers func createTestFile(atPath path: String) { let content = "abcdefghijklmnopqrstuvwxyz".data(using: .utf8)! fsManager.createFile(atPath: path, content: content) } func deleteTestFile(atPath path: String) { do { try fsManager.deleteObject(atPath: path) } catch let error as FileSystemError { XCTFail(error.description) } catch { XCTFail("Unhandled error") } } // MARK: - Tests func testWriteData() throws { let testfilePath = "\(fsManager.workPath)/\(UUID().uuidString)" let fileOutStreamer: FileOutputStreamer = try FileOutputStreamer(file: testfilePath) let writeData = "abcdefghijklmnopqrstuvwxyz".data(using: .utf8)! let count = fileOutStreamer.write(content: writeData) fileOutStreamer.synchronize() let data = try fileHandler.readWholeFile(atPath: testfilePath) let content = String(data: data, encoding: .utf8)! XCTAssertEqual(content, "abcdefghijklmnopqrstuvwxyz") XCTAssertEqual(Int(count), writeData.count) deleteTestFile(atPath: testfilePath) } }
31.970149
92
0.672736
3bd4078589661c4e3bdae77a0e4dd81177a087d7
828
dart
Dart
example/lib/main.dart
NelsonCloudWalk/flutter_facebook_app_events
7f357925824cfb6cfd81664b37d7b535d05169a5
[ "Apache-2.0" ]
null
null
null
example/lib/main.dart
NelsonCloudWalk/flutter_facebook_app_events
7f357925824cfb6cfd81664b37d7b535d05169a5
[ "Apache-2.0" ]
null
null
null
example/lib/main.dart
NelsonCloudWalk/flutter_facebook_app_events
7f357925824cfb6cfd81664b37d7b535d05169a5
[ "Apache-2.0" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:facebook_app_events/facebook_app_events.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { static final facebookAppEvents = FacebookAppEvents(); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: const Text('Plugin example app'), ), body: Center( child: RaisedButton( color: Colors.green, child: Text("Click me!"), onPressed: () { facebookAppEvents.logEvent( name: 'button_clicked', parameters: { 'button_id': 'the_clickme_button', }, ); }, ), ), ), ); } }
25.090909
62
0.531401
b0da6b2e0eeed2fb6296dc97922b44ec158d8b59
248
py
Python
vfmgui/fonts.py
sharkwouter/vaporos-flatpak-manager
da1dce2a806fdb51aa9366408ace50c28fbc3ff6
[ "MIT" ]
null
null
null
vfmgui/fonts.py
sharkwouter/vaporos-flatpak-manager
da1dce2a806fdb51aa9366408ace50c28fbc3ff6
[ "MIT" ]
21
2019-09-15T08:42:58.000Z
2021-08-28T16:48:54.000Z
vfmgui/fonts.py
sharkwouter/vaporos-flatpak-manager
da1dce2a806fdb51aa9366408ace50c28fbc3ff6
[ "MIT" ]
null
null
null
import pygame pygame.font.init() class Fonts: _font = pygame.font.match_font('liberationsansnarrow') print(_font) REGULAR = pygame.font.Font(_font, 64) SMALL = pygame.font.Font(_font, 32) LARGE = pygame.font.Font(_font, 96)
19.076923
58
0.689516
0d35c51a825cdb0e2e3c9da4c69894a640285c3f
4,991
cs
C#
MVCProject/Form1.Designer.cs
david-hilles/GitCsharp
b9bec1fa96ea5dc71a25279e9817879eabb468fa
[ "MIT" ]
null
null
null
MVCProject/Form1.Designer.cs
david-hilles/GitCsharp
b9bec1fa96ea5dc71a25279e9817879eabb468fa
[ "MIT" ]
null
null
null
MVCProject/Form1.Designer.cs
david-hilles/GitCsharp
b9bec1fa96ea5dc71a25279e9817879eabb468fa
[ "MIT" ]
null
null
null
namespace MVCProject { partial class Form1 { /// <summary> /// Variável de designer necessária. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Limpar os recursos que estão sendo usados. /// </summary> /// <param name="disposing">true se for necessário descartar os recursos gerenciados; caso contrário, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Código gerado pelo Windows Form Designer /// <summary> /// Método necessário para suporte ao Designer - não modifique /// o conteúdo deste método com o editor de código. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.button1 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.usuariosTableAdapter1 = new MVCProject.SistemaBibliotecaDBDataSetTableAdapters.UsuariosTableAdapter(); this.SuspendLayout(); // // button1 // this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button1.Location = new System.Drawing.Point(65, 125); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(192, 56); this.button1.TabIndex = 0; this.button1.Text = "Login"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.Button1_Click); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(13, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(47, 17); this.label1.TabIndex = 1; this.label1.Text = "Login:"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(16, 56); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(53, 17); this.label2.TabIndex = 2; this.label2.Text = "Senha:"; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(94, 13); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(163, 22); this.textBox1.TabIndex = 3; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(94, 56); this.textBox2.Name = "textBox2"; this.textBox2.PasswordChar = '*'; this.textBox2.Size = new System.Drawing.Size(163, 22); this.textBox2.TabIndex = 4; this.textBox2.UseSystemPasswordChar = true; // // usuariosTableAdapter1 // this.usuariosTableAdapter1.ClearBeforeFill = true; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Control; this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = new System.Drawing.Size(357, 222); this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox1); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.button1); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; private SistemaBibliotecaDBDataSetTableAdapters.UsuariosTableAdapter usuariosTableAdapter1; } }
41.941176
167
0.562012
2b9fb7f70df3960cdc75ca834e114ae47379af1f
10,552
rb
Ruby
lib/command_lion/app.rb
picatz/command_lion
a101056a72c481e30a23c159e836e7b532c9b004
[ "MIT" ]
4
2017-08-28T02:12:50.000Z
2018-04-22T12:00:00.000Z
lib/command_lion/app.rb
picatz/command_lion
a101056a72c481e30a23c159e836e7b532c9b004
[ "MIT" ]
4
2017-09-02T21:57:54.000Z
2020-02-20T23:51:49.000Z
lib/command_lion/app.rb
picatz/command_lion
a101056a72c481e30a23c159e836e7b532c9b004
[ "MIT" ]
null
null
null
module CommandLion class App < Base def self.default_help(app) flagz = [] app.commands.each do |_, cmd| if cmd.options? cmd.options.each do |_, opt| if opt.flags? if opt.flags.long? flagz << opt.flags.short + opt.flags.long else flagz << opt.flags.short end elsif opt.index? flagz << opt.index.to_s if opt.index? end end end if cmd.flags? if cmd.flags.long? flagz << cmd.flags.short + cmd.flags.long else flagz << cmd.flags.short end elsif cmd.index? flagz << cmd.index.to_s if cmd.index? else raise "No flags or index was given!" end end max_flag = flagz.map(&:length).max + 4 max_desc = app.commands.values.map(&:description).select{|d| d unless d.nil? }.map(&:length).max puts app.name if app.version? puts puts "VERSION" puts app.version puts unless app.description? end if app.description? puts puts "DESCRIPTION" puts app.description puts end if app.usage? puts puts "USAGE" puts usage puts end puts unless app.version? || app.description? || app.usage? puts "COMMANDS" app.commands.values.select { |cmd| cmd unless cmd.is_a? CommandLion::Option }.each do |command| if command.flags? short = command.flags.long? ? command.flags.short + ", " : command.flags.short short_long = "#{short}#{command.flags.long}".ljust(max_flag) else short_long = "#{command.index.to_s}".ljust(max_flag) end puts "#{short_long} #{command.description}" if command.options? command.options.each do |_, option| if option.flags? short = option.flags.long? ? option.flags.short + ", " : option.flags.short short_long = " " + "#{short}#{option.flags.long}".ljust(max_flag - 2) else short_long = " " + "#{option.index.to_s}".ljust(max_flag - 2) end puts "#{short_long} #{option.description}" end end puts end end # The run method will run a given block of code using the # Commmand Lion DSL. def self.run(&block) # Initialize an instance of an App object. app = new # Evaluate the block of code within the context of that App object. app.instance_eval(&block) # Parse the application logic out. app.parse # Sometimes a command-line application is run without being given any arguments. if ARGV.empty? # Default to a help menu. if cmd = app.commands[:help] cmd.before.call if cmd.before? cmd.action.call if cmd.action? cmd.after.call if cmd.after? exit 0 else # Use the default help menu for the application unless that's been # explictly removed by the author for whatever reason. default_help(app) unless app.default_help_menu_removed? end else app.commands.each do |_, cmd| next unless cmd.given? cmd.options.each do |_, opt| next unless opt.given? opt.before.call if opt.before? opt.action.call if opt.action? opt.after.call if opt.after? end if cmd.options? cmd.before.call if cmd.before? cmd.action.call if cmd.action? cmd.after.call if cmd.after? end end end # Check if there has been an indexed help command. def help? return true if @commands[:help] false end # Explicitly remove the default help menu from the application. def remove_default_help_menu @remove_default_help_menu = true end # Check if the default help menu for the application has been explicitly removed. def default_help_menu_removed? @remove_default_help_menu || false end # Simple attributes for the application. Mostly just metadata to help # provide some context to the application. # # * `name` is the name people would refernce your application to in conversation. # * `usage` is a simple, optional custom string to provide further context for the app. # * `description` allows you to describe what your application does and why it exists. # * `version` allows you to do simple version control for your app. simple_attrs :name, :usage, :description, :version, :help # An application usually has multiple commands. # # == Example # app = CommandLion::App.build # # meta information # # command :example1 do # # more code # end # # command :example2 do # # more code # end # end # # app.commands.map(&:name) # # => [:example1, :example2] def command(index, &block) if index.is_a? Command cmd = index else cmd = Command.new cmd.index= index cmd.instance_eval(&block) end @commands = {} unless @commands @flags = [] unless @flags if cmd.flags? @flags << cmd.flags.short if cmd.flags.short? @flags << cmd.flags.long if cmd.flags.long? elsif cmd.index # just use index @flags << cmd.index.to_s else raise "No index or flags were given to use this command." end if cmd.options? cmd.options.each do |_, option| if option.flags? @flags << option.flags.short if option.flags.short? @flags << option.flags.long if option.flags.long? else # just use index @flags << option.index.to_s end @commands[option.index] = option end end @commands[cmd.index] = cmd cmd end def ctrl_c(&block) trap("SIGINT") { block.call } end def help(&block) command :help, &block end # Plugin a command that's probably been built outside of the application's run or build block. # This is helpful for sharing or reusing commands in applications. # @param command [Command] def plugin(command) command(command) end # Direct access to the various flags an application has. Helpfulp for debugging. def flags @flags end # Direct access to the various commands an application has. Helpful for debugging. def commands @commands.reject { |_, v| v.is_a? CommandLion::Option } end # Parse arguments off of ARGV. # # @TODO Re-visit this. def parse @commands.each do |_, cmd| if cmd.flags? # or for the || seems to not do what I want it to do... next unless argv_index = ARGV.index(cmd.flags.short) || ARGV.index(cmd.flags.long) else next unless argv_index = ARGV.index(cmd.index.to_s) end cmd.given = true unless argv_index.nil? if cmd.type.nil? yield cmd if block_given? else if parsed = parse_cmd(cmd, flags) cmd.arguments = parsed || cmd.default yield cmd if block_given? elsif cmd.default cmd.arguments = cmd.default yield cmd if block_given? end end end end # Parse a given command with its given flags. # @TODO Re-visit this. def parse_cmd(cmd, flags) if cmd.flags? args = Raw.arguments_to(cmd.flags.short, flags) if args.nil? || args.empty? args = Raw.arguments_to(cmd.flags.long, flags) end else args = Raw.arguments_to(cmd.index.to_s, flags) end unless cmd.type.to_s =~ /stdin/ return nil if args.nil? end case cmd.type when :stdin args = STDIN.gets.strip when :stdin_stream args = STDIN when :stdin_string args = STDIN.gets.strip when :stdin_strings args = [] while arg = STDIN.gets next if arg.nil? arg = arg.strip args << arg end args when :stdin_integer args = STDIN.gets.strip.to_i when :stdin_integers args = [] while arg = STDIN.gets next if arg.nil? arg = arg.strip parse = arg.to_i if parse.to_s == arg args << parse end end args when :stdin_bool args = STDIN.gets.strip.downcase == "true" when :single, :string args = args.first when :strings, :multi if cmd.delimiter? if args.count > 1 args = args.first.split(cmd.delimiter) else args = args.map { |arg| arg.split(cmd.delimiter) }.flatten end end args when :integer args = args.first.to_i when :integers if cmd.delimiter? if args.count > 1 args = args.join args = args.select { |arg| arg if arg.include?(cmd.delimiter) } args = args.map { |arg| arg.split(cmd.delimiter) }.flatten else args = args.map { |arg| arg.split(cmd.delimiter) }.flatten end end args = args.map(&:to_i) when :bool, :bools if cmd.delimiter? if args.count > 1 args = args.join args = args.select { |arg| arg if arg.include?(cmd.delimiter) } args = args.map { |arg| arg.split(cmd.delimiter) }.flatten else args = args.map { |arg| arg.split(cmd.delimiter) }.flatten end end args = args.map { |arg| arg == "true" } end rescue => e# this is dangerous puts e nil end def run! parse do |cmd| next unless cmd.given? cmd.options.each do |_, opt| next unless opt.given? opt.before.call if opt.before? opt.action.call if opt.action? opt.after.call if opt.after? end if cmd.options? cmd.before.call if cmd.before? cmd.action.call if cmd.action? cmd.after.call if cmd.after? end end # Run the application if the file is the main file being run. # It's almost kind of narcisitc, if you think about it. if __FILE__== $0 run! end end end
29.977273
102
0.559799
daa445ac83193da6bb5fa97cf88795fb73a2e0a1
8,926
ts
TypeScript
dev/state/EntityState.ts
stockbal/quick-data-reporter
394d6686ebc95bc0ef5a0284a4b0d7f64a85d78a
[ "MIT" ]
10
2021-09-22T16:20:12.000Z
2022-01-10T19:32:20.000Z
dev/state/EntityState.ts
stockbal/quick-data-reporter
394d6686ebc95bc0ef5a0284a4b0d7f64a85d78a
[ "MIT" ]
4
2021-07-04T16:53:20.000Z
2021-10-01T14:04:41.000Z
dev/state/EntityState.ts
stockbal/quick-data-reporter
394d6686ebc95bc0ef5a0284a4b0d7f64a85d78a
[ "MIT" ]
2
2021-09-22T16:20:17.000Z
2021-10-02T13:20:21.000Z
import Log from "sap/base/Log"; import ValueHelpUtil from "../helper/valuehelp/ValueHelpUtil"; import { DataResult } from "../model/AjaxJSONModel"; import Entity, { ConfigurableEntity, TableFilters } from "../model/Entity"; import { DEFAULT_VISIBLE_COL_COUNT } from "../model/globalConsts"; import { EntityType, EntityMetadata, ColumnConfig, ValueHelpMetadata, ValueHelpType, FieldMetadata, QueryRequest, FieldType } from "../model/types"; import EntityService from "../service/EntityService"; import BaseState from "./BaseState"; /** * State for the current visible entity * @nonui5 */ export default class EntityState extends BaseState<Entity> { private _entityService: EntityService; private _valueHelpMetadataMap: Record<string, ValueHelpMetadata> = {}; constructor() { super(new Entity()); this._entityService = new EntityService(); this.getModel().setDataProvider("/rows", { getData: this._loadData.bind(this) }); } exists(): boolean { return this.data.metadata?.fields?.length > 0; } setConfiguration(newSettings: ConfigurableEntity): void { this.data.columnsItems = newSettings?.columnsItems; this.data.aggregationCond = newSettings?.aggregationCond; this.data.sortCond = newSettings?.sortCond; this.updateModel(); } setColumnsItems(columnsItems: ColumnConfig[]): void { this.data.columnsItems = columnsItems; this.updateModel(); } getCurrentConfiguration(): ConfigurableEntity { return this.data; } setEntityInfo(name: string, type: EntityType): void { this.data.name = name; this.data.type = type; this.updateModel(); } setMetadata(metadata: EntityMetadata): void { this.data.metadata = metadata; this.updateModel(); } setFilters(filters: TableFilters): void { this.data.filters = filters; this.updateModel(); } setParameters(parameters: TableFilters): void { this.data.parameters = parameters; this.updateModel(); } /** * DataProvider for fetching query results */ private async _loadData(startIndex: number, length: number, determineLength?: boolean): Promise<DataResult> { const queryRequest = { settings: { maxRows: length, determineMaxRows: determineLength, offset: startIndex }, parameters: this.data.getParameters(), filters: this.data.getFilledFilters(), sortFields: this.data.sortCond, outputFields: this.data.getOutputFields(), aggregations: { aggregationExpressions: this.data.aggregationCond } } as QueryRequest; return this._entityService.getEntityData(this.data.type, this.data.name, queryRequest); } async loadVariants(): Promise<void> { try { const variantData = await this._entityService.getVariants(this.data.type, this.data.name); this.data.variants = [...variantData] || []; this.updateModel(); } catch (reqError) { const errorMessage = (reqError as any).error?.message; Log.error( `Variants for entity with type: ${this.data.type}, name: ${this.data.name} could not be loaded`, errorMessage ); } } async loadMetadata(): Promise<EntityMetadata> { const getDescription = (fieldMeta: FieldMetadata): string => { if (fieldMeta.mediumDescription) { return fieldMeta.mediumDescription; } else if (fieldMeta.shortDescription) { return fieldMeta.shortDescription; } else if (fieldMeta.longDescription) { if (fieldMeta.longDescription.length <= 25) { return fieldMeta.longDescription; } else { return `${fieldMeta.longDescription.substring(0, 22)}...`; } } else if (fieldMeta.fieldText) { if (fieldMeta.fieldText.length <= 25) { return fieldMeta.fieldText; } else { return `${fieldMeta.fieldText.substring(0, 22)}...`; } } else { return fieldMeta.name; } }; try { const entityMetadata = await this._entityService.getMetadata(this.data.type, this.data.name); this.noModelUpdates = true; if (entityMetadata?.fields) { for (let i = 0; i < entityMetadata.fields.length; i++) { const fieldMeta = entityMetadata.fields[i]; fieldMeta.description = getDescription(fieldMeta); if (i < DEFAULT_VISIBLE_COL_COUNT) { this.data.columnsItems.push({ fieldName: fieldMeta.name, visible: true, index: i }); } } } if (entityMetadata?.parameters) { const initialParamFilters = {} as TableFilters; for (let i = 0; i < entityMetadata.parameters.length; i++) { const fieldMeta = entityMetadata.parameters[i]; fieldMeta.description = getDescription(fieldMeta); // create filter entry for parameter as all parameters are mandatory at this time initialParamFilters[fieldMeta.name] = {}; } this.data.parameters = initialParamFilters; } this.setMetadata({ entity: entityMetadata.entity, fields: entityMetadata?.fields || [], parameters: entityMetadata?.parameters || [] }); this.noModelUpdates = false; this.updateModel(); } catch (reqError) { const errorMessage = (reqError as any).error?.message; this.reset(); Log.error( `Metadata for entity with type: ${this.data.type}, name: ${this.data.name} could not be determined`, errorMessage ); } return this.data.metadata; } /** * Retrieves value help metadata for the given field * @param fieldName metadata information of a field * @param isParam flag to indicate if field is a parameter * @returns promise with value help meta data */ async getFieldValueHelpInfo(fieldName: string, isParam?: boolean): Promise<ValueHelpMetadata> { const mappedFieldName = isParam ? `@param:${fieldName}` : fieldName; if (!this._valueHelpMetadataMap.hasOwnProperty(mappedFieldName)) { this._valueHelpMetadataMap[mappedFieldName] = await this._determineValueHelpInfo(fieldName, isParam); } return this._valueHelpMetadataMap[mappedFieldName]; } reset(): void { this._valueHelpMetadataMap = {}; this.setStateData(new Entity()); this.updateModel(true); } private async _determineValueHelpInfo(fieldName: string, isParam: boolean): Promise<ValueHelpMetadata> { const source = isParam ? "parameters" : "fields"; const fieldMeta = this.data.metadata[source].find(f => f.name === fieldName); switch (fieldMeta.valueHelpType) { case ValueHelpType.CheckTable: case ValueHelpType.DDICSearchHelp: case ValueHelpType.ElementaryDDICSearchHelp: case ValueHelpType.CollectiveDDICSearchHelp: case ValueHelpType.CdsAnnotation: try { const vhMetadataForField = await this._entityService.getValueHelpMetadataForField( this.data.name, this.data.type, fieldMeta.valueHelpType, fieldName, isParam ? FieldType.Parameter : FieldType.Normal ); if (fieldMeta.valueHelpType === ValueHelpType.DDICSearchHelp) { fieldMeta.valueHelpType = vhMetadataForField.type; } return vhMetadataForField; } catch (error) { Log.error( `Valuehelp metadata at column '${fieldMeta.name}' with type '${fieldMeta.valueHelpType}' could not be determined` ); return ValueHelpUtil.getNoVhMetadata(fieldMeta); } case ValueHelpType.DomainFixValues: return ValueHelpUtil.getDomainFixValuesVhMetadata(fieldMeta); default: return ValueHelpUtil.getNoVhMetadata(fieldMeta); } } }
40.026906
137
0.57607
9fda260f9b08d615f542158e59dd64c5f3686659
8,620
py
Python
tests/test_sampling.py
AndrewRook/polling_simulator
df390b26bb7f2f6fd019813de1ab188489a68d61
[ "MIT" ]
null
null
null
tests/test_sampling.py
AndrewRook/polling_simulator
df390b26bb7f2f6fd019813de1ab188489a68d61
[ "MIT" ]
null
null
null
tests/test_sampling.py
AndrewRook/polling_simulator
df390b26bb7f2f6fd019813de1ab188489a68d61
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd import pytest from functools import partial from polling_simulator import sampling from polling_simulator import Variable, Demographic from polling_simulator.distributions import truncated_gaussian_distribution class TestPredefinedSample: def test_fails_when_asked_for_too_many_people(self): data = pd.DataFrame({ "response_likelihood": np.ones(10) }) with pytest.raises(ValueError): sampling.predefined_sample(1, False)(20, data) def test_fails_when_response_likelihood_is_too_low(self): data = pd.DataFrame({ "response_likelihood": np.ones(1000) * 0.000001 }) with pytest.raises(ValueError): sampling.predefined_sample(1, False)(20, data) def test_fails_when_turnout_likelihood_is_too_low(self): data = pd.DataFrame({ "response_likelihood": np.ones(1000), "turnout_likelihood": np.ones(1000) * 0.000001 }) sampling.predefined_sample(1, False)(500, data) with pytest.raises(ValueError): sampling.predefined_sample(1, True)(500, data) def test_returns_fewer_than_desired_when_response_rates_are_low(self): np.random.seed(123) data = pd.DataFrame({ "response_likelihood": np.ones(20) * 0.5 }) poll_responders, poll_non_responders = sampling.predefined_sample(1, False)(10, data) assert len(poll_responders) < 10 assert len(poll_responders) + len(poll_non_responders) == 10 def test_reaches_more_people_when_makes_multiple_attempts(self): np.random.seed(123) data = pd.DataFrame({ "response_likelihood": np.ones(40) * 0.1 }) single_call_responders, _ = sampling.predefined_sample(1, False)(20, data) multi_call_responders, non_responders = sampling.predefined_sample(5, False)(20, data) assert len(multi_call_responders) > len(single_call_responders) assert len(multi_call_responders) < 20 assert len(multi_call_responders) + len(non_responders) == 20 def test_applies_likely_voter_screen_correctly(self): data = pd.DataFrame({ "response_likelihood": np.ones(1000), "turnout_likelihood": np.ones(1000) * 0.1 }) responders, nonresponders = sampling.predefined_sample(1, True)(50, data) assert len(responders) + len(nonresponders) < 50 class TestGuaranteedSample: def test_fails_when_asked_for_too_many_people(self): np.random.seed(123) data = pd.DataFrame({ "response_likelihood": np.ones(10) * 0.05 }) with pytest.raises(ValueError): sampling.guaranteed_sample(1, False)(5, data) @pytest.mark.parametrize("num_people", [10, 50, 100, 500]) def test_always_returns_the_asked_for_number_of_people(self, num_people): np.random.seed(123) data = pd.DataFrame({ "response_likelihood": np.ones(10000) * 0.1 }) responders, non_responders = sampling.guaranteed_sample(1, False)(num_people, data) assert len(responders) == num_people assert len(non_responders) > 0 def test_works_with_multiple_attempts(self): np.random.seed(123) data = pd.DataFrame({ "response_likelihood": np.ones(10000) * 0.1 }) single_attempt_responders, single_attempt_non_responders = sampling.guaranteed_sample(1, False)(100, data) multiple_attempt_responders, multiple_attempt_non_responders = sampling.guaranteed_sample(5, False)(100, data) assert len(single_attempt_responders) == len(multiple_attempt_responders) assert len(multiple_attempt_non_responders) < len(single_attempt_non_responders) def test_works_with_likely_voter_screen(self): np.random.seed(123) data = pd.DataFrame({ "response_likelihood": np.ones(10000) * 0.5, "turnout_likelihood": np.ones(10000) * 0.1 }) _, no_screen_non_responders = sampling.guaranteed_sample(1, False)(200, data) responders, screened_non_responders = sampling.guaranteed_sample(1, True)(200, data) assert len(responders) == 200 assert len(screened_non_responders) > 5 * len(no_screen_non_responders) class TestPreStratifiedSample: def test_freezes_assumed_demographics(self): age = Variable("age", truncated_gaussian_distribution(25, 25, 18, 110)) young_people = Demographic(0.5, 0.1, {"a": 1}, age < 40) old_people = Demographic(0.5, 0.1, {"b": 1}, age >= 40) demographics = [ young_people, old_people ] sampler = sampling.stratified_sample(demographics, sampling.guaranteed_sample(1, False)) demographics.pop(0) assert len(demographics) == 1 for item in sampler.__closure__: if type(item.cell_contents) == list: assert len(item.cell_contents) == 2 def test_errors_when_demographics_are_not_mece(self): age = Variable("age", truncated_gaussian_distribution(25, 25, 18, 110)) young_people = Demographic(0.5, 0.1, {"a": 1}, age < 40) old_people = Demographic(0.5, 0.1, {"b": 1}, age >= 60) sampler = sampling.stratified_sample([young_people, old_people], sampling.guaranteed_sample(1, False)) electorate = pd.DataFrame({ "age": np.arange(100) }) with pytest.raises(ValueError) as e: sampler(100, electorate) assert "Demographics are not mutually exclusive" in e.value.args[0] def test_stratification_works_as_expected(self): np.random.seed(123) gender = Variable("gender", partial( np.random.choice, np.array(["M", "F"]), replace=True, p=np.array([0.5, 0.5]) )) men = Demographic(0.5, 0.1, {"a": 1}, (gender == "M")) women = Demographic(0.5, 0.2, {"b": 1}, (gender == "F")) demographics = [men, women] sampler = sampling.stratified_sample(demographics, sampling.guaranteed_sample(1, False)) male_electorate = pd.DataFrame({ "turnout_likelihood": np.ones(50000) * men.turnout_likelihood, "response_likelihood": men.response_likelihood, "candidate_preference": "a", "gender": "M" }) female_electorate = pd.DataFrame({ "turnout_likelihood": np.ones(50000) * women.turnout_likelihood, "response_likelihood": women.response_likelihood, "candidate_preference": "b", "gender": "F" }) shuffled_electorate = pd.concat([male_electorate, female_electorate]).sample(frac=1) responders, non_responders = sampler(1000, shuffled_electorate) assert np.sum(responders["gender"] == "F") == 500 assert np.sum(responders["gender"] == "M") == 500 assert len(non_responders) > 3000 assert np.sum(non_responders["gender"] == "M") > np.sum(non_responders["gender"] == "F") class TestInternalGetResponses: def test_fails_when_passed_zero_attempts(self): with pytest.raises(ValueError): sampling._get_responses(None, 0) def test_works_with_single_attempt(self): np.random.seed(123) response_likelihoods = np.ones(40) * 0.5 did_respond, num_attempts_required = sampling._get_responses(response_likelihoods, 1) assert np.sum(did_respond) < len(response_likelihoods) np.testing.assert_allclose(np.unique(num_attempts_required), np.array([-1, 1])) assert np.min(num_attempts_required[did_respond]) == 1 def test_works_with_pandas_series(self): np.random.seed(123) response_likelihoods = pd.Series(np.ones(40) * 0.5) did_respond, num_attempts_required = sampling._get_responses(response_likelihoods, 1) assert np.sum(did_respond) < len(response_likelihoods) np.testing.assert_allclose(np.unique(num_attempts_required), np.array([-1, 1])) assert np.min(num_attempts_required[did_respond]) == 1 def test_works_with_multiple_attempts(self): np.random.seed(123) response_likelihoods = np.ones(40) * 0.25 did_respond_single, _ = sampling._get_responses(response_likelihoods, 1) did_respond_multi, num_attempts_required = sampling._get_responses(response_likelihoods, 3) assert np.sum(did_respond_multi) > np.sum(did_respond_single) np.testing.assert_allclose(np.unique(num_attempts_required), np.array([-1, 1, 2, 3])) assert np.min(num_attempts_required[did_respond_multi]) == 1
44.205128
118
0.665545
25a288886259792316c644363e16ae121f3044dc
492
js
JavaScript
src/index.js
Deshan-Charuka/fronend-AdminLte
eaa5520c71f7a86fcc0c327ece7bd1514689c4b8
[ "MIT" ]
null
null
null
src/index.js
Deshan-Charuka/fronend-AdminLte
eaa5520c71f7a86fcc0c327ece7bd1514689c4b8
[ "MIT" ]
null
null
null
src/index.js
Deshan-Charuka/fronend-AdminLte
eaa5520c71f7a86fcc0c327ece7bd1514689c4b8
[ "MIT" ]
null
null
null
//js files import '../node_modules/admin-lte/plugins/jquery/jquery.min.js'; import '../node_modules/admin-lte/plugins/jquery-ui/jquery-ui.min.js'; // $.widget.bridge('uibutton', $.ui.button); import '../node_modules/admin-lte/plugins/bootstrap/js/bootstrap.bundle.min.js'; import '../node_modules/admin-lte/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js'; import '../node_modules/admin-lte/dist/js/adminlte.js'; import './js/menu.js'; //stylesheets import './scss/style.scss';
41
96
0.75
79c49cb2d7fe9f7dbe44ce1f7c3221bce2fc1c58
3,613
php
PHP
Datatable/DatatableFactory.php
RedWeb/DatatablesBundle
cbf3c4e0d2c8ef175e93e6f8896b1645cb7ae378
[ "MIT" ]
null
null
null
Datatable/DatatableFactory.php
RedWeb/DatatablesBundle
cbf3c4e0d2c8ef175e93e6f8896b1645cb7ae378
[ "MIT" ]
null
null
null
Datatable/DatatableFactory.php
RedWeb/DatatablesBundle
cbf3c4e0d2c8ef175e93e6f8896b1645cb7ae378
[ "MIT" ]
1
2020-01-29T14:44:32.000Z
2020-01-29T14:44:32.000Z
<?php /* * This file is part of the SgDatatablesBundle package. * * (c) stwe <https://github.com/stwe/DatatablesBundle> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sg\DatatablesBundle\Datatable; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ManagerRegistry; use Exception; use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Twig\Environment; class DatatableFactory { /** * The AuthorizationChecker service. * * @var AuthorizationCheckerInterface */ protected $authorizationChecker; /** * The doctrine service. * * @var ManagerRegistry */ protected $doctrine; /** * The SecurityTokenStorage service. * * @var TokenStorageInterface */ protected $securityToken; /** * The Translator service. * * @var TranslatorInterface */ protected $translator; /** * The Router service. * * @var RouterInterface */ protected $router; /** * The doctrine orm entity manager service. * * @var EntityManagerInterface */ protected $em; /** * The Twig Environment. * * @var Twig_Environment */ protected $twig; public function __construct( AuthorizationCheckerInterface $authorizationChecker, TokenStorageInterface $securityToken, $translator, RouterInterface $router, ManagerRegistry $doctrine, Environment $twig ) { $this->authorizationChecker = $authorizationChecker; $this->securityToken = $securityToken; if (!($translator instanceof LegacyTranslatorInterface) && !($translator instanceof TranslatorInterface)) { throw new \InvalidArgumentException(sprintf('The $translator argument of %s must be an instance of %s or %s, a %s was given.', static::class, LegacyTranslatorInterface::class, TranslatorInterface::class, get_class($translator))); } $this->translator = $translator; $this->router = $router; $this->doctrine = $doctrine; $this->twig = $twig; } //------------------------------------------------- // Create Datatable //------------------------------------------------- /** * @param string $class * * @throws Exception * * @return DatatableInterface */ public function create($class) { if (! \is_string($class)) { $type = \gettype($class); throw new Exception("DatatableFactory::create(): String expected, {$type} given"); } if (false === class_exists($class)) { throw new Exception("DatatableFactory::create(): {$class} does not exist"); } if (\in_array(DatatableInterface::class, class_implements($class), true)) { return new $class( $this->authorizationChecker, $this->securityToken, $this->translator, $this->router, $this->doctrine, $this->twig ); } throw new Exception("DatatableFactory::create(): The class {$class} should implement the DatatableInterface."); } }
27.371212
241
0.613064
b772059e29c36f6fae62de9e01eb9f0647deba2a
8,831
cs
C#
openvpn-auth-ldap/Program.cs
laozhanga/openvpn-auth-ldap-win
40500a525574a6b066c605e4c2636696be43b399
[ "MIT" ]
3
2019-12-10T07:52:19.000Z
2020-03-06T03:45:08.000Z
openvpn-auth-ldap/Program.cs
laozhanga/openvpn-auth-ldap-win
40500a525574a6b066c605e4c2636696be43b399
[ "MIT" ]
1
2020-03-27T13:36:32.000Z
2020-04-03T07:21:48.000Z
openvpn-auth-ldap/Program.cs
laozhanga/openvpn-auth-ldap-win
40500a525574a6b066c605e4c2636696be43b399
[ "MIT" ]
1
2022-03-04T14:31:21.000Z
2022-03-04T14:31:21.000Z
using System; using System.Collections.Generic; using System.Linq; using System.DirectoryServices; using System.Configuration; using System.Collections.Specialized; using System.IO; namespace WindowsADLogin { public class Logs { private static string _logPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "LoginLog"); private static object _lockerForLog = new object(); /// <summary> /// Log /// </summary> /// <param name="content"></param> /// public static void SaveLog(string content) { bool enableLog = true; string enableLogConfig = ConfigurationManager.AppSettings["Log"]; if (!string.IsNullOrEmpty(enableLogConfig)) { if (bool.TryParse(enableLogConfig, out enableLog)) { if (!enableLog) return; } } try { if (!Directory.Exists(_logPath)) { Directory.CreateDirectory(_logPath); } lock (_lockerForLog) { FileStream fs; fs = new FileStream(Path.Combine(_logPath, DateTime.Now.ToString("yyyyMMdd") + ".log"), FileMode.OpenOrCreate); StreamWriter streamWriter = new StreamWriter(fs); streamWriter.BaseStream.Seek(0, SeekOrigin.End); streamWriter.WriteLine("[" + DateTime.Now.ToString() + "]:" + content); streamWriter.Flush(); fs.Close(); } } catch { } } } class Program { private static string domain = "contoso.com"; private static bool enableInheritanceDetection = false; private static string AccessGroup = "VPN"; private static string GroupReadAdmin = "ReadGroup"; private static string Password = "1234abcd!@#$"; static bool Auth(string userAccount, string userPassword) { using (DirectoryEntry deUser = new DirectoryEntry(@"LDAP://" + domain, userAccount, userPassword)) { DirectorySearcher directorySearcher = new DirectorySearcher(deUser); directorySearcher.Filter = "(&(&(objectCategory=person)(objectClass=user))(sAMAccountName=" + userAccount + "))"; directorySearcher.PropertiesToLoad.Add("cn"); directorySearcher.PropertiesToLoad.Add("memberof"); directorySearcher.SearchRoot = deUser; directorySearcher.SearchScope = SearchScope.Subtree; try { SearchResult result = directorySearcher.FindOne(); if (result != null) { string[] memberof = new string[result.Properties["memberof"].Count]; int i = 0; foreach (Object myColl in result.Properties["memberof"]) { memberof[i] = myColl.ToString().Substring(3, myColl.ToString().IndexOf(",") - 3); if (memberof[i] == AccessGroup) { return true; } i++; } if (enableInheritanceDetection) { foreach (string GroupName in memberof) { if (InheritanceDetection(GroupName, AccessGroup)) return true; } } Logs.SaveLog(String.Format("User logged in successfully, but is not a member of the access group {0}", AccessGroup)); } else { Logs.SaveLog("User exception, DC did not return data"); } } catch (DirectoryServicesCOMException ex) when (ex.ErrorCode == -2147023570) { Logs.SaveLog(String.Format("username or password are invalid {0}:{1}", userAccount, userPassword)); } catch (System.Runtime.InteropServices.COMException ex) when (ex.ErrorCode == -2147016646) { Logs.SaveLog("Domain connection timeout"); } catch (Exception ex) { Logs.SaveLog(String.Format("Error Authenticating User. {0}", ex.Message)); } return false; } } private static bool InheritanceDetection(string GroupName, string RoleName) { bool isFind = false; try { DirectoryEntry entry = new DirectoryEntry(@"LDAP://" + domain, GroupReadAdmin, Password); DirectorySearcher mySearcher = new DirectorySearcher(entry); mySearcher.PropertiesToLoad.Add("memberof"); SearchResult mysr = mySearcher.FindOne(); string memberof; if (mysr.Properties.Count > 1) { foreach (Object myColl in mysr.Properties["memberof"]) { memberof = myColl.ToString().Substring(3, myColl.ToString().IndexOf(",") - 3); if (memberof == RoleName) { isFind = true; break; } else if (InheritanceDetection(memberof, RoleName)) { isFind = true; break; } } } } catch (Exception ex) { Logs.SaveLog(String.Format("InheritanceDetection Exception {0}", ex.Message)); return false; } return isFind; } static int Main(string[] args) { try { string enableInheritanceDetectionConfig = ConfigurationManager.AppSettings["InheritanceDetection"]; if (!string.IsNullOrEmpty(enableInheritanceDetectionConfig)) { if (!bool.TryParse(enableInheritanceDetectionConfig, out enableInheritanceDetection)) { throw new Exception(); } } } catch { enableInheritanceDetection = false; Logs.SaveLog("InheritanceDetection is Wrong value Default is false"); } if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["Domain"])) { domain = ConfigurationManager.AppSettings["Domain"]; } else { Logs.SaveLog("Domain not is Empty"); return 1; } if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["AccessGroup"])) { AccessGroup = ConfigurationManager.AppSettings["AccessGroup"]; } else { Logs.SaveLog("AccessGroup not is Empty"); return 1; } if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["ReadGroupUser"])) { GroupReadAdmin = ConfigurationManager.AppSettings["ReadGroupUser"]; } else { Logs.SaveLog("ReadGroupUser not is Empty"); return 1; } if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["Password"])) { Password = ConfigurationManager.AppSettings["Password"]; } else { Logs.SaveLog("Password not is Empty"); return 1; } string userAccount = Environment.GetEnvironmentVariable("USERNAME"); string userPassword = Environment.GetEnvironmentVariable("PASSWORD"); if (string.IsNullOrEmpty(userAccount) || string.IsNullOrEmpty(userPassword)) { Logs.SaveLog("Authentication transfer error"); return 1; } if (Auth(userAccount, userPassword)) { Logs.SaveLog(String.Format("{0} Login successfully", userAccount)); return 0; } else return 1; } } }
38.229437
141
0.478428
ed1f1ca5b4109e3525c10b9d39630a4ae659c03e
220
h
C
DetoxInstruments/DetoxInstruments/Views/DTXChevronButton.h
LeoNatan/DetoxInstruments
9bdf0ffb217714f3396dbf2051484181a0114375
[ "MIT" ]
1
2021-11-12T11:38:30.000Z
2021-11-12T11:38:30.000Z
DetoxInstruments/DetoxInstruments/Views/DTXChevronButton.h
LeoNatan/DetoxInstruments
9bdf0ffb217714f3396dbf2051484181a0114375
[ "MIT" ]
null
null
null
DetoxInstruments/DetoxInstruments/Views/DTXChevronButton.h
LeoNatan/DetoxInstruments
9bdf0ffb217714f3396dbf2051484181a0114375
[ "MIT" ]
null
null
null
// // DTXChevronButton.h // DetoxInstruments // // Created by Leo Natan on 11/27/19. // Copyright © 2017-2022 Leo Natan. All rights reserved. // #import <Cocoa/Cocoa.h> @interface DTXChevronButton : NSButton @end
15.714286
57
0.695455
e05f3c333bb4607cfcd6cdf84a9e996c5358a4a4
174,214
h
C
TinyScreenClockAndDisplay/font.h
SammyDuino/Watch-2.0
8bc0af8724d6a23ad3e4f7e76c64bc9a2cbc600d
[ "Apache-2.0" ]
null
null
null
TinyScreenClockAndDisplay/font.h
SammyDuino/Watch-2.0
8bc0af8724d6a23ad3e4f7e76c64bc9a2cbc600d
[ "Apache-2.0" ]
1
2015-08-17T19:03:49.000Z
2015-08-17T19:03:49.000Z
TinyScreenClockAndDisplay/font.h
SammyDuino/Watch-2.0
8bc0af8724d6a23ad3e4f7e76c64bc9a2cbc600d
[ "Apache-2.0" ]
null
null
null
/* Generated by The Dot Factory, written by Eran Duchan, currently available at http://www.eran.io/the-dot-factory-an-lcd-font-and-image-generator/ using the configuration xml included with this library. Just put the configuration file in the same directory as the executable, and copy and paste the output to the end of this file. Fonts that are not used are not included by the compiler and do not take up any space on the microcontroller flash. */ /* ** Font data for Liberation Sans 8pt */ /* Character bitmaps for Liberation Sans 8pt */ static const unsigned char PROGMEM liberationSans_8ptBitmaps[] = { /* @0 ' ' (2 pixels wide) */ // // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @11 '!' (1 pixels wide) */ // # ###### 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @22 '"' (4 pixels wide) */ // ## // // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x90, 0x00, /* @33 '#' (6 pixels wide) */ // # # // ##### // # ### // ### # // ##### // # # 0x00, 0x00, 0x10, 0x50, 0xFC, 0x48, 0x48, 0xFC, 0x28, 0x20, 0x00, /* @44 '$' (6 pixels wide) */ // # ## // # # # // # # # // ######## // # # # // ## # 0x00, 0x00, 0x78, 0x94, 0x14, 0x18, 0x70, 0x90, 0x94, 0x78, 0x00, /* @55 '%' (10 pixels wide) */ // ### // # # // # # # // # ### // ## // ## // ### # // # # # // # # // ### 0x00, 0x00, 0x21, 0x12, 0x0A, 0x6A, 0x95, 0x94, 0x92, 0x61, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, /* @77 '&' (7 pixels wide) */ // ## // ## # // # ##### // # # # # // # ### // # ## // # 0x00, 0x00, 0x76, 0xC8, 0x94, 0x64, 0x30, 0x28, 0x28, 0x38, 0x00, /* @88 ''' (1 pixels wide) */ // ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, /* @99 '(' (2 pixels wide) */ // ###### // ## ## 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x00, /* @110 ')' (2 pixels wide) */ // ## ## // ###### 0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x00, /* @121 '*' (4 pixels wide) */ // # # // # // ## // # # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x60, 0xB0, 0x00, 0x00, /* @132 '+' (6 pixels wide) */ // # // # // # // ### // # // # 0x00, 0x00, 0x00, 0x00, 0x10, 0xFC, 0x10, 0x00, 0x00, 0x00, 0x00, /* @143 ',' (1 pixels wide) */ // ### 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @154 '-' (2 pixels wide) */ // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, /* @165 '.' (1 pixels wide) */ // # 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @176 '/' (3 pixels wide) */ // ## // #### // ## 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x00, /* @187 '0' (6 pixels wide) */ // ## // ## ### // # # // # # // ## ### // ## 0x00, 0x00, 0x30, 0x48, 0x48, 0x84, 0x84, 0x48, 0x48, 0x78, 0x00, /* @198 '1' (5 pixels wide) */ // # # // # # // ######## // # // # 0x00, 0x00, 0xF8, 0x20, 0x20, 0x20, 0x20, 0x20, 0xA0, 0x60, 0x00, /* @209 '2' (4 pixels wide) */ // ## ## // # # # // # # # // # #### 0x00, 0x00, 0xF0, 0x80, 0x40, 0x20, 0x10, 0x10, 0x90, 0xF0, 0x00, /* @220 '3' (5 pixels wide) */ // ## ## // # # # // # # # // ## # ### // # 0x00, 0x00, 0xF0, 0x90, 0x08, 0x10, 0x60, 0x10, 0x90, 0xF0, 0x00, /* @231 '4' (6 pixels wide) */ // # // ### // # # // # ## // ######## // # 0x00, 0x00, 0x08, 0x08, 0xFC, 0x48, 0x48, 0x28, 0x18, 0x18, 0x00, /* @242 '5' (5 pixels wide) */ // ## ##### // # # # // # # # // ## ## # // # 0x00, 0x00, 0xF0, 0x90, 0x08, 0x90, 0xF0, 0x80, 0x80, 0xF0, 0x00, /* @253 '6' (5 pixels wide) */ // ###### // # # # // # # # // ## ## ## // # 0x00, 0x00, 0x70, 0x90, 0x88, 0x90, 0xF0, 0x80, 0x90, 0x70, 0x00, /* @264 '7' (4 pixels wide) */ // # // ### # // ## # // ### 0x00, 0x00, 0x40, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0xF0, 0x00, /* @275 '8' (6 pixels wide) */ // # // ## # ### // # # # // # # # // ## # ### // # 0x00, 0x00, 0x78, 0x48, 0x84, 0x48, 0x30, 0x48, 0x48, 0x78, 0x00, /* @286 '9' (5 pixels wide) */ // # // ## ## ## // # # # // # # # // ###### 0x00, 0x00, 0x70, 0x48, 0x08, 0x78, 0x48, 0x88, 0x48, 0x70, 0x00, /* @297 ':' (1 pixels wide) */ // # # 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* @308 ';' (1 pixels wide) */ // ### # 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* @319 '<' (6 pixels wide) */ // # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x0C, 0x70, 0x80, 0x70, 0x0C, 0x00, 0x00, 0x00, /* @330 '=' (6 pixels wide) */ // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, /* @341 '>' (6 pixels wide) */ // # # // # # // # # // # # // # # // # 0x00, 0x00, 0x00, 0xC0, 0x38, 0x04, 0x38, 0xC0, 0x00, 0x00, 0x00, /* @352 '?' (5 pixels wide) */ // ## // # # # // # # // # ## // # 0x00, 0x00, 0x40, 0x00, 0x40, 0x20, 0x10, 0x08, 0x90, 0xF0, 0x00, /* @363 '@' (9 pixels wide) */ // ##### // # ## // # #### # // # # # # // # # # # // # # # # // # # ### # // # # // #### 0x3E, 0x40, 0x80, 0xBB, 0xA4, 0xA2, 0xA2, 0x5E, 0x61, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, /* @385 'A' (8 pixels wide) */ // # // ## // #### // # ## // # ## // #### // ### // # 0x00, 0x00, 0x81, 0x42, 0x7E, 0x26, 0x24, 0x24, 0x18, 0x18, 0x00, /* @396 'B' (5 pixels wide) */ // ######## // # # # // # # # // # # # // #### ## 0x00, 0x00, 0xF8, 0x88, 0x88, 0x88, 0xF0, 0x88, 0x88, 0xF0, 0x00, /* @407 'C' (6 pixels wide) */ // ###### // # # // # # // # # // ## ## // # 0x00, 0x00, 0x78, 0x8C, 0x80, 0x80, 0x80, 0x80, 0x88, 0x78, 0x00, /* @418 'D' (6 pixels wide) */ // ######## // # # // # # // # # // ###### // ## 0x00, 0x00, 0xF0, 0x88, 0x88, 0x8C, 0x8C, 0x88, 0x88, 0xF0, 0x00, /* @429 'E' (5 pixels wide) */ // ######## // # # # // # # # // # # # // # 0x00, 0x00, 0xF8, 0x80, 0x80, 0x80, 0xF0, 0x80, 0x80, 0xF0, 0x00, /* @440 'F' (5 pixels wide) */ // ######## // # # // # # // # # // # 0x00, 0x00, 0x80, 0x80, 0x80, 0xF0, 0x80, 0x80, 0x80, 0xF8, 0x00, /* @451 'G' (6 pixels wide) */ // ###### // ## # // # # // # # # // # # # // ### # 0x00, 0x00, 0x78, 0xC4, 0x84, 0x9C, 0x80, 0x80, 0x84, 0x78, 0x00, /* @462 'H' (5 pixels wide) */ // ######## // # // # // # // ######## 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x88, 0x00, /* @473 'I' (1 pixels wide) */ // ######## 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @484 'J' (4 pixels wide) */ // # // # // # # // ######## 0x00, 0x00, 0x70, 0x90, 0x10, 0x10, 0x10, 0x10, 0x10, 0x30, 0x00, /* @495 'K' (5 pixels wide) */ // ######## // # // # # // # # // ## # 0x00, 0x00, 0x88, 0x88, 0x90, 0xA0, 0xC0, 0xA0, 0x90, 0x88, 0x00, /* @506 'L' (5 pixels wide) */ // ######## // # // # // # // # 0x00, 0x00, 0xF8, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @517 'M' (6 pixels wide) */ // ######## // ### // ### // ### // ### // ######## 0x00, 0x00, 0x84, 0xB4, 0xB4, 0xB4, 0xCC, 0xCC, 0xCC, 0x84, 0x00, /* @528 'N' (5 pixels wide) */ // ######## // ## // ## // ## // ######## 0x00, 0x00, 0x88, 0x98, 0x98, 0xA8, 0xA8, 0xC8, 0xC8, 0x88, 0x00, /* @539 'O' (6 pixels wide) */ // ###### // ## # // # # // # # // # # // ###### 0x00, 0x00, 0x78, 0xC4, 0x84, 0x84, 0x84, 0x84, 0x84, 0x78, 0x00, /* @550 'P' (5 pixels wide) */ // ######## // # # // # # // ##### // # 0x00, 0x00, 0x80, 0x80, 0x80, 0xF0, 0x90, 0x98, 0x90, 0xF0, 0x00, /* @561 'Q' (6 pixels wide) */ // ###### // ## # // # # // ### # // # # # // # ###### 0x1C, 0x10, 0x78, 0xC4, 0x84, 0x84, 0x84, 0x84, 0x84, 0x78, 0x00, /* @572 'R' (5 pixels wide) */ // ######## // # # // # # // ## # // ## #### 0x00, 0x00, 0x88, 0x88, 0x90, 0xF0, 0x88, 0x88, 0x88, 0xF8, 0x00, /* @583 'S' (6 pixels wide) */ // ## ### // # # # // # # # // # # # // #### ## // # 0x00, 0x00, 0xF8, 0x88, 0x0C, 0x18, 0xE0, 0x80, 0x88, 0x78, 0x00, /* @594 'T' (6 pixels wide) */ // # // # // # // ######## // # // # 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFC, 0x00, /* @605 'U' (5 pixels wide) */ // ####### // # // # // # // ####### 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, /* @616 'V' (8 pixels wide) */ // # // ## // ### // ## // ## // ### // ## // # 0x00, 0x00, 0x18, 0x18, 0x24, 0x24, 0x24, 0x42, 0x42, 0x81, 0x00, /* @627 'W' (10 pixels wide) */ // ## // #### // ## // ### // ### // #### // ### // ## // #### // ## 0x00, 0x00, 0x21, 0x33, 0x52, 0x52, 0x4C, 0x4C, 0x8C, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x00, /* @649 'X' (5 pixels wide) */ // ## ## // # ## // ## // ## # // ## ## 0x00, 0x00, 0x88, 0x88, 0x50, 0x30, 0x20, 0x50, 0xC8, 0x88, 0x00, /* @660 'Y' (6 pixels wide) */ // ## // # // ##### // ## // # // ## 0x00, 0x00, 0x20, 0x20, 0x20, 0x30, 0x30, 0x48, 0x84, 0x84, 0x00, /* @671 'Z' (7 pixels wide) */ // # // ## # // # ## # // # ## # // # # # // # ## // # 0x00, 0x00, 0xFE, 0x40, 0x20, 0x30, 0x10, 0x08, 0x04, 0x7C, 0x00, /* @682 '[' (2 pixels wide) */ // ########## // # # 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x00, /* @693 '\' (3 pixels wide) */ // ## // #### // ## 0x00, 0x00, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x00, /* @704 ']' (2 pixels wide) */ // # # // ########## 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xC0, 0x00, /* @715 '^' (5 pixels wide) */ // # // ## // # // ## // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x50, 0x50, 0x20, 0x00, /* @726 '_' (6 pixels wide) */ // # // # // # // # // # // # 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @737 '`' (2 pixels wide) */ // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, /* @748 'a' (6 pixels wide) */ // # // #### # // # # # // # # # // ###### // # 0x00, 0x00, 0x7C, 0xC8, 0x48, 0x78, 0x08, 0x78, 0x00, 0x00, 0x00, /* @759 'b' (5 pixels wide) */ // ######## // # # // # # // ## ## // ## 0x00, 0x00, 0xF0, 0x90, 0x88, 0x88, 0x90, 0xF0, 0x80, 0x80, 0x00, /* @770 'c' (5 pixels wide) */ // #### // # # // # # // # ## // # # 0x00, 0x00, 0x70, 0x88, 0x80, 0x80, 0x98, 0x70, 0x00, 0x00, 0x00, /* @781 'd' (5 pixels wide) */ // ## // ## ## // # # // # # // ######## 0x00, 0x00, 0x78, 0x48, 0x88, 0x88, 0x48, 0x78, 0x08, 0x08, 0x00, /* @792 'e' (6 pixels wide) */ // ## // ###### // # # # // # # # // ## ### // # 0x00, 0x00, 0x78, 0x48, 0xC0, 0xFC, 0x48, 0x78, 0x00, 0x00, 0x00, /* @803 'f' (4 pixels wide) */ // # // ####### // # # // # # 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0xF0, 0x40, 0x30, 0x00, /* @814 'g' (5 pixels wide) */ // ## // # ## ## // # # # // # # # // ######## 0x78, 0x08, 0x78, 0x48, 0x88, 0x88, 0x48, 0x78, 0x00, 0x00, 0x00, /* @825 'h' (4 pixels wide) */ // ######## // # // # // ###### 0x00, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90, 0xF0, 0x80, 0x80, 0x00, /* @836 'i' (1 pixels wide) */ // ###### # 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, /* @847 'j' (2 pixels wide) */ // # // ####### # 0x80, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, /* @858 'k' (4 pixels wide) */ // ######## // ## // # ## // # 0x00, 0x00, 0x90, 0xA0, 0xC0, 0xC0, 0xA0, 0xA0, 0x80, 0x80, 0x00, /* @869 'l' (1 pixels wide) */ // ######## 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @880 'm' (6 pixels wide) */ // ###### // # // ## // ##### // # // ###### 0x00, 0x00, 0x94, 0x94, 0x94, 0x94, 0xB4, 0xEC, 0x00, 0x00, 0x00, /* @891 'n' (4 pixels wide) */ // ###### // # // # // ###### 0x00, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90, 0xF0, 0x00, 0x00, 0x00, /* @902 'o' (6 pixels wide) */ // ## // ## ## // # # // # # // ## ## // ## 0x00, 0x00, 0x78, 0x48, 0x84, 0x84, 0x48, 0x78, 0x00, 0x00, 0x00, /* @913 'p' (5 pixels wide) */ // ######## // # # // # # // ## ## // ## 0x80, 0x80, 0xF0, 0x90, 0x88, 0x88, 0x90, 0xF0, 0x00, 0x00, 0x00, /* @924 'q' (5 pixels wide) */ // ## // ## ## // # # // # # // ######## 0x08, 0x08, 0x78, 0x48, 0x88, 0x88, 0x48, 0x78, 0x00, 0x00, 0x00, /* @935 'r' (3 pixels wide) */ // ###### // # // # 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x00, 0x00, 0x00, /* @946 's' (6 pixels wide) */ // # // # ### // # # # // # # # // # # # // # 0x00, 0x00, 0x78, 0x84, 0x18, 0x60, 0x40, 0x78, 0x00, 0x00, 0x00, /* @957 't' (3 pixels wide) */ // # // ####### // # # 0x00, 0x00, 0x60, 0x40, 0x40, 0x40, 0x40, 0xE0, 0x40, 0x00, 0x00, /* @968 'u' (4 pixels wide) */ // ###### // # // # // ###### 0x00, 0x00, 0xF0, 0x90, 0x90, 0x90, 0x90, 0x90, 0x00, 0x00, 0x00, /* @979 'v' (6 pixels wide) */ // # // ### // ## // ## // ### // # 0x00, 0x00, 0x30, 0x30, 0x48, 0x48, 0x48, 0x84, 0x00, 0x00, 0x00, /* @990 'w' (8 pixels wide) */ // ### // ### // ### // ### // ### // ### // ### // ### 0x00, 0x00, 0x66, 0x66, 0x66, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, /* @1001 'x' (4 pixels wide) */ // ## ## // ## // ## // ## ## 0x00, 0x00, 0x90, 0x90, 0x60, 0x60, 0x90, 0x90, 0x00, 0x00, 0x00, /* @1012 'y' (6 pixels wide) */ // # # // # ## // #### // ## // ### // # 0xC0, 0x20, 0x30, 0x30, 0x28, 0x48, 0x48, 0x84, 0x00, 0x00, 0x00, /* @1023 'z' (5 pixels wide) */ // # // ## # // # # # // # # # // # ## 0x00, 0x00, 0xF8, 0x40, 0x20, 0x10, 0x08, 0x78, 0x00, 0x00, 0x00, /* @1034 '{' (4 pixels wide) */ // # // #### ### // # # // # # 0x30, 0x40, 0x40, 0x40, 0x40, 0x80, 0x40, 0x40, 0x40, 0x30, 0x00, /* @1045 '|' (1 pixels wide) */ // ########## 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @1056 '}' (4 pixels wide) */ // # # // # # // #### ### // # 0xC0, 0x20, 0x20, 0x20, 0x20, 0x10, 0x20, 0x20, 0x20, 0xC0, 0x00, /* @1067 '~' (6 pixels wide) */ // # // # // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x64, 0x00, 0x00, 0x00, 0x00, }; /* Character descriptors for Liberation Sans 8pt */ /* { [Char width in bits], [Offset into liberationSans_8ptCharBitmaps in bytes] } */ static const FONT_CHAR_INFO PROGMEM liberationSans_8ptDescriptors[] = { {2, 0}, /* */ {1, 11}, /* ! */ {4, 22}, /* " */ {6, 33}, /* # */ {6, 44}, /* $ */ {10, 55}, /* % */ {7, 77}, /* & */ {1, 88}, /* ' */ {2, 99}, /* ( */ {2, 110}, /* ) */ {4, 121}, /* * */ {6, 132}, /* + */ {1, 143}, /* , */ {2, 154}, /* - */ {1, 165}, /* . */ {3, 176}, /* / */ {6, 187}, /* 0 */ {5, 198}, /* 1 */ {4, 209}, /* 2 */ {5, 220}, /* 3 */ {6, 231}, /* 4 */ {5, 242}, /* 5 */ {5, 253}, /* 6 */ {4, 264}, /* 7 */ {6, 275}, /* 8 */ {5, 286}, /* 9 */ {1, 297}, /* : */ {1, 308}, /* ; */ {6, 319}, /* < */ {6, 330}, /* = */ {6, 341}, /* > */ {5, 352}, /* ? */ {9, 363}, /* @ */ {8, 385}, /* A */ {5, 396}, /* B */ {6, 407}, /* C */ {6, 418}, /* D */ {5, 429}, /* E */ {5, 440}, /* F */ {6, 451}, /* G */ {5, 462}, /* H */ {1, 473}, /* I */ {4, 484}, /* J */ {5, 495}, /* K */ {5, 506}, /* L */ {6, 517}, /* M */ {5, 528}, /* N */ {6, 539}, /* O */ {5, 550}, /* P */ {6, 561}, /* Q */ {5, 572}, /* R */ {6, 583}, /* S */ {6, 594}, /* T */ {5, 605}, /* U */ {8, 616}, /* V */ {10, 627}, /* W */ {5, 649}, /* X */ {6, 660}, /* Y */ {7, 671}, /* Z */ {2, 682}, /* [ */ {3, 693}, /* \ */ {2, 704}, /* ] */ {5, 715}, /* ^ */ {6, 726}, /* _ */ {2, 737}, /* ` */ {6, 748}, /* a */ {5, 759}, /* b */ {5, 770}, /* c */ {5, 781}, /* d */ {6, 792}, /* e */ {4, 803}, /* f */ {5, 814}, /* g */ {4, 825}, /* h */ {1, 836}, /* i */ {2, 847}, /* j */ {4, 858}, /* k */ {1, 869}, /* l */ {6, 880}, /* m */ {4, 891}, /* n */ {6, 902}, /* o */ {5, 913}, /* p */ {5, 924}, /* q */ {3, 935}, /* r */ {6, 946}, /* s */ {3, 957}, /* t */ {4, 968}, /* u */ {6, 979}, /* v */ {8, 990}, /* w */ {4, 1001}, /* x */ {6, 1012}, /* y */ {5, 1023}, /* z */ {4, 1034}, /* { */ {1, 1045}, /* | */ {4, 1056}, /* } */ {6, 1067}, /* ~ */ }; /* Font information for Liberation Sans 8pt */ static const FONT_INFO liberationSans_8ptFontInfo = { 11, /* Character height */ ' ', /* Start character */ '~', /* End character */ liberationSans_8ptDescriptors, /* Character descriptor array */ liberationSans_8ptBitmaps, /* Character bitmap array */ }; /* ** Font data for Liberation Sans 10pt */ /* Character bitmaps for Liberation Sans 10pt */ static const unsigned char PROGMEM liberationSans_10ptBitmaps[] = { /* @0 ' ' (2 pixels wide) */ // // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @14 '!' (1 pixels wide) */ // # ######## 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @28 '"' (3 pixels wide) */ // ### // // ### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xA0, 0xA0, 0x00, /* @42 '#' (7 pixels wide) */ // # # // ##### # // # ##### // # # // ##### # // # #### // # # 0x00, 0x00, 0x00, 0x40, 0x48, 0x48, 0xFE, 0x48, 0x28, 0x24, 0xFE, 0x24, 0x24, 0x00, /* @56 '$' (7 pixels wide) */ // # // ## ##### // # # # // ############ // # ## # // ## # ## // ### 0x00, 0x00, 0x10, 0x7C, 0xD6, 0x12, 0x12, 0x1C, 0x78, 0x50, 0x50, 0x54, 0x7C, 0x10, /* @70 '%' (12 pixels wide) */ // # // ## ## // # # // ## # # // # ### // ## // ## // ### # // # # ## // # # // ## ## // # 0x00, 0x00, 0x00, 0x10, 0x11, 0x09, 0x05, 0x04, 0x72, 0x4A, 0x89, 0x48, 0x70, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x20, 0x10, 0x20, 0xE0, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, /* @98 '&' (9 pixels wide) */ // # // ##### // # # ## // # ## # // # ## # # // ## # # // ### ## // # ## // # 0x00, 0x00, 0x00, 0x7B, 0x46, 0xCE, 0x49, 0x71, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @126 ''' (1 pixels wide) */ // ### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, /* @140 '(' (3 pixels wide) */ // ######### // ### ### // # # 0x60, 0x40, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x40, 0x60, 0x00, /* @154 ')' (3 pixels wide) */ // # # // ### ### // ######### 0xC0, 0x40, 0x60, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x60, 0x40, 0xC0, 0x00, /* @168 '*' (5 pixels wide) */ // # // ### // ### // ### // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x50, 0x70, 0xA8, 0x20, 0x00, /* @182 '+' (6 pixels wide) */ // # // # // ####### // # // # // # 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0xFC, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, /* @196 ',' (2 pixels wide) */ // # # // ## 0x00, 0x80, 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @210 '-' (2 pixels wide) */ // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @224 '.' (2 pixels wide) */ // # // # 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @238 '/' (4 pixels wide) */ // ## // #### // #### // ## 0x00, 0x00, 0x00, 0x80, 0xC0, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x30, 0x10, 0x00, /* @252 '0' (7 pixels wide) */ // ## // ######## // # # // # # // # # // ######## // ## 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0xC6, 0xC6, 0x44, 0x44, 0x44, 0x38, 0x00, /* @266 '1' (6 pixels wide) */ // # # // # # // ########## // # // # // # 0x00, 0x00, 0x00, 0xFC, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xA0, 0x60, 0x20, 0x00, /* @280 '2' (5 pixels wide) */ // ## # // # ## # // # ## # // # ## # // # #### 0x00, 0x00, 0x00, 0xF8, 0x80, 0x40, 0x60, 0x30, 0x18, 0x08, 0x08, 0x88, 0x70, 0x00, /* @294 '3' (5 pixels wide) */ // ## # // # # // # # # // # # # // #### ### 0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x08, 0x08, 0x30, 0x08, 0x08, 0x88, 0x70, 0x00, /* @308 '4' (7 pixels wide) */ // # // ### // # ## // # ## // ########## // # // # 0x00, 0x00, 0x00, 0x08, 0x08, 0xFE, 0x48, 0x48, 0x28, 0x28, 0x18, 0x18, 0x08, 0x00, /* @322 '5' (5 pixels wide) */ // # ###### // # # # // # # # // # # # // #### # 0x00, 0x00, 0x00, 0x70, 0x88, 0x08, 0x08, 0x88, 0xF0, 0x80, 0x80, 0x80, 0xF8, 0x00, /* @336 '6' (5 pixels wide) */ // ######## // # # ## // # # # // # # # // #### # 0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0xF0, 0x80, 0x80, 0xC8, 0x70, 0x00, /* @350 '7' (5 pixels wide) */ // # // ## # // ##### # // ### # // ### 0x00, 0x00, 0x00, 0x40, 0x60, 0x20, 0x20, 0x20, 0x30, 0x10, 0x18, 0x08, 0xF8, 0x00, /* @364 '8' (5 pixels wide) */ // #### ### // # # # // # # # // # # # // #### ### 0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, /* @378 '9' (5 pixels wide) */ // # ##### // # # # // # # # // ## # # // ######## 0x00, 0x00, 0x00, 0x70, 0x98, 0x08, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, /* @392 ':' (2 pixels wide) */ // # # // # # 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, /* @406 ';' (2 pixels wide) */ // # # # // ## # 0x00, 0x80, 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, /* @420 '<' (6 pixels wide) */ // ## // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0x04, 0x18, 0xE0, 0x80, 0x60, 0x18, 0x04, 0x00, 0x00, 0x00, /* @434 '=' (6 pixels wide) */ // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, /* @448 '>' (6 pixels wide) */ // # # // # # // # # // # # // # # // ## 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x1C, 0x04, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, /* @462 '?' (6 pixels wide) */ // ## // # // # ## # // # # // #### // ## 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x20, 0x10, 0x08, 0x0C, 0x0C, 0x88, 0xF0, 0x00, /* @476 '@' (11 pixels wide) */ // ##### // ## ## // # ## # // # ## ## # // # # # # // # # # # // # # # # // # ##### # // # # # # // # ## // #### 0x00, 0x1F, 0x60, 0x40, 0x9D, 0xB3, 0xA1, 0x91, 0x91, 0x4E, 0x40, 0x30, 0x0F, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x40, 0x20, 0x20, 0x20, 0xA0, 0x40, 0xC0, 0x00, 0x00, /* @504 'A' (9 pixels wide) */ // # // ### // ### // # ### // # # // # ### // #### // ### // # 0x00, 0x00, 0x00, 0x80, 0x41, 0x41, 0x7F, 0x22, 0x22, 0x16, 0x14, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @532 'B' (7 pixels wide) */ // ########## // # # # // # # # // # # # // # # # // # # # ## // #### ## 0x00, 0x00, 0x00, 0xFC, 0x82, 0x82, 0x82, 0x86, 0xF8, 0x84, 0x82, 0x86, 0xFC, 0x00, /* @546 'C' (7 pixels wide) */ // ###### // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x3C, 0x42, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x42, 0x3C, 0x00, /* @560 'D' (7 pixels wide) */ // ########## // # # // # # // # # // # # // # # // ###### 0x00, 0x00, 0x00, 0xF8, 0x84, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x84, 0xF8, 0x00, /* @574 'E' (7 pixels wide) */ // ########## // # # # // # # # // # # # // # # # // # # # // # # # 0x00, 0x00, 0x00, 0xFE, 0x80, 0x80, 0x80, 0x80, 0xFE, 0x80, 0x80, 0x80, 0xFE, 0x00, /* @588 'F' (6 pixels wide) */ // ########## // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, 0x80, 0xFC, 0x00, /* @602 'G' (8 pixels wide) */ // ###### // # # // # # // # # // # # # // # # # // # # ## // #### # 0x00, 0x00, 0x00, 0x3C, 0x43, 0x81, 0x81, 0x8F, 0x80, 0x80, 0x80, 0x43, 0x3E, 0x00, /* @616 'H' (7 pixels wide) */ // ########## // # // # // # // # // # // ########## 0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFE, 0x82, 0x82, 0x82, 0x82, 0x00, /* @630 'I' (1 pixels wide) */ // ########## 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @644 'J' (5 pixels wide) */ // # // ## // # # // # # // ######### 0x00, 0x00, 0x00, 0x70, 0xC8, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, /* @658 'K' (7 pixels wide) */ // ########## // # // # // # # // ## # // ## ## // ## # 0x00, 0x00, 0x00, 0x82, 0x86, 0x8C, 0x88, 0xD0, 0xA0, 0x90, 0x88, 0x84, 0x86, 0x00, /* @672 'L' (6 pixels wide) */ // ########## // # // # // # // # // # 0x00, 0x00, 0x00, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @686 'M' (9 pixels wide) */ // ########## // ## // ### // ### // ## // ### // ### // ## // ########## 0x00, 0x00, 0x00, 0x88, 0x88, 0x94, 0x94, 0x94, 0xA2, 0xA2, 0xA2, 0xC1, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @714 'N' (7 pixels wide) */ // ########## // ## // ## // ## // ## // ## // ########## 0x00, 0x00, 0x00, 0x86, 0x86, 0x8A, 0x8A, 0x92, 0x92, 0xA2, 0xA2, 0xC2, 0xC2, 0x00, /* @728 'O' (8 pixels wide) */ // ###### // # # // # # // # # // # # // # # // # # // ###### 0x00, 0x00, 0x00, 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3C, 0x00, /* @742 'P' (7 pixels wide) */ // ########## // # # // # # // # # // # # // # # // #### 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xFC, 0x82, 0x82, 0x82, 0x82, 0xFC, 0x00, /* @756 'Q' (8 pixels wide) */ // ###### // # # // # # // # # // ## # // # # # // # # # // ###### 0x00, 0x06, 0x08, 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3C, 0x00, /* @770 'R' (7 pixels wide) */ // ########## // # # // # # // # # // ## # // ## ## ## // ## #### 0x00, 0x00, 0x00, 0x82, 0x86, 0x84, 0x88, 0xFC, 0x86, 0x82, 0x82, 0x86, 0xFC, 0x00, /* @784 'S' (7 pixels wide) */ // # ### // # ## ## // # # # // # # # // # ## # // # # # // #### # 0x00, 0x00, 0x00, 0x7C, 0x82, 0x02, 0x02, 0x0E, 0x78, 0xC0, 0x80, 0xC2, 0x7C, 0x00, /* @798 'T' (7 pixels wide) */ // # // # // # // ########## // # // # // # 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFE, 0x00, /* @812 'U' (7 pixels wide) */ // ######## // # // # // # // # // # // ######## 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x00, /* @826 'V' (9 pixels wide) */ // # // #### // ### // ### // # // ### // ### // #### // # 0x00, 0x00, 0x00, 0x08, 0x14, 0x14, 0x14, 0x22, 0x22, 0x63, 0x41, 0x41, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* @854 'W' (13 pixels wide) */ // ## // #### // ##### // ## // #### // ##### // # // #### // #### // ## // ##### // #### // ## 0x00, 0x00, 0x00, 0x10, 0x38, 0x28, 0x28, 0x2C, 0x65, 0x45, 0x45, 0xC5, 0x82, 0x00, 0x00, 0x00, 0x00, 0x40, 0xE0, 0xA0, 0xA0, 0xA0, 0x30, 0x10, 0x10, 0x18, 0x08, 0x00, /* @882 'X' (7 pixels wide) */ // # // ## ## // ## ## // ## // ## ## // ### ## // # 0x00, 0x00, 0x00, 0xC6, 0x44, 0x2C, 0x28, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x00, /* @896 'Y' (7 pixels wide) */ // ## // ## // ## // ###### // ## // ## // ## 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x28, 0x44, 0xC6, 0x82, 0x00, /* @910 'Z' (7 pixels wide) */ // # // ### # // # ### # // # ## # // # ## # // # ## // # 0x00, 0x00, 0x00, 0xFE, 0x40, 0x60, 0x20, 0x30, 0x10, 0x08, 0x08, 0x04, 0x7C, 0x00, /* @924 '[' (3 pixels wide) */ // ############# // # # // # # 0xE0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x00, /* @938 '\' (4 pixels wide) */ // ## // #### // #### // ## 0x00, 0x00, 0x00, 0x10, 0x30, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0xC0, 0x80, 0x00, /* @952 ']' (3 pixels wide) */ // # # // # # // ############# 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xE0, 0x00, /* @966 '^' (5 pixels wide) */ // # // ### // # // ### // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x50, 0x50, 0x50, 0x20, 0x00, /* @980 '_' (7 pixels wide) */ // # // # // # // # // # // # // # 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @994 '`' (2 pixels wide) */ // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, /* @1008 'a' (6 pixels wide) */ // #### # // # # # // # # # // # # # // ###### // # 0x00, 0x00, 0x00, 0xEC, 0x98, 0x88, 0xF8, 0x08, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, /* @1022 'b' (5 pixels wide) */ // ########## // # # // # # // # # // ####### 0x00, 0x00, 0x00, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x88, 0xF8, 0x80, 0x80, 0x80, 0x00, /* @1036 'c' (6 pixels wide) */ // ##### // # # // # # // # # // ## ## // # 0x00, 0x00, 0x00, 0x78, 0x8C, 0x80, 0x80, 0x80, 0x88, 0x78, 0x00, 0x00, 0x00, 0x00, /* @1050 'd' (5 pixels wide) */ // ####### // # # // # # // # # // ########## 0x00, 0x00, 0x00, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x88, 0xF8, 0x08, 0x08, 0x08, 0x00, /* @1064 'e' (5 pixels wide) */ // ##### // # # # // # # # // # # # // # ### 0x00, 0x00, 0x00, 0x70, 0x88, 0x80, 0xF8, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, /* @1078 'f' (3 pixels wide) */ // # // ########## // # # 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xE0, 0x40, 0x40, 0x60, 0x00, /* @1092 'g' (5 pixels wide) */ // # ####### // # # # // # # # // # # # // ######### 0x70, 0x88, 0x08, 0xE8, 0x98, 0x88, 0x88, 0x88, 0x98, 0xE8, 0x00, 0x00, 0x00, 0x00, /* @1106 'h' (5 pixels wide) */ // ########## // # // # // # // ####### 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0xC8, 0xB8, 0x80, 0x80, 0x80, 0x00, /* @1120 'i' (1 pixels wide) */ // ####### # 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, /* @1134 'j' (2 pixels wide) */ // # // ########## # 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x40, 0x00, /* @1148 'k' (6 pixels wide) */ // ########## // # // ## // ## # // ## # // # 0x00, 0x00, 0x00, 0x8C, 0x98, 0x90, 0xE0, 0xA0, 0x90, 0x88, 0x80, 0x80, 0x80, 0x00, /* @1162 'l' (1 pixels wide) */ // ########## 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @1176 'm' (9 pixels wide) */ // ####### // # // # // # // ####### // # // # // # // ####### 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0xCC, 0xBB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @1204 'n' (5 pixels wide) */ // ####### // # // # // # // ####### 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0xC8, 0xB8, 0x00, 0x00, 0x00, 0x00, /* @1218 'o' (5 pixels wide) */ // ##### // # # // # # // # # // ##### 0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, /* @1232 'p' (5 pixels wide) */ // ########## // # # // # # // # # // ####### 0x80, 0x80, 0x80, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x88, 0xF8, 0x00, 0x00, 0x00, 0x00, /* @1246 'q' (5 pixels wide) */ // ####### // # # // # # // # # // ########## 0x08, 0x08, 0x08, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x88, 0xF8, 0x00, 0x00, 0x00, 0x00, /* @1260 'r' (3 pixels wide) */ // ####### // # // # 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x00, 0x00, 0x00, 0x00, /* @1274 's' (6 pixels wide) */ // # // ## ### // # # # // # # # // # # # // #### ## 0x00, 0x00, 0x00, 0x7C, 0xC4, 0x04, 0x3C, 0x40, 0x44, 0x7C, 0x00, 0x00, 0x00, 0x00, /* @1288 't' (4 pixels wide) */ // # // ######### // # # // # # 0x00, 0x00, 0x00, 0x70, 0x40, 0x40, 0x40, 0x40, 0x40, 0xF0, 0x40, 0x40, 0x00, 0x00, /* @1302 'u' (5 pixels wide) */ // ####### // # // # // # // ####### 0x00, 0x00, 0x00, 0xE8, 0x98, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, /* @1316 'v' (5 pixels wide) */ // ## // ##### // # // ##### // ## 0x00, 0x00, 0x00, 0x20, 0x50, 0x50, 0x50, 0x50, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, /* @1330 'w' (9 pixels wide) */ // ## // #### // # // ##### // # // ##### // # // #### // ## 0x00, 0x00, 0x00, 0x22, 0x55, 0x55, 0x55, 0x55, 0x94, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @1358 'x' (5 pixels wide) */ // ## ## // # ## // # // ## ## // ## ## 0x00, 0x00, 0x00, 0x88, 0x98, 0x50, 0x20, 0x50, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, /* @1372 'y' (7 pixels wide) */ // # # // # ## // ## ### // ## // ### // ### // # 0xE0, 0x20, 0x10, 0x10, 0x28, 0x28, 0x2C, 0x44, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, /* @1386 'z' (5 pixels wide) */ // ## # // # # # // # # # // # ### // # ## 0x00, 0x00, 0x00, 0xF8, 0x80, 0x40, 0x20, 0x10, 0x18, 0xF8, 0x00, 0x00, 0x00, 0x00, /* @1400 '{' (4 pixels wide) */ // # // ##### #### // ###### #### // # # 0x30, 0x20, 0x60, 0x60, 0x60, 0x60, 0x40, 0x80, 0x40, 0x60, 0x60, 0x60, 0x30, 0x00, /* @1414 '|' (1 pixels wide) */ // ############# 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @1428 '}' (4 pixels wide) */ // # # // ###### #### // ##### #### // # 0xC0, 0x40, 0x60, 0x60, 0x60, 0x60, 0x20, 0x10, 0x20, 0x60, 0x60, 0x60, 0xC0, 0x00, /* @1442 '~' (6 pixels wide) */ // # // # // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* Character descriptors for Liberation Sans 10pt */ /* { [Char width in bits], [Offset into liberationSans_10ptCharBitmaps in bytes] } */ static const FONT_CHAR_INFO PROGMEM liberationSans_10ptDescriptors[] = { {2, 0}, /* */ {1, 14}, /* ! */ {3, 28}, /* " */ {7, 42}, /* # */ {7, 56}, /* $ */ {12, 70}, /* % */ {9, 98}, /* & */ {1, 126}, /* ' */ {3, 140}, /* ( */ {3, 154}, /* ) */ {5, 168}, /* * */ {6, 182}, /* + */ {2, 196}, /* , */ {2, 210}, /* - */ {2, 224}, /* . */ {4, 238}, /* / */ {7, 252}, /* 0 */ {6, 266}, /* 1 */ {5, 280}, /* 2 */ {5, 294}, /* 3 */ {7, 308}, /* 4 */ {5, 322}, /* 5 */ {5, 336}, /* 6 */ {5, 350}, /* 7 */ {5, 364}, /* 8 */ {5, 378}, /* 9 */ {2, 392}, /* : */ {2, 406}, /* ; */ {6, 420}, /* < */ {6, 434}, /* = */ {6, 448}, /* > */ {6, 462}, /* ? */ {11, 476}, /* @ */ {9, 504}, /* A */ {7, 532}, /* B */ {7, 546}, /* C */ {7, 560}, /* D */ {7, 574}, /* E */ {6, 588}, /* F */ {8, 602}, /* G */ {7, 616}, /* H */ {1, 630}, /* I */ {5, 644}, /* J */ {7, 658}, /* K */ {6, 672}, /* L */ {9, 686}, /* M */ {7, 714}, /* N */ {8, 728}, /* O */ {7, 742}, /* P */ {8, 756}, /* Q */ {7, 770}, /* R */ {7, 784}, /* S */ {7, 798}, /* T */ {7, 812}, /* U */ {9, 826}, /* V */ {13, 854}, /* W */ {7, 882}, /* X */ {7, 896}, /* Y */ {7, 910}, /* Z */ {3, 924}, /* [ */ {4, 938}, /* \ */ {3, 952}, /* ] */ {5, 966}, /* ^ */ {7, 980}, /* _ */ {2, 994}, /* ` */ {6, 1008}, /* a */ {5, 1022}, /* b */ {6, 1036}, /* c */ {5, 1050}, /* d */ {5, 1064}, /* e */ {3, 1078}, /* f */ {5, 1092}, /* g */ {5, 1106}, /* h */ {1, 1120}, /* i */ {2, 1134}, /* j */ {6, 1148}, /* k */ {1, 1162}, /* l */ {9, 1176}, /* m */ {5, 1204}, /* n */ {5, 1218}, /* o */ {5, 1232}, /* p */ {5, 1246}, /* q */ {3, 1260}, /* r */ {6, 1274}, /* s */ {4, 1288}, /* t */ {5, 1302}, /* u */ {5, 1316}, /* v */ {9, 1330}, /* w */ {5, 1358}, /* x */ {7, 1372}, /* y */ {5, 1386}, /* z */ {4, 1400}, /* { */ {1, 1414}, /* | */ {4, 1428}, /* } */ {6, 1442}, /* ~ */ }; /* Font information for Liberation Sans 10pt */ static const FONT_INFO liberationSans_10ptFontInfo = { 14, /* Character height */ ' ', /* Start character */ '~', /* End character */ liberationSans_10ptDescriptors, /* Character descriptor array */ liberationSans_10ptBitmaps, /* Character bitmap array */ }; /* ** Font data for Liberation Sans 12pt */ /* Character bitmaps for Liberation Sans 12pt */ static const unsigned char PROGMEM liberationSans_12ptBitmaps[] = { /* @0 ' ' (2 pixels wide) */ // // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @16 '!' (1 pixels wide) */ // ## ######### 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @32 '"' (4 pixels wide) */ // ### // // // ### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90, 0x90, 0x00, /* @48 '#' (9 pixels wide) */ // # # // #### # // ###### // # #### // # # // #### # // ####### // # # ## // # # 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0xFF, 0x22, 0x22, 0x22, 0x22, 0xFF, 0x12, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, /* @80 '$' (9 pixels wide) */ // # // ## #### // # ## ## // # # # // ############## // # ## # // # # # // ##### # // ### 0x00, 0x00, 0x08, 0x7E, 0xC9, 0x09, 0x09, 0x09, 0x0F, 0x3C, 0x68, 0x48, 0x48, 0x69, 0x3E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @112 '%' (12 pixels wide) */ // ###### // # # // # # # // ## ###### // ## // ## // ## // ### // ###### ## // # # # // # # // ###### 0x00, 0x00, 0x00, 0x20, 0x10, 0x18, 0x08, 0x04, 0x04, 0xF2, 0x93, 0x91, 0x91, 0x90, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x90, 0x90, 0x90, 0x90, 0xF0, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x00, /* @144 '&' (10 pixels wide) */ // #### // ## ## // # ##### // # ### # // # ## # # // ### ## # // ## ### // ## ## // # # // # 0x00, 0x00, 0x00, 0x79, 0xC7, 0x86, 0x8D, 0xD9, 0x70, 0x3C, 0x26, 0x22, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @176 ''' (1 pixels wide) */ // ### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, /* @192 '(' (4 pixels wide) */ // ####### // #### #### // ## ## // # # 0x30, 0x60, 0x40, 0x40, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x40, 0x40, 0x60, 0x30, 0x00, /* @208 ')' (4 pixels wide) */ // # # // ## ## // #### #### // ####### 0xC0, 0x60, 0x20, 0x20, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x30, 0x20, 0x20, 0x60, 0xC0, 0x00, /* @224 '*' (6 pixels wide) */ // # // # # // ### // ##### // # # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x30, 0x30, 0xFC, 0x10, 0x10, 0x00, /* @240 '+' (7 pixels wide) */ // # // # // # // ####### // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, /* @256 ',' (2 pixels wide) */ // ## // #### 0x00, 0x40, 0x40, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @272 '-' (3 pixels wide) */ // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @288 '.' (2 pixels wide) */ // ## // ## 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @304 '/' (4 pixels wide) */ // ## // #### // #### // ## 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x20, 0x10, 0x10, 0x00, /* @320 '0' (7 pixels wide) */ // ######## // ## # // # # // # # // # # // ## # // ######## 0x00, 0x00, 0x00, 0x38, 0x44, 0xC6, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, /* @336 '1' (7 pixels wide) */ // # // # # // # ## // ############ // # // # // # 0x00, 0x00, 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x70, 0x30, 0x00, /* @352 '2' (7 pixels wide) */ // ## ## // ### ## // # # # // # # # // # # # // # ### ### // # #### 0x00, 0x00, 0x00, 0xFE, 0xC0, 0x40, 0x20, 0x10, 0x0C, 0x04, 0x06, 0x02, 0x86, 0xC6, 0x7C, 0x00, /* @368 '3' (7 pixels wide) */ // ## ## // ## ## // # # # // # # # // # ## # // ## #### ## // ##### ### 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x82, 0x02, 0x02, 0x06, 0x3C, 0x0C, 0x06, 0x82, 0xC6, 0x7C, 0x00, /* @384 '4' (9 pixels wide) */ // # // ### // # ## // # ## // # ### // # ## // ############ // # // # 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0xFF, 0x42, 0x62, 0x22, 0x12, 0x1A, 0x0A, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @416 '5' (7 pixels wide) */ // # ###### // ## # ### // # # # // # # # // # # # // # ## # // ###### # 0x00, 0x00, 0x00, 0x78, 0xC6, 0x02, 0x02, 0x02, 0x02, 0xC6, 0xBC, 0x80, 0xC0, 0xC0, 0xFE, 0x00, /* @432 '6' (7 pixels wide) */ // ######## // ## ## ## // # # # // # # # // # # # // ## ## ## // ###### # 0x00, 0x00, 0x00, 0x3C, 0x46, 0xC2, 0x82, 0x82, 0xC2, 0xC6, 0xBC, 0x80, 0xC0, 0x46, 0x3C, 0x00, /* @448 '7' (7 pixels wide) */ // # // # // #### # // ##### # // ### # // ## # // ## 0x00, 0x00, 0x00, 0x20, 0x20, 0x30, 0x30, 0x10, 0x10, 0x18, 0x08, 0x0C, 0x04, 0x02, 0xFE, 0x00, /* @464 '8' (7 pixels wide) */ // ##### #### // ## # # ## // # # # // # # # // # # # // ## # # ## // ##### #### 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x82, 0x82, 0x82, 0xC6, 0x38, 0xC6, 0x82, 0x82, 0xC6, 0x7C, 0x00, /* @480 '9' (7 pixels wide) */ // # ###### // ## ## ## // # # # // # # # // # # # // ## # ## // ######## 0x00, 0x00, 0x00, 0x78, 0xC4, 0x06, 0x02, 0x7A, 0xC6, 0x82, 0x82, 0x82, 0x86, 0xC4, 0x78, 0x00, /* @496 ':' (2 pixels wide) */ // ## ## // ## ## 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, /* @512 ';' (2 pixels wide) */ // ## ## // #### ## 0x00, 0x40, 0x40, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, /* @528 '<' (7 pixels wide) */ // ### // # # // # # // ## ## // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1C, 0xF0, 0x80, 0xF0, 0x1C, 0x02, 0x00, 0x00, 0x00, 0x00, /* @544 '=' (7 pixels wide) */ // # # // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, /* @560 '>' (7 pixels wide) */ // # # // # # // # # // ## ## // # # // # # // ### 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x1E, 0x02, 0x1E, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, /* @576 '?' (7 pixels wide) */ // ## // ## // ## # // ## ## # // # # // ## ## // ##### 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x10, 0x10, 0x0C, 0x06, 0x02, 0x02, 0x82, 0xC6, 0x7C, 0x00, /* @592 '@' (14 pixels wide) */ // #### // ### ### // ## ## // # #### # // # ## ### # // # # ## # // # # # # // # # # # // # # ## # // # ####### # // # # ## # // ## ## // ### ### // ### 0x00, 0x0F, 0x30, 0x60, 0x4E, 0xD9, 0x90, 0x90, 0x98, 0x48, 0x4C, 0x67, 0x20, 0x18, 0x07, 0x00, 0x00, 0x80, 0x60, 0x00, 0x70, 0x58, 0xC8, 0x48, 0x44, 0x44, 0xEC, 0xA8, 0x18, 0x30, 0xC0, 0x00, /* @624 'A' (11 pixels wide) */ // # // #### // ### // ##### // # #### // # # // # #### // ##### // ### // #### // # 0x00, 0x00, 0x00, 0xC0, 0x40, 0x40, 0x60, 0x3F, 0x31, 0x11, 0x11, 0x1B, 0x0A, 0x0A, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x60, 0x40, 0x40, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @656 'B' (9 pixels wide) */ // ############ // ############ // # # # // # # # // # # # // # # # // # ## ## // ## # #### // ##### 0x00, 0x00, 0x00, 0xFE, 0xC1, 0xC1, 0xC0, 0xC0, 0xC1, 0xFE, 0xC3, 0xC1, 0xC1, 0xC3, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @688 'C' (10 pixels wide) */ // ###### // #### ### // # # // # # // # # // # # // # # // # # // # # // ## ## 0x00, 0x00, 0x00, 0x1F, 0x60, 0x40, 0xC0, 0xC0, 0x80, 0x80, 0x80, 0xC0, 0x40, 0x60, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xC0, 0x00, 0x00, /* @720 'D' (10 pixels wide) */ // ############ // ############ // # # // # # // # # // # # // ## # // # # // ### ### // ###### 0x00, 0x00, 0x00, 0xFE, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0x40, 0x40, 0x40, 0x40, 0xC0, 0x80, 0x80, 0x00, 0x00, /* @752 'E' (9 pixels wide) */ // ############ // ############ // # # # // # # # // # # # // # # # // # # # // # # # // # # 0x00, 0x00, 0x00, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* @784 'F' (8 pixels wide) */ // ############ // ############ // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0x00, /* @800 'G' (10 pixels wide) */ // ###### // ### ### // # # // # # // # # // # # # // # # # // ## # ## // ##### ## // #### # 0x00, 0x00, 0x00, 0x1F, 0x61, 0x40, 0xC0, 0x80, 0x87, 0x80, 0x80, 0xC0, 0x40, 0x61, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x80, 0x00, 0x00, /* @832 'H' (9 pixels wide) */ // ############ // ############ // # // # // # // # // # // ############ // ############ 0x00, 0x00, 0x00, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xFF, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @864 'I' (1 pixels wide) */ // ############ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @880 'J' (7 pixels wide) */ // # // ## // # // # # // # # // ########### // ########## 0x00, 0x00, 0x00, 0x38, 0x44, 0xC6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x1E, 0x00, /* @896 'K' (9 pixels wide) */ // ############ // ############ // ## // ## // ##### // ## ## // ## ## // ## ## // ## # 0x00, 0x00, 0x00, 0xC0, 0xC1, 0xC3, 0xC6, 0xCC, 0xE8, 0xF8, 0xD8, 0xCC, 0xC6, 0xC3, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* @928 'L' (7 pixels wide) */ // ############ // ############ // # // # // # // # // # 0x00, 0x00, 0x00, 0xFE, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, /* @944 'M' (11 pixels wide) */ // ############ // ############ // #### // ### // ### // ## // #### // #### // #### // ############ // ############ 0x00, 0x00, 0x00, 0xC4, 0xC6, 0xCA, 0xCA, 0xCB, 0xD1, 0xD1, 0xF1, 0xE0, 0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xE0, 0xE0, 0xE0, 0xE0, 0x60, 0x00, /* @976 'N' (9 pixels wide) */ // ############ // ############ // ### // ## // ## // ## // ## // ############ // ############ 0x00, 0x00, 0x00, 0xC1, 0xC3, 0xC3, 0xC5, 0xC5, 0xC9, 0xC9, 0xD1, 0xF1, 0xE1, 0xE1, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @1008 'O' (10 pixels wide) */ // ####### // ### ### // # # // # # // # # // # # // # # // # # // ### ### // ####### 0x00, 0x00, 0x00, 0x1E, 0x61, 0x40, 0xC0, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x61, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0x40, 0x40, 0x40, 0x40, 0xC0, 0xC0, 0x80, 0x00, 0x00, /* @1040 'P' (9 pixels wide) */ // ############ // ############ // # # // # # // # # // # # // # # // ## ## // ##### 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFE, 0xC1, 0xC1, 0xC0, 0xC1, 0xC1, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, /* @1072 'Q' (10 pixels wide) */ // ####### // ### ### // # # // # # // # # // ### # // ## # # // # # # // # ### ### // ####### 0x03, 0x06, 0x04, 0x1E, 0x61, 0x40, 0xC0, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x61, 0x1E, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0x40, 0x40, 0x40, 0x40, 0xC0, 0xC0, 0x80, 0x00, 0x00, /* @1104 'R' (9 pixels wide) */ // ############ // ############ // # # // # # // # # // ## # // #### # // ### ##### // # ### 0x00, 0x00, 0x00, 0xC1, 0xC1, 0xC3, 0xC2, 0xC6, 0xFE, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, /* @1136 'S' (9 pixels wide) */ // ## ## // # #### // # ## ## // # # # // # # # // # ## # // # # # // # ## ## // #### ## 0x00, 0x00, 0x00, 0x3E, 0xC1, 0x80, 0x00, 0x01, 0x07, 0x3C, 0x60, 0xC0, 0xC1, 0x61, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, /* @1168 'T' (9 pixels wide) */ // # // # // # // # // ############ // # // # // # // # 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* @1200 'U' (9 pixels wide) */ // ######### // ########### // ## // # // # // # // ## // ########### // ######### 0x00, 0x00, 0x00, 0x3E, 0x63, 0x41, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @1232 'V' (11 pixels wide) */ // # // #### // #### // #### // ### // # // ### // #### // #### // #### // # 0x00, 0x00, 0x00, 0x04, 0x0A, 0x0A, 0x1B, 0x11, 0x11, 0x31, 0x20, 0x60, 0x60, 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0x40, 0x60, 0x00, /* @1264 'W' (15 pixels wide) */ // ## // ##### // ###### // ##### // ### // ##### // ##### // ## // ##### // ##### // ### // #### // ##### // ##### // ## 0x00, 0x00, 0x00, 0x18, 0x18, 0x1C, 0x34, 0x34, 0x24, 0x26, 0x62, 0x62, 0x42, 0xC3, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x70, 0x58, 0x48, 0x48, 0xC8, 0x8C, 0x84, 0x84, 0x86, 0x06, 0x00, /* @1296 'X' (9 pixels wide) */ // ## # // ## ### // ### ## // ## ## // ## // ##### // ### ## // ## ### // ## # 0x00, 0x00, 0x00, 0x80, 0xC1, 0x63, 0x22, 0x36, 0x1C, 0x0C, 0x14, 0x36, 0x63, 0x41, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* @1328 'Y' (7 pixels wide) */ // ## // ### // ### // ####### // ### // ### // ## 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x28, 0x6C, 0x44, 0xC6, 0x82, 0x00, /* @1344 'Z' (9 pixels wide) */ // # // ### # // # ## # // # ### # // # ### # // # ## # // # #### // # ## // # 0x00, 0x00, 0x00, 0xFF, 0x40, 0x60, 0x30, 0x10, 0x18, 0x08, 0x0C, 0x06, 0x02, 0x03, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @1376 '[' (3 pixels wide) */ // ############### // # # // # # 0xE0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x00, /* @1392 '\' (4 pixels wide) */ // ## // #### // #### // ## 0x00, 0x00, 0x00, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x00, /* @1408 ']' (3 pixels wide) */ // # # // # # // ############### 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xE0, 0x00, /* @1424 '^' (7 pixels wide) */ // # // ### // ### // # // ### // ### // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x44, 0x44, 0x28, 0x28, 0x38, 0x00, /* @1440 '_' (9 pixels wide) */ // # // # // # // # // # // # // # // # // # 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @1472 '`' (3 pixels wide) */ // # // ## // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0xC0, /* @1488 'a' (8 pixels wide) */ // ### # // # ## ## // # # # // # # # // # # # // ######## // ####### // # 0x00, 0x00, 0x00, 0x73, 0x8E, 0x86, 0xC6, 0x7E, 0x06, 0x06, 0xC4, 0x7C, 0x00, 0x00, 0x00, 0x00, /* @1504 'b' (7 pixels wide) */ // ############ // ####### ### // # # // # # // # # // ## ## // ####### 0x00, 0x00, 0x00, 0xBC, 0xC6, 0xC2, 0xC2, 0xC2, 0xC2, 0xC2, 0xC6, 0xBC, 0xC0, 0xC0, 0xC0, 0x00, /* @1520 'c' (6 pixels wide) */ // ####### // ## ## // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x78, 0xC4, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC4, 0x78, 0x00, 0x00, 0x00, 0x00, /* @1536 'd' (7 pixels wide) */ // ####### // ## ## // # # // # # // # # // ########### // ############ 0x00, 0x00, 0x00, 0x7A, 0xC6, 0x86, 0x86, 0x86, 0x86, 0x86, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x00, /* @1552 'e' (7 pixels wide) */ // ####### // ## # ## // # # # // # # # // # # # // ## # ## // # #### 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x80, 0x80, 0xFE, 0x82, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* @1568 'f' (4 pixels wide) */ // # // ########### // ############ // # # 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x60, 0x60, 0x30, 0x00, /* @1584 'g' (7 pixels wide) */ // # ####### // ## ## ## // # # # // # # # // # # ## // ######### // ########## 0x78, 0xC4, 0x06, 0x76, 0xCE, 0x86, 0x86, 0x86, 0x86, 0x86, 0xCA, 0x7A, 0x00, 0x00, 0x00, 0x00, /* @1600 'h' (6 pixels wide) */ // ############ // ## // # // # // ## // ######## 0x00, 0x00, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0xC4, 0xCC, 0xB8, 0x80, 0x80, 0x80, 0x00, /* @1616 'i' (2 pixels wide) */ // ######### # // ######### # 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0x00, /* @1632 'j' (2 pixels wide) */ // # // ############ # 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x40, 0x00, /* @1648 'k' (7 pixels wide) */ // ############ // ## // ## // #### // ### ## // ## ## // # 0x00, 0x00, 0x00, 0x86, 0x8C, 0x88, 0xD8, 0xF0, 0xB0, 0x98, 0x8C, 0x84, 0x80, 0x80, 0x80, 0x00, /* @1664 'l' (1 pixels wide) */ // ############ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @1680 'm' (11 pixels wide) */ // ######### // ## // # // # // # // ######## // # // # // # // ## // ######## 0x00, 0x00, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0xC4, 0xC6, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, /* @1712 'n' (6 pixels wide) */ // ######### // ## // # // # // ## // ######## 0x00, 0x00, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0xC4, 0xCC, 0xB8, 0x00, 0x00, 0x00, 0x00, /* @1728 'o' (7 pixels wide) */ // ####### // ## ## // # # // # # // # # // ## ## // ####### 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x82, 0x82, 0x82, 0x82, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, /* @1744 'p' (7 pixels wide) */ // ############ // ### ####### // # # // # # // # # // ## ## // ####### 0xC0, 0xC0, 0xC0, 0xBC, 0xC6, 0xC2, 0xC2, 0xC2, 0xC2, 0xC2, 0xC6, 0xBC, 0x00, 0x00, 0x00, 0x00, /* @1760 'q' (7 pixels wide) */ // ####### // ## ## // # # // # # // # # // ### ####### // ############ 0x06, 0x06, 0x06, 0x7A, 0xC6, 0x86, 0x86, 0x86, 0x86, 0x86, 0xC6, 0x7A, 0x00, 0x00, 0x00, 0x00, /* @1776 'r' (4 pixels wide) */ // ######### // ## // # // # 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xB0, 0x00, 0x00, 0x00, 0x00, /* @1792 's' (6 pixels wide) */ // # ### // # ## # // # # # // # # # // # ## # // ### # 0x00, 0x00, 0x00, 0x78, 0x84, 0x04, 0x0C, 0x78, 0xC0, 0x80, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, /* @1808 't' (4 pixels wide) */ // # // ########### // ########### // # # 0x00, 0x00, 0x00, 0x70, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x60, 0x60, 0x00, 0x00, /* @1824 'u' (6 pixels wide) */ // ######## // ## // # // # // ## // ######### 0x00, 0x00, 0x00, 0x74, 0xCC, 0x8C, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x00, 0x00, 0x00, 0x00, /* @1840 'v' (7 pixels wide) */ // ## // ##### // ##### // # // #### // ##### // ## 0x00, 0x00, 0x00, 0x30, 0x28, 0x28, 0x28, 0x6C, 0x44, 0x44, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, /* @1856 'w' (11 pixels wide) */ // ## // ##### // #### // #### // ##### // # // ##### // ### // #### // ##### // ## 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x7A, 0x4A, 0x4A, 0x4A, 0xCA, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xC0, 0x40, 0x40, 0x40, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00, /* @1888 'x' (7 pixels wide) */ // # // ## ## // ## ### // ## // ## ### // ## ## // # 0x00, 0x00, 0x00, 0xC6, 0x44, 0x28, 0x28, 0x10, 0x38, 0x28, 0x6C, 0x44, 0x00, 0x00, 0x00, 0x00, /* @1904 'y' (7 pixels wide) */ // # # // # ##### // ## ##### // #### // #### // ##### // ## 0xE0, 0x30, 0x10, 0x10, 0x38, 0x28, 0x28, 0x6C, 0x64, 0x44, 0x46, 0xC6, 0x00, 0x00, 0x00, 0x00, /* @1920 'z' (5 pixels wide) */ // ### # // # ## # // # ### # // # #### // # ## 0x00, 0x00, 0x00, 0xF8, 0x80, 0xC0, 0x60, 0x20, 0x30, 0x10, 0x18, 0xF8, 0x00, 0x00, 0x00, 0x00, /* @1936 '{' (5 pixels wide) */ // # // ### // ####### ####### // # # // # # 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x60, 0xC0, 0x60, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, /* @1952 '|' (1 pixels wide) */ // ############### 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @1968 '}' (5 pixels wide) */ // # # // # # // ####### ####### // ### // # 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x18, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0xE0, 0x00, /* @1984 '~' (7 pixels wide) */ // ## // # // # // # // # // # // ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x92, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* Character descriptors for Liberation Sans 12pt */ /* { [Char width in bits], [Offset into liberationSans_12ptCharBitmaps in bytes] } */ static const FONT_CHAR_INFO PROGMEM liberationSans_12ptDescriptors[] = { {4, 0}, /* */ {1, 16}, /* ! */ {4, 32}, /* " */ {9, 48}, /* # */ {9, 80}, /* $ */ {12, 112}, /* % */ {10, 144}, /* & */ {1, 176}, /* ' */ {4, 192}, /* ( */ {4, 208}, /* ) */ {6, 224}, /* * */ {7, 240}, /* + */ {2, 256}, /* , */ {3, 272}, /* - */ {2, 288}, /* . */ {4, 304}, /* / */ {7, 320}, /* 0 */ {7, 336}, /* 1 */ {7, 352}, /* 2 */ {7, 368}, /* 3 */ {9, 384}, /* 4 */ {7, 416}, /* 5 */ {7, 432}, /* 6 */ {7, 448}, /* 7 */ {7, 464}, /* 8 */ {7, 480}, /* 9 */ {2, 496}, /* : */ {2, 512}, /* ; */ {7, 528}, /* < */ {7, 544}, /* = */ {7, 560}, /* > */ {7, 576}, /* ? */ {14, 592}, /* @ */ {11, 624}, /* A */ {9, 656}, /* B */ {10, 688}, /* C */ {10, 720}, /* D */ {9, 752}, /* E */ {8, 784}, /* F */ {10, 800}, /* G */ {9, 832}, /* H */ {1, 864}, /* I */ {7, 880}, /* J */ {9, 896}, /* K */ {7, 928}, /* L */ {11, 944}, /* M */ {9, 976}, /* N */ {10, 1008}, /* O */ {9, 1040}, /* P */ {10, 1072}, /* Q */ {9, 1104}, /* R */ {9, 1136}, /* S */ {9, 1168}, /* T */ {9, 1200}, /* U */ {11, 1232}, /* V */ {15, 1264}, /* W */ {9, 1296}, /* X */ {7, 1328}, /* Y */ {9, 1344}, /* Z */ {3, 1376}, /* [ */ {4, 1392}, /* \ */ {3, 1408}, /* ] */ {7, 1424}, /* ^ */ {9, 1440}, /* _ */ {3, 1472}, /* ` */ {8, 1488}, /* a */ {7, 1504}, /* b */ {6, 1520}, /* c */ {7, 1536}, /* d */ {7, 1552}, /* e */ {4, 1568}, /* f */ {7, 1584}, /* g */ {6, 1600}, /* h */ {2, 1616}, /* i */ {2, 1632}, /* j */ {7, 1648}, /* k */ {1, 1664}, /* l */ {11, 1680}, /* m */ {6, 1712}, /* n */ {7, 1728}, /* o */ {7, 1744}, /* p */ {7, 1760}, /* q */ {4, 1776}, /* r */ {6, 1792}, /* s */ {4, 1808}, /* t */ {6, 1824}, /* u */ {7, 1840}, /* v */ {11, 1856}, /* w */ {7, 1888}, /* x */ {7, 1904}, /* y */ {5, 1920}, /* z */ {5, 1936}, /* { */ {1, 1952}, /* | */ {5, 1968}, /* } */ {7, 1984}, /* ~ */ }; /* Font information for Liberation Sans 12pt */ static const FONT_INFO liberationSans_12ptFontInfo = { 16, /* Character height */ ' ', /* Start character */ '~', /* End character */ liberationSans_12ptDescriptors, /* Character descriptor array */ liberationSans_12ptBitmaps, /* Character bitmap array */ }; /* ** Font data for Liberation Sans 14pt */ /* Character bitmaps for Liberation Sans 14pt */ static const unsigned char PROGMEM liberationSans_14ptBitmaps[] = { /* @0 ' ' (4 pixels wide) */ // // // // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @19 '!' (2 pixels wide) */ // ## ######### // ## ######### 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, /* @38 '"' (5 pixels wide) */ // #### // # // // ## // #### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x98, 0xD8, 0x00, 0x00, /* @57 '#' (11 pixels wide) */ // # // # # # // ##### # // # #### // # # ### // # # // ### # # // ###### // # ##### // # # # // # 0x00, 0x00, 0x00, 0x00, 0x42, 0x22, 0x22, 0x21, 0xFF, 0x21, 0x11, 0x11, 0x7F, 0x10, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x80, 0xE0, 0x80, 0x80, 0x80, 0x40, 0x00, 0x00, /* @95 '$' (11 pixels wide) */ // # // ## #### // ## ## ## // # # # // # ## # // ################# // # # # // # ## # // ## ## # // ##### ## // ### 0x00, 0x00, 0x04, 0x04, 0x3F, 0x64, 0xC4, 0x04, 0x04, 0x05, 0x0F, 0x3C, 0x64, 0x44, 0x64, 0x64, 0x1F, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x60, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x40, 0xC0, 0x00, 0x00, 0x00, /* @133 '%' (15 pixels wide) */ // ##### // ## # // # # // ## # # // ## ##### // ### ### // ## // ### // ## // ### ### // ###### ## // # # ## // # # // ## # // ##### 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x0C, 0x04, 0x06, 0x03, 0x71, 0xC9, 0x8C, 0x8C, 0x8C, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x26, 0x62, 0x62, 0x62, 0x22, 0x3C, 0x80, 0xC0, 0x40, 0x60, 0x30, 0x10, 0x00, 0x00, /* @171 '&' (12 pixels wide) */ // ##### // ## ## // # # #### // # ####### // # ### # // # ### # # // #### # # // ## ##### // ##### ### // # ### // # # // # 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC3, 0x83, 0x86, 0x86, 0xCC, 0x78, 0x1C, 0x33, 0x31, 0x31, 0x31, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x80, 0x80, 0x80, 0xC0, 0x40, 0x60, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, /* @209 ''' (2 pixels wide) */ // #### // #### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, /* @228 '(' (5 pixels wide) */ // ######## // ############ // ### ### // ## ## // # # 0x18, 0x30, 0x20, 0x60, 0x40, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x40, 0x60, 0x20, 0x30, 0x18, 0x00, /* @247 ')' (5 pixels wide) */ // # # // ## ## // ### ### // ############ // ######## 0xC0, 0x60, 0x20, 0x30, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x30, 0x20, 0x60, 0xC0, 0x00, /* @266 '*' (7 pixels wide) */ // # // # ## // ### // ##### // ### // # ## // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x38, 0x7C, 0xD6, 0x10, 0x10, 0x00, 0x00, /* @285 '+' (9 pixels wide) */ // # // # // # // # // ######### // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @323 ',' (1 pixels wide) */ // #### 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @342 '-' (4 pixels wide) */ // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @361 '.' (1 pixels wide) */ // ## 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @380 '/' (5 pixels wide) */ // ## // ###### // ###### // ###### // ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x40, 0x40, 0x60, 0x60, 0x20, 0x20, 0x30, 0x30, 0x10, 0x10, 0x18, 0x18, 0x00, /* @399 '0' (9 pixels wide) */ // ######### // #### #### // ## ## // # # // # # // # # // ## ## // #### #### // ######### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0xC1, 0xC1, 0xC1, 0x80, 0x80, 0x80, 0xC1, 0xC1, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @437 '1' (8 pixels wide) */ // # ## // # ## // # ## // ############# // ############# // # // # // # 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x98, 0xD8, 0x78, 0x38, 0x00, 0x00, /* @456 '2' (9 pixels wide) */ // ## # // ### ### // # ## ## // # ## # // # ## # // # ## # // # ## ## // # ###### // # ### 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x07, 0x03, 0x01, 0x41, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @494 '3' (9 pixels wide) */ // ## # // ### ### // ## ## // # # # // # # # // # # # // ## # # ## // ##### ##### // ### ### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0xC1, 0xC1, 0x01, 0x03, 0x1C, 0x03, 0x01, 0x41, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @532 '4' (10 pixels wide) */ // # // ### // # ## // # ### // # ### // # ## // # ### // ############# // ############# // # 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0xFF, 0x41, 0x61, 0x31, 0x19, 0x19, 0x0D, 0x07, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xC0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, /* @570 '5' (9 pixels wide) */ // # ##### // ## ####### // ## # # // # # # // # # # // # # # // ## ## # // ###### # // #### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0xC1, 0x01, 0x01, 0x01, 0xC3, 0xFE, 0xC0, 0xC0, 0xC0, 0x40, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @608 '6' (9 pixels wide) */ // ####### // ########### // ## # # // # # # // # # # // # # # // ## ## ## // ###### ## // #### # 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0x41, 0xC1, 0xC1, 0xC1, 0xE3, 0xDE, 0xC0, 0xC0, 0x41, 0x63, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, /* @646 '7' (9 pixels wide) */ // # // # // # // ##### # // #### # // ### # // ### # // ### // ## 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x18, 0x18, 0x08, 0x0C, 0x04, 0x06, 0x02, 0x03, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, /* @684 '8' (9 pixels wide) */ // ### ### // ##### ##### // ## ## ## // # # # // # # # // # # # // # ## ## // ##### ##### // #### ### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x61, 0xC1, 0xC1, 0xC1, 0x41, 0x3E, 0x63, 0xC1, 0xC1, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @722 '9' (9 pixels wide) */ // # ##### // ## ####### // ## ## ## // # # # // # # # // # # # // # # ## // ########### // ####### 0x00, 0x00, 0x00, 0x00, 0x3C, 0x63, 0xC1, 0x01, 0x3D, 0x63, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @760 ':' (1 pixels wide) */ // ## ## 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @779 ';' (1 pixels wide) */ // #### ## 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @798 '<' (9 pixels wide) */ // ### // # # // # # // ## ## // # # // ## ## // # # // # # // ## ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1C, 0xF0, 0x80, 0xF0, 0x1C, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @836 '=' (9 pixels wide) */ // # # // # # // # # // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @874 '>' (9 pixels wide) */ // ## ## // # # // # # // ## ## // # # // ## ## // # # // # # // ### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xF0, 0x1C, 0x07, 0x00, 0x07, 0x1C, 0xF0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @912 '?' (9 pixels wide) */ // ## // ### // ## // ## # # // ## ## # // ## # // ## # // ## ## // #### 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x0C, 0x06, 0x03, 0x01, 0xC0, 0xC1, 0x61, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, /* @950 '@' (16 pixels wide) */ // # // ######### // ## ### // ## ## // # ##### ## // # ### #### # // # # # ## // # # # # // # # # # // # # # # // # ### # # // # ######## # // # # ### # // # ## // ## ## // ######## 0x00, 0x07, 0x18, 0x30, 0x60, 0x47, 0x4C, 0x4C, 0xC8, 0x4C, 0x4C, 0x44, 0x66, 0x21, 0x30, 0x18, 0x0E, 0x03, 0x00, 0x00, 0xE0, 0x18, 0x00, 0x00, 0x9C, 0x72, 0x33, 0x31, 0x11, 0x11, 0x19, 0x39, 0xC9, 0x03, 0x06, 0x0C, 0xF0, 0x00, /* @988 'A' (13 pixels wide) */ // # // ### // #### // #### // # ##### // # #### // # # // # #### // # ##### // #### // #### // #### // # 0x00, 0x00, 0x00, 0x00, 0xC0, 0x40, 0x60, 0x20, 0x3F, 0x30, 0x18, 0x18, 0x08, 0x0D, 0x0D, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x30, 0x30, 0xE0, 0x60, 0xC0, 0xC0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @1026 'B' (10 pixels wide) */ // ############# // # # # // # # # // # # # // # # # // # ## # // # ## # // ## ####### // ##### #### // ### 0x00, 0x00, 0x00, 0x00, 0xFF, 0x81, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x87, 0x81, 0x81, 0x81, 0x81, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, /* @1064 'C' (12 pixels wide) */ // ##### // ######### // ## ## // # # // # # // # # // # # // # # // # # // # # // ## ### // ## ## 0x00, 0x00, 0x00, 0x00, 0x0F, 0x30, 0x60, 0x40, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x40, 0x60, 0x30, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60, 0x80, 0x00, 0x00, /* @1102 'D' (11 pixels wide) */ // ############# // # # // # # // # # // # # // # # // # # // # # // ## ## // ######### // ###### 0x00, 0x00, 0x00, 0x00, 0xFE, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x40, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, /* @1140 'E' (10 pixels wide) */ // ############# // # # # // # # # // # # # // # # # // # # # // # # # // # # # // # # # // # # 0x00, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, /* @1178 'F' (9 pixels wide) */ // ############# // # # // # # // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, /* @1216 'G' (13 pixels wide) */ // ###### // ######### // ## ## // # # // # # // # # // # # // # # # // # # # // ## # ## // # # ### // ###### ## // ##### 0x00, 0x00, 0x00, 0x00, 0x0F, 0x30, 0x60, 0x40, 0xC0, 0xC0, 0xC1, 0xC0, 0xC0, 0xC0, 0x60, 0x30, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x30, 0x30, 0x60, 0xC0, 0x00, 0x00, /* @1254 'H' (11 pixels wide) */ // ############# // ############# // # // # // # // # // # // # // # // ############# // ############# 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xE0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, /* @1292 'I' (2 pixels wide) */ // ############# // ############# 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, /* @1311 'J' (9 pixels wide) */ // # // ### // ## // # // # # // # # // ## # // ############ // ######### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0x41, 0xC1, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, /* @1349 'K' (10 pixels wide) */ // ############# // ## // ## // ### // ## ## // ## ## // ### ## // ### ## // ### # // # # 0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x83, 0x83, 0x86, 0xCC, 0xF8, 0xB0, 0x98, 0x8C, 0x86, 0x83, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, /* @1387 'L' (8 pixels wide) */ // ############# // # // # // # // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, /* @1406 'M' (13 pixels wide) */ // ############# // ############# // ### // #### // #### // #### // ## // #### // #### // #### // ### // ############# // ############# 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC7, 0xC5, 0xC5, 0xCD, 0xC8, 0xC8, 0xD8, 0xD0, 0xD0, 0xF0, 0xE0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x98, 0x98, 0x98, 0xD8, 0x58, 0x58, 0x78, 0x38, 0x38, 0x00, 0x00, /* @1444 'N' (11 pixels wide) */ // ############# // ############# // ### // ### // ### // ### // ### // ### // ### // ############# // ############# 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC1, 0xC3, 0xC3, 0xC6, 0xC4, 0xCC, 0xD8, 0xD8, 0xF0, 0xE0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE0, 0xE0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, /* @1482 'O' (13 pixels wide) */ // ####### // ######### // ## ## // # # // # # // # # // # # // # # // # # // # # // ## ## // ######### // ###### 0x00, 0x00, 0x00, 0x00, 0x0F, 0x30, 0x60, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x60, 0x30, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x30, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0x60, 0x80, 0x00, 0x00, /* @1520 'P' (10 pixels wide) */ // ############# // # # // # # // # # // # # // # # // # # // ## ## // ###### // #### 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x81, 0x80, 0x80, 0x80, 0x80, 0x81, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, /* @1558 'Q' (13 pixels wide) */ // ####### // ######### // ## ## // # # // # # // # # // ### # // #### # // ## # # // # # # // # ## ## // ######### // ####### 0x00, 0x01, 0x03, 0x03, 0x0F, 0x30, 0x60, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x60, 0x30, 0x0F, 0x00, 0x00, 0xE0, 0x80, 0x00, 0x00, 0x80, 0x60, 0x30, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0x60, 0x80, 0x00, 0x00, /* @1596 'R' (11 pixels wide) */ // ############# // # # // # # // # # // # # // # # // ### # // #### # // ### # ## // ### ##### // # # 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x81, 0x83, 0x83, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0xC0, 0x40, 0x60, 0x40, 0xC0, 0x80, 0x00, 0x00, /* @1634 'S' (11 pixels wide) */ // # // ### #### // ## ## # // # # # // # ## # // # # # // # # # // # # # // ## ## ## // ##### ## // ### # 0x00, 0x00, 0x00, 0x00, 0x3F, 0x60, 0xC0, 0x40, 0x00, 0x00, 0x0F, 0x38, 0x60, 0x40, 0x40, 0x60, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x60, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x60, 0xC0, 0x80, 0x00, 0x00, /* @1672 'T' (12 pixels wide) */ // # // # // # // # // # // ############# // ############# // # // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, /* @1710 'U' (11 pixels wide) */ // ######### // ########### // ## // ## // # // # // # // ## // ## // ########### // ######### 0x00, 0x00, 0x00, 0x00, 0x1F, 0x31, 0x60, 0x40, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x40, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, /* @1748 'V' (13 pixels wide) */ // # // ### // ##### // #### // #### // #### // ## // #### // #### // #### // ##### // ### // # 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x05, 0x0D, 0x08, 0x18, 0x18, 0x30, 0x30, 0x20, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0x60, 0x60, 0x20, 0x30, 0x30, 0x18, 0x00, 0x00, /* @1786 'W' (19 pixels wide) */ // # // #### // ###### // ###### // ##### // ## // ##### // ##### // ##### // ## // ###### // ##### // ##### // ## // ##### // ###### // ###### // #### // # 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0E, 0x1A, 0x1A, 0x1B, 0x33, 0x31, 0x31, 0x21, 0x60, 0x60, 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0E, 0x0B, 0x0B, 0x1B, 0x19, 0x11, 0xB1, 0xB0, 0xA0, 0xA0, 0xE0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x40, 0x60, 0x00, 0x00, /* @1843 'X' (11 pixels wide) */ // # # // ### ## // ### ### // ## ### // ##### // ## // ##### // ### ### // ## ### // ### ## // # # 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x60, 0x31, 0x1B, 0x0B, 0x0E, 0x0E, 0x1B, 0x31, 0x31, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x40, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0x60, 0x00, 0x00, /* @1881 'Y' (10 pixels wide) */ // ## // ### // ### // ### // ######## // ######## // ### // ### // ### // ## 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x1E, 0x33, 0x21, 0x61, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, 0x00, /* @1919 'Z' (10 pixels wide) */ // ## # // ### # // # ### # // # ## # // # ## # // # ### # // # ## # // # ## # // # ### // # # 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x60, 0x20, 0x30, 0x18, 0x0C, 0x04, 0x06, 0x03, 0x01, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0x00, 0x00, /* @1957 '[' (4 pixels wide) */ // ################## // ################## // # # // # # 0xF0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xF0, 0x00, /* @1976 '\' (5 pixels wide) */ // ## // ###### // ###### // ###### // ## 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x10, 0x10, 0x30, 0x30, 0x20, 0x20, 0x60, 0x60, 0x40, 0x40, 0xC0, 0xC0, 0x00, /* @1995 ']' (4 pixels wide) */ // # # // # # // ################## // ################## 0xF0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xF0, 0x00, /* @2014 '^' (7 pixels wide) */ // # // #### // #### // # // #### // #### // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x44, 0x44, 0x6C, 0x28, 0x28, 0x38, 0x00, 0x00, /* @2033 '_' (11 pixels wide) */ // # // # // # // # // # // # // # // # // # // # // # 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2071 '`' (3 pixels wide) */ // # // ## // ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x60, 0xC0, 0x00, /* @2090 'a' (9 pixels wide) */ // #### # // ## ### ## // # # # // # # # // # # # // ## # ## // ######### // ######## // # 0x00, 0x00, 0x00, 0x00, 0x7B, 0xC7, 0x87, 0xC3, 0xC3, 0x7F, 0x03, 0xC3, 0x46, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2128 'b' (9 pixels wide) */ // ############## // ############## // # # // # # // # # // # # // ## ## // ######## // ###### 0x00, 0x00, 0x00, 0x00, 0xDE, 0xE3, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE3, 0xDE, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2166 'c' (8 pixels wide) */ // ###### // ######## // ## ## // # # // # # // # # // ## ## // ## ## 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0xC1, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2185 'd' (9 pixels wide) */ // ###### // ######## // ## ## // # # // # # // # # // # # // ############## // ############## 0x00, 0x00, 0x00, 0x00, 0x3D, 0x63, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x63, 0x3D, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @2223 'e' (9 pixels wide) */ // ###### // ######## // ## # ## // # # # // # # # // # # # // ## # ## // ## #### // # ### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0xC1, 0xC0, 0xC0, 0xFF, 0xC1, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2261 'f' (6 pixels wide) */ // # // # // ############# // ############## // # # // # # 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x1C, 0x00, /* @2280 'g' (9 pixels wide) */ // # ###### // ## ######## // ## ## ## // # # # // # # # // # # # // ## ## ## // ############# // ########### 0x3E, 0x63, 0xC1, 0x01, 0x3D, 0x63, 0xC3, 0xC1, 0xC1, 0xC1, 0xC1, 0xC3, 0x63, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2318 'h' (8 pixels wide) */ // ############## // ############## // # // # // # // # // ########## // ######### 0x00, 0x00, 0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xE3, 0xDE, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, /* @2337 'i' (2 pixels wide) */ // ########## ## // ########## ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, /* @2356 'j' (3 pixels wide) */ // # // ############## ## // ############# ## 0xC0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, /* @2375 'k' (8 pixels wide) */ // ############## // ############## // ## // ### // ### ## // ### ### // ## # // # 0x00, 0x00, 0x00, 0x00, 0xC3, 0xC6, 0xCC, 0xCC, 0xF8, 0xF0, 0xD8, 0xCC, 0xC4, 0xC6, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, /* @2394 'l' (2 pixels wide) */ // ############## // ############## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, /* @2413 'm' (14 pixels wide) */ // ########## // ########## // # // # // # // # // ########## // ######### // # // # // # // # // ########## // ######## 0x00, 0x00, 0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xE3, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x88, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2451 'n' (8 pixels wide) */ // ########## // ########## // # // # // # // # // ########## // ######### 0x00, 0x00, 0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xE3, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2470 'o' (9 pixels wide) */ // ###### // ######## // ## ## // # # // # # // # # // ## ## // ######## // ###### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2508 'p' (9 pixels wide) */ // ############## // ############## // # # // # # // # # // # # // ## ## // ######## // ###### 0xC0, 0xC0, 0xC0, 0xC0, 0xDE, 0xE3, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE3, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2546 'q' (9 pixels wide) */ // ###### // ######## // ## ## // # # // # # // # # // # # // ############## // ############## 0x01, 0x01, 0x01, 0x01, 0x3D, 0x63, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x63, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2584 'r' (5 pixels wide) */ // ########## // ########## // # // ## // ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xF8, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2603 's' (8 pixels wide) */ // ## ### // ## ##### // # # # // # # # // # ## # // # ## # // ## ## ## // #### ## 0x00, 0x00, 0x00, 0x00, 0x7E, 0xC3, 0x81, 0x03, 0x0F, 0x7C, 0xC0, 0xC1, 0xC3, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2622 't' (5 pixels wide) */ // # // ######### // ############ // # # // # # 0x00, 0x00, 0x00, 0x00, 0x38, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, /* @2641 'u' (8 pixels wide) */ // ######### // ########## // # // # // # // # // ########## // ########## 0x00, 0x00, 0x00, 0x00, 0x7B, 0xC7, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2660 'v' (9 pixels wide) */ // # // #### // ##### // ##### // # // ##### // ##### // #### // # 0x00, 0x00, 0x00, 0x00, 0x1C, 0x14, 0x14, 0x36, 0x36, 0x22, 0x63, 0x63, 0x41, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2698 'w' (13 pixels wide) */ // ## // ###### // ###### // # // ##### // ###### // # // ###### // ##### // ## // ##### // ###### // ## 0x00, 0x00, 0x00, 0x00, 0x38, 0x28, 0x28, 0x28, 0x6D, 0x65, 0x45, 0x45, 0xC5, 0xC7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xA0, 0xA0, 0xB0, 0x30, 0x10, 0x10, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2736 'x' (7 pixels wide) */ // ## ## // ### ### // ###### // ## // ###### // ### ### // ## ## 0x00, 0x00, 0x00, 0x00, 0x82, 0xC6, 0x6C, 0x6C, 0x38, 0x38, 0x28, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2755 'y' (9 pixels wide) */ // # // # #### // ## ##### // ## #### // #### // ##### // ##### // #### // # 0x60, 0x30, 0x18, 0x08, 0x0C, 0x1C, 0x14, 0x36, 0x36, 0x22, 0x63, 0x63, 0x41, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2793 'z' (7 pixels wide) */ // ## # // #### # // # ### # // # ### # // # ### # // # ### // # ## 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0, 0x60, 0x60, 0x30, 0x18, 0x18, 0x0C, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2812 '{' (6 pixels wide) */ // # // # // ######## ####### // ######## ####### // # # // # # 0x1C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0xC0, 0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x1C, 0x00, /* @2831 '|' (2 pixels wide) */ // ################## // ################## 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, /* @2850 '}' (6 pixels wide) */ // # # // # # // ######## ####### // ######## ####### // # // # 0xE0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x10, 0x0C, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xE0, 0x00, /* @2869 '~' (9 pixels wide) */ // # // # // # // # // # // ## // # // # // ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x8C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* Character descriptors for Liberation Sans 14pt */ /* { [Char width in bits], [Offset into liberationSans_14ptCharBitmaps in bytes] } */ static const FONT_CHAR_INFO PROGMEM liberationSans_14ptDescriptors[] = { {4, 0}, /* */ {2, 19}, /* ! */ {5, 38}, /* " */ {11, 57}, /* # */ {11, 95}, /* $ */ {15, 133}, /* % */ {12, 171}, /* & */ {2, 209}, /* ' */ {5, 228}, /* ( */ {5, 247}, /* ) */ {7, 266}, /* * */ {9, 285}, /* + */ {1, 323}, /* , */ {4, 342}, /* - */ {1, 361}, /* . */ {5, 380}, /* / */ {9, 399}, /* 0 */ {8, 437}, /* 1 */ {9, 456}, /* 2 */ {9, 494}, /* 3 */ {10, 532}, /* 4 */ {9, 570}, /* 5 */ {9, 608}, /* 6 */ {9, 646}, /* 7 */ {9, 684}, /* 8 */ {9, 722}, /* 9 */ {1, 760}, /* : */ {1, 779}, /* ; */ {9, 798}, /* < */ {9, 836}, /* = */ {9, 874}, /* > */ {9, 912}, /* ? */ {16, 950}, /* @ */ {13, 988}, /* A */ {10, 1026}, /* B */ {12, 1064}, /* C */ {11, 1102}, /* D */ {10, 1140}, /* E */ {9, 1178}, /* F */ {13, 1216}, /* G */ {11, 1254}, /* H */ {2, 1292}, /* I */ {9, 1311}, /* J */ {10, 1349}, /* K */ {8, 1387}, /* L */ {13, 1406}, /* M */ {11, 1444}, /* N */ {13, 1482}, /* O */ {10, 1520}, /* P */ {13, 1558}, /* Q */ {11, 1596}, /* R */ {11, 1634}, /* S */ {12, 1672}, /* T */ {11, 1710}, /* U */ {13, 1748}, /* V */ {19, 1786}, /* W */ {11, 1843}, /* X */ {10, 1881}, /* Y */ {10, 1919}, /* Z */ {4, 1957}, /* [ */ {5, 1976}, /* \ */ {4, 1995}, /* ] */ {7, 2014}, /* ^ */ {11, 2033}, /* _ */ {3, 2071}, /* ` */ {9, 2090}, /* a */ {9, 2128}, /* b */ {8, 2166}, /* c */ {9, 2185}, /* d */ {9, 2223}, /* e */ {6, 2261}, /* f */ {9, 2280}, /* g */ {8, 2318}, /* h */ {2, 2337}, /* i */ {3, 2356}, /* j */ {8, 2375}, /* k */ {2, 2394}, /* l */ {14, 2413}, /* m */ {8, 2451}, /* n */ {9, 2470}, /* o */ {9, 2508}, /* p */ {9, 2546}, /* q */ {5, 2584}, /* r */ {8, 2603}, /* s */ {5, 2622}, /* t */ {8, 2641}, /* u */ {9, 2660}, /* v */ {13, 2698}, /* w */ {7, 2736}, /* x */ {9, 2755}, /* y */ {7, 2793}, /* z */ {6, 2812}, /* { */ {2, 2831}, /* | */ {6, 2850}, /* } */ {9, 2869}, /* ~ */ }; /* Font information for Liberation Sans 14pt */ static const FONT_INFO liberationSans_14ptFontInfo = { 19, /* Character height */ ' ', /* Start character */ '~', /* End character */ liberationSans_14ptDescriptors, /* Character descriptor array */ liberationSans_14ptBitmaps, /* Character bitmap array */ }; /* ** Font data for Liberation Sans 16pt */ /* Character bitmaps for Liberation Sans 16pt */ static const unsigned char PROGMEM liberationSans_16ptBitmaps[] = { /* @0 ' ' (2 pixels wide) */ // // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @20 '!' (2 pixels wide) */ // ## ########## // ## ########## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, /* @40 '"' (5 pixels wide) */ // ##### // ##### // // ### // ##### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, 0xC8, 0xD8, 0xD8, 0xD8, 0x00, 0x00, /* @60 '#' (12 pixels wide) */ // # // # # # // ##### # // ###### // # ##### // # # // # # # // ##### # // ###### // # ##### // # # // # 0x00, 0x00, 0x00, 0x00, 0x63, 0x21, 0x21, 0x21, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x7F, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x80, 0x80, 0x80, 0x80, 0xF0, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, /* @100 '$' (12 pixels wide) */ // # // ### ### // ## ##### // ## ## ## // # # # // ################## // ################## // # ## # // # # ## // # ## ## // ##### # // ## 0x00, 0x00, 0x06, 0x06, 0x1F, 0x76, 0x66, 0xC6, 0x06, 0x06, 0x07, 0x1F, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1F, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x20, 0x30, 0x30, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x60, 0xC0, 0x80, 0x00, 0x00, /* @140 '%' (17 pixels wide) */ // ###### // ## ## // # # // # # # // ## ## ## // ### ###### // ## // ### // ## // ### // ## // ###### ### // ## ## ## // # # # // # # // ## ## // ###### 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x04, 0x06, 0x03, 0x01, 0x79, 0xCC, 0x84, 0x84, 0x84, 0x84, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x19, 0x10, 0x10, 0x10, 0x10, 0x99, 0xCF, 0x40, 0x60, 0x30, 0x10, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @200 '&' (13 pixels wide) */ // ##### // ## ### // ## ## ## // # ###### // # ### ## // # ### # # // ## ### # # // ### # ## // ### #### // ##### // # ### // # // # 0x00, 0x00, 0x00, 0x00, 0x3E, 0xE3, 0xC1, 0x83, 0xC6, 0xC6, 0x6C, 0x38, 0x1E, 0x11, 0x30, 0x30, 0x19, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xC0, 0xC0, 0xC0, 0x60, 0x20, 0x20, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, /* @240 ''' (2 pixels wide) */ // ##### // ##### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, /* @260 '(' (5 pixels wide) */ // ##### // ########### // #### #### // ## ## // ## ## 0x08, 0x18, 0x30, 0x20, 0x60, 0x60, 0x40, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x40, 0x60, 0x60, 0x20, 0x30, 0x18, 0x08, 0x00, /* @280 ')' (5 pixels wide) */ // ## ## // ## ## // #### #### // ########### // ##### 0x80, 0xC0, 0x60, 0x20, 0x30, 0x30, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, 0x20, 0x60, 0xC0, 0x80, 0x00, /* @300 '*' (6 pixels wide) */ // # // ## # // ##### // ##### // ## # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x48, 0x30, 0x78, 0xB4, 0x30, 0x30, 0x00, 0x00, /* @320 '+' (10 pixels wide) */ // # // # // # // # // ######### // ######### // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0xFF, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @360 ',' (2 pixels wide) */ // # ## // #### 0x00, 0x80, 0x40, 0x40, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @380 '-' (5 pixels wide) */ // ## // ## // ## // ## // ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @400 '.' (2 pixels wide) */ // ## // ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @420 '/' (6 pixels wide) */ // ## // ##### // ###### // ###### // ##### // ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x40, 0x60, 0x60, 0x20, 0x30, 0x30, 0x30, 0x10, 0x18, 0x18, 0x08, 0x0C, 0x0C, 0x00, /* @440 '0' (10 pixels wide) */ // ######## // ############ // # # // # # // # # // # # // # # // # # // ############ // ######## 0x00, 0x00, 0x00, 0x00, 0x1E, 0x61, 0x40, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x40, 0x61, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, /* @480 '1' (9 pixels wide) */ // # ## // # ## // # # // ############## // ############## // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x98, 0xD8, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @520 '2' (10 pixels wide) */ // ## # // ### ### // # ## # // # ## # // # ## # // # # # // # ## # // # ### ## // # ###### // # ## 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x60, 0x30, 0x18, 0x0E, 0x03, 0x01, 0x01, 0x00, 0xC0, 0x40, 0x61, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, /* @560 '3' (10 pixels wide) */ // ## ## // ### ### // ## ## // # # # // # # # // # # # // # # # // ## # # ## // ###### ##### // #### ## 0x00, 0x00, 0x00, 0x00, 0x3F, 0x61, 0xC0, 0xC0, 0x00, 0x00, 0x01, 0x1E, 0x01, 0x00, 0xC0, 0xC0, 0x61, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, /* @600 '4' (11 pixels wide) */ // # // ### // #### // # ## // # ## // # ### // # ### // # ## // ############## // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x60, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, /* @640 '5' (10 pixels wide) */ // ## ### // ### ####### // ## # # // # # # // # # # // # # # // # # # // ## ## # // ####### # // ##### 0x00, 0x00, 0x00, 0x00, 0x3F, 0x61, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xE1, 0xDF, 0xC0, 0x40, 0x40, 0x40, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, /* @680 '6' (10 pixels wide) */ // ###### // ########## // ## # ## // ## # ## // # # # // # # # // # # # // ## ## ## // ####### ## // ##### 0x00, 0x00, 0x00, 0x00, 0x1F, 0x31, 0x60, 0x40, 0xC0, 0xC0, 0xC0, 0xE1, 0xDF, 0xC0, 0x40, 0x60, 0x31, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, /* @720 '7' (10 pixels wide) */ // # // # // # // #### # // ####### # // #### # // #### # // ### # // ### // ## 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x08, 0x0C, 0x0C, 0x06, 0x06, 0x03, 0x03, 0x01, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, 0x00, /* @760 '8' (10 pixels wide) */ // #### ### // ###### ##### // ## # # ## // # # # // # # # // # # # // # # # // ## # # ## // ###### ##### // #### ### 0x00, 0x00, 0x00, 0x00, 0x3F, 0x61, 0xC0, 0xC0, 0xC0, 0xC0, 0x61, 0x1E, 0x61, 0xC0, 0xC0, 0xC0, 0x61, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, /* @800 '9' (10 pixels wide) */ // # ##### // ## ####### // ## ## ## // # # # // # # # // # # # // ## # # // ## # ## // ########### // ####### 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0xC1, 0x00, 0x00, 0x3E, 0x61, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0x61, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, /* @840 ':' (2 pixels wide) */ // ## ## // ## ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, /* @860 ';' (2 pixels wide) */ // # ## ## // #### ## 0x00, 0x80, 0x40, 0x40, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, /* @880 '<' (10 pixels wide) */ // ### // # # // ## ## // ## ## // ## ## // ## ## // # # // ## ## // # # // ## ## 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0x3C, 0xF0, 0x80, 0xF0, 0x3C, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x40, 0x00, 0x00, 0x00, /* @920 '=' (10 pixels wide) */ // # # // # # // # # // # # // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @960 '>' (10 pixels wide) */ // ## ## // # # // ## ## // # # // ## ## // ## ## // ## ## // ## ## // # # // ### 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0x3C, 0x0F, 0x03, 0x00, 0x03, 0x0F, 0x3C, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @1000 '?' (10 pixels wide) */ // ## // ### // # // # // ## ## # // ## ### # // ## # // # ## // ###### // #### 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x06, 0x03, 0x00, 0x00, 0xC0, 0xC0, 0x61, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, /* @1040 '@' (17 pixels wide) */ // ######## // ### ### // # ## // # ## # // ## ####### ## // # ## ### # // # # ## # // # # # # // # # # # // # # # # // # ## # # // # ######## # // # # ##### ## // ## # # # // ## ## // ### ### // ####### 0x00, 0x0F, 0x18, 0x60, 0x40, 0xC7, 0x8C, 0x88, 0x98, 0x98, 0x88, 0x8C, 0xCC, 0x46, 0x63, 0x20, 0x18, 0x0C, 0x03, 0x00, 0x00, 0xE0, 0x1C, 0x04, 0x00, 0x9E, 0x53, 0x31, 0x31, 0x10, 0x18, 0x18, 0x18, 0x28, 0xCD, 0x01, 0x03, 0x0E, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @1100 'A' (13 pixels wide) */ // # // #### // ##### // #### // # ##### // # #### // # ## // # #### // # ##### // #### // #### // #### // # 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x60, 0x60, 0x20, 0x3F, 0x10, 0x18, 0x18, 0x08, 0x0D, 0x0D, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x30, 0x30, 0x20, 0xE0, 0x40, 0xC0, 0xC0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, /* @1140 'B' (11 pixels wide) */ // ############## // ############## // # # # // # # # // # # # // # # # // # # # // # ## ## // # # ##### // ###### #### // #### 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC1, 0xC0, 0xC0, 0xC0, 0xC1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x60, 0x60, 0x60, 0xC0, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, /* @1180 'C' (13 pixels wide) */ // ###### // ########## // ### ### // ## # // ## ## // # # // # # // # # // # # // ## ## // # ## // ### ### // ## ## 0x00, 0x00, 0x00, 0x00, 0x0F, 0x38, 0x70, 0x60, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x60, 0x60, 0x38, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x70, 0xC0, 0x00, 0x00, /* @1220 'D' (12 pixels wide) */ // ############## // ############## // # # // # # // # # // # # // # # // ## ## // ## # // ### ### // ########## // ###### 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC1, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0x60, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, /* @1260 'E' (11 pixels wide) */ // ############## // ############## // # # # // # # # // # # # // # # # // # # # // # # # // # # # // # # # // # # 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, /* @1300 'F' (10 pixels wide) */ // ############## // ############## // # # // # # // # # // # # // # # // # # // # # // # # 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, /* @1340 'G' (13 pixels wide) */ // ###### // ########## // ### ### // # # // ## ## // # # // # # // # # # // # # # // # # ## // # # ## // ## # ### // ##### ## 0x00, 0x00, 0x00, 0x00, 0x0F, 0x38, 0x60, 0x60, 0xC0, 0xC0, 0xC1, 0xC0, 0xC0, 0xC0, 0x60, 0x60, 0x38, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x30, 0x18, 0x08, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x18, 0x38, 0x70, 0xC0, 0x00, 0x00, /* @1380 'H' (10 pixels wide) */ // ############## // ############## // # // # // # // # // # // # // ############## // ############## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, /* @1420 'I' (2 pixels wide) */ // ############## // ############## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, /* @1440 'J' (9 pixels wide) */ // # // ### // ### // # // # # // # # // ## # // ############# // ############ 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0x61, 0xC1, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, /* @1480 'K' (11 pixels wide) */ // ############## // ############## // ## // ## // #### // ### ## // ### ## // ### ## // ### ## // ### # // # 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC1, 0xC3, 0xC7, 0xC6, 0xEC, 0xF8, 0xD8, 0xCC, 0xC6, 0xC3, 0xC1, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x00, 0x00, /* @1520 'L' (9 pixels wide) */ // ############## // ############## // # // # // # // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @1560 'M' (13 pixels wide) */ // ############## // ## // #### // ##### // #### // ##### // ## // #### // ##### // #### // #### // ## // ############## 0x00, 0x00, 0x00, 0x00, 0x82, 0x87, 0x85, 0x85, 0x8D, 0x8C, 0x98, 0x98, 0x90, 0xB0, 0xB0, 0xA0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x88, 0x88, 0x88, 0xC8, 0xC8, 0x48, 0x68, 0x28, 0x28, 0x38, 0x18, 0x00, 0x00, /* @1600 'N' (10 pixels wide) */ // ############## // ### // ### // ### // ### // #### // ### // ### // ### // ############## 0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x81, 0x83, 0x86, 0x86, 0x8C, 0x8C, 0x98, 0x90, 0xB0, 0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, /* @1640 'O' (14 pixels wide) */ // ###### // ########## // ### ### // # # // ## ## // # # // # # // # # // # # // ## ## // # # // ### ### // ########## // ###### 0x00, 0x00, 0x00, 0x00, 0x0F, 0x38, 0x60, 0x60, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x60, 0x60, 0x38, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, 0x18, 0x18, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x18, 0x70, 0xC0, 0x00, 0x00, /* @1680 'P' (11 pixels wide) */ // ############## // ############## // # # // # # // # # // # # // # # // # # // ## ## // ###### // #### 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x60, 0x60, 0x60, 0xC0, 0x80, 0x00, 0x00, /* @1720 'Q' (14 pixels wide) */ // ###### // ########## // ### ### // # # // ## ## // # # // # # // #### # // ## # # // ## ## ## // # # # // # ### ### // ########## // ###### 0x00, 0x01, 0x01, 0x01, 0x0F, 0x38, 0x60, 0x60, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x60, 0x60, 0x38, 0x0F, 0x00, 0x00, 0x70, 0xC0, 0x80, 0x00, 0xC0, 0x70, 0x18, 0x18, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x18, 0x70, 0xC0, 0x00, 0x00, /* @1760 'R' (12 pixels wide) */ // ############## // ############## // # # // # # // # # // # # // ## # // ### # // ### ## ## // #### ###### // ## ###### // # 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC1, 0xC3, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x60, 0xC0, 0xC0, 0x80, 0x00, 0x80, 0xE0, 0x60, 0x60, 0x60, 0x60, 0xE0, 0x80, 0x00, 0x00, /* @1800 'S' (12 pixels wide) */ // ## // ### ##### // # ##### // ## ## ## // # # # // # # # // # ## # // # ## # // # # ## // # ## ## // ###### ### // #### 0x00, 0x00, 0x00, 0x00, 0x1F, 0x70, 0xC0, 0xC0, 0x00, 0x00, 0x03, 0x1F, 0x70, 0x60, 0x60, 0x60, 0x70, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x30, 0x30, 0x30, 0x70, 0xE0, 0x00, 0x00, 0x00, 0x20, 0x60, 0xE0, 0x80, 0x00, 0x00, /* @1840 'T' (12 pixels wide) */ // # // # // # // # // # // ############## // ############## // # // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, /* @1880 'U' (12 pixels wide) */ // ######### // ############ // ### // ## // # // # // # // # // ## // ### // ############ // ######### 0x00, 0x00, 0x00, 0x00, 0x1F, 0x30, 0x60, 0x60, 0x40, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x60, 0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, /* @1920 'V' (13 pixels wide) */ // # // #### // ##### // ##### // ##### // ##### // ## // ##### // ##### // ##### // ##### // #### // # 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x05, 0x0D, 0x0D, 0x18, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0x60, 0x60, 0x30, 0x30, 0x30, 0x18, 0x00, 0x00, /* @1960 'W' (21 pixels wide) */ // # // #### // ###### // ###### // ###### // ### // #### // ##### // ###### // ###### // ## // ###### // ###### // ##### // #### // ### // ###### // ####### // ###### // #### // # 0x00, 0x00, 0x00, 0x00, 0x06, 0x0E, 0x0F, 0x0B, 0x19, 0x19, 0x19, 0x30, 0x30, 0x30, 0x60, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x07, 0x06, 0x04, 0x8C, 0x8C, 0x88, 0xD8, 0xD8, 0xD8, 0x50, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0x40, 0x60, 0x60, 0x60, 0x30, 0x30, 0x30, 0x18, 0x00, 0x00, /* @2020 'X' (12 pixels wide) */ // # # // ### ## // ### ## // ## ### // ### ### // #### // ### // ### ### // ### ### // ### ### // ### ## // # # 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60, 0x60, 0x30, 0x19, 0x0D, 0x0F, 0x06, 0x0F, 0x19, 0x19, 0x30, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x60, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x60, 0x30, 0x00, 0x00, /* @2060 'Y' (12 pixels wide) */ // ## // ### // ### // ### // ### // ######## // ######## // ### // ### // ### // ### // ## 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0F, 0x19, 0x19, 0x30, 0x60, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0x60, 0x70, 0x30, 0x00, 0x00, /* @2100 'Z' (11 pixels wide) */ // ## # // ### # // # ### # // # ### # // # ## # // # ### # // # ### # // # ## # // # #### // # ### // # # 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x60, 0x30, 0x30, 0x18, 0x0C, 0x06, 0x06, 0x03, 0x01, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xE0, 0x00, 0x00, /* @2140 '[' (4 pixels wide) */ // ################### // # # // # # // # # 0xF0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF0, 0x00, /* @2160 '\' (6 pixels wide) */ // ## // ##### // ###### // ###### // ##### // ## 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x08, 0x18, 0x18, 0x10, 0x30, 0x30, 0x30, 0x20, 0x60, 0x60, 0x40, 0xC0, 0xC0, 0x00, /* @2180 ']' (4 pixels wide) */ // # # // # # // # # // ################### 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x00, /* @2200 '^' (8 pixels wide) */ // # // #### // ##### // ### // ### // ##### // #### // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x42, 0x66, 0x66, 0x24, 0x3C, 0x3C, 0x18, 0x00, 0x00, /* @2220 '_' (12 pixels wide) */ // # // # // # // # // # // # // # // # // # // # // # // # 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2260 '`' (4 pixels wide) */ // # // # // ## // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0xE0, 0x00, /* @2280 'a' (11 pixels wide) */ // #### # // ###### ## // # ## ## // # # # // # # # // # # # // # # # // ######### // ########## // # // # 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC2, 0xC1, 0xC1, 0xC1, 0x61, 0x3F, 0x01, 0xC1, 0x61, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2320 'b' (9 pixels wide) */ // ############### // ############### // ## ## // # # // # # // # # // ## ## // ######### // ####### 0x00, 0x00, 0x00, 0x00, 0xDE, 0xE3, 0xE1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE1, 0xE3, 0xDE, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2360 'c' (9 pixels wide) */ // ##### // ######### // ## ## // # # // # # // # # // # # // ## ## // ## ## 0x00, 0x00, 0x00, 0x00, 0x3E, 0x61, 0x41, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x41, 0x61, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2400 'd' (9 pixels wide) */ // ####### // ######### // ## ## // # # // # # // # # // ## ## // ############### // ############### 0x00, 0x00, 0x00, 0x00, 0x3D, 0x63, 0xC3, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC3, 0x63, 0x3D, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, /* @2440 'e' (10 pixels wide) */ // ###### // ######### // # # ## // # # # // # # # // # # # // # # # // ## # ## // ## ##### // # ### 0x00, 0x00, 0x00, 0x00, 0x1F, 0x61, 0x40, 0xC0, 0xC0, 0xFF, 0xC0, 0xC0, 0xC0, 0x61, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2480 'f' (6 pixels wide) */ // # // # // ############## // ############### // # # // # # 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x1C, 0x00, /* @2500 'g' (9 pixels wide) */ // # ####### // ## ######### // ## ## ## // # # # // # # # // # # # // ## # ## // ############## // ############ 0x3E, 0x63, 0xC1, 0x01, 0x39, 0x65, 0xC3, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC3, 0x63, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2540 'h' (9 pixels wide) */ // ############### // ############### // ## // # // # // # // ## // ########## // ######### 0x00, 0x00, 0x00, 0x00, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE1, 0xE3, 0xDE, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2580 'i' (2 pixels wide) */ // ########### ## // ########### ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, /* @2600 'j' (4 pixels wide) */ // # // # // ############### ## // ############## ## 0xE0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, /* @2620 'k' (9 pixels wide) */ // ############### // ############### // ## // ## // ##### // ### ### // ### ### // ## # // # 0x00, 0x00, 0x00, 0x00, 0xC1, 0xC3, 0xC6, 0xCE, 0xEC, 0xF8, 0xD8, 0xCC, 0xC6, 0xC6, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2660 'l' (2 pixels wide) */ // ############### // ############### 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, /* @2680 'm' (14 pixels wide) */ // ########### // ########### // # // # // # // # // ########### // ########## // # // # // # // ## // ########### // ######### 0x00, 0x00, 0x00, 0x00, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xE3, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x98, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2720 'n' (9 pixels wide) */ // ########### // ########### // ## // # // # // # // ## // ########### // ######### 0x00, 0x00, 0x00, 0x00, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE1, 0xE3, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2760 'o' (10 pixels wide) */ // ####### // ######### // ## ## // # # // # # // # # // # # // ## ## // ######### // ####### 0x00, 0x00, 0x00, 0x00, 0x3F, 0x61, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x61, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2800 'p' (9 pixels wide) */ // ############### // ############### // ## ## // # # // # # // # # // ## ## // ######### // ####### 0xC0, 0xC0, 0xC0, 0xC0, 0xDE, 0xE3, 0xE1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE1, 0xE3, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2840 'q' (9 pixels wide) */ // ####### // ######### // ## ## // # # // # # // # # // ## ## // ############### // ############### 0x01, 0x01, 0x01, 0x01, 0x3D, 0x63, 0xC3, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC3, 0x63, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2880 'r' (6 pixels wide) */ // ########### // ########### // ## // ## // ## // ## 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xDC, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2900 's' (9 pixels wide) */ // ## ### // # #### // # ## # // # ## # // # ## # // # # # // # ## ## // ##### ## // #### ## 0x00, 0x00, 0x00, 0x00, 0x3E, 0xC1, 0x81, 0x01, 0x03, 0x3F, 0x78, 0xC0, 0xC1, 0xC3, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @2940 't' (6 pixels wide) */ // # // # // ############# // ############# // # # // # # 0x00, 0x00, 0x00, 0x00, 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0x00, 0x00, /* @2960 'u' (9 pixels wide) */ // ######### // ########## // ## // # // # // # // ## // ########### // ########### 0x00, 0x00, 0x00, 0x00, 0x3D, 0x63, 0xC3, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* @3000 'v' (11 pixels wide) */ // # // #### // ##### // ##### // #### // ## // ##### // ##### // ##### // #### // # 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x1B, 0x1B, 0x13, 0x31, 0x31, 0x60, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, /* @3040 'w' (15 pixels wide) */ // ## // ###### // ###### // #### // ### // ###### // ###### // ## // ###### // ###### // ### // #### // ###### // ##### // ## 0x00, 0x00, 0x00, 0x00, 0x18, 0x1C, 0x3C, 0x34, 0x24, 0x66, 0x66, 0x62, 0x42, 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x70, 0x78, 0x58, 0x48, 0xC8, 0xCC, 0x8C, 0x84, 0x86, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, /* @3080 'x' (8 pixels wide) */ // ## ## // ### ### // ### ### // #### // #### // ### ### // ### ### // ## ## 0x00, 0x00, 0x00, 0x00, 0xC3, 0xC3, 0x66, 0x24, 0x3C, 0x18, 0x3C, 0x3C, 0x66, 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, /* @3100 'y' (11 pixels wide) */ // # // # ### // # ##### // ## #### // ### #### // #### // #### // #### // ##### // #### // # 0x70, 0x18, 0x0C, 0x0C, 0x06, 0x0E, 0x0A, 0x1B, 0x19, 0x31, 0x31, 0x20, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, /* @3140 'z' (7 pixels wide) */ // ## # // #### # // # #### # // # #### # // # ##### // # #### // # ## 0x00, 0x00, 0x00, 0x00, 0xFE, 0xC0, 0x60, 0x60, 0x30, 0x30, 0x18, 0x1C, 0x0C, 0x0E, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, /* @3160 '{' (7 pixels wide) */ // # // # // ## ## // ######## ######## // ## ## // # # // # # 0x0E, 0x18, 0x10, 0x10, 0x10, 0x10, 0x10, 0x30, 0x30, 0xC0, 0x30, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x18, 0x0E, 0x00, /* @3180 '|' (2 pixels wide) */ // ################### // ################### 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, /* @3200 '}' (7 pixels wide) */ // # # // # # // ## ## // ######## ######## // ## ## // # // # 0xE0, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x06, 0x18, 0x18, 0x10, 0x10, 0x10, 0x10, 0x10, 0x30, 0xE0, 0x00, /* @3220 '~' (10 pixels wide) */ // # // # // # // # // # // # // # // # // # // # 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x8C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* Character descriptors for Liberation Sans 16pt */ /* { [Char width in bits], [Offset into liberationSans_16ptCharBitmaps in bytes] } */ static const FONT_CHAR_INFO PROGMEM liberationSans_16ptDescriptors[] = { {2, 0}, /* */ {2, 20}, /* ! */ {5, 40}, /* " */ {12, 60}, /* # */ {12, 100}, /* $ */ {17, 140}, /* % */ {13, 200}, /* & */ {2, 240}, /* ' */ {5, 260}, /* ( */ {5, 280}, /* ) */ {6, 300}, /* * */ {10, 320}, /* + */ {2, 360}, /* , */ {5, 380}, /* - */ {2, 400}, /* . */ {6, 420}, /* / */ {10, 440}, /* 0 */ {9, 480}, /* 1 */ {10, 520}, /* 2 */ {10, 560}, /* 3 */ {11, 600}, /* 4 */ {10, 640}, /* 5 */ {10, 680}, /* 6 */ {10, 720}, /* 7 */ {10, 760}, /* 8 */ {10, 800}, /* 9 */ {2, 840}, /* : */ {2, 860}, /* ; */ {10, 880}, /* < */ {10, 920}, /* = */ {10, 960}, /* > */ {10, 1000}, /* ? */ {17, 1040}, /* @ */ {13, 1100}, /* A */ {11, 1140}, /* B */ {13, 1180}, /* C */ {12, 1220}, /* D */ {11, 1260}, /* E */ {10, 1300}, /* F */ {13, 1340}, /* G */ {10, 1380}, /* H */ {2, 1420}, /* I */ {9, 1440}, /* J */ {11, 1480}, /* K */ {9, 1520}, /* L */ {13, 1560}, /* M */ {10, 1600}, /* N */ {14, 1640}, /* O */ {11, 1680}, /* P */ {14, 1720}, /* Q */ {12, 1760}, /* R */ {12, 1800}, /* S */ {12, 1840}, /* T */ {12, 1880}, /* U */ {13, 1920}, /* V */ {21, 1960}, /* W */ {12, 2020}, /* X */ {12, 2060}, /* Y */ {11, 2100}, /* Z */ {4, 2140}, /* [ */ {6, 2160}, /* \ */ {4, 2180}, /* ] */ {8, 2200}, /* ^ */ {12, 2220}, /* _ */ {4, 2260}, /* ` */ {11, 2280}, /* a */ {9, 2320}, /* b */ {9, 2360}, /* c */ {9, 2400}, /* d */ {10, 2440}, /* e */ {6, 2480}, /* f */ {9, 2500}, /* g */ {9, 2540}, /* h */ {2, 2580}, /* i */ {4, 2600}, /* j */ {9, 2620}, /* k */ {2, 2660}, /* l */ {14, 2680}, /* m */ {9, 2720}, /* n */ {10, 2760}, /* o */ {9, 2800}, /* p */ {9, 2840}, /* q */ {6, 2880}, /* r */ {9, 2900}, /* s */ {6, 2940}, /* t */ {9, 2960}, /* u */ {11, 3000}, /* v */ {15, 3040}, /* w */ {8, 3080}, /* x */ {11, 3100}, /* y */ {7, 3140}, /* z */ {7, 3160}, /* { */ {2, 3180}, /* | */ {7, 3200}, /* } */ {10, 3220}, /* ~ */ }; /* Font information for Liberation Sans 16pt */ static const FONT_INFO liberationSans_16ptFontInfo = { 20, /* Character height */ ' ', /* Start character */ '~', /* End character */ liberationSans_16ptDescriptors, /* Character descriptor array */ liberationSans_16ptBitmaps, /* Character bitmap array */ }; /* ** Font data for Liberation Sans 22pt */ /* Character bitmaps for Liberation Sans 22pt */ static const unsigned char PROGMEM liberationSans_22ptBitmaps[] = { /* @0 '0' (14 pixels wide) */ // ######## // ############## // ################ // ### ### // ### ### // ## ## // ## ## // ## ## // ## ## // ### ### // #### ### // ################ // ############## // ######## 0x0F, 0x1F, 0x38, 0x70, 0x60, 0x60, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0x60, 0x60, 0x70, 0x38, 0x1F, 0x0F, 0xC0, 0xE0, 0x70, 0x38, 0x38, 0x18, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x18, 0x18, 0x38, 0x70, 0xE0, 0xC0, /* @40 '1' (13 pixels wide) */ // ## // ## ## // ## ### // ## ### // ## ## // #################### // #################### // #################### // ## // ## // ## // ## // ## 0xFF, 0xFF, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x67, 0x77, 0x3F, 0x1F, 0x07, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @80 '2' (14 pixels wide) */ // ## // #### ## // ##### #### // ###### ### // ## ### ### // ## ### ## // ## ### ## // ## ## ## // ## ## ## // ## ### ### // ## #### ### // ## ######### // ## ###### // ## 0xFF, 0xFF, 0x70, 0x70, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x38, 0x3F, 0x0F, 0xFC, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0x70, 0x30, 0x38, 0x18, 0x18, 0x18, 0x38, 0x78, 0xF0, 0xC0, /* @120 '3' (14 pixels wide) */ // # // #### ### // ##### #### // ## ### // ### ### // ## ## ## // ## ## ## // ## ## ## // ## ## ## // ### #### ### // ## ### ### #### // ######## ######## // ####### ###### // ### 0x0F, 0x3F, 0x78, 0x60, 0xE0, 0x60, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x78, 0x3F, 0x0F, 0xC0, 0xF0, 0x78, 0x18, 0x1C, 0x1C, 0x1C, 0x38, 0x78, 0xE0, 0xC0, 0x70, 0x38, 0x38, 0x18, 0x38, 0x38, 0x78, 0xF0, 0xC0, /* @160 '4' (14 pixels wide) */ // ### // ##### // ## ### // ## ### // ## #### // ## ### // ## #### // ## ### // ## #### // #################### // #################### // ## // ## // ## 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0x60, 0x70, 0x38, 0x18, 0x0C, 0x0E, 0x06, 0x03, 0x03, 0x01, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0xFC, 0xFC, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xE0, 0xE0, 0xE0, 0xE0, /* @200 '5' (14 pixels wide) */ // # // ### ########## // #### ########## // ## ## ###### // ### ## ## // ## ## ## // ## ## ## // ## ## ## // ## ## ## // ### ### ## // ### ### ## // ########### ## // ######### ## // ##### 0x0F, 0x3F, 0x78, 0x60, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7F, 0x67, 0x60, 0x70, 0x70, 0x70, 0x70, 0x7F, 0x7F, 0xC0, 0xF0, 0x78, 0x38, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x38, 0x78, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, /* @240 '6' (14 pixels wide) */ // ### // ############ // ################ // #### ## ##### // ## ## ## // ## ## ### // ## ## ## // ## ## ## // ## ## ## // ### ### ### // ### ### ### // ########### ### // ######### ## // #### 0x07, 0x1F, 0x38, 0x30, 0x70, 0x60, 0x60, 0x60, 0xE0, 0xF0, 0xF8, 0x6F, 0x67, 0x60, 0x70, 0x70, 0x30, 0x3C, 0x1F, 0x07, 0xC0, 0xF0, 0x78, 0x38, 0x18, 0x1C, 0x1C, 0x1C, 0x1C, 0x38, 0x78, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x38, 0x78, 0xF0, 0xC0, /* @280 '7' (14 pixels wide) */ // ## // ## // ## // ## // #### ## // ######## ## // ########## ## // ###### ## // ##### ## // ##### ## // #### ## // ##### // #### // ## 0x0E, 0x0E, 0x0E, 0x0E, 0x06, 0x06, 0x07, 0x07, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xE0, 0x60, 0x70, 0x38, 0x18, 0xFC, 0xFC, /* @320 '8' (14 pixels wide) */ // ### // ####### ###### // ######## ######## // ## ##### ### // ### #### ### // ## ## ## // ## ## ## // ## ## ## // ## ## ## // ## #### ### // ## ##### ### // ######## ######## // ####### ###### // ### 0x0F, 0x3F, 0x78, 0x60, 0xE0, 0xE0, 0xE0, 0x60, 0x78, 0x1F, 0x1F, 0x38, 0x70, 0x60, 0x60, 0x60, 0x70, 0x78, 0x3F, 0x0F, 0xC0, 0xF0, 0x38, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x78, 0xE0, 0xE0, 0x70, 0x38, 0x18, 0x18, 0x18, 0x38, 0x78, 0xF0, 0xC0, /* @360 '9' (14 pixels wide) */ // ### // ## ######### // ### ########### // ### ### ### // ### ### ### // ## ## ## // ## ## ## // ## ## ## // ### ## ## // ## ## ### // #### ## #### // ################ // ############# // ##### 0x0F, 0x3F, 0x78, 0x70, 0x00, 0x00, 0x00, 0x0F, 0x3F, 0x78, 0x70, 0x60, 0xE0, 0xE0, 0xE0, 0x60, 0x70, 0x78, 0x3F, 0x0F, 0x80, 0xE0, 0xF0, 0x30, 0x38, 0x18, 0x18, 0x98, 0xDC, 0x7C, 0x3C, 0x1C, 0x1C, 0x18, 0x18, 0x38, 0x38, 0x70, 0xE0, 0xC0, /* @400 ':' (2 pixels wide) */ // ### ### // ### ### 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, }; /* Character descriptors for Liberation Sans 22pt */ /* { [Char width in bits], [Offset into liberationSans_22ptCharBitmaps in bytes] } */ static const FONT_CHAR_INFO PROGMEM liberationSans_22ptDescriptors[] = { {14, 0}, /* 0 */ {13, 40}, /* 1 */ {14, 80}, /* 2 */ {14, 120}, /* 3 */ {14, 160}, /* 4 */ {14, 200}, /* 5 */ {14, 240}, /* 6 */ {14, 280}, /* 7 */ {14, 320}, /* 8 */ {14, 360}, /* 9 */ {2, 400}, /* : */ }; /* Font information for Liberation Sans 22pt */ static const FONT_INFO liberationSans_22ptFontInfo = { 20, /* Character height */ '0', /* Start character */ ':', /* End character */ liberationSans_22ptDescriptors, /* Character descriptor array */ liberationSans_22ptBitmaps, /* Character bitmap array */ };
30.758121
121
0.332189
146cfb1aab0afb036fd9f774ed8323c9848de776
204
ts
TypeScript
src/types/simple-readable-stream.ts
Originate/node-text-stream-search
80456929c97e99652448c7a62bec35e7ec4c6629
[ "ISC" ]
3
2018-02-09T12:02:55.000Z
2019-02-06T16:48:26.000Z
src/types/simple-readable-stream.ts
Originate/node-text-stream-search
80456929c97e99652448c7a62bec35e7ec4c6629
[ "ISC" ]
7
2016-02-16T01:02:14.000Z
2018-11-15T10:42:15.000Z
src/types/simple-readable-stream.ts
kevgo/node-text-stream-search
2b81b3b793bfb7541b0da915172528f1af870b30
[ "0BSD" ]
null
null
null
/** * SimpleReadableStream describes the API that this library uses * on the streams it consumes. */ export interface SimpleReadableStream { on(eventName: string, cb: (data: Buffer) => void): void }
25.5
64
0.72549
388604f18ae0c77974489811a7fb0bc3fcdf6cc6
975
php
PHP
database/migrations/2022_03_10_000932_create_channels_table.php
floaeza/boffice
3c4fe3af3cd1500ef8be88293fa693c981d14382
[ "MIT" ]
null
null
null
database/migrations/2022_03_10_000932_create_channels_table.php
floaeza/boffice
3c4fe3af3cd1500ef8be88293fa693c981d14382
[ "MIT" ]
null
null
null
database/migrations/2022_03_10_000932_create_channels_table.php
floaeza/boffice
3c4fe3af3cd1500ef8be88293fa693c981d14382
[ "MIT" ]
null
null
null
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('channels', function (Blueprint $table) { $table->id(); $table->char('name', 20); $table->char('abbreviation',20); $table->text('description'); $table->unsignedBigInteger('station_id'); $table->foreign('station_id')->references('id')->on('stations'); $table->unsignedBigInteger('channel_data_id'); $table->foreign('channel_data_id')->references('id')->on('channel_data'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('channels'); } };
25
85
0.562051
db81baf7d084d750c7c68d0420777623db59be12
1,476
php
PHP
resources/views/customers/form.blade.php
muhtarudinsiregar/laravel-happy
c986e35588520668f75b236697f60cb2d10b15c5
[ "MIT" ]
null
null
null
resources/views/customers/form.blade.php
muhtarudinsiregar/laravel-happy
c986e35588520668f75b236697f60cb2d10b15c5
[ "MIT" ]
5
2021-03-10T01:21:07.000Z
2022-02-26T21:03:39.000Z
resources/views/customers/form.blade.php
muhtarudinsiregar/laravel-happy
c986e35588520668f75b236697f60cb2d10b15c5
[ "MIT" ]
null
null
null
<div class="form-group pb-2"> <label for="">Name</label> <input type="text" name="name" placeholder="Fullname" class="form-control" value="{{ old('name')?? $customer->name }}"> <div class="text-danger">{{ $errors->first('name') }}</div> </div> <div class="form-group pb-2"> <label for="">Email</label> <input type="text" name="email" placeholder="Email" class="form-control" value="{{ old('email')?? $customer->email }}"> <div class="text-danger">{{ $errors->first('email') }}</div> </div> <div class="form-group"> <label for="company_id">Companies</label> <div class="text-danger">{{ $errors->first('company_id') }}</div> <select name="company_id" class="form-control" id="company_id"> @foreach ($companies as $company) <option value="{{$company->id}}" {{ $company->id === $customer->company_id? 'selected': '' }}> {{$company->name}}</option> @endforeach </select> </div> <div class="form-group"> <label for="">Status</label> <div class="text-danger">{{ $errors->first('active') }}</div> <select name="active" class="form-control" id="active"> <option value="" disabled>Select Customer status</option> @foreach ($customer->activeOption() as $activeOptionKey => $activeOptionValue) <option value="1" {{ $customer->active == $activeOptionValue? "selected": "" }}>{{ $activeOptionValue }} </option> @endforeach </select> </div>
42.171429
112
0.597561
815f4e8a2112d28064aaeb4e0411d314e0fceffa
463
lua
Lua
entities/FBullet.lua
JunoNgx/p8wonyun
e9ba60d509ee94fafe415dae8d751e07dfa1da2a
[ "MIT" ]
4
2020-06-28T10:21:35.000Z
2020-10-31T13:59:11.000Z
entities/FBullet.lua
JunoNgx/p8wonyun
e9ba60d509ee94fafe415dae8d751e07dfa1da2a
[ "MIT" ]
null
null
null
entities/FBullet.lua
JunoNgx/p8wonyun
e9ba60d509ee94fafe415dae8d751e07dfa1da2a
[ "MIT" ]
1
2020-09-14T02:45:16.000Z
2020-09-14T02:45:16.000Z
-- friendly bullet function FBullet(_x, _y) add(world, { id = { class = "bullet", subclass = "fbullet" }, pos = { x=_x, y=_y }, vel = { x=0, y=C.FBULLET_SPEED }, box = { w = 5, h = 6 }, outOfBoundsDestroy = true, drawTag = "projectile", draw = function(self) spr(19, self.pos.x, self.pos.y, 1, 1) end }) end
17.148148
40
0.408207
e1f8ab48bb772f16ec66f04ac0fcd398347f0e73
4,367
rb
Ruby
tests/units/test_index_ops.rb
naveenmora/ruby-git
a6b776787c129d094fa67ef2671c9da9333d83c1
[ "MIT" ]
null
null
null
tests/units/test_index_ops.rb
naveenmora/ruby-git
a6b776787c129d094fa67ef2671c9da9333d83c1
[ "MIT" ]
null
null
null
tests/units/test_index_ops.rb
naveenmora/ruby-git
a6b776787c129d094fa67ef2671c9da9333d83c1
[ "MIT" ]
null
null
null
#!/usr/bin/env ruby require_relative '../test_helper' class TestIndexOps < Test::Unit::TestCase def setup set_file_paths @git = Git.open(@wdir) end def test_add in_temp_dir do |path| g = Git.clone(@wbare, 'new') Dir.chdir('new') do assert_equal('100644', g.status['example.txt'].mode_index) new_file('test-file', 'blahblahblah') assert(g.status.untracked.assoc('test-file')) g.add assert(g.status.added.assoc('test-file')) assert(!g.status.untracked.assoc('test-file')) assert(!g.status.changed.assoc('example.txt')) new_file('example.txt', 'hahahaha') assert(g.status.changed.assoc('example.txt')) g.add assert(g.status.changed.assoc('example.txt')) g.commit('my message') assert(!g.status.changed.assoc('example.txt')) assert(!g.status.added.assoc('test-file')) assert(!g.status.untracked.assoc('test-file')) assert_equal('hahahaha', g.status['example.txt'].blob.contents) end end end def test_clean in_temp_dir do |path| g = Git.clone(@wbare, 'clean_me') Dir.chdir('clean_me') do new_file('test-file', 'blahblahbal') new_file('ignored_file', 'ignored file contents') new_file('.gitignore', 'ignored_file') g.add g.commit("first commit") new_file('file-to-clean', 'blablahbla') FileUtils.mkdir_p("dir_to_clean") Dir.chdir('dir_to_clean') do new_file('clean-me-too', 'blablahbla') end assert(File.exists?('file-to-clean')) assert(File.exists?('dir_to_clean')) assert(File.exists?('ignored_file')) g.clean(:force => true) assert(!File.exists?('file-to-clean')) assert(File.exists?('dir_to_clean')) assert(File.exists?('ignored_file')) new_file('file-to-clean', 'blablahbla') g.clean(:force => true, :d => true) assert(!File.exists?('file-to-clean')) assert(!File.exists?('dir_to_clean')) assert(File.exists?('ignored_file')) g.clean(:force => true, :x => true) assert(!File.exists?('ignored_file')) end end end def test_revert in_temp_dir do |path| g = Git.clone(@wbare, 'new') Dir.chdir('new') do new_file('test-file', 'blahblahbal') g.add g.commit("first commit") first_commit = g.gcommit('HEAD') new_file('test-file2', 'blablahbla') g.add g.commit("second-commit") g.gcommit('HEAD') commits = g.log(1e4).count g.revert(first_commit.sha) assert_equal(commits + 1, g.log(1e4).count) assert(!File.exists?('test-file2')) end end end def test_add_array in_temp_dir do |path| g = Git.clone(@wbare, 'new') Dir.chdir('new') do new_file('test-file1', 'blahblahblah1') new_file('test-file2', 'blahblahblah2') assert(g.status.untracked.assoc('test-file1')) g.add(['test-file1', 'test-file2']) assert(g.status.added.assoc('test-file1')) assert(g.status.added.assoc('test-file1')) assert(!g.status.untracked.assoc('test-file1')) g.commit('my message') assert(!g.status.added.assoc('test-file1')) assert(!g.status.untracked.assoc('test-file1')) assert_equal('blahblahblah1', g.status['test-file1'].blob.contents) end end end def test_remove in_temp_dir do |path| g = Git.clone(@wbare, 'remove_test') Dir.chdir('remove_test') do assert(g.status['example.txt']) g.remove('example.txt') assert(g.status.deleted.assoc('example.txt')) g.commit('deleted file') assert(!g.status['example.txt']) end end end def test_reset in_temp_dir do |path| g = Git.clone(@wbare, 'reset_test') Dir.chdir('reset_test') do new_file('test-file1', 'blahblahblah1') new_file('test-file2', 'blahblahblah2') assert(g.status.untracked.assoc('test-file1')) g.add(['test-file1', 'test-file2']) assert(!g.status.untracked.assoc('test-file1')) g.reset assert(g.status.untracked.assoc('test-file1')) assert(!g.status.added.assoc('test-file1')) end end end end
27.465409
75
0.588963
67794e254228cbae8a7e348e6e1f4dc08a2a0dad
1,799
sql
SQL
node_employees.sql
srmishra/node-mysql-employee-crud
a0eb81ea8ac7ad559bf28802b2899617c06ad177
[ "MIT" ]
null
null
null
node_employees.sql
srmishra/node-mysql-employee-crud
a0eb81ea8ac7ad559bf28802b2899617c06ad177
[ "MIT" ]
null
null
null
node_employees.sql
srmishra/node-mysql-employee-crud
a0eb81ea8ac7ad559bf28802b2899617c06ad177
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Sep 28, 2016 at 04:23 PM -- Server version: 10.1.8-MariaDB -- PHP Version: 5.6.14 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `node_employees` -- -- -------------------------------------------------------- -- -- Table structure for table `employees` -- CREATE TABLE `employees` ( `id` int(11) NOT NULL, `name` varchar(50) DEFAULT NULL, `email` varchar(50) DEFAULT NULL, `phone` varchar(15) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `employees` -- INSERT INTO `employees` (`id`, `name`, `email`, `phone`) VALUES (1, 'Super Admin', 'sadmin@gmail.com', '1234567890'), (2, 'admin', 'admin@gmail.com', '123456789'), (3, 'manager', 'manager@gmail.com', '12345678'), (4, 'staff', 'staff@gmail.com', '12345890'), (5, 'Test Employee1', 'emp1@gmail.com', '12121212'), (7, 'Test Employee 3', 'emp3@gmail.com', '123456546'), (8, 'Test Employee 4', 'emp4@gmail.com', '123456'); -- -- Indexes for dumped tables -- -- -- Indexes for table `employees` -- ALTER TABLE `employees` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `employees` -- ALTER TABLE `employees` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
25.338028
67
0.667037
ea8b71c5e4d0280138c7a5e60fe052c983dac2e6
640
dart
Dart
DostiPak/lib/widgets/loading_card.dart
ABDULKARIMALBAIK/DostiPak
823ba14db1821ff2c51e5f571346b4dee73efa69
[ "MIT" ]
8
2022-02-07T07:28:39.000Z
2022-03-26T01:05:32.000Z
DostiPak/lib/widgets/loading_card.dart
Van-Lang-University/Dating-App
823ba14db1821ff2c51e5f571346b4dee73efa69
[ "MIT" ]
1
2022-03-13T19:28:10.000Z
2022-03-26T01:08:29.000Z
DostiPak/lib/widgets/loading_card.dart
Van-Lang-University/Dating-App
823ba14db1821ff2c51e5f571346b4dee73efa69
[ "MIT" ]
3
2022-02-07T07:28:39.000Z
2022-02-08T20:23:00.000Z
import 'package:flutter/material.dart'; import 'package:rishtpak/widgets/default_card_border.dart'; import 'package:shimmer/shimmer.dart'; class LoadingCard extends StatelessWidget { final double? iconSize; const LoadingCard({this.iconSize}); @override Widget build(BuildContext context) { return Card( color: Colors.grey[200], clipBehavior: Clip.antiAlias, shape: defaultCardBorder(), child: Shimmer.fromColors( child: Icon(Icons.favorite_border, size: iconSize ?? 150), baseColor: Colors.grey.withAlpha(70), highlightColor: Theme.of(context).accentColor), ); } }
27.826087
68
0.698438
b04b23ef95ebcf76239af5412f5ebe44fc0db15a
472
sql
SQL
pargres/src/pl/plpython/sql/plpython_error.sql
mzym/thesis
4099fbfc6ccf82acd86001aeb8202dafe8fb499f
[ "MIT" ]
450
2015-09-05T09:12:51.000Z
2018-08-30T01:45:36.000Z
pargres/src/pl/plpython/sql/plpython_error.sql
mzym/thesis
4099fbfc6ccf82acd86001aeb8202dafe8fb499f
[ "MIT" ]
1,274
2015-09-22T20:06:16.000Z
2018-08-31T22:14:00.000Z
pargres/src/pl/plpython/sql/plpython_error.sql
mzym/thesis
4099fbfc6ccf82acd86001aeb8202dafe8fb499f
[ "MIT" ]
278
2015-09-21T19:15:06.000Z
2018-08-31T00:36:51.000Z
-- test error handling, i forgot to restore Warn_restart in -- the trigger handler once. the errors and subsequent core dump were -- interesting. SELECT invalid_type_uncaught('rick'); SELECT invalid_type_caught('rick'); SELECT invalid_type_reraised('rick'); SELECT valid_type('rick'); -- -- Test Unicode error handling. -- SELECT unicode_return_error(); INSERT INTO unicode_test (testvalue) VALUES ('test'); SELECT unicode_plan_error1(); SELECT unicode_plan_error2();
24.842105
69
0.773305
af83923c9100dc6ae4a0fe867d6f85a13ad53bef
2,396
py
Python
week_two_quiz.py
Ronlin1/cit_quiz_two
afb9cd676b833caf7f9f65a16ba8c857d6d72b6b
[ "MIT" ]
null
null
null
week_two_quiz.py
Ronlin1/cit_quiz_two
afb9cd676b833caf7f9f65a16ba8c857d6d72b6b
[ "MIT" ]
null
null
null
week_two_quiz.py
Ronlin1/cit_quiz_two
afb9cd676b833caf7f9f65a16ba8c857d6d72b6b
[ "MIT" ]
null
null
null
""" WEEK TWO QUIZ AS AT 05 MARCH 2020 ___PYTHON-BLOCKCHAIN-AWS-CIT-CLASS 2021___ """ # WELCOME SCREEN print('------------------------- WEEK TWO QUIZ --------------------------') # TODO: QUIZ ANSWERS # Global variable --->End of question separator in the ---- terminal ---- end_of_answer = '------------------------------------------------------------------' # 1 --> Identified, created and re-fixed a few errors. # 2 --> UNICODE? Converting a sting to unicode -UTF8 """ Unicode is a universal character encoding standard that assigns a code to every character and symbol in every language in the world. The difference between ASCII and Unicode is that ASCII represents lowercase letters (a-z), uppercase letters (A-Z), digits (0–9) and symbols such as punctuation marks while Unicode represents letters of English, Arabic, Greek etc.... UTF-8 is the most widely used way to represent Unicode text in web pages UTF-8 is a Unicode Transformation Format that uses 8-bit blocks to represent a character and is essential for software localization. """ # In Python 3 and higher, all strings are already in unicode, however, we can deode every letter # Using functions ord() and chr() my_string = "Hello World!" print(f'My String: {my_string}') my_string_decoded = [] for letter in my_string: my_string_decoded.append((ord(letter))) print(f'My String decoded: {my_string_decoded}') # Note : Unicode characters include space, comma, punctuations etc... # To convert back , we use chr() my_string_encoded_again = [] for i in my_string_decoded: my_string_encoded_again.append(chr(i)) print(f'Encoded: {my_string_encoded_again}') print('So we know H=72, e=101, l=108 and so on ... ') print(end_of_answer) print("\U0001F606") print("\N{grinning face}") # EMOJI CHALLENGE # importing emoji module import emoji # simple emoji print-outs print(emoji.emojize("Here we gat :grinning_face_with_big_eyes: and :winking_face_with_tongue: and :zipper-mouth_face:")) # without import -> Use of \N and {} specifies Unicode print("\N{cherry blossom}") print("\N{slightly smiling face}") print("\N{winking face}") # We can use shortcodes too print("\U0001f600 , \U0001F606 , \U0001F923, \U0001F601, \U0001F609, \U0001F60B, \U0001F60D, \U0001F680") print(end_of_answer) print(emoji.emojize("Yeah I think Python is :thumbs_up: and my favourite emoji is :nerd_face:"))
35.761194
120
0.699499
3f5b33d5eaab17f299671cbfe66bc702a7e6638b
6,277
php
PHP
resources/views/v_direktoriCare.blade.php
faikarghas/one-onco
b7c92f0f18340f97498fb0e3ddca4af8228d196c
[ "MIT" ]
null
null
null
resources/views/v_direktoriCare.blade.php
faikarghas/one-onco
b7c92f0f18340f97498fb0e3ddca4af8228d196c
[ "MIT" ]
null
null
null
resources/views/v_direktoriCare.blade.php
faikarghas/one-onco
b7c92f0f18340f97498fb0e3ddca4af8228d196c
[ "MIT" ]
null
null
null
@extends('components/layouts.layout') @section('content') @include('components/presentational/header',['path'=>'direktori']) <main> {{-- <section class="direktoriDet__header forMobile"> <div class="container"> <div class="row"> <div class="col-12"> <div class="row justify-content-center"> <h3 class="text-center"><strong>Cari Care Center di daerahmu:</strong></h3> </div> </div> <div class="col-12"> <form action="" method="POST"> <div class="col-12 mb-2 mt-4"> <input style="border-radius: 12px;" type="text" class="form-control form-control-lg" id="exampleFormControlInput1" placeholder="Ketik kata kunci"> </div> <div class="col"> <select class="form-select mb-2" aria-label="Default select example" id="selectProvinces4" name="provinces3"> <option selected>Pilih Kota</option> @foreach ($provinces as $province => $value) <option value="{{ $province }}"> {{ $value }}</option> @endforeach </select> </div> <div class="col"> <select class="form-select mb-2" aria-label="Default select example" id="selectCities4" name="cities3"> <option value="">Pilih Kabupaten</option> </select> </div> </form> </div> </div> </div> </section> --}} @include('components/presentational/boxHeaderDirectoryDesktop',['path'=>'direktori']) @if (empty(Request::segment(2))) <section class="direktori__list"> @include('components/presentational/boxFilterDirectoryDesktop',['path'=>'direktori']) @include('components/presentational/boxResultFilterDirectoryFaskes',['path'=>'direktori']) <div class="container text-center mt-3"> <div class="row"> <div class="col-12 "> <p style="color:#c3c2c2;">Segala konten yang diterbitkan/ publikasikan hanya ditujukan untuk kepentingan penyampaian informasi kepada public. Jadwal dan informasi terkait layanan dapat berubah sewaktu-waktu tanpa pemberitahuan. <br/> Seluruh pengguna diharapkan untuk mengkonfirmasi jadwal dengan layanan sebelumnya.</p> </div> </div> </div> </section> @else <section class="direktori__list-detail"> {{-- @include('components/presentational/boxFilterDirectoryDesktop',['path'=>'direktori']) --}} @include('components/presentational/boxDirectoryFaskesDetail',['path'=>'direktori']) </section> @endif <section class="direktori__menuTabM bg-color_lightGrey pt-3 pb-4 forMobile"> <div class="container"> <div class="row"> <div class="col-12"> @include('components/presentational.boxRec',array( 'image_url'=>'directori_dokter2.svg', 'title'=>'Direktori Dokter', 'description'=>'Cari tau mengenai perawatan kanker yang diderita', 'color'=>'#00A2E3;', 'colorPar'=>'#808080;', 'path'=>'direktori-dokter', 'bgColor'=> 'white' )) @include('components/presentational.boxRec',array( 'image_url'=>'directori_komunitas.svg', 'title'=>'Direktori Komunitas', 'description'=>'Cari tau mengenai perawatan kanker yang diderita', 'color'=>'#00A2E3;', 'colorPar'=>'#808080;', 'path'=>'direktori-komunitas', 'bgColor'=> 'white' )) </div> </div> </div> </section> </main> @endsection @push('custom-scripts') <script> document.addEventListener('DOMContentLoaded', function () { $('#search').on('keyup', function() { $value = $(this).val(); getMoreFaskes(1); }); $('#spesialis').on('change', function() { getMoreFaskes(); }); $('#provinsi').on('change', function() { data = $(this).find(':selected').attr('data-id'); if (data !== "null") { axios.get(`/cities/get/${data}`).then(function (response) { $('select[name="kabupaten"]').empty(); $('select[name="kabupaten"]').append('<option value=""> Pilih Kabupaten</option>'); $.each(response.data, function(key, value){ $('select[name="kabupaten"]').append(new Option(value, value)); }); }); } getMoreFaskes(); }); $('#kabupaten').on('change', function() { console.log('kabupaten') getMoreFaskes(); }); }); function getMoreFaskes(page) { var search = $('#search').val(); var selectedSpesialis = $("#spesialis option:selected").val(); var selectedProvinsi= $("#provinsi option:selected").val(); var selectedKabupaten= $("#kabupaten option:selected").val(); $.ajax({ type: "GET", data: { 'search_query':search, 'spesialis': selectedSpesialis, 'provinsi': selectedProvinsi, 'kabupaten': selectedKabupaten }, url: "{{ route('faskes.get-more-faskes') }}", success:function(data) { $('#faskes_data').html(data); } }); } </script> @endpush @stack('custom-scripts')
44.51773
344
0.476979
2501016563e0f56214e4471e51c67fd7906b8a15
98
rb
Ruby
spec/support/cookie_helper.rb
gsmlg/peatio
6a5e3362754de5de810502dbd35ae4ce6841d752
[ "MIT" ]
3,436
2015-01-02T02:49:24.000Z
2022-03-31T23:19:00.000Z
spec/support/cookie_helper.rb
xinfushe/peatio
6fe7e960a12c40053370cb25cdd0968b67041aa0
[ "MIT" ]
471
2015-01-01T00:20:54.000Z
2019-03-24T05:07:50.000Z
spec/support/cookie_helper.rb
computeus/peatio
db0667ab2788fd7c3ca75b4fb024ef90e818afac
[ "MIT" ]
2,084
2015-01-02T05:32:13.000Z
2022-03-31T23:19:25.000Z
def clear_cookie page.driver.cookies.each do |k, v| page.driver.remove_cookie k end end
14
37
0.714286
e2b54474a33da4e72c5ff99192fe2687b9f4d1ce
5,534
py
Python
Section_4/expense_tracker/main.py
PacktPublishing/Software-Engineering-with-Python-3.x
056e4c89e4f8d7fc4a4095ee0671d6944a86630e
[ "MIT" ]
1
2020-02-02T13:55:29.000Z
2020-02-02T13:55:29.000Z
Section_4/expense_tracker/main.py
PacktPublishing/Software-Engineering-with-Python-3.x
056e4c89e4f8d7fc4a4095ee0671d6944a86630e
[ "MIT" ]
null
null
null
Section_4/expense_tracker/main.py
PacktPublishing/Software-Engineering-with-Python-3.x
056e4c89e4f8d7fc4a4095ee0671d6944a86630e
[ "MIT" ]
2
2020-02-09T12:41:40.000Z
2020-09-21T02:16:06.000Z
from source.expense import Expense from source.user import User from source.group import UserGroup from source.utilities import initialize_data, print_menu, print_users, print_expenses, get_user_id if __name__ == "__main__": # Initialize Dummy data users_list, groups_list, expense_list = initialize_data() while True: # Print the Menu options print_menu() # Get the User Choice next_choice = input() print(f"Choice selected is {next_choice}") if next_choice=='1': # Get User Details print("Enter New User Details Below") # Get User Name while True: user_name = input("Enter Name : ") if len(user_name) == 0: print("User Name cannot be left blank") else: break # Get User Email user_email = input("Enter Email (default: None):") # Create a new user new_user = User(user_name, user_email) # Add the user to the users_list users_list.append(new_user) print(f"New user {user_name} added successfully.") elif next_choice=='2': # Get Group Details print("Enter Group Details") # Get Group Name while True: group_name = input("Enter Name : ") if len(group_name) == 0: print("User Name cannot be left blank") else: break # Add the users to the Group while True: print("Now select the members to add to this group") print_users(users_list) print("Enters the user no.(s), seperated by a comma.") print("Please enter at least 2 users ") group_users = input() if len(group_users.split(',')) < 2: print("Please enter at least 2 users ") else: break # Map the user id to user_list # group_users = "1,2,3" # group.split(',') = ["1", "2", "3"] users_info = list(map(lambda x: users_list[int(x)-1], group_users.split(','))) # users_info = [] # for user_id in group_users.split(','): # users_info.append(user_list[int(user_id)-1]) # Create a new Group new_group = UserGroup(group_name, users_info) # Add the group to groups_list groups_list.append(new_group) print(f"New Group {group_name} added successfully!") elif next_choice == '3': # Get the Expense Details group_name = None print("Enter Expense Details") print("Enter the Lender ID") # Get the Lender ID lender_id = get_user_id(users_list) # Get the amount print("Enter the amount lent :") amount_lent = int(input()) # Check for Group Expense print("Is this a Group Expense [y/n]?") group_flag = input() if 'y' in group_flag or 'Y' in group_flag: # Select the Group while True: gid = 1 for group in groups_list: print(f"{gid}. {group.group_name}") gid += 1 selected_group = input() if len(selected_group) == 0: print("Group cannot be None") else: # TODO: Check if the index is valid group_name = groups_list[int(selected_group)-1] break # Create new Expense new_expense = Expense(users_list[int(lender_id)], amount_lent, group=group_name) # Add the expense to the Expense list expense_list.append(new_expense) else: print("Enter how many lendee(s) are there for this expense ?") print(f"Note: There are total {len(users_list)} users only!") lendee_count = int(input("Enter lendee(s) count")) lendees_list = [] while lendee_count > 0: print("Select lendee from this list") lendee_id = get_user_id(users_list) lendees_list.append(users_list[lendee_id]) lendee_count -= 1 # If Lendess_list = ["BOB"] ==> "BOB" # i.e. we flatten the list, so this changes the type # from list to User Class if len(lendees_list)==1: lendees_list = lendees_list[0] # Create a new Expense new_expense = Expense(users_list[int(lender_id)], amount_lent, lendee=lendees_list) # Add the expense to the list of expenses expense_list.append(new_expense) elif next_choice == '4': print_expenses(expense_list) elif next_choice == '5': curr_user_id = get_user_id(users_list) users_list[int(curr_user_id)].get_report() else: break
34.372671
98
0.489881
ce4aa5ef248811b9bf0d342e5f0bc4dd2a150d3b
3,823
rs
Rust
components/pkg-export-helm/src/chartfile.rs
jeremymv2/habitat
79a9ed4df3be36f7e4f84b73cf4270c3acbb57ab
[ "Apache-2.0" ]
1
2018-12-21T01:31:50.000Z
2018-12-21T01:31:50.000Z
components/pkg-export-helm/src/chartfile.rs
jeremymv2/habitat
79a9ed4df3be36f7e4f84b73cf4270c3acbb57ab
[ "Apache-2.0" ]
null
null
null
components/pkg-export-helm/src/chartfile.rs
jeremymv2/habitat
79a9ed4df3be36f7e4f84b73cf4270c3acbb57ab
[ "Apache-2.0" ]
null
null
null
// Copyright (c) 2018 Chef Software Inc. and/or applicable contributors // // 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. use clap; use failure::SyncFailure; use handlebars::Handlebars; use serde_json; use crate::export_docker::Result; use crate::hcore::package::PackageIdent; use crate::maintainer::Maintainer; pub const DEFAULT_VERSION: &str = "0.0.1"; // Helm chart file template const CHARTFILE: &str = include_str!("../defaults/HelmChartFile.hbs"); pub struct ChartFile { pub name: String, pub version: String, pub description: Option<String>, pub app_version: Option<String>, pub home: Option<String>, pub icon: Option<String>, pub deprecated: bool, pub keywords: Vec<String>, pub sources: Vec<String>, pub maintainers: Vec<Maintainer>, } impl ChartFile { pub fn new_from_cli_matches( matches: &clap::ArgMatches<'_>, pkg_ident: &PackageIdent, ) -> Result<Self> { let name = matches .value_of("CHART") .unwrap_or(&pkg_ident.name) .to_string(); let pkg_version = pkg_ident.version.as_ref(); let version = matches .value_of("VERSION") .or_else(|| pkg_version.map(|s| s.as_ref())) .unwrap_or(DEFAULT_VERSION) .to_owned(); let app_version = pkg_version.map(|v| { pkg_ident .release .as_ref() .map(|r| format!("{}-{}", v, r)) .unwrap_or_else(|| v.to_string()) }); let description = matches.value_of("DESCRIPTION").map(|s| s.to_owned()); let home = matches.value_of("HOME").map(|s| s.to_owned()); let icon = matches.value_of("ICON").map(|s| s.to_owned()); let deprecated = matches.is_present("DEPRECATED"); let keywords = matches .values_of("KEYWORD") .map(|args| args.map(|k| k.to_owned()).collect()) .unwrap_or_default(); let sources = matches .values_of("SOURCE") .map(|args| args.map(|k| k.to_owned()).collect()) .unwrap_or_default(); let maintainers = Maintainer::from_args(&matches)?; Ok(ChartFile { name, version, description, app_version, home, icon, deprecated, keywords, sources, maintainers, }) } // TODO: Implement TryInto trait instead when it's in stable std crate pub fn into_string(&self) -> Result<String> { let mut maintainers: Vec<serde_json::Value> = vec![]; for maintainer in &self.maintainers { maintainers.push(maintainer.to_json()); } let json = json!({ "name": self.name, "version": self.version, "description": self.description, "appVersion": self.app_version, "home": self.home, "icon": self.icon, "deprecated": self.deprecated, "keywords": self.keywords, "sources": self.sources, "maintainers": maintainers, }); Handlebars::new() .template_render(CHARTFILE, &json) .map_err(SyncFailure::new) .map_err(From::from) } }
32.12605
80
0.584619
57767f6e35411d5cbf64c8b4dab2e8fa9d7ee69b
445
sql
SQL
sql/updates/0.0.3/sql_r577.sql
uzmcoco/Cotonti
ef7451118587deca574e58f1c96119deb7eca83b
[ "BSD-3-Clause" ]
2
2015-06-03T10:17:02.000Z
2017-10-26T16:40:25.000Z
sql/updates/0.0.3/sql_r577.sql
uzmcoco/Cotonti
ef7451118587deca574e58f1c96119deb7eca83b
[ "BSD-3-Clause" ]
null
null
null
sql/updates/0.0.3/sql_r577.sql
uzmcoco/Cotonti
ef7451118587deca574e58f1c96119deb7eca83b
[ "BSD-3-Clause" ]
1
2019-07-14T18:23:27.000Z
2019-07-14T18:23:27.000Z
/* r577 Tags plugin update */ INSERT INTO sed_config (`config_owner`, `config_cat`, `config_order`, `config_name`, `config_type`, `config_value`, `config_default`, `config_text`) VALUES ('plug', 'tags', '10', 'more', 3, '1', '', 'Show All Tags link in tag clouds'); INSERT INTO `sed_plugins` (`pl_hook`, `pl_code`, `pl_part`, `pl_title`, `pl_file`, `pl_order`, `pl_active`) VALUES ('header.main', 'tags', 'header', 'Tags', 'tags.header', 10, 1);
148.333333
235
0.669663
79cb0d9b1df2afa58bd8d9646b37da0697f90de4
1,187
php
PHP
resources/views/chat.blade.php
prakashgithub4/chatExample
aed9e303d03397367e61405fe12ff6e0a032ac9f
[ "MIT" ]
null
null
null
resources/views/chat.blade.php
prakashgithub4/chatExample
aed9e303d03397367e61405fe12ff6e0a032ac9f
[ "MIT" ]
null
null
null
resources/views/chat.blade.php
prakashgithub4/chatExample
aed9e303d03397367e61405fe12ff6e0a032ac9f
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <title>Pusher Test</title> <link rel="stylesheet" type="text/css" href="{{url('public/assets/css/style.css')}}"> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet"> <style> /* body{ background-color: red; } */ </style> <script src="https://js.pusher.com/6.0/pusher.min.js"></script> <script> // Enable pusher logging - don't include this in production Pusher.logToConsole = true; var pusher = new Pusher('12d9da88c545d19af2c5', { cluster: 'eu' }); var channel = pusher.subscribe('my-channel'); // channel channel.bind('form-submitted', function(data) { // e alert(JSON.stringify(data)); }); </script> </head> <body> <!-- <h1>Pusher Test</h1> <p> Try publishing an event to channel <code>my-channel</code> with event name <code>my-event</code>. </p> --> <div class="main_frame"> <header> <div class="logo_part"> <img class="logo" src="{{url('public/assets/images/logo1.png')}}" alt="logo"> <span>Welcome To FChat</span> </div> <div class="contact_us"> <a href="#">+91-999999999</a> </div> </header> </div> </body> </html>
25.804348
112
0.6369
d15385fc1b0c6da8e5b6fb500910e5d08710c936
2,439
html
HTML
python/cli/kwidgzwzz.html
kodingwindow/kodingwindow.github.io
af4e0a234858d1882ec49802f911665be4ef662e
[ "MIT" ]
2
2020-09-12T11:52:46.000Z
2021-01-26T04:31:49.000Z
python/cli/kwidgzwzz.html
kodingwindow/kodingwindow.github.io
af4e0a234858d1882ec49802f911665be4ef662e
[ "MIT" ]
null
null
null
python/cli/kwidgzwzz.html
kodingwindow/kodingwindow.github.io
af4e0a234858d1882ec49802f911665be4ef662e
[ "MIT" ]
1
2020-10-02T08:38:02.000Z
2020-10-02T08:38:02.000Z
--- layout: kw title: Python Built-in Functions --- <div class="blackwell"><mark>Title: </mark>{{ page.title }}</div> <div class="terminalwell">type() function</div> <span><pre> kodingwindow@kw:~$ <mark>python3</mark> Python 3.8.6 (default, Sep 25 2020, 09:36:53) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> <mark>type('Hello, World!')</mark> &lt;class 'str'&gt; >>> <mark>type(7)</mark> &lt;class 'int'&gt; >>> <mark>type(7.23)</mark> &lt;class 'float'&gt; >>> <mark>type(True)</mark> &lt;class 'bool'&gt; >>> <mark>type(False)</mark> &lt;class 'bool'&gt; >>> <mark>a=[1, 2, 3, 4, 5]</mark> >>> <mark>type(a)</mark> &lt;class 'list'&gt; >>> <mark>a=(1)</mark> >>> <mark>type(a)</mark> &lt;class 'int'&gt; >>> <mark>a=(1, 1.1)</mark> >>> <mark>type(a)</mark> &lt;class 'tuple'&gt; </pre></span> <div class="terminalwell">range() function</div> <span><pre> >>> <mark>range(10)</mark> range(0, 10) >>> <mark>list(range(10))</mark> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> <mark>list(range(5,10))</mark> [5, 6, 7, 8, 9] >>> <mark>list(range(0,10,1))</mark> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> <mark>list(range(0,10,2))</mark> [0, 2, 4, 6, 8] >>> <mark>list(range(0,10,3))</mark> [0, 3, 6, 9] </pre></span> <div class="terminalwell">chr() and ord() functions</div> <span><pre> >>> <mark>chr(42)</mark> '*' >>> <mark>chr(65)</mark> 'A' >>> <mark>ord('A')</mark> 65 >>> <mark>ord('*')</mark> 42 </pre></span> <div class="terminalwell">bytes() and bytearray() functions</div> <span><pre> >>> <mark>a=[1,2,3,4,5,6]</mark> >>> a[0]</mark> 1 >>> <mark>a[-1]</mark> 6 >>> <mark>a[-1]=-1000</mark> >>> <mark>a</mark> [1, 2, 3, 4, 5, -1000] >>> <mark>exp=bytes(a)</mark> <error>Traceback (most recent call last): File "&lt;stdin>", line 1, in &lt;module> ValueError: bytes must be in range(0, 256)</error> >>> <mark>a[-1]=255</mark> >>> <mark>a</mark> [1, 2, 3, 4, 5, 255] >>> <mark>exp=bytes(a)</mark> >>> <mark>exp[-1]=6</mark> <error>Traceback (most recent call last): File "&lt;stdin>", line 1, in &lt;module> TypeError: 'bytes' object does not support item assignment</error> <hr>>>> <mark>a=[1,2,3,4,5,6]</mark> >>> <mark>exp=bytearray(a)</mark> >>> <mark>exp[0]</mark> 1 >>> <mark>exp[-1]</mark> 6 >>> <mark>exp[-1]=255</mark> >>> <mark>exp</mark> bytearray(b'\x01\x02\x03\x04\x05\xff') >>> <mark>for i in exp: print(i) ... </mark> 1 2 3 4 5 255 >>> </pre></span>
19.204724
70
0.569906
5d39cab3b556780aef1711a198c517b9d0a095ce
1,619
kt
Kotlin
androidBreakingBad/src/main/java/com/czech/breakingbad/android/presentation/theme/Theme.kt
Czeach/Breaking-Bad
55d074a8cf9c3bf6907e5a25b45c308259e050d4
[ "MIT" ]
null
null
null
androidBreakingBad/src/main/java/com/czech/breakingbad/android/presentation/theme/Theme.kt
Czeach/Breaking-Bad
55d074a8cf9c3bf6907e5a25b45c308259e050d4
[ "MIT" ]
null
null
null
androidBreakingBad/src/main/java/com/czech/breakingbad/android/presentation/theme/Theme.kt
Czeach/Breaking-Bad
55d074a8cf9c3bf6907e5a25b45c308259e050d4
[ "MIT" ]
null
null
null
package com.czech.breakingbad.android.presentation.theme import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.czech.breakingbad.android.presentation.components.CircularProgressBar import com.czech.breakingbad.android.presentation.components.DialogQueue import com.czech.breakingbad.util.MessageInfo import com.czech.breakingbad.util.Queue val LightThemeColors = lightColors( primary = Grey900, primaryVariant = Grey800, onPrimary = Grey700, secondary = Grey100, secondaryVariant = Grey200, onSecondary = Grey200, error = Red800, onError = Red600, background = Grey300, onBackground = Grey400, surface = Grey400 ) @Composable fun AppTheme( displayProgressBar: Boolean, dialogQueue: Queue<MessageInfo> = Queue(mutableListOf()), onRemoveLastMessageFromQueue: () -> Unit, content: @Composable () -> Unit ) { MaterialTheme( colors = LightThemeColors, typography = RobotoTypography, shapes = AppShapes, ) { Box( modifier = Modifier .fillMaxSize() ) { DialogQueue( dialogQueue = dialogQueue, onRemoveLastMessageFromQueue = onRemoveLastMessageFromQueue ) content() CircularProgressBar( isDisplayed = displayProgressBar, verticalBias = 0.3f) } } }
29.981481
80
0.685608
da15594b1b9f3f9b788a8f0a453a8cabfb25064a
463
php
PHP
tests/unit/Grav/Console/Gpm/InstallCommandTest.php
spirojess/Spiro2021
2b5881d58d1cd7be15493ef58cf128d0e0905aac
[ "MIT" ]
3
2017-01-10T13:40:17.000Z
2019-01-17T06:51:53.000Z
tests/unit/Grav/Console/Gpm/InstallCommandTest.php
Die-Greifen/die-greifen-webseite
cf9339258706e214487ad4daca441a543700d5a7
[ "Unlicense" ]
31
2020-04-05T22:18:40.000Z
2022-03-02T21:27:11.000Z
tests/unit/Grav/Console/Gpm/InstallCommandTest.php
Die-Greifen/die-greifen-webseite
cf9339258706e214487ad4daca441a543700d5a7
[ "Unlicense" ]
20
2016-06-08T16:43:08.000Z
2021-07-28T09:32:06.000Z
<?php use Codeception\Util\Fixtures; use Grav\Common\Grav; /** * Class InstallCommandTest */ class InstallCommandTest extends \Codeception\TestCase\Test { /** @var Grav $grav */ protected $grav; /** @var InstallCommand */ protected $installCommand; protected function _before() { $this->grav = Fixtures::get('grav'); $this->installCommand = new InstallCommand(); } protected function _after() { } }
16.535714
59
0.62851
9a03fd8c41576ebbf355a7a7477103d67ab0adc8
8,389
asm
Assembly
dv3/q40/hd/fpart.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
dv3/q40/hd/fpart.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
dv3/q40/hd/fpart.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
; DV3 Q40 Find Partition (Atari root)  1999 Tony Tebby ; 2020-04-29 V3.05 fix for atari partition check (wl) ; 2020-03-24 V3.04 fix for direct QLWA formatted CF cards, can use other partitions on FAT32 cards (wl) ; 2018-02-06 V3.03 fix for *d2d access to fat16 CF cards (wl) ; 2017-11-21 V3.02 LBA access to QXL.WIN files on FAT32 formatted media (wl) ; 2003-01-17 V3.01 Fixed the ICD extension (8 additional partitions in table) ; Note : when using FAT32 formateted sdhc cards, this always sets ddf_psoff to 0 ; and stores the "real" partition offset at ddf_dtop-4(a4)1 section dv3 xdef hd_fpart xref id_diradd include 'dev8_keys_err' include 'dev8_keys_qlwa' include 'dev8_keys_atari' include 'dev8_dv3_keys' include 'dev8_keys_dos' include 'dev8_mac_xword' include 'dev8_dv3_hd_keys' ;+++ ; DV3 Atari find partition. ; It starts by loading and examining the root sector. ; ; d1 r as d3 but in ths format if required ; d2 r size of partition, -1 no partition table ; d3 r sector number with partition root ; d4 r partition ID ; d7 c p drive ID / number ; a3 c p pointer to linkage block ; a4 c p pointer to physical definition ; ; error return 0 or error ;--- hd_fpart hfp.reg reg d5-d7/a0-a3/a5 movem.l hfp.reg,-(sp) clr.b ddf_lba(a4) ; preset LBA addressing moveq #0,d4 lea hdl_part-1(a3),a1 move.b (a1,d7.w),d4 ; partition required bmi.l hfp_mchk moveq #0,d3 ; start at real root moveq #0,d6 ; offset starts at 0 clr.l ddf_dtop-4(a4) ;!!! no partition offset !!! hfp_rootloop lea hdl_buff(a3),a1 ; root sector buffer move.l d3,d0 ; physical root sector - MBR moveq #1,d2 jsr id_diradd ; check bne hfp_mchk jsr hdl_rsint(a3) ; read sector bne hfp_npart ; no partition move.l d4,d0 lsl.w #4,d0 ; 3.36 : don't change d4 add.w #dos_prt1,d0 move.l (a1,d0.w),d0 ; partition start cmp.w #dos.ftcs,dos_ftcs(a1) ; (unswapped) FAT32 marker present? beq chk_fat32_normal ; ... yes cmp.w #dos.ftsw,dos_ftcs(a1) ; (swapped) FAT32 marker present? beq chk_fat32_switched ; ... yes hfp_atri cmp.w #$0260,(a1) ; swapped atari type root sector marker ? beq.s hfp_lpart ; ... yes cmp.w #art.id,(a1) ; unswapped atari type root sector ? beq.s hfp_lpart2 ; ... yes tst.b d4 ; partition 0? beq hfp_root ; ... yes, presume it's SMSQE QLWA bra hfp_mchk ; ... no, then we have a problem ; here we hve a byte-swapped Atari type root partition ; swap the bytes back swp_sct move.l a1,a2 moveq #127,d2 ; 512 bytes in long words - DBF swp_lp move.l (a2),d0 rol.w #8,d0 swap d0 rol.w #8,d0 swap d0 move.l d0,(a2)+ dbf d2,swp_lp rts hfp_lpart bsr.s swp_sct ; swap bytes hfp_lpart2 st ddf_lba(a4) ; this is NOT an LBA drive, but CHS lea art_p0(a1),a1 ; look from partition 0 move.l #art.pchk,d1 move.l #art.xflg,d5 moveq #4,d2 ; check four in first section hfp_partloop move.l d1,d0 and.l art_pflg(a1),d0 ; partition flag cmp.l d5,d0 ; extended? beq.s hfp_xlink subq.b #1,d4 ; partition found blt.s hfp_found add.w #art.plen,a1 subq.w #1,d2 ; extended group yet? bne.s hfp_partloop tst.l d2 ; all tried? bne.s hfp_root ; was: beq.s hfp_root moveq #-8,d2 neg.w d2 ; try eight more lea art_pext-art_p0-4*art.plen(a1),a1 ; (JG: this should work now!) bra.s hfp_partloop hfp_xlink move.l d6,d3 add.l art_pstt(a1),d3 ; new root tst.l d6 ; first partition yet? bne hfp_rootloop move.l d3,d6 ; ... yes, save base of first bra hfp_rootloop hfp_found btst #art.pval+24,d0 ; partition valid? beq.s hfp_mchk move.l art_psiz(a1),d2 ; size of partition add.l art_pstt(a1),d3 ; root sector for partition move.l d0,d4 ; partition ID hfp_ok move.l d3,d0 jsr id_diradd move.l d0,d1 ; physical root sector moveq #0,d0 move.b d0,hdl_npart(a3) ; partition found hfp_exit movem.l (sp)+,hfp.reg rts hfp_fnf hfp_mchk moveq #err.mchk,d0 hfp_npart st hdl_npart(a3) ; set no partition found bra.s hfp_exit hfp_root st ddf_lba(a4) ; this is NOT an LBA drive, but CHS cmp.l #'LQAW',(a1) ; swapped? bne.s noswp bsr swp_sct ; re-swap noswp moveq #-1,d2 ; size unknown move.l #art.qflg,d4 ; for QDOS disk bra.s hfp_ok ; if we get here, we have a fat32 drive (possibly) ; the bytes in each word are (normally) still the wrong way round chk_fat32_switched ; bytes were switched, swap only words swap d0 bra.s common chk_fat32_normal ; bytes not switched, swap bytes & words xlong d0 common sf ddf_lba(a4) ; use LBA & switch bytes move.l d0,d4 ; keep for later, start of partition jsr hdl_rsint(a3) ; read partition root sector into (a1) bne nofat32 ; ooops ; I should now have the partition root sector at (a1) cmp.l #'FAT3',dos_f32s(a1) ; check for FAT32 signature bne nofat32 ; ... nope cmp.b #'2',dos_f32s+4(a1) ; continue check for FAT32 signature bne nofat32 cmp.b #2,dos_sctl+1(a1) ; sector size =512 bytes? bne.s hfp_fnf ; I can't handle anything else tst.b dos_sctl(a1) ; still 512 bytes? bne.s hfp_fnf ; ... no ; Here I should have what I can consider a valid fat32 partition. ; Now find the root dir. clr.l d3 move.b dos_clst(a1),d3 ; cluster size (sectors per cluster) beq hfp_fnf ; what?????? moveq #0,d5 move.b dos_fats(a1),d5 ; nbr of fats beq hfp_fnf ; what ???? move.l dos_bspf(a1),d0 ; "big" sectors per fat xlong d0 ; in big endian format move.l d0,d6 ; d6 = also sectors per fat ; now use MK's multiply routine mulu d5,d6 ; lower 16 bit * number of fats swap d0 mulu d5,d0 ; upper 16 bit * number of fats swap d0 add.l d0,d6 ; combine add.l d4,d6 ; add start of partition clr.l d0 move.w dos_ress(a1),d0 rol.w #8,d0 ; res sector count add.l d0,d6 ; d6 + res sect count = data start add.l d0,d4 ; D4 = start of fat move.l dos_rdir(a1),d1 ; root dir cluster xlong d1 subq.l #2,d1 ; always starts at 2 less! ; root dir cluster * sectors per cluster (MK) move.l d1,d0 ; keep root dir cluster mulu d3,d1 ; lower 16 bit * sectors per cluster swap d0 mulu d3,d0 ; upper 16 bit * sectors per cluster swap d0 add.l d1,d0 ; combine add.l d6,d0 ; root dir start = data start + root dir sect jsr hdl_rsint(a3) ; read root dir 1st sector bne hfp_fnf ; check the first 16 entries in the root dir for my file moveq #15,d1 ; check first 16 entries in root dir lea hdl_end-12(a3),a2 moveq #0,d0 move.w d7,d0 mulu #12,d0 add.l a2,d0 ; normalized name we're looking for move.l a3,d5 ; keep linkage block move.l a1,a0 ; also point to start of dir srchlp1 move.l d0,a2 ; point to my name (again) move.l a0,a3 cmp.l (a2)+,(a3)+ ; name matches? bne.s nxtsrch ; no cmp.l (a2)+,(a3)+ bne.s nxtsrch move.l (a3),d2 clr.b d2 cmp.l (a2),d2 ; last part of name matches? beq.s found ; yes nxtsrch add.w #dos.drel,a0 ; get next entry in the root dir fndlp dbf d1,srchlp1 bra hfp_fnf ; if we get here, file wasn't found ; here the dir entry for the image file is found at (a0), get to 1st sector of it found move.l dos_flen(a0),d2 ; filesize = "partition length" xlong d2 move.w $14(a0),d0 ; high word of 1st cluster of file rol.w #8,d0 swap d0 move.w $1a(a0),d1 ; low word of 1st cluster of file rol.w #8,d1 ; move.w d1,d0 ; d0 = 1rst cluster of file subq.l #2,d0 ; First data cluster is cluster 2 move.l d0,d1 ; keep for multiply mulu d3,d1 ; lower 16 bit * sectors per cluster swap d0 mulu d3,d0 ; upper 16 bit * sectors per cluster swap d0 add.l d0,d1 ; combine add.l d6,d1 ; d1 = start sector of my qxl.win file move.l d5,a3 ; get my pointer back ; D1 is the start position of my container, as a sector number ( one sector = ; 512 bytes). The rest of the container must necessarily be contained in ; contiguous sectors from there on. (Perhaps in later versions it needn't be). ; ; For LBA drives, the partition offset in ddf_psoff is set to 0 and the real ; offset is kept at ddt_dtop-4 - move.l d1,ddf_dtop-4(a4) moveq #0,d1 ; will go into ddf_psoff moveq #-1,d2 ; partition length unknown move.l d1,d3 move.l #art.qflg,d4 ; for QDOS disk move.l d1,d0 ; all ok movem.l (sp)+,hfp.reg rts ; v. 3.03 fix nofat32 st ddf_lba(a4) ; this is NOT an LBA drive, but CHS move.l d3,d0 ; physical root sector - MBR moveq #1,d2 jsr id_diradd ; check bne hfp_mchk jsr hdl_rsint(a3) ; read sector beq hfp_atri bra hfp_npart ; no partition end
28.245791
104
0.688401
e7734de156a185757fe58abff3a36514c86be109
1,727
php
PHP
application/api/controller/v1/home/Producter.php
jiangbowen1995/TP5.1-GatewayWorker
acd1b9630ee4576ac46ceb80a0180aca9b8f3f00
[ "Apache-2.0" ]
1
2019-10-27T09:48:36.000Z
2019-10-27T09:48:36.000Z
application/api/controller/v1/home/Producter.php
jiangbowen1995/TP5.1-GatewayWorker
acd1b9630ee4576ac46ceb80a0180aca9b8f3f00
[ "Apache-2.0" ]
null
null
null
application/api/controller/v1/home/Producter.php
jiangbowen1995/TP5.1-GatewayWorker
acd1b9630ee4576ac46ceb80a0180aca9b8f3f00
[ "Apache-2.0" ]
null
null
null
<?php namespace app\api\controller\v1\home; use think\Controller; use PhpAmqpLib\Connection\AMQPConnection; use PhpAmqpLib\Message\AMQPMessage; use think\Request; class Producter extends Controller { public function __construct() { parent::__construct(); } public function sendMessage() { $queue = 'msgs'; $exchange = 'router'; $connection = new AMQPConnection('localhost', 5672, 'rabbitadmin', '123456','/'); $channel = $connection->channel(); $channel->queue_declare( $queue, #queue - Queue names may be up to 255 bytes of UTF-8 characters false, #passive - can use this to check whether an exchange exists without modifying the server state true, #durable, make sure that RabbitMQ will never lose our queue if a crash occurs - the queue will survive a broker restart false, #exclusive - used by only one connection and the queue will be deleted when that connection closes false #auto delete - queue is deleted when last consumer unsubscribes ); $channel->exchange_declare($exchange, 'direct', false, true, false); $channel->queue_bind($queue, $exchange); // $argv2 = array('jiangbowen to heppe'); // $messageBody = implode(' ', array_slice($argv2, 1)); // $messageBody = serialize($argv) $messageBody = 'hello world'; $message = new AMQPMessage($messageBody, array('content_type' => 'text/plain', 'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT)); $channel->basic_publish($message, $exchange); $channel->close(); $connection->close(); } }
40.162791
149
0.630573
c9cba2d1cadcd9151baa8f08dcc165c75f8ea3fa
2,234
ts
TypeScript
src/gql/handleSubgraphError.ts
elmurci/tribute-ui
6272c48aad0b530280e0aba3000623211ae719a0
[ "Apache-2.0" ]
27
2021-07-01T21:45:02.000Z
2022-03-28T21:53:41.000Z
src/gql/handleSubgraphError.ts
elmurci/tribute-ui
6272c48aad0b530280e0aba3000623211ae719a0
[ "Apache-2.0" ]
105
2021-05-05T16:02:17.000Z
2022-03-15T12:27:28.000Z
src/gql/handleSubgraphError.ts
elmurci/tribute-ui
6272c48aad0b530280e0aba3000623211ae719a0
[ "Apache-2.0" ]
19
2021-07-07T03:30:17.000Z
2022-03-14T03:12:04.000Z
import {ApolloLink} from '@apollo/client'; import {onError} from '@apollo/client/link/error'; import {Store} from 'redux'; import {setSubgraphNetworkStatus} from '../store/actions'; import {SubgraphNetworkStatus} from '../store/subgraphNetworkStatus/types'; import {StoreState} from '../store/types'; /** * handleSubgraphError * * Handles an error from The Graph's GQL server at the Apollo * Link level. * * Handles network errors from The Graph's GQL server. * * About network errors from the Apollo Docs: * * "Network errors occur "These are errors encountered while attempting * to communicate with your GraphQL server, usually resulting in a * 4xx or 5xx response status code (and no data)." * * We do not handle GQL errors that arise from individual queries. * Perhaps it best to handle those inside of the concerned components * (i.e. IF query error || subgraph is down THEN fallback) * * About GQL errors from the Apollo Docs: * * - Syntax errors (e.g., a query was malformed) * - Validation errors (e.g., a query included a schema field that doesn't exist) * - Resolver errors (e.g., an error occurred while attempting to populate a query field) * * @param {Store} store * @returns {ApolloLink} * @link https://www.apollographql.com/docs/react/data/error-handling */ export function handleSubgraphError(store: Store): ApolloLink { return onError(({/* graphQLErrors */ networkError}) => { if (networkError) { const reduxStateNotYetSet = (store.getState() as StoreState).subgraphNetworkStatus.status !== SubgraphNetworkStatus.ERR; if (reduxStateNotYetSet) { store.dispatch( setSubgraphNetworkStatus({status: SubgraphNetworkStatus.ERR}) ); // Show error once console.error(`[Subgraph network error]: ${networkError}`); } } // Reset when there's no more network error if (!networkError) { const reduxStateNotYetSet = (store.getState() as StoreState).subgraphNetworkStatus.status !== SubgraphNetworkStatus.OK; if (reduxStateNotYetSet) { store.dispatch( setSubgraphNetworkStatus({status: SubgraphNetworkStatus.OK}) ); } } }); }
32.852941
90
0.685765
a33cf49db97348fca9d046bc7c239142dfee2d6f
3,193
java
Java
nerve/nerve-consensus-pocbft/src/main/java/network/nerve/pocbft/storage/impl/AgentStorageServiceImpl.java
LaudateCorpus1/nerve-2
4980c66ae7fc66b21399e374c778fd84273dd7de
[ "MIT" ]
103
2020-02-07T03:55:21.000Z
2022-01-21T16:13:48.000Z
nerve/nerve-consensus-pocbft/src/main/java/network/nerve/pocbft/storage/impl/AgentStorageServiceImpl.java
LaudateCorpus1/nerve-2
4980c66ae7fc66b21399e374c778fd84273dd7de
[ "MIT" ]
59
2020-04-07T10:14:29.000Z
2021-07-29T04:08:23.000Z
nerve/nerve-consensus-pocbft/src/main/java/network/nerve/pocbft/storage/impl/AgentStorageServiceImpl.java
LaudateCorpus1/nerve-2
4980c66ae7fc66b21399e374c778fd84273dd7de
[ "MIT" ]
30
2020-04-13T10:08:36.000Z
2022-03-22T10:33:42.000Z
package network.nerve.pocbft.storage.impl; import network.nerve.pocbft.constant.ConsensusConstant; import network.nerve.pocbft.model.po.AgentPo; import network.nerve.pocbft.storage.AgentStorageService; import io.nuls.base.data.NulsHash; import io.nuls.core.core.annotation.Component; import io.nuls.core.rockdb.model.Entry; import io.nuls.core.rockdb.service.RocksDBService; import io.nuls.core.exception.NulsException; import io.nuls.core.log.Log; import java.util.ArrayList; import java.util.List; /** * 节点信息管理实现类 * Node Information Management Implementation Class * * @author tag * 2018/11/06 * */ @Component public class AgentStorageServiceImpl implements AgentStorageService { @Override public boolean save(AgentPo agentPo, int chainID) { if(agentPo == null || agentPo.getHash() == null){ return false; } try { byte[] key = agentPo.getHash().getBytes(); byte[] value = agentPo.serialize(); return RocksDBService.put(ConsensusConstant.DB_NAME_AGENT+ConsensusConstant.SEPARATOR +chainID,key,value); }catch (Exception e){ Log.error(e); return false; } } @Override public AgentPo get(NulsHash hash,int chainID) { if(hash == null){ return null; } try { byte[] key = hash.getBytes(); byte[] value = RocksDBService.get(ConsensusConstant.DB_NAME_AGENT+ConsensusConstant.SEPARATOR +chainID,key); if(value == null){ return null; } AgentPo agentPo = new AgentPo(); agentPo.parse(value,0); agentPo.setHash(hash); return agentPo; }catch (Exception e){ Log.error(e); return null; } } @Override public boolean delete(NulsHash hash,int chainID) { if(hash == null){ return false; } try { byte[] key = hash.getBytes(); return RocksDBService.delete(ConsensusConstant.DB_NAME_AGENT+ConsensusConstant.SEPARATOR +chainID,key); }catch (Exception e){ Log.error(e); return false; } } @Override public List<AgentPo> getList(int chainID) throws NulsException { List<Entry<byte[], byte[]>> list = RocksDBService.entryList(ConsensusConstant.DB_NAME_AGENT+ConsensusConstant.SEPARATOR +chainID); List<AgentPo> agentList = new ArrayList<>(); if(list != null && !list.isEmpty()){ for (Entry<byte[], byte[]> entry:list) { AgentPo po = new AgentPo(); po.parse(entry.getValue(),0); NulsHash hash = new NulsHash(entry.getKey()); po.setHash(hash); agentList.add(po); } } return agentList; } @Override public int size(int chainID) { List<byte[]> keyList = RocksDBService.keyList(ConsensusConstant.DB_NAME_AGENT+ConsensusConstant.SEPARATOR +chainID); if(keyList != null){ return keyList.size(); } return 0; } }
31.613861
142
0.592233
25a1099ced5b0c64328b522eb2127ef8e90d8f1b
3,262
js
JavaScript
core/test/header.spec.js
jesusreal/luigi
0eba0f1bafd10f38e4d92f2edcafafdc321dc358
[ "Apache-2.0" ]
null
null
null
core/test/header.spec.js
jesusreal/luigi
0eba0f1bafd10f38e4d92f2edcafafdc321dc358
[ "Apache-2.0" ]
null
null
null
core/test/header.spec.js
jesusreal/luigi
0eba0f1bafd10f38e4d92f2edcafafdc321dc358
[ "Apache-2.0" ]
null
null
null
const headerService = require('../src/navigation/services/header'); const assert = require('chai').assert; const sinon = require('sinon'); describe('Header', function() { afterEach(() => { sinon.restore(); }); describe('processHeaderSettings', function() { let component; const setHeaderSettings = headerSettings => { window.Luigi.config = { settings: { header: Object.assign({}, headerSettings) } }; }; beforeEach(() => { component = { set: sinon.spy(), store: { on: (e, cb) => {}, get: () => {} } }; }); it('should not fail for undefined arguments', async () => { window.Luigi.config = {}; await headerService.processHeaderSettings(component); }); it('should resolve title', async () => { // given const headerSettings = { title: 'Luigi Demo' }; setHeaderSettings(headerSettings); document.title = ''; // when await headerService.processHeaderSettings(component); // then assert.equal(document.title, headerSettings.title, 'document title'); assert( component.set.calledWith({ title: headerSettings.title }), 'component set() title' ); }); it('should hide logo if not defined', async () => { setHeaderSettings({}); // when await headerService.processHeaderSettings(component); // then assert( component.set.calledWith({ hasLogo: false }), 'component set() hasLogo false' ); }); it('should resolve logo and set hasLogo', async () => { // given const headerSettings = { logo: 'data:image/svg+xml;base64,XXX=' }; setHeaderSettings(headerSettings); component.refs = { logo: { style: { backgroundImage: null } }, logo2: { style: { backgroundImage: null } } }; // when await headerService.processHeaderSettings(component); // then assert( component.set.calledOnceWith({ hasLogo: true }), 'component set() hasLogo' ); assert.equal(component.refs.logo.src, headerSettings.logo, 'header logo'); }); it('should resolve favicon', async () => { // given const headerSettings = { favicon: '/assets/favicon.ico' }; setHeaderSettings(headerSettings); sinon.stub(document, 'createElement').returns({}); const appendChild = sinon.spy(); sinon .stub(document, 'getElementsByTagName') .returns([{ appendChild, childNodes: [] }]); const expectedLink = { type: 'image/x-icon', rel: 'shortcut icon', href: headerSettings.favicon }; // when await headerService.processHeaderSettings(component); // then assert( document.createElement.calledOnce, 'document.createElement() call' ); assert( document.getElementsByTagName.calledOnceWith('head'), 'document.getElementsByTagName() call' ); assert(appendChild.calledOnceWith(expectedLink), 'appendChild() call'); }); }); });
24.343284
80
0.55886
8e5d95620960b1d63e827d576419d0fd08a1759e
521
js
JavaScript
server/modules/domain/controllers/domain-controller.js
detis46901/postgres
930f65dbb9a560fd58300d648a1fb8b1b5afc5a6
[ "MIT" ]
null
null
null
server/modules/domain/controllers/domain-controller.js
detis46901/postgres
930f65dbb9a560fd58300d648a1fb8b1b5afc5a6
[ "MIT" ]
6
2020-07-15T23:24:40.000Z
2022-02-14T04:21:06.000Z
server/modules/domain/controllers/domain-controller.js
detis46901/API
930f65dbb9a560fd58300d648a1fb8b1b5afc5a6
[ "MIT" ]
null
null
null
"use strict"; var domainService = require('../services/domain-service'); var DomainModel = require('../models/domain-model'); var stream = require('stream'); var express = require('express'); var router = express.Router(); var service = new domainService(); router.get('/test', function (req, res) { console.log('testing'); DomainModel.Model.findAll().then(); res.send('Test Passed'); }); module.exports = router; //# sourceMappingURL=../../../source-maps/modules/domain/controllers/domain-controller.js.map
32.5625
93
0.696737
dd80ff8e32eef0104273a54632a8098e0dbb1f6f
2,263
java
Java
src/main/java/com/wyl/xue/system/controller/MenuController.java
cangshantiannan/xue
2a35770e8489d198055ab6334b12ad663440121a
[ "Apache-2.0" ]
null
null
null
src/main/java/com/wyl/xue/system/controller/MenuController.java
cangshantiannan/xue
2a35770e8489d198055ab6334b12ad663440121a
[ "Apache-2.0" ]
null
null
null
src/main/java/com/wyl/xue/system/controller/MenuController.java
cangshantiannan/xue
2a35770e8489d198055ab6334b12ad663440121a
[ "Apache-2.0" ]
null
null
null
/** * @Author wangyl * @E-mail wangyl0629@foxmail.com **/ package com.wyl.xue.system.controller; import com.wyl.xue.system.mybatis.entity.SystemMenu; import com.wyl.xue.system.mybatis.service.SystemMenuService; import com.wyl.xue.system.vo.MenuTree; import com.wyl.xue.util.result.WebResponse; import com.wyl.xue.util.result.WebResult; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.List; /** * @ClassName: MenuController * @Function: 菜单接口 * @Date: 2019/12/23 22:13 * @author wyl * @version V1.0 */ @RestController @RequestMapping("/v1") @Api(tags = {"菜单信息接口"}) @AllArgsConstructor public class MenuController { private final SystemMenuService systemMenuService; @PostMapping(value = "/menu") @ApiOperation(value = "新增菜单信息", notes = "根据菜单信息新增菜单") // @PreAuthorize("hasAuthority('sys:menu:add')") public WebResult<Boolean> addMenu(@RequestBody SystemMenu systemMenu) { return WebResponse.WebResponse.ok(systemMenuService.save(systemMenu)); } @PutMapping(value = "/menu") @ApiOperation(value = "更新菜单信息", notes = "根据菜单信息更新菜单") @PreAuthorize("hasAuthority('sys:menu:update')") public WebResult<Boolean> changeMenu(@RequestBody SystemMenu systemMenu) { return WebResponse.WebResponse.ok(systemMenuService.updateById(systemMenu)); } @GetMapping(value = "/menu/tree") @ApiOperation(value = "获取菜单树 不包含按钮") public WebResult<List<MenuTree>> menuTree() { return WebResponse.WebResponse.ok(systemMenuService.getMenuTree()); } @DeleteMapping(value = "/menu/{id}") @ApiOperation(value = "删除菜单信息", notes = "根据菜单id删除指定菜单") @PreAuthorize("hasAuthority('sys:menu:del')") public WebResult<Boolean> deleteMenu(@PathVariable String id) { return WebResponse.WebResponse.ok(systemMenuService.removeById(id)); } @GetMapping(value = "/menus/{id}") @ApiOperation(value = "获取指定菜单下的所有按钮") public WebResult<List<SystemMenu>> getMenusById(@PathVariable String id) { return WebResponse.WebResponse.ok(systemMenuService.getMenusById(id)); } }
32.797101
84
0.726027
e3bd9e64f8a06ce88e5bdbddf1ef6490a22c39f3
173
swift
Swift
Sources/Casimir/SwiftUI/Extensions/NavigationLink+omittedParamsInit.swift
przemek-jablonski/Casimir
4c86faf44690b81bdfd447ee99d948cb9aa90ee8
[ "MIT" ]
null
null
null
Sources/Casimir/SwiftUI/Extensions/NavigationLink+omittedParamsInit.swift
przemek-jablonski/Casimir
4c86faf44690b81bdfd447ee99d948cb9aa90ee8
[ "MIT" ]
null
null
null
Sources/Casimir/SwiftUI/Extensions/NavigationLink+omittedParamsInit.swift
przemek-jablonski/Casimir
4c86faf44690b81bdfd447ee99d948cb9aa90ee8
[ "MIT" ]
null
null
null
import SwiftUI public extension NavigationLink { init(_ label: Label, destination: Destination) { self.init(destination: destination, label: { label }) } }
21.625
61
0.687861
24bfd20ec385f8d6cc98a6e6ceb312b153cbc275
1,080
php
PHP
resources/views/user/pre_reservations/cfm.blade.php
daiki-kudou/test_smg_3
2f4426367046ff0474df0fb618184e997345be85
[ "MIT" ]
null
null
null
resources/views/user/pre_reservations/cfm.blade.php
daiki-kudou/test_smg_3
2f4426367046ff0474df0fb618184e997345be85
[ "MIT" ]
null
null
null
resources/views/user/pre_reservations/cfm.blade.php
daiki-kudou/test_smg_3
2f4426367046ff0474df0fb618184e997345be85
[ "MIT" ]
null
null
null
@extends('layouts.user.app') @section('content') <link href="{{ asset('/css/template.css') }}" rel="stylesheet"> <script src="{{ asset('/js/template.js') }}"></script> <div class="container-fluid"> <div class="container-field mt-3 d-md-flex justify-content-md-between"> <h2 class="mt-3 mb-md-5">本予約 申込み 完了</h2> <div class=""> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> <li class="breadcrumb-item active"> {{ Breadcrumbs::render(Route::currentRouteName()) }} </li> </ol> </nav> </div> </div> <hr> <div class="notion_wrap mt-5"> <h3 class="text-md-center mt-3"> 本予約にお申込みいただき、ありがとうございました。 </h3> <div class="notion_inner"> <p>弊社で内容を確認して、ご連絡致します。</p> <p>※追加のお申込み内容をご希望の場合は、下記連絡先までご連絡ください。<br> TEL:06-1234-5678<br> mail:test@gmail.com </p> </div> <div class="confirm_inner"> <p class="text-center mb-5 mt-3"> <a href="{{url('user/home')}}" class="more_btn_lg">予約一覧</a> </p> </div> </div> </div> @endsection
27
73
0.567593
3762e35bb0a529086078279c1ee5750a88e72b06
6,801
lua
Lua
src/open_weather_parser.lua
maciejmiklas/LuaTutorial
04309432b7dfac97f5119e1e0a724d4d9472de4f
[ "Apache-2.0" ]
10
2017-02-05T16:23:13.000Z
2019-06-14T08:42:54.000Z
src/open_weather_parser.lua
maciejmiklas/LuaTutorial
04309432b7dfac97f5119e1e0a724d4d9472de4f
[ "Apache-2.0" ]
null
null
null
src/open_weather_parser.lua
maciejmiklas/LuaTutorial
04309432b7dfac97f5119e1e0a724d4d9472de4f
[ "Apache-2.0" ]
2
2017-08-15T13:25:41.000Z
2019-09-17T04:21:29.000Z
require "json_list_parser" -- parser api owe_p = { forecast_days = 3, -- forecast for next 3 days. Contains only weather for the day from 6:00 to 21:00. -- Forecast for the first day reflects weather for current day, and if it's a night for a next day. forecast = {}, -- forecast text for 3 days forecast_text = nil, current = {}, has_weather = false, utc_offset = 3600 } local dateFormat = DateFormat.new() -- forecast by day local tmp = { day_forecast_idx = 0, forecast = {} } local function free_temp() tmp.day_forecast_idx = 0 tmp.forecast = {} end function owe_p.on_data_start() free_temp() end function round(num, numDecimalPlaces) local mult = 10 ^ (numDecimalPlaces or 0) return math.floor(num * mult + 0.5) / mult end local function update_current() local today = owe_p.forecast[1] local codes_str = {} for i = 1, today.codes_size do if i > 1 then table.insert(codes_str, ",") end table.insert(codes_str, today.codes[i]) end owe_p.current.icons = table.concat(codes_str) local currentTemp = owe_p.forecast[1].temp if currentTemp < 0 then owe_p.current.temp = round(currentTemp) else owe_p.current.temp = round(currentTemp, 1) end end local function update_forecast_text() local text = {} for idx, weather in pairs(owe_p.forecast) do local temp_min = round(weather.temp_min) local temp_max = round(weather.temp_max) if idx > 1 then table.insert(text, " ") table.insert(text, string.char(3)) table.insert(text, string.char(4)) table.insert(text, " ") end table.insert(text, weather.day) table.insert(text, ":") table.insert(text, string.char(2)) table.insert(text, temp_min) table.insert(text, " ") table.insert(text, string.char(1)) table.insert(text, temp_max) table.insert(text, " ") local first = true for _, desc in pairs(weather.description) do if first then first = false else table.insert(text, ",") end table.insert(text, desc) end end owe_p.forecast_text = table.concat(text) end local function on_data_end() if log.is_info then log.info("OWE Got weather") end owe_p.forecast = tmp.forecast update_current() update_forecast_text() owe_p.has_weather = true free_temp() end --https://openweathermap.org/weather-conditions local function map_code(condition) local mapped = 0 -- ICON_IDX_MIX_SUN_RAIN if (condition >= 500 and condition < 511) then mapped = 0 -- ICON_IDX_PARTLY_SUNNY elseif condition == 801 then mapped = 1 -- ICON_IDX_RAIN elseif (condition >= 300 and condition < 400) or (condition >= 511 and condition < 600) then mapped = 2 -- ICON_IDX_THUNDERSTORM elseif condition >= 200 and condition < 300 then mapped = 3 -- ICON_IDX_MIX_SUN_THUNDERSTORM -- elseif code == 37 or code == 38 or code == 47 then -- mapped = 4 -- ICON_IDX_MOON -- elseif code == 31 or code == 33 then -- mapped = 5 -- ICON_IDX_MIX_SUN_SNOW elseif condition == 600 or condition == 620 or condition == 615 then mapped = 6 -- ICON_IDX_SNOW elseif condition >= 600 and condition < 700 then mapped = 7 -- ICON_IDX_CLOUDY elseif (condition >= 802 and condition < 900) or (condition >= 700 and condition < 800) then mapped = 8 -- ICON_IDX_SUNNY elseif condition == 800 then mapped = 9 end return mapped; end local function contains(tab, val) for _, value in ipairs(tab) do if value == val then return true end end return false end local function describe(description) if string.find(description, "clouds") then description = "clouds" elseif string.find(description, "rain") then description = "rain" end return description end local function update_day_forecast(df, weather) df.temp_min = math.min(df.temp_min, weather.temp_min) df.temp_max = math.max(df.temp_max, weather.temp_max) local description = describe(weather.description) if not contains(df.description, description) then table.insert(df.description, description) local code = map_code(weather.id) if df.codes_size == 0 or (df.codes_size > 0 and df.codes[df.codes_size] ~= code) then table.insert(df.codes, code) df.codes_size = df.codes_size + 1 end end end local function init_df(df) df.temp_min = 1000 df.temp_max = -1000 df.description = {} df.codes = {} df.codes_size = 0 return df; end local function next_weather_chunk(doc) -- first day in weather chunk, or next day, like MON->TUE if tmp.day_forecast_idx == 0 or tmp.forecast[tmp.day_forecast_idx].day ~= doc.day then if tmp.day_forecast_idx == owe_p.forecast_days then return false end tmp.day_forecast_idx = tmp.day_forecast_idx + 1 if tmp.forecast[tmp.day_forecast_idx] == nil then tmp.forecast[tmp.day_forecast_idx] = {} end local df = tmp.forecast[tmp.day_forecast_idx] init_df(df) df.temp = doc.temp df.day = doc.day tmp.forecast[tmp.day_forecast_idx] = df end update_day_forecast(tmp.forecast[tmp.day_forecast_idx], doc) return true end local function accept_time(date) local hourStr = date:sub(12, 13) local hour = tonumber(hourStr) return hour >= 6 and hour <= 21 end function owe_p.on_next_document(doc) if tmp.day_forecast_idx == owe_p.forecast_days + 1 then return false end if not doc.dt_txt then return end local date = doc.dt_txt if not accept_time(date) then if log.is_debug then log.debug("OWE reject:", tostring(date)) end return true end dateFormat:set_time(doc.dt, owe_p.utc_offset) local df = {} -- Day Forecast df.date = date df.day = dateFormat:get_day_of_week_up() df.temp_min = doc.main.temp_min df.temp_max = doc.main.temp_max df.temp = doc.main.temp local dw = doc.weather[1] df.description = dw.description df.id = dw.id if log.is_debug then log.debug("OWE next:", date, ",", df.day, ",", df.temp_min, ",", df.temp_max, ",", df.temp, ",", df.id, ",", df.description) end local next_doc = next_weather_chunk(df) if not next_doc then on_data_end() end return next_doc end
26.670588
132
0.618733
256f216a8b11064aef45c264c1450e147f9498e5
180
js
JavaScript
helpers/pqd.js
phuquocdog/wallet
0433bc358f53ae4f42ef2eb2b64fdecd547c34d1
[ "MIT" ]
1
2021-09-01T14:09:54.000Z
2021-09-01T14:09:54.000Z
helpers/pqd.js
phuquocdog/wallet
0433bc358f53ae4f42ef2eb2b64fdecd547c34d1
[ "MIT" ]
null
null
null
helpers/pqd.js
phuquocdog/wallet
0433bc358f53ae4f42ef2eb2b64fdecd547c34d1
[ "MIT" ]
null
null
null
const formatBalance = (balance) => { return balance + 'PQD'; } const formatAmountFiat = (balance) => { return balance*0.0001; } export { formatBalance, formatAmountFiat }
15
39
0.677778
6adcf811189ed5f8c0c3d3e396c539a7d9be19c6
468
swift
Swift
SwiftyShare/Classes/Connector.swift
FuYouFang/SwiftyShare
5923e57514c73a832f820ceb0a3064305164bd8c
[ "MIT" ]
null
null
null
SwiftyShare/Classes/Connector.swift
FuYouFang/SwiftyShare
5923e57514c73a832f820ceb0a3064305164bd8c
[ "MIT" ]
null
null
null
SwiftyShare/Classes/Connector.swift
FuYouFang/SwiftyShare
5923e57514c73a832f820ceb0a3064305164bd8c
[ "MIT" ]
null
null
null
// // Connector.swift // SwiftyShare // // Created by fuyoufang on 2020/12/10. // import Foundation // 微信平台 protocol WechatConnectorType { static func register(appid: String, universalLink: String) } // QQ protocol QQConnectorType { static func register(appid: String, enableUniveralLink: Bool, universalLink: String) } // 新浪微博 protocol SinaWeiboConnectorType { static func register(appid: String, enableUniveralLink: Bool, universalLink: String) }
19.5
88
0.741453
db8879dd215e687ece52ee53ecb13b6b459d4561
14,871
php
PHP
tests/old_api/Risk/RiskModelCreateCest.php
rashmi8105/Synapse
1213821588b459b81f6ca73f7a4be023f5ee28fe
[ "MIT" ]
null
null
null
tests/old_api/Risk/RiskModelCreateCest.php
rashmi8105/Synapse
1213821588b459b81f6ca73f7a4be023f5ee28fe
[ "MIT" ]
null
null
null
tests/old_api/Risk/RiskModelCreateCest.php
rashmi8105/Synapse
1213821588b459b81f6ca73f7a4be023f5ee28fe
[ "MIT" ]
null
null
null
<?php require_once 'tests/api/SynapseTestHelper.php'; class RiskModelCreateCest extends SynapseTestHelper { private $token; public function _before(ApiTester $I) { $this->token = $this->authenticate($I); } public function testCreateRiskGroup(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->add(new DateInterval('P2D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $I->sendPOST('riskmodels', array( 'risk_model_name' => 'Model' . uniqid(), 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => $this->getRequestIndicator() )); $I->seeResponseCodeIs(201); $I->seeResponseIsJson(); $I->seeResponseContains('id'); } public function testCreateRiskGroupInvaliddate(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->sub(new DateInterval('P10D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $I->sendPOST('riskmodels', array( 'risk_model_name' => 'Model' . uniqid(), 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => $this->getRequestIndicator() )); $I->seeResponseCodeIs(400); $I->seeResponseIsJson(); } public function testCreateRiskGroupWithoutName(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->add(new DateInterval('P2D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $I->sendPOST('riskmodels', array( 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => $this->getRequestIndicator() )); $I->seeResponseCodeIs(400); $I->seeResponseIsJson(); } public function testCreateRiskGroupDuplicateNmae(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->add(new DateInterval('P2D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $name = "Risk Model_1234_A"; $I->sendPOST('riskmodels', array( 'risk_model_name' => $name, 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => $this->getRequestIndicator() )); $I->sendPOST('riskmodels', array( 'risk_model_name' => $name, 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => $this->getRequestIndicator() )); $I->seeResponseCodeIs(400); $I->seeResponseIsJson(); } public function testCreateRiskGroupOverLap1(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->add(new DateInterval('P2D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $I->sendPOST('riskmodels', array( 'risk_model_name' => 'Model-A', 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => array( 0 => array( 'name' => 'red2low', 'min' => 1.1, 'max' => 1.2 ), 1 => array( 'name' => 'red2high', 'min' => 1.3, 'max' => 1.5 ), 2 => array( 'name' => 'redlow', 'min' => 1.5, 'max' => 1.6 ), 3 => array( 'name' => 'redhigh', 'min' => 1.7, 'max' => 1.8 ), 4 => array( 'name' => 'yellowlow', 'min' => 1.9, 'max' => 2 ), 5 => array( 'name' => 'yellowhigh', 'min' => 2.1, 'max' => 2.2 ), 6 => array( 'name' => 'greenlow', 'min' => 2.5, 'max' => 2.7 ) ) )); $I->seeResponseCodeIs(400); $I->seeResponseIsJson(); $I->seeResponseContains('id'); } public function testCreateRiskGroupOverLap2(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->add(new DateInterval('P2D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $I->sendPOST('riskmodels', array( 'risk_model_name' => 'Model-A', 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => array( 0 => array( 'name' => 'red2low', 'min' => 1.1, 'max' => 1.2 ), 1 => array( 'name' => 'red2high', 'min' => 1.3, 'max' => 1.4 ), 2 => array( 'name' => 'redlow', 'min' => 1.6, 'max' => 1.5 ), 3 => array( 'name' => 'redhigh', 'min' => 1.7, 'max' => 1.8 ), 4 => array( 'name' => 'yellowlow', 'min' => 1.9, 'max' => 2 ), 5 => array( 'name' => 'yellowhigh', 'min' => 2.1, 'max' => 2.2 ), 6 => array( 'name' => 'greenlow', 'min' => 2.5, 'max' => 2.7 ) ) )); $I->seeResponseCodeIs(400); $I->seeResponseIsJson(); $I->seeResponseContains('id'); } public function testCreateRiskGroupOverLap3(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->add(new DateInterval('P2D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $I->sendPOST('riskmodels', array( 'risk_model_name' => 'Model-A', 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => array( 0 => array( 'name' => 'red2low', 'min' => 1.1, 'max' => 1.2 ), 1 => array( 'name' => 'red2high', 'min' => 1.3, 'max' => 1.4 ), 2 => array( 'name' => 'redlow', 'min' => 1.5, 'max' => 1.6 ), 3 => array( 'name' => 'redhigh', 'min' => 1.7, 'max' => 1.8 ), 4 => array( 'name' => 'yellowlow', 'min' => 1.9, 'max' => 2.0 ), 5 => array( 'name' => 'yellowhigh', 'min' => 2.1, 'max' => 2.5 ), 6 => array( 'name' => 'greenlow', 'min' => 2.4, 'max' => 2.7 ) ) )); $I->seeResponseCodeIs(400); $I->seeResponseIsJson(); $I->seeResponseContains('id'); } public function testCreateRiskGroupOverLap4(ApiTester $I) { $I->wantTo('Create Risk Group by API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->haveHttpHeader('Accept-Language', null); $I->amBearerAuthenticated($this->token); $I->haveHttpHeader('Accept', 'application/json'); $start = new \DateTime(); $start->add(new DateInterval('P2D')); $end = new \DateTime(); $end->add(new DateInterval('P7D')); $enroll = new \DateTime(); $enroll->add(new DateInterval('P6D')); $I->sendPOST('riskmodels', array( 'risk_model_name' => 'Model-A', 'calculation_start_date' => $start->format('m/d/Y'), 'calculation_stop_date' => $end->format('m/d/Y'), 'enrollment_end_date' => $enroll->format('m/d/Y'), 'model_state' => 'Unassigned', 'risk_indicators' => array( 0 => array( 'name' => 'red2low', 'min' => 1.1, 'max' => 1.2 ), 1 => array( 'name' => 'red2high', 'min' => 1.2, 'max' => 1.5 ), 2 => array( 'name' => 'redlow', 'min' => 1.5, 'max' => 1.6 ), 3 => array( 'name' => 'redhigh', 'min' => 1.7, 'max' => 1.8 ), 4 => array( 'name' => 'yellowlow', 'min' => 1.9, 'max' => 2 ), 5 => array( 'name' => 'yellowhigh', 'min' => 2.1, 'max' => 2.2 ), 6 => array( 'name' => 'greenlow', 'min' => 2.5, 'max' => 2.7 ) ) )); $I->seeResponseCodeIs(400); $I->seeResponseIsJson(); $I->seeResponseContains('id'); } public function getRequestIndicator() { return array( 0 => array( 'name' => 'red2', 'min' => 1.1, 'max' => 1.2 ), 1 => array( 'name' => 'red', 'min' => 1.3, 'max' => 1.4 )/*, 2 => array( 'name' => 'redlow', 'min' => 1.5, 'max' => 1.6 ), 3 => array( 'name' => 'redhigh', 'min' => 1.7, 'max' => 1.8 ), 4 => array( 'name' => 'yellowlow', 'min' => 1.9, 'max' => 2 ), 5 => array( 'name' => 'yellowhigh', 'min' => 2.1, 'max' => 2.2 ), 6 => array( 'name' => 'greenlow', 'min' => 2.5, 'max' => 2.7 )*/ ); } }
33.120267
66
0.412413
25501f8c416114dbee9d6faa5559461f3bf05638
1,732
cs
C#
src/Identity/Beer.Identity.Shared/Requests/ClientRequests.cs
just-the-benno/Beer
e0c6b0ba2f0b615d8f2aa0c0ad44add62cdfef14
[ "MIT" ]
2
2022-01-20T18:38:54.000Z
2022-03-01T14:15:46.000Z
src/Identity/Beer.Identity.Shared/Requests/ClientRequests.cs
just-the-benno/Beer
e0c6b0ba2f0b615d8f2aa0c0ad44add62cdfef14
[ "MIT" ]
null
null
null
src/Identity/Beer.Identity.Shared/Requests/ClientRequests.cs
just-the-benno/Beer
e0c6b0ba2f0b615d8f2aa0c0ad44add62cdfef14
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace Beer.Identity.Shared.Requests { public static class ClientRequests { public static class V1 { public abstract class CreateOrUpdateClientRequest { [Required] [StringLength(50, MinimumLength = 3)] public String DisplayName { get; set; } [Required] [StringLength(50, MinimumLength = 3)] public String ClientId { get; set; } [Required] [StringLength(50, MinimumLength = 3)] public String Password { get; set; } public Boolean RequirePkce { get; set; } [Required] [MinLength(1)] [MaxLength(30)] public IEnumerable<String> RedirectUris { get; set; } [MaxLength(30)] public IEnumerable<String> AllowedCorsOrigins { get; set; } public String FrontChannelLogoutUri { get; set; } [Required] [MinLength(1)] [MaxLength(30)] public IEnumerable<String> PostLogoutRedirectUris { get; set; } [MaxLength(30)] public IEnumerable<String> AllowedScopes { get; set; } } public class CreateClientRequest : CreateOrUpdateClientRequest { } public class UpdateClientRequest : CreateOrUpdateClientRequest { public Guid SystemId { get; set; } } } } }
28.866667
79
0.524249
ed6ba510a7b13fd8940ca104231698f730c8c528
3,346
h
C
mtrace/mtrace.h
david-grs/boost_multi_index_container
8cb22a98c4d514260d45c8fefa34e113dd1d3aa8
[ "MIT" ]
8
2016-11-21T02:55:32.000Z
2021-01-26T12:49:11.000Z
mtrace/mtrace.h
david-grs/boost_multi_index_container
8cb22a98c4d514260d45c8fefa34e113dd1d3aa8
[ "MIT" ]
null
null
null
mtrace/mtrace.h
david-grs/boost_multi_index_container
8cb22a98c4d514260d45c8fefa34e113dd1d3aa8
[ "MIT" ]
4
2018-09-25T09:44:45.000Z
2021-01-26T12:59:01.000Z
#pragma once #include <tuple> #include <utility> extern "C" { #include <malloc.h> } namespace { using malloc_hook = void*(*)(size_t, const void*); using free_hook = void(*)(void*, const void*); using realloc_hook = void*(*)(void*, size_t, const void*); } namespace detail { template<typename T, typename F, std::size_t... Is> void for_each(T&& t, F f, std::integer_sequence<std::size_t, Is...>) { auto l = { (f(std::get<Is>(t)), 0)... }; } template<typename... Ts, typename F> void for_each_in_tuple(std::tuple<Ts...>& t, F f) { detail::for_each(t, f, std::make_index_sequence<sizeof...(Ts)>{}); } } template <typename... Handlers> struct mtrace { mtrace() { save_hooks(); load_custom_hooks(); } ~mtrace() { restore_hooks(); } template <std::size_t I> auto& get() { return std::get<I>(_handlers); } template <std::size_t I> const auto& get() const { return std::get<I>(_handlers); } static void* malloc(size_t size, const void* caller) { restore_hooks(); detail::for_each_in_tuple(_handlers, [&](auto& x) { x.pre_malloc(size); }); void* p = ::malloc(size); detail::for_each_in_tuple(_handlers, [&](auto& x) { x.post_malloc(size, p); }); save_hooks(); load_custom_hooks(); return p; } static void free(void* mem, const void* caller) { restore_hooks(); detail::for_each_in_tuple(_handlers, [&](auto& x) { x.pre_free(mem); }); ::free(mem); detail::for_each_in_tuple(_handlers, [&](auto& x) { x.post_free(mem); }); save_hooks(); load_custom_hooks(); } static void* realloc(void* mem, size_t size, const void* caller) { restore_hooks(); detail::for_each_in_tuple(_handlers, [&](auto& x) { x.pre_realloc(mem, size); }); void* p = ::realloc(mem, size); detail::for_each_in_tuple(_handlers, [&](auto& x) { x.post_realloc(mem, size, p); }); save_hooks(); load_custom_hooks(); return p; } private: static void load_custom_hooks() { __malloc_hook = malloc; __free_hook = free; __realloc_hook = realloc; } static void save_hooks() { _old_malloc = __malloc_hook; _old_free = __free_hook; _old_realloc = __realloc_hook; } static void restore_hooks() { __malloc_hook = _old_malloc; __free_hook = _old_free; __realloc_hook = _old_realloc; } static malloc_hook _old_malloc; static free_hook _old_free; static realloc_hook _old_realloc; static std::tuple<Handlers...> _handlers; template <std::size_t I, typename... Ts> friend auto& std::get(const mtrace<Ts...>&); }; template <typename... Handlers> malloc_hook mtrace<Handlers...>::_old_malloc; template <typename... Handlers> free_hook mtrace<Handlers...>::_old_free; template <typename... Handlers> realloc_hook mtrace<Handlers...>::_old_realloc; template <typename... Handlers> std::tuple<Handlers...> mtrace<Handlers...>::_handlers; namespace std { template<size_t I, typename... Handlers> auto& get(const mtrace<Handlers...>& mt) { return std::get<I>(mt._handlers); } }
23.56338
93
0.592648
6506b72e14d82e985c0eca48a6e920bb08315669
6,113
css
CSS
src/u-line-chart.vue/module.css
rainfore/vision-ui
953379f35b0a150a4d5daaee1702cdf875860024
[ "MIT" ]
9
2019-04-12T01:52:25.000Z
2020-08-28T08:25:50.000Z
src/u-line-chart.vue/module.css
rainfore/vision-ui
953379f35b0a150a4d5daaee1702cdf875860024
[ "MIT" ]
1
2018-09-17T11:11:16.000Z
2018-10-10T08:19:53.000Z
src/u-line-chart.vue/module.css
vusion/vusion-ui
953379f35b0a150a4d5daaee1702cdf875860024
[ "MIT" ]
null
null
null
$axis-y_width: 40px; $axis-x_height: 30px; $axis_border: #ccc; $axis-y_offset: 10px; $axis-x_offset: 6px; $line_border: #eee; $line_width: 2px; $line_offset: 6px; .wrap { height: 100%; } .grid { position: absolute; bottom: $axis-x_height; top: 15px; left: $axis-y_width; right: 20px; font-size: 0; } .layer { position: absolute; bottom: $axis-x_height; top: 15px; left: $axis-y_width; right: 20px; font-size: 0; } .line { position: absolute; fill-opacity: 0; stroke-width: $line_width; } .line[role="x"] { left: 0; right: 0; border-top: 1px solid $line_border; } .line[role="y"] { top: 0; bottom: -$line_offset; /* border-left: 1px solid $line_border; */ } .axis { position: absolute; z-index: 2; } .axis[role="axisx"] { left: $axis-y_width; right: 19px; bottom: 0; height: calc($axis-x_height + 1px); border-top: 1px solid $axis_border; } .axis[role="axisy"] { left: 0; top: 14px; bottom: $axis-x_height; width: calc($axis-y_width + 1px); border-right: 1px solid $axis_border; border: none; } .label { position: absolute; font-size: 12px; z-index: 10; } .label[role="label-xName"] { right: -50px; top: 6px; bottom: 0; } .label[role="label-yName"] { right: 10px; top: -25px; text-align: center; } .label[role="labelx"] { top: $axis-x_offset; bottom: 0; transform: translateX(-50%); text-align: center; } .label[role="labely"] { left: 0; right: $axis-y_offset; transform: translateY(50%); text-align: right; } .label-xName { right: -50px; top: 6px; bottom: 0; } .label-yName { right: 10px; top: -30px; text-align: right; } .elsvg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /* 修复最下面2px线条在svg中只显示一半的问题 */ .layer[role="layersvg"] { bottom: 28px; } .area { stroke-opacity: 0; fill: transparent; opacity: 0.2; } .elsvg:nth-of-type(5n+1) .line, .elsvg[color][color="info"] .line { stroke: $brand-info; } .elsvg:nth-of-type(5n+1) .area, .elsvg[color][color="info"] .area { fill: $brand-info; } .elsvg:nth-of-type(5n+2) .line, .elsvg[color][color="warning"] .line { stroke: $brand-warning; } .elsvg:nth-of-type(5n+2) .area, .elsvg[color][color="warning"] .area { fill: $brand-warning; } .elsvg:nth-of-type(5n+3) .line, .elsvg[color][color="success"] .line { stroke: $brand-success; } .elsvg:nth-of-type(5n+3) .area, .elsvg[color][color="success"] .area { fill: $brand-success; } .elsvg:nth-of-type(5n+4) .line, .elsvg[color][color="error"] .line { stroke: $brand-error; } .elsvg:nth-of-type(5n+4) .area, .elsvg[color][color="error"] .area { fill: $brand-error; } .elsvg:nth-of-type(5n+5) .line, .elsvg[color][color="primary"] .line { stroke: $brand-primary; } .elsvg:nth-of-type(5n+5) .area, .elsvg[color][color="primary"] .area { fill: $brand-primary; } .piece { position: absolute; top: 0; bottom: 0; border-left: 1px solid transparent; /* transition: border-left-color $transition-duration-base; */ } .piece::before { content: ''; position: absolute; top: 0; bottom: 0; left: -50%; width: 50%; } .piece .u-tooltip { display: none; position: absolute; z-index: 10; margin-top: -16px; white-space: nowrap; padding: 4px 12px; font-size: 12px; background: #333; color: #eee; box-sizing: border-box; max-width: 230px; } .piece .u-tooltip::after { content: ''; display: block; position: absolute; border: 5px solid #333; } .piece .u-tooltip[role="u-tooltip-right-top"] { margin-left: 6px; } .piece .u-tooltip[role="u-tooltip-right-top"]::after { top: 10px; left: -5px; border-left: none; border-top-color: transparent; border-bottom-color: transparent; } .piece .u-tooltip[role="u-tooltip-right-bottom"] { margin-left: 6px; } .piece .u-tooltip[role="u-tooltip-right-bottom"]::after { top: 10px; left: -5px; border-left: none; border-top-color: transparent; border-bottom-color: transparent; } .piece .u-tooltip[role="u-tooltip-left-top"] { margin-right: 10px; right: 100%; } .piece .u-tooltip[role="u-tooltip-left-top"]::after { top: 10px; right: -5px; border-right: none; border-top-color: transparent; border-bottom-color: transparent; } .piece .u-tooltip[role="u-tooltip-left-bottom"] { margin-right: 10px; right: 100%; } .piece .u-tooltip[role="u-tooltip-left-bottom"]::after { top: 10px; right: -5px; border-right: none; border-top-color: transparent; border-bottom-color: transparent; } .piece:hover { border-left-color: rgba(0, 0, 0, 0.2); } .piece[scatter]:hover { border: none; } .piece:hover .u-tooltip { display: block; } .point { position: absolute; z-index: 2; box-sizing: border-box; background: white; /* border: 2px solid white; */ border-radius: 100%; margin-bottom: -4px; margin-left: -4px; width: 7px; height: 7px; display: none; } .point[scatter] { width: 4px; height: 4px; margin-bottom: -2px; margin-left: -2px; border-color: rgb(97, 218, 198); background: rgb(97, 218, 198); border: 1px solid rgba(0, 153, 255, 0.6); display: block; } .piece .point { background: $brand-info; } .piece:hover .point { display: block; } .piece:hover .point[scatter] { transform: scale(2); } .piece .point:nth-of-type(5n+1), .piece .point[color][color="info"] { background: $brand-info; } .piece .point:nth-of-type(5n+2), .piece .point[color][color="warning"] { background: $brand-warning; } .piece .point:nth-of-type(5n+3), .piece .point[color][color="success"] { background: $brand-success; } .piece .point:nth-of-type(5n+4), .piece .point[color][color="error"] { background: $brand-error; } .piece .point:nth-of-type(5n+5), .piece .point[color][color="primary"] { background: $brand-primary; } .piece .point[special][class] { display: block; background-color: red; }
20.792517
102
0.611647
141d52942b4ff4a9fc096ff3f3cbe232a1b3c367
115
ts
TypeScript
src/constants/index.ts
thecuriousbig/nateekul
b73251bb0bff0f0782aa9086e19ce7ffc8178f1e
[ "MIT" ]
null
null
null
src/constants/index.ts
thecuriousbig/nateekul
b73251bb0bff0f0782aa9086e19ce7ffc8178f1e
[ "MIT" ]
null
null
null
src/constants/index.ts
thecuriousbig/nateekul
b73251bb0bff0f0782aa9086e19ce7ffc8178f1e
[ "MIT" ]
null
null
null
import COMMON from './common' import COLORS from './color' import MAP from './map' export { COMMON, COLORS, MAP }
19.166667
30
0.695652
b0908c633f0709f6002f5e1414100bb8b82462ba
3,494
py
Python
scripts/mkcpio.py
comptuzus/alchemy
4e9423193422d212b718c0f95dc31e2fc6d004a3
[ "BSD-3-Clause" ]
17
2015-11-06T10:00:04.000Z
2021-11-14T03:43:29.000Z
scripts/mkcpio.py
comptuzus/alchemy
4e9423193422d212b718c0f95dc31e2fc6d004a3
[ "BSD-3-Clause" ]
5
2015-11-06T09:59:20.000Z
2021-10-04T07:42:50.000Z
scripts/mkcpio.py
comptuzus/alchemy
4e9423193422d212b718c0f95dc31e2fc6d004a3
[ "BSD-3-Clause" ]
20
2015-11-03T06:12:49.000Z
2021-07-07T21:43:22.000Z
#=============================================================================== # Generate a file system image in 'cpio' format. #=============================================================================== import os import stat #=============================================================================== #=============================================================================== class Cpio(object): def __init__(self, fout): self.writeLen = 0 self.inode = 0 self.fout = fout def align4(self): for _ in range(0, (4 - self.writeLen % 4) % 4): self.fout.write(b"\0") self.writeLen += 1 def align512(self): for _ in range(0, (512 - self.writeLen % 512) % 512): self.fout.write(b"\0") self.writeLen += 1 def write(self, buf): self.fout.write(buf) self.writeLen += len(buf) def writeHeader(self, entry): buf = ("%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x" % ( "070701", self.inode, entry.st.st_mode, entry.st.st_uid, entry.st.st_gid, 1, int(entry.st.st_mtime), entry.dataSize, 0, 0, os.major(entry.st.st_dev), os.minor(entry.st.st_dev), len(entry.filePath) + 1, 0)) self.write(buf.encode("UTF-8")) self.write((entry.filePath + "\0").encode("UTF-8")) self.align4() self.inode += 1 def writeTrailer(self): filePath = "TRAILER!!!" buf = ("%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x" % ( "070701", self.inode, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, len(filePath) + 1, 0)) self.write(buf.encode("UTF-8")) self.write((filePath + "\0").encode("UTF-8")) self.align512() self.inode += 1 #=============================================================================== #=============================================================================== def processTree(cpio, tree): for child in tree.children.values(): if stat.S_IFMT(child.st.st_mode) == stat.S_IFDIR: # No data, only header, do recursion cpio.writeHeader(child) processTree(cpio, child) elif stat.S_IFMT(child.st.st_mode) == stat.S_IFREG: # Write file header and file content cpio.writeHeader(child) cpio.write(child.getData()) cpio.align4() elif stat.S_IFMT(child.st.st_mode) == stat.S_IFLNK: # Data is link target cpio.writeHeader(child) cpio.write(child.getData()) cpio.align4() elif stat.S_IFMT(child.st.st_mode) == stat.S_IFBLK: # No data, only header cpio.writeHeader(child) elif stat.S_IFMT(child.st.st_mode) == stat.S_IFCHR: # No data, only header cpio.writeHeader(child) #=============================================================================== #=============================================================================== def genImage(image, root): cpio = Cpio(image.fout) processTree(cpio, root) cpio.writeTrailer()
34.254902
80
0.398397
b0faea051e37499a50ef92a2362b1600ce64afee
7,831
py
Python
00_Miscellaneous/text-similarity-analysis/etl/modules/pipeline.py
bmjhit/tf-estimator-tutorials
c6801e178b2a2c12286f49cb92ad81ae51743958
[ "Apache-2.0" ]
685
2018-01-18T03:25:08.000Z
2022-03-19T06:54:02.000Z
00_Miscellaneous/text-similarity-analysis/etl/modules/pipeline.py
bmjhit/tf-estimator-tutorials
c6801e178b2a2c12286f49cb92ad81ae51743958
[ "Apache-2.0" ]
9
2020-09-26T01:26:59.000Z
2022-02-10T02:09:25.000Z
00_Miscellaneous/text-similarity-analysis/etl/modules/pipeline.py
bmjhit/tf-estimator-tutorials
c6801e178b2a2c12286f49cb92ad81ae51743958
[ "Apache-2.0" ]
259
2018-01-22T12:00:44.000Z
2022-03-12T22:57:10.000Z
#!/usr/bin/python # # Copyright 2018 Google LLC # # 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. from __future__ import absolute_import from __future__ import print_function from __future__ import division import apache_beam as beam import tensorflow as tf import tensorflow_transform as tft import tensorflow_transform.coders as tft_coders from tensorflow_transform.beam import impl from tensorflow_transform.beam.tft_beam_io import transform_fn_io from tensorflow_transform.tf_metadata import dataset_schema from tensorflow_transform.tf_metadata import dataset_metadata ########################################################### # Preprocess Reuter Dataset ########################################################### def get_paths(file_pattern, test_mode=False): """ glob_pattern = './data/*.sgm' """ import tensorflow as tf paths = tf.gfile.Glob(file_pattern) if test_mode: paths = paths[:1] return paths def get_articles(file_path): """ file_path = './data/reut2-000.sgm' """ import bs4 import tensorflow as tf data = tf.gfile.GFile(file_path).read() soup = bs4.BeautifulSoup(data, "html.parser") articles = [] for raw_article in soup.find_all('reuters'): article = { 'title': get_title(raw_article), 'content': get_content(raw_article), 'topics': get_topics(raw_article), } if None not in article.values(): if [] not in article.values(): articles.append(article) return articles def get_title(article): title = article.find('text').title if title != None: title = title.text.encode('ascii', 'ignore') return title def get_content(article): import nltk content = article.find('text').body if content != None: content = content.text.encode('ascii', 'ignore') content = content.replace('\n Reuter\n\x03', '') content = content.replace('\n', ' ') try: content = '\n'.join(nltk.sent_tokenize(content)) except LookupError: nltk.download('punkt') content = '\n'.join(nltk.sent_tokenize(content)) return content def get_topics(article): topics = [] for topic in article.topics.children: topics.append(topic.text.encode('ascii', 'ignore')) if len(topics) > 0: return ','.join(topics) else: return '' ########################################################### # TensorFlow Transform ########################################################### def get_metadata(): from tensorflow_transform.tf_metadata import dataset_schema from tensorflow_transform.tf_metadata import dataset_metadata metadata = dataset_metadata.DatasetMetadata(dataset_schema.Schema({ 'title': dataset_schema.ColumnSchema( tf.string, [], dataset_schema.FixedColumnRepresentation()), 'content': dataset_schema.ColumnSchema( tf.string, [], dataset_schema.FixedColumnRepresentation()), 'topics': dataset_schema.ColumnSchema( tf.string, [], dataset_schema.FixedColumnRepresentation()), })) return metadata def preprocess_fn(input_features): import tensorflow_transform as tft title_embed = tft.apply_function(get_embed_content, input_features['content']) content_embed = tft.apply_function(get_embed_title, input_features['title']) output_features = { 'topics': input_features['topics'], 'title': input_features['title'], 'content': input_features['content'], 'title_embed': title_embed, 'content_embed': content_embed, } return output_features def get_embed_title( title, module_url='https://tfhub.dev/google/universal-sentence-encoder/1'): import tensorflow as tf import tensorflow_hub as hub module = hub.Module(module_url) embed = module(title) return embed def get_embed_content( content, delimiter='\n', module_url='https://tfhub.dev/google/universal-sentence-encoder/1'): import tensorflow as tf import tensorflow_hub as hub module = hub.Module(module_url) def _map_fn(t): t = tf.cast(t, tf.string) t = tf.string_split([t], delimiter).values e = module(t) e = tf.reduce_mean(e, axis=0) return tf.squeeze(e) embed = tf.map_fn(_map_fn, content, dtype=tf.float32) return embed ########################################################### # Write data to files or bq table ########################################################### def to_bq_row(entry): # might not need to round... entry['title_embed'] = [round(float(e), 3) for e in entry['title_embed']] entry['content_embed'] = [round(float(e), 3) for e in entry['content_embed']] return entry def get_bigquery_schema(): """ Returns a bigquery schema. """ from apache_beam.io.gcp.internal.clients import bigquery table_schema = bigquery.TableSchema() columns = (('topics', 'string', 'nullable'), ('title', 'string', 'nullable'), ('content', 'string', 'nullable'), ('title_embed', 'float', 'repeated'), ('content_embed', 'float', 'repeated')) for column in columns: column_schema = bigquery.TableFieldSchema() column_schema.name = column[0] column_schema.type = column[1] column_schema.mode = column[2] table_schema.fields.append(column_schema) return table_schema ########################################################### # Dataflow Pipeline ########################################################### def run(pipeline_options, known_args): pipeline = beam.Pipeline(options=pipeline_options) with impl.Context(known_args.transform_temp_dir): articles = ( pipeline | 'Get Paths' >> beam.Create(get_paths(known_args.file_pattern)) | 'Get Articles' >> beam.Map(get_articles) | 'Get Article' >> beam.FlatMap(lambda x: x) ) dataset = (articles, get_metadata()) transform_fn = ( dataset | 'Analyse dataset' >> impl.AnalyzeDataset(preprocess_fn) ) transformed_data_with_meta = ( (dataset, transform_fn) | 'Transform dataset' >> impl.TransformDataset() ) transformed_data, transformed_metadata = transformed_data_with_meta transform_fn | 'Export Transform Fn' >> transform_fn_io.WriteTransformFn( known_args.transform_export_dir) ( transformed_data | 'Convert to Insertable data' >> beam.Map(to_bq_row) | 'Write to BigQuery table' >> beam.io.WriteToBigQuery( project=known_args.bq_project, dataset=known_args.bq_dataset, table=known_args.bq_table, schema=get_bigquery_schema(), create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED, write_disposition=beam.io.BigQueryDisposition.WRITE_TRUNCATE) ) if known_args.enable_tfrecord: transformed_data | 'Write TFRecords' >> beam.io.tfrecordio.WriteToTFRecord( file_path_prefix='{0}/{1}'.format(known_args.tfrecord_export_dir, 'reuter'), file_name_suffix='.tfrecords', coder=tft_coders.example_proto_coder.ExampleProtoCoder(transformed_metadata.schema)) if known_args.enable_debug: transformed_data | 'Debug Output' >> beam.io.textio.WriteToText( file_path_prefix=known_args.debug_output_prefix, file_name_suffix='.txt') job = pipeline.run() if pipeline_options.get_all_options()['runner'] == 'DirectRunner': job.wait_until_finish()
31.449799
94
0.659047
a42a08cffb3a8903f43a0ac9f86a70297567b51a
700
php
PHP
src/Domain/Event/ImageRegistered.php
Innmind/Library
500048a0cb751ed821e7bc50a82e945453fae619
[ "MIT" ]
null
null
null
src/Domain/Event/ImageRegistered.php
Innmind/Library
500048a0cb751ed821e7bc50a82e945453fae619
[ "MIT" ]
8
2019-06-07T09:08:14.000Z
2022-03-29T22:34:07.000Z
src/Domain/Event/ImageRegistered.php
Innmind/Library
500048a0cb751ed821e7bc50a82e945453fae619
[ "MIT" ]
null
null
null
<?php declare(strict_types = 1); namespace Domain\Event; use Domain\Entity\Image\Identity; use Innmind\Url\{ Path, Query }; final class ImageRegistered { private Identity $identity; private Path $path; private Query $query; public function __construct( Identity $identity, Path $path, Query $query ) { $this->identity = $identity; $this->path = $path; $this->query = $query; } public function identity(): Identity { return $this->identity; } public function path(): Path { return $this->path; } public function query(): Query { return $this->query; } }
16.27907
40
0.572857
54bff11757910d43e534ff08db95639366a3b782
3,847
h
C
Engine/Source/Editor/Sequencer/Public/ISequencerKeyCollection.h
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
1
2022-01-29T18:36:12.000Z
2022-01-29T18:36:12.000Z
Engine/Source/Editor/Sequencer/Public/ISequencerKeyCollection.h
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
null
null
null
Engine/Source/Editor/Sequencer/Public/ISequencerKeyCollection.h
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
null
null
null
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" class UMovieSceneSection; class FSequencerDisplayNode; class IKeyArea; enum class EFindKeyDirection { Forwards, Backwards }; struct FSequencerKeyCollectionSignature { FSequencerKeyCollectionSignature() {} /** Initialize this key collection from the specified nodes. Only gathers keys from those explicitly specified. */ SEQUENCER_API static FSequencerKeyCollectionSignature FromNodes(const TArray<FSequencerDisplayNode*>& InNodes, float InDuplicateThresholdTime); /** Initialize this key collection from the specified nodes. Gathers keys from all child nodes. */ SEQUENCER_API static FSequencerKeyCollectionSignature FromNodesRecursive(const TArray<FSequencerDisplayNode*>& InNodes, float InDuplicateThresholdTime); /** Initialize this key collection from the specified node and section index. */ SEQUENCER_API static FSequencerKeyCollectionSignature FromNodeRecursive(FSequencerDisplayNode& InNode, UMovieSceneSection* InSection, float InDuplicateThresholdTime); /** Compare this signature for inequality with another */ SEQUENCER_API friend bool operator!=(const FSequencerKeyCollectionSignature& A, const FSequencerKeyCollectionSignature& B); /** Compare this signature for equality with another */ SEQUENCER_API friend bool operator==(const FSequencerKeyCollectionSignature& A, const FSequencerKeyCollectionSignature& B); /** Access the map of keyareas and signatures this signature was generated for */ const TMap<TSharedRef<IKeyArea>, FGuid>& GetKeyAreas() const { return KeyAreaToSignature; } /** Access duplicate threshold that this signature was generated for */ float GetDuplicateThreshold() const { return DuplicateThresholdTime; } private: /** Check whether this signature contains content that cannot be cached (such content causes this signature to never compare equal with another) */ bool HasUncachableContent() const; /** The time at which proximal keys are considered duplicates */ float DuplicateThresholdTime; /** Map of key areas to the section signature with with this signature was generated */ TMap<TSharedRef<IKeyArea>, FGuid> KeyAreaToSignature; }; /** * A collection of keys gathered recursively from a particular node or nodes */ class ISequencerKeyCollection { public: virtual ~ISequencerKeyCollection() {} public: /** Iterate the keys contained within this collection */ virtual void IterateKeys(const TFunctionRef<bool(float)>& Iter) = 0; /** Get a value specifying how close keys need to be in order to be considered equal by this collection */ virtual float GetKeyGroupingThreshold() const = 0; /** Find the first key in the given range */ virtual TOptional<float> FindFirstKeyInRange(const TRange<float>& InRange, EFindKeyDirection Direction) const = 0; public: /** * Initialize this key collection from the specified nodes. Only gathers keys from those explicitly specified. * @return true if this collection was (re)initialized, false if it did not need updating */ virtual bool InitializeExplicit(const TArray<FSequencerDisplayNode*>& InNodes, float DuplicateThreshold = SMALL_NUMBER) = 0; /** * Initialize this key collection from the specified nodes. Gathers keys from all child nodes. * @return true if this collection was (re)initialized, false if it did not need updating */ virtual bool InitializeRecursive(const TArray<FSequencerDisplayNode*>& InNodes, float DuplicateThreshold = SMALL_NUMBER) = 0; /** * Initialize this key collection from the specified node and section index. * @return true if this collection was (re)initialized, false if it did not need updating */ virtual bool InitializeRecursive(FSequencerDisplayNode& InNode, UMovieSceneSection* InSection, float DuplicateThreshold = SMALL_NUMBER) = 0; };
39.255102
167
0.788407
f46d6b7092c5321dcf1b36ce725cf5d2818ef09c
3,608
cs
C#
TencentCloud/As/V20180419/Models/InternetAccessible.cs
TencentCloud/tencentcloud-sdk-dotnet-intl-en
0cf98d17d670b8ba00c6ceb41f856b3d100572ae
[ "Apache-2.0" ]
1
2020-12-07T13:02:41.000Z
2020-12-07T13:02:41.000Z
TencentCloud/As/V20180419/Models/InternetAccessible.cs
TencentCloud/tencentcloud-sdk-dotnet-intl-en
0cf98d17d670b8ba00c6ceb41f856b3d100572ae
[ "Apache-2.0" ]
20
2021-04-26T00:59:24.000Z
2021-04-26T00:59:43.000Z
TencentCloud/As/V20180419/Models/InternetAccessible.cs
TencentCloud/tencentcloud-sdk-dotnet-intl-en
0cf98d17d670b8ba00c6ceb41f856b3d100572ae
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. 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. */ namespace TencentCloud.As.V20180419.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class InternetAccessible : AbstractModel { /// <summary> /// Network billing method. Value range: <br><li>BANDWIDTH_PREPAID: Prepaid by bandwidth <br><li>TRAFFIC_POSTPAID_BY_HOUR: Postpaid by traffic on a per hour basis <br><li>BANDWIDTH_POSTPAID_BY_HOUR: Postpaid by bandwidth on a per hour basis <br><li>BANDWIDTH_PACKAGE: BWP user <br>Default value: TRAFFIC_POSTPAID_BY_HOUR. /// Note: This field may return null, indicating that no valid values can be obtained. /// </summary> [JsonProperty("InternetChargeType")] public string InternetChargeType{ get; set; } /// <summary> /// The maximum outbound bandwidth in Mbps of the public network. The default value is 0 Mbps. The upper limit of bandwidth varies by model. For more information, see [Purchase Network Bandwidth](https://intl.cloud.tencent.com/document/product/213/509?from_cn_redirect=1). /// Note: This field may return null, indicating that no valid values can be obtained. /// </summary> [JsonProperty("InternetMaxBandwidthOut")] public ulong? InternetMaxBandwidthOut{ get; set; } /// <summary> /// Whether to assign a public IP. Value range: <br><li>TRUE: Assign a public IP <br><li>FALSE: Do not assign a public IP <br><br>If the public network bandwidth is greater than 0 Mbps, you are free to choose whether to enable the public IP (which is enabled by default). If the public network bandwidth is 0 Mbps, no public IP will be allowed to be assigned. /// Note: This field may return null, indicating that no valid values can be obtained. /// </summary> [JsonProperty("PublicIpAssigned")] public bool? PublicIpAssigned{ get; set; } /// <summary> /// Bandwidth package ID. You can obtain the ID from the `BandwidthPackageId` field in the response of the [DescribeBandwidthPackages](https://intl.cloud.tencent.com/document/api/215/19209?from_cn_redirect=1) API. /// Note: this field may return null, indicating that no valid value was found. /// </summary> [JsonProperty("BandwidthPackageId")] public string BandwidthPackageId{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "InternetChargeType", this.InternetChargeType); this.SetParamSimple(map, prefix + "InternetMaxBandwidthOut", this.InternetMaxBandwidthOut); this.SetParamSimple(map, prefix + "PublicIpAssigned", this.PublicIpAssigned); this.SetParamSimple(map, prefix + "BandwidthPackageId", this.BandwidthPackageId); } } }
52.289855
367
0.693736
45463c9983ef77308c2d9879bef9ecc62d62de8e
1,905
py
Python
hw1/code/VBEM.py
shinshiner/CS420-Machine-Learning
dacb1b5e5caef2be523a0b56af81db3f449049d0
[ "MIT" ]
6
2019-05-07T02:38:43.000Z
2022-03-14T07:46:59.000Z
hw1/code/VBEM.py
shinshiner/CS420-Machine-Learning
dacb1b5e5caef2be523a0b56af81db3f449049d0
[ "MIT" ]
null
null
null
hw1/code/VBEM.py
shinshiner/CS420-Machine-Learning
dacb1b5e5caef2be523a0b56af81db3f449049d0
[ "MIT" ]
null
null
null
from sklearn.mixture import BayesianGaussianMixture from dataset import Dataset import numpy as np import matplotlib.pyplot as plt from copy import deepcopy class VBEM(object): def __init__(self, n_components = 1, verbose = 2, verbose_interval = 1, Data = None): ''' :param n_components: cluster number :param verbose: whether to show training details :param verbose_interval: showing training details interval :param Data: dataset ''' self.model = BayesianGaussianMixture( n_components = n_components, verbose = verbose, verbose_interval = verbose_interval) self.n_components = n_components if Data == None: self.dataset = Dataset() self.dataset.generate() else: self.dataset = Data self.data = self.dataset.data def train(self): self.model.fit(self.data) def show(self, n = None): ''' show the result of trained model :param n: just used for save files :return: None ''' plt.figure() labels = self.model.predict(self.data) plt.scatter(self.data[:, 0], self.data[:, 1], c = labels, s = 15) if n == None: plt.show() else: plt.savefig('report/demo/vbem_%d_%d' % (n, 4)) def show_dis(self, dis = None): ''' show the result of trained model :param dis: just used for save files :return: None ''' plt.figure() labels = self.model.predict(self.data) plt.scatter(self.data[:, 0], self.data[:, 1], c = labels, s = 15) if dis == None: plt.show() else: plt.savefig('report/demo/dis_vbem_%d_%d' % (dis, 3)) if __name__ == '__main__': gmm = VBEM(n_components = 4) gmm.train() gmm.show()
28.863636
75
0.564829
e38db037220a0dd049e23e7fdd62e5045a71e7e0
5,858
rb
Ruby
spec/models/ovrs/newborn_record_spec.rb
CDCgov/artemis
57767f8a213212894873c38807937c9b95850592
[ "Apache-2.0" ]
1
2020-10-15T01:35:46.000Z
2020-10-15T01:35:46.000Z
spec/models/ovrs/newborn_record_spec.rb
CDCgov/artemis
57767f8a213212894873c38807937c9b95850592
[ "Apache-2.0" ]
2
2017-11-30T16:14:33.000Z
2018-03-19T19:45:48.000Z
spec/models/ovrs/newborn_record_spec.rb
CDCgov/GaTech-Fall2017-Newborn-FHIRFighters
c9172b5ffcf9303811b98b4bb53421f0aaf6be9e
[ "Apache-2.0" ]
1
2020-12-21T22:23:14.000Z
2020-12-21T22:23:14.000Z
require 'rails_helper' RSpec.describe OVRS::NewbornRecord, type: :model do before { described_class.reload } describe '.collection_cache_key' do it 'returns a cacheable string' do expect(described_class.collection_cache_key).to match %r{OVRS\/\d+} end end it 'correctly loads the records from the CSV file' do expect(described_class.count).to eq 100 first = described_class.first expect(first.attributes).to eq( id: 'UT850A001', birth_length: 27, birth_weight: 3255, birthdate: Date.new(2015, 3, 2), first_name: 'James', kit: 'UT850A001', last_name: 'Kirk', mothers_birthdate: Date.new(2000, 1, 1), mothers_first_name: nil, mothers_last_name: 'Kirk', multiple_birth: 1, sex: 'M' ) end describe '#fhir elements' do let(:record) { described_class.find('UT850A002') } # 2015 00135,UT850A002,Christmas,Merry,2015,12,8,F,Christmas,1985,1,8,2881,1,22 let(:fhir_patient) { record.patient_object } describe '#patient_object' do it 'returns a FHIR Patient' do expect(record.patient_object).to be_a(FHIR::Patient) end it 'uses the record ID as the identifier' do expect(fhir_patient.identifier[0].value).to eq(record[:id]) expect(fhir_patient.identifier[0].use).to eq('official') end it 'fills in the given name' do expect(fhir_patient.name[0].given[0]).to eq(record[:first_name]) end it 'fills in the family name' do expect(fhir_patient.name[0].family).to eq(record[:last_name]) end it 'fills in the birth date' do expect(fhir_patient.birthDate).to eq(record[:birthdate]) end it 'fills in the multiple birth integer value' do expect(fhir_patient.multipleBirthInteger).to eq(record[:multiple_birth]) end context 'gender is mapped properly when gender is' do before(:each) do allow(record).to receive(:[]).and_call_original allow(record).to receive(:[]).with(:sex).and_return(sex) end context 'female' do let(:sex) { 'F' } it 'fills in the gender' do expect(fhir_patient.gender).to eq('female') end end context 'male' do let(:sex) { 'M' } it 'fills in the gender' do expect(fhir_patient.gender).to eq('male') end end context 'missing' do let(:sex) { nil } it 'fills in the gender' do expect(fhir_patient.gender).to eq('unknown') end end end end describe '#add_mother_to_patient' do let(:fhir_patient) { record.patient_object } let(:mother) { double('RelatedPerson', id: '12345') } it 'adds a reference to a RelatedPerson representing the mother' do record.add_mother_to_patient(mother, fhir_patient) expect(fhir_patient.link[0]).to be_a(FHIR::Patient::Link) expect( fhir_patient.link[0].other.reference ).to eq("RelatedPerson/#{mother.id}") end end describe '#mother_info' do let(:mother) { record.mother_info fhir_patient } it 'fills in the birthdate' do expect(mother.birthDate).to eq(record[:mothers_birthdate]) end it 'fills in the family name' do expect(mother.name[0].family).to eq(record[:mothers_last_name]) end it 'does not fill in a first name' do expect(mother.name[0].given).to be_empty end it 'links the mother to the patient' do expect(mother.patient).to be_a(FHIR::Reference) expect(mother.patient.reference).to eq("Patient/#{fhir_patient.id}") end end describe '#birth_length_observation' do let(:code) { '8305-5' } let(:observation) { record.birth_length_observation fhir_patient } it 'returns an observation' do expect(observation).to be_a(FHIR::Observation) end it 'links the observation to the patient' do expect(observation.subject).to be_a(FHIR::Reference) expect(observation.subject.reference).to eq("Patient/#{fhir_patient.id}") end it 'fills in the coding system and code' do expect(observation.code).to be_a(FHIR::CodeableConcept) expect(observation.code.coding[0]).to be_a(FHIR::Coding) expect(observation.code.coding[0].system).to eq('http://loinc.org') expect(observation.code.coding[0].code).to eq(code) end it 'fills in the birth length' do expect(observation.valueQuantity).to be_a(FHIR::Quantity) expect(observation.valueQuantity.unit).to eq('cm') expect(observation.valueQuantity.value).to eq(record[:birth_length]) end end describe '#birth_weight_observation' do let(:code) { '56056-5' } let(:observation) { record.birth_weight_observation fhir_patient } it 'returns an observation for the birth weight' do expect(observation).to be_a(FHIR::Observation) end it 'links the observation to the patient' do expect(observation.subject).to be_a(FHIR::Reference) expect(observation.subject.reference).to eq("Patient/#{fhir_patient.id}") end it 'fills in the coding system and code' do expect(observation.code).to be_a(FHIR::CodeableConcept) expect(observation.code.coding[0]).to be_a(FHIR::Coding) expect(observation.code.coding[0].system).to eq('http://loinc.org') expect(observation.code.coding[0].code).to eq(code) end it 'fills in the birth length' do expect(observation.valueQuantity).to be_a(FHIR::Quantity) expect(observation.valueQuantity.unit).to eq('g') expect(observation.valueQuantity.value).to eq(record[:birth_weight]) end end end end
32.186813
84
0.639467
7f2b9506fe907aaede1cbda5876df7ed7521f67c
187
cs
C#
CommonAssemblyInfo.cs
thirkcircus/Obsolete
68a96575eda0f3226b2f2e8333a302f1c13cafcc
[ "MIT" ]
null
null
null
CommonAssemblyInfo.cs
thirkcircus/Obsolete
68a96575eda0f3226b2f2e8333a302f1c13cafcc
[ "MIT" ]
null
null
null
CommonAssemblyInfo.cs
thirkcircus/Obsolete
68a96575eda0f3226b2f2e8333a302f1c13cafcc
[ "MIT" ]
null
null
null
using System.Reflection; [assembly: AssemblyTitle("Obsolete")] [assembly: AssemblyProduct("Obsolete")] [assembly: AssemblyVersion("3.0.1")] [assembly: AssemblyFileVersion("3.0.1")]
31.166667
41
0.73262
9c1d246ec6161c2b1b7e9ce77b0889fcb21f130d
1,484
lua
Lua
share/user_script.lua
paolofrb/cotson
1289b58ecc5d8279bc1124495ca0042f9586af11
[ "MIT" ]
null
null
null
share/user_script.lua
paolofrb/cotson
1289b58ecc5d8279bc1124495ca0042f9586af11
[ "MIT" ]
null
null
null
share/user_script.lua
paolofrb/cotson
1289b58ecc5d8279bc1124495ca0042f9586af11
[ "MIT" ]
null
null
null
#!/usr/bin/env lua -- (C) Copyright 2009 Hewlett-Packard Development Company, L.P. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -- OTHER DEALINGS IN THE SOFTWARE. -- -- $Id$ dofile(arg[0]:gsub("(.+)/.+","%1/defaults.lua")) function mysplit(inputstr, sep) if sep == nil then sep = "%s" end local t={} ; i=0 for str in string.gmatch(inputstr,"([^"..sep.."]+)") do t[i] = str i = i + 1 end return t end executed=false function execute(x) local tmpstrv={} tmpstrv=mysplit(x) l=location(tmpstrv[0]) check_exists(l,"user script '"..tmpstrv[0].."' does not exist") if (tmpstrv[1] ~= nil) then local tmps2=table.concat(tmpstrv, " ", 1); puts(l.." "..tmps2) else puts(l) end executed=true end if type(simnow)~='table' or type(simnow.commands)~='function' then error("no simnow.commands function") end if user_script==nil then simnow.commands() if executed==false then error("no execute call inside simnow.commands") end else execute(user_script) end
26.035088
77
0.650943
ffa89d65ac7556506d5cfedfa200390670df68be
4,363
py
Python
code/models/concrete_dropout.py
yannick-t/probabilistic_forecasting_of_energy_time_series_using_deep_learning
98a2b12270e79045b8704e9d9cc506ffadb95127
[ "CNRI-Python" ]
2
2021-04-12T10:52:40.000Z
2021-11-28T21:39:34.000Z
code/models/concrete_dropout.py
yannick-t/probabilistic_forecasting_of_energy_time_series_using_deep_learning
98a2b12270e79045b8704e9d9cc506ffadb95127
[ "CNRI-Python" ]
null
null
null
code/models/concrete_dropout.py
yannick-t/probabilistic_forecasting_of_energy_time_series_using_deep_learning
98a2b12270e79045b8704e9d9cc506ffadb95127
[ "CNRI-Python" ]
1
2021-07-07T17:17:59.000Z
2021-07-07T17:17:59.000Z
# Code based on https://github.com/yaringal/ConcreteDropout # License: # MIT License # # Copyright (c) 2017 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import torch import numpy as np from torch import nn from models.base_nn import BaseNN class ConcreteDropout(nn.Module): def __init__(self, weight_regularizer=1e-6, dropout_regularizer=1e-5, init_min=0.1, init_max=0.1): super(ConcreteDropout, self).__init__() self.weight_regularizer = weight_regularizer self.dropout_regularizer = dropout_regularizer init_min = np.log(init_min) - np.log(1. - init_min) init_max = np.log(init_max) - np.log(1. - init_max) self.p_logit = nn.Parameter(torch.empty(1).uniform_(init_min, init_max)) def forward(self, x, layer): p = torch.sigmoid(self.p_logit) out = layer(self._concrete_dropout(x, p)) sum_of_square = 0 for param in layer.parameters(): sum_of_square += torch.sum(torch.pow(param, 2)) weights_regularizer = self.weight_regularizer * sum_of_square / (1 - p) dropout_regularizer = p * torch.log(p) dropout_regularizer += (1. - p) * torch.log(1. - p) input_dimensionality = x[0].numel() # Number of elements of first item in batch dropout_regularizer *= self.dropout_regularizer * input_dimensionality regularization = weights_regularizer + dropout_regularizer return out, regularization def _concrete_dropout(self, x, p): eps = 1e-7 temp = 0.1 unif_noise = torch.rand_like(x) drop_prob = (torch.log(p + eps) - torch.log(1 - p + eps) + torch.log(unif_noise + eps) - torch.log(1 - unif_noise + eps)) drop_prob = torch.sigmoid(drop_prob / temp) random_tensor = 1 - drop_prob retain_prob = 1 - p x = torch.mul(x, random_tensor) x /= retain_prob return x class ConcreteDropoutNN(BaseNN): def __init__(self, weight_regularizer, dropout_regularizer, input_size, output_size, **kwargs): super(ConcreteDropoutNN, self).__init__(**kwargs) self.hidden_size.append(output_size) self.linear1 = nn.Linear(input_size, self.hidden_size[0]) self.linears = nn.ModuleList([nn.Linear(self.hidden_size[i], self.hidden_size[i + 1]) for i in range(len(self.hidden_size) - 1)]) self.conc_drops = nn.ModuleList([ConcreteDropout(weight_regularizer=weight_regularizer, dropout_regularizer=dropout_regularizer) for i in range(len(self.hidden_size))]) self.act = nn.ReLU() def forward(self, x): regularization = torch.empty(len(self.hidden_size), device=x.device) out_arr = [] out, regularization[0] = self.conc_drops[0](x, nn.Sequential(self.linear1, self.act)) out_arr.append(out) for i in range(len(self.hidden_size) - 1): if i == len(self.hidden_size) - 2: act = nn.Identity() else: act = self.act out, regularization[i + 1] = self.conc_drops[i + 1](out, nn.Sequential(self.linears[i], act)) out_arr.append(out) return out, regularization.sum()
36.974576
137
0.654825
ccc974be19d548278ac9c66b09c01fcf1640af5b
426
sql
SQL
Databases Basics/07.FunctionsProcedures/13.ScalarFunction.sql
borisbotev/SoftUni
c5526bd7af209cc4d526d2d67ac6bf361b6b6e84
[ "MIT" ]
null
null
null
Databases Basics/07.FunctionsProcedures/13.ScalarFunction.sql
borisbotev/SoftUni
c5526bd7af209cc4d526d2d67ac6bf361b6b6e84
[ "MIT" ]
null
null
null
Databases Basics/07.FunctionsProcedures/13.ScalarFunction.sql
borisbotev/SoftUni
c5526bd7af209cc4d526d2d67ac6bf361b6b6e84
[ "MIT" ]
null
null
null
CREATE FUNCTION dbo.ufn_CashInUsersGames (@gameName VARCHAR(MAX)) RETURNS @oddRowsTable TABLE (SumCash MONEY) AS BEGIN INSERT INTO @oddRowsTable SELECT SUM(ugg.Cash) AS Sum FROM ( SELECT ug.Cash, ROW_NUMBER() OVER (ORDER BY ug.Cash DESC) AS RowNumber, g.Name FROM UsersGames as ug INNER JOIN Games as g ON g.Id = ug.GameId WHERE g.Name = @gameName ) AS ugg WHERE ugg.RowNumber % 2 = 1 RETURN END
23.666667
65
0.711268
45d6e8fc5196bec03798ec495a1ff8618b56f0f5
4,200
py
Python
models/data/common.py
giorking/CenterNet_Pro_Max
dc50e7dd4b10eff5ad8f428641cc2f9a7ba01ce6
[ "Apache-2.0" ]
2
2020-05-05T07:08:05.000Z
2020-06-19T03:20:21.000Z
models/data/common.py
cavalleria/CenterNet_Pro_Max
bf2f6708c83ca2cb716315bb1aaf71039f458746
[ "Apache-2.0" ]
null
null
null
models/data/common.py
cavalleria/CenterNet_Pro_Max
bf2f6708c83ca2cb716315bb1aaf71039f458746
[ "Apache-2.0" ]
2
2020-03-29T01:41:18.000Z
2020-04-19T04:06:31.000Z
# # Copyright (c) 2020 jintian. # # This file is part of CenterNet_Pro_Max # (see jinfagang.github.io). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # import copy import logging import random import torch.utils.data as data import cloudpickle class PicklableWrapper(object): """ Wrap an object to make it more picklable, note that it uses heavy weight serialization libraries that are slower than pickle. It's best to use it only on closures (which are usually not picklable). This is a simplified version of https://github.com/joblib/joblib/blob/master/joblib/externals/loky/cloudpickle_wrapper.py """ def __init__(self, obj): self._obj = obj def __reduce__(self): s = cloudpickle.dumps(self._obj) return cloudpickle.loads, (s,) def __call__(self, *args, **kwargs): return self._obj(*args, **kwargs) def __getattr__(self, attr): # Ensure that the wrapped object can be used seamlessly as the previous object. if attr not in ["_obj"]: return getattr(self._obj, attr) return getattr(self, attr) __all__ = ["MapDataset", "DatasetFromList"] class MapDataset(data.Dataset): """ Map a function over the elements in a dataset. Args: dataset: a dataset where map function is applied. map_func: a callable which maps the element in dataset. map_func is responsible for error handling, when error happens, it needs to return None so the MapDataset will randomly use other elements from the dataset. """ def __init__(self, dataset, map_func): self._dataset = dataset self._map_func = PicklableWrapper(map_func) # wrap so that a lambda will work self._rng = random.Random(42) self._fallback_candidates = set(range(len(dataset))) def __len__(self): return len(self._dataset) def __getitem__(self, idx): retry_count = 0 cur_idx = int(idx) while True: data = self._map_func(self._dataset[cur_idx]) if data is not None: self._fallback_candidates.add(cur_idx) return data # _map_func fails for this idx, use a random new index from the pool retry_count += 1 self._fallback_candidates.discard(cur_idx) cur_idx = self._rng.sample(self._fallback_candidates, k=1)[0] if retry_count >= 3: logger = logging.getLogger(__name__) logger.warning( "Failed to apply `_map_func` for idx: {}, retry count: {}".format( idx, retry_count ) ) class DatasetFromList(data.Dataset): """ Wrap a list to a torch Dataset. It produces elements of the list as data. """ def __init__(self, lst: list, copy: bool = True): """ Args: lst (list): a list which contains elements to produce. copy (bool): whether to deepcopy the element when producing it, so that the result can be modified in place without affecting the source in the list. """ self._lst = lst self._copy = copy def __len__(self): return len(self._lst) def __getitem__(self, idx): if self._copy: return copy.deepcopy(self._lst[idx]) else: return self._lst[idx]
31.818182
93
0.642619
b0e0509d819a7690d43c33a6a6ef1b7817c6a95a
12,495
py
Python
mlonmcu/setup/task.py
tum-ei-eda/mlonmcu
0d5c114b85f2ae9e48e7d815bfce8df04c2bdb46
[ "Apache-2.0" ]
3
2022-03-07T09:38:12.000Z
2022-03-24T09:28:36.000Z
mlonmcu/setup/task.py
tum-ei-eda/mlonmcu
0d5c114b85f2ae9e48e7d815bfce8df04c2bdb46
[ "Apache-2.0" ]
24
2022-03-07T16:09:32.000Z
2022-03-31T08:08:51.000Z
mlonmcu/setup/task.py
tum-ei-eda/mlonmcu
0d5c114b85f2ae9e48e7d815bfce8df04c2bdb46
[ "Apache-2.0" ]
1
2022-03-07T09:38:17.000Z
2022-03-07T09:38:17.000Z
# # Copyright (c) 2022 TUM Department of Electrical and Computer Engineering. # # This file is part of MLonMCU. # See https://github.com/tum-ei-eda/mlonmcu.git for further info. # # 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. # """Definitions of a task registry used to automatically install dependencies.""" from functools import wraps import itertools from enum import Enum import time from typing import List, Tuple import networkx as nx from tqdm import tqdm from mlonmcu.logging import get_logger logger = get_logger() def get_combs(data) -> List[dict]: """Utility which returns combinations of the input data. Parameters ---------- data : dict Input dictionary Returns ------- combs : list All combinations of the input data. Examples -------- >>> get_combs({"foo": [False, True], "bar": [5, 10]}) [{"foo": False, "bar": 5}, {"foo": False, "bar": 10}, {"foo": True, "bar": 5}, {"foo": True, "bar": 10}] """ keys = list(data.keys()) values = list(data.values()) prod = list(itertools.product(*values)) if len(prod) == 1: if len(prod[0]) == 0: prod = [] combs = [dict(zip(keys, p)) for p in prod] return combs class TaskType(Enum): """Enumeration for the task type.""" MISC = 0 FRAMEWORK = 1 BACKEND = 2 TOOLCHAIN = 3 TARGET = 4 FRONTEND = 5 OPT = 6 FEATURE = 7 PLATFORM = 8 class TaskGraph: """Task graph object. Attributes ---------- names : list list of task names in the graph dependencies : dict Dependencies between task artifacts providers : dict Providers for all the artifacts Examples ------- TODO """ def __init__(self, names: List[str], dependencies: dict, providers: dict): self.names = names self.dependencies = dependencies self.providers = providers def get_graph(self) -> Tuple[list, list]: """Get nodes and edges of the task graph. Returns ------- nodes : list List of edges edges : list List of edge tuples. """ nodes = list(self.names) edges = [] for dest, deps in self.dependencies.items(): for dep in deps: if dep not in self.providers.keys(): raise RuntimeError(f"Unable to resolve dependency '{dep}'") src = self.providers[dep] edge = (src, dest) edges.append(edge) # Remove duplicates edges = list(dict.fromkeys(edges)) return nodes, edges def get_order(self) -> list: """Get execution order of tasks via topological sorting.""" nodes, edges = self.get_graph() graph = nx.DiGraph(edges) graph.add_nodes_from(nodes) order = list(nx.topological_sort(graph)) return order class TaskFactory: """Class which is used to register all available tasks and their annotations. Attributes ---------- registry : dict Mapping of task names and their actual function dependencies : dict Mapping of task dependencies providers : dict Mapping of which task provides which artifacts types : dict Mapping of task types validates : dict Mapping of validation functions for the tasks changed : list List of tasks?artifacts which have changed recently """ def __init__(self): self.registry = {} self.dependencies = {} self.providers = {} self.types = {} self.params = {} self.validates = {} self.changed = [] # Main problem: per def reset_changes(self): """Reset all pending changes.""" self.changed = [] def needs(self, keys, force=True): """Decorator which registers the artifacts a task needs to be processed.""" def real_decorator(function): name = function.__name__ if name in self.dependencies: self.dependencies[name].extend(keys) else: self.dependencies[name] = keys @wraps(function) def wrapper(*args, **kwargs): # logger.debug("Checking inputs...") if force: context = args[0] variables = context.cache._vars for key in keys: if key not in variables.keys() or variables[key] is None: raise RuntimeError(f"Task '{name}' needs the value of '{key}' which is not set") retval = function(*args, **kwargs) return retval return wrapper return real_decorator def optional(self, keys): """Decorator for optional task requirements.""" return self.needs(keys, force=False) # def optional(self, keys): # def real_decorator(function): # name = function.__name__ # if name in self.dependencies: # self.dependencies[name].extend(keys) # else: # self.dependencies[name] = keys # @wraps(function) # def wrapper(*args, **kwargs): # retval = function(*args, **kwargs) # return retval # return wrapper # return real_decorator def provides(self, keys): """Decorator which registers what a task provides.""" def real_decorator(function): name = function.__name__ for key in keys: self.providers[key] = name @wraps(function) def wrapper(*args, **kwargs): context = args[0] for key in keys: if key in context.cache._vars: del context.cache._vars[key] # Unset the value before calling function retval = function(*args, **kwargs) if retval is not False: # logger.debug("Checking outputs...") variables = context.cache._vars for key in keys: if key not in variables.keys() or variables[key] is None: raise RuntimeError(f"Task '{name}' did not set the value of '{key}'") return retval self.registry[name] = wrapper return wrapper return real_decorator def param(self, flag, options): """Decorator which registers available task parameters.""" if not isinstance(options, list): options = [options] def real_decorator(function): name = function.__name__ if name in self.params: self.params[name][flag] = options else: self.params[name] = {flag: options} @wraps(function) def wrapper(*args, **kwargs): retval = function(*args, **kwargs) return retval return wrapper return real_decorator def validate(self, func): """Decorator which registers validattion functions for a task.""" def real_decorator(function): name = function.__name__ self.validates[name] = func return function return real_decorator def register(self, category=TaskType.MISC): """Decorator which actually registers a task in the registry.""" def real_decorator(function): name = function.__name__ @wraps(function) def wrapper(*args, rebuild=False, progress=False, **kwargs): combs = get_combs(self.params[name]) def get_valid_combs(combs): ret = [] for comb in combs: if name in self.validates: check = self.validates[name](args[0], params=comb) if not check: continue ret.append(comb) return ret combs = get_valid_combs(combs) def process(name_, params=None, rebuild=False): if not params: params = [] rebuild = rebuild if name in self.dependencies: for dep in self.dependencies[name]: if dep in self.changed: rebuild = True break retval = function(*args, params=params, rebuild=rebuild, **kwargs) if retval: keys = [key for key, provider in self.providers.items() if provider == name] for key in keys: if key not in self.changed: self.changed.append(key) # logger.debug("Processed task:", function.__name__) return retval if progress: pbar = tqdm( total=max(len(combs), 1), desc="Processing", ncols=100, bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}s]", leave=None, ) else: pbar = None if len(combs) == 0: if pbar: pbar.set_description(f"Processing: {name}") else: logger.info("Processing task: %s", name) time.sleep(0.1) check = True if name in self.validates: check = self.validates[name](args[0], params={}) if check: start = time.time() retval = process(name, rebuild=rebuild) end = time.time() diff = end - start minutes = int(diff // 60) seconds = int(diff % 60) duration_str = f"{seconds}s" if minutes == 0 else f"{minutes}m{seconds}s" if not pbar: logger.debug("-> Done (%s)", duration_str) # TODO: move this to helper func else: logger.debug("-> Skipped") retval = False if pbar: pbar.update(1) else: for comb in combs: # TODO process in parallel? extended_name = name + str(comb) if pbar: pbar.set_description(f"Processing - {extended_name}") else: logger.info("Processing task: %s", extended_name) time.sleep(0.1) start = time.time() retval = process(extended_name, params=comb, rebuild=rebuild) end = time.time() diff = end - start minutes = int(diff // 60) seconds = int(diff % 60) duration_str = f"{seconds}s" if minutes == 0 else f"{minutes}m{seconds}s" if not pbar: logger.debug("-> Done (%s)", duration_str) # TODO: move this to helper func else: pbar.update(1) if pbar: pbar.close() return retval self.registry[name] = wrapper self.types[name] = category self.params[name] = {} return wrapper return real_decorator
33.679245
108
0.504682
0a3617a47de3d3fb39eaeef306a28e7b1fc3d93a
893
sql
SQL
03.TableRelationships/UniversityDatabase.sql
llukanov/SoftUni-Database-Basics
5395d4d3e749884be7e028d445d24e148d6bc630
[ "MIT" ]
null
null
null
03.TableRelationships/UniversityDatabase.sql
llukanov/SoftUni-Database-Basics
5395d4d3e749884be7e028d445d24e148d6bc630
[ "MIT" ]
null
null
null
03.TableRelationships/UniversityDatabase.sql
llukanov/SoftUni-Database-Basics
5395d4d3e749884be7e028d445d24e148d6bc630
[ "MIT" ]
null
null
null
CREATE DATABASE University USE University CREATE TABLE Majors ( [MajorID] INT IDENTITY NOT NULL PRIMARY KEY, [Name] NVARCHAR(50) NOT NULL, ) CREATE TABLE Students ( [StudentID] INT IDENTITY NOT NULL PRIMARY KEY, [StudentNumber] INT NOT NULL, [StudentName] NVARCHAR(50) NOT NULL, [MajorID] INT NOT NULL FOREIGN KEY REFERENCES Majors([MajorID]) ) CREATE TABLE Payments ( [PaymentID] INT IDENTITY NOT NULL PRIMARY KEY, [PaymentDate] DATE NOT NULL, [PaymentAmount] DECIMAL(18, 2) NOT NULL, [StudentID] INT NOT NULL FOREIGN KEY REFERENCES Students([StudentID]) ) CREATE TABLE Subjects ( [SubjectID] INT IDENTITY NOT NULL PRIMARY KEY, [SubjectsName] NVARCHAR(50) NOT NULL ) CREATE TABLE Agenda ( [StudentID] INT NOT NULL FOREIGN KEY REFERENCES Students([StudentID]), [SubjectID] INT NOT NULL FOREIGN KEY REFERENCES Subjects([SubjectID]), PRIMARY KEY ([StudentID], [SubjectID]) )
27.060606
71
0.753639
a9dafc21b66b546ef1740fc86296da6c3ae5f540
3,182
php
PHP
app/Http/Controllers/Admin/MenuController.php
yeniref/laravel-8-blog
ea570ec50c3512b122dcf6a0e6c32ed9fa29de8f
[ "MIT" ]
null
null
null
app/Http/Controllers/Admin/MenuController.php
yeniref/laravel-8-blog
ea570ec50c3512b122dcf6a0e6c32ed9fa29de8f
[ "MIT" ]
null
null
null
app/Http/Controllers/Admin/MenuController.php
yeniref/laravel-8-blog
ea570ec50c3512b122dcf6a0e6c32ed9fa29de8f
[ "MIT" ]
1
2021-09-20T22:49:42.000Z
2021-09-20T22:49:42.000Z
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\Menu; class MenuController extends Controller { public $timestamps = false; /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $menus = Menu::orderBy('id', 'desc')->paginate(10); return view('admin.menu.list',compact('menus')) ->with('i', (request()->input('page', 1) - 1) * 10); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $menus = Menu::find('parent_id', '=', 0)->get(); return view('admin.menu.create',compact('menus')); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $request->validate([ 'title' => 'required', 'link' => 'required', ]); $input = $request->all(); $input['parent_id'] = empty($input['parent_id']) ? 0 : $input['parent_id']; $input['sort_order'] = empty($input['sort_order']) ? 0 : $input['sort_order']; Menu::create($input); return redirect()->route('menu.index')->with('success','Başarılı Bir Şekilde Kaydedildi.'); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $menu = Menu::find($id) ?? abort('404','Menü Bulunamadı'); $menu_sub = Menu::where('parent_id', '=', $id)->get(); return view('admin.menu.show',compact('menu','menu_sub')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $menus = Menu::latest()->orderBy('title', 'asc')->get(); $menu = Menu::find($id) ?? abort('404','Menü Bulunamadı'); return view('admin.menu.edit',compact('menu','menus')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $request->validate([ 'title' => 'required', 'link' => 'required', ]); $menu = Menu::find($id); $input = $request->all(); $menu->update($input); return redirect()->route('menu.index')->with('success','Başarılı Bir Şekilde Düzenlendi...'); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $menu = Menu::find($id) ?? abort('404','Kategori Bulunamadı'); $menu->delete(); return redirect()->route('menu.index')->withSuccess('Başarılı Bir Şekilde Silindi...'); } }
28.159292
101
0.548712