content
stringlengths
263
5.24M
pred_label
stringclasses
1 value
pred_score_pos
float64
0.6
1
--- Category: - Pwn Difficulty: Easy Platform: HackTheBox Status: 3. Complete tags: - code-review - reversing --- >[!quote] > *How are you doing, sir?* # Set up ![Instance on HTB](../../zzz_res/attachments/Pasted_image_20210605173802.png) Instance on HTB # Information Gathering File info: ```bash ┌──(kali㉿...
__label__POS
0.94062
import Ember from "ember"; var CardMoveMixin = Ember.Mixin.create({ setTheOrderKey: function(){ var is_column = this.toString().match(/hb-column/); var key = is_column ? "order" : "milestone_order"; this.set("cardMover.orderKey", key); }.on("init"), cardMover: Ember.Object.create({ calculateIssu...
__label__POS
0.870063
var repo = {"id":2659467,"name":"huboard","full_name":"rauhryan/huboard","owner":{"login":"rauhryan","id":68954,"avatar_url":"https://avatars.githubusercontent.com/u/68954?v=3","gravatar_id":"","url":"https://api.github.com/users/rauhryan","html_url":"https://github.com/rauhryan","followers_url":"https://api.github.com...
__label__POS
0.855079
{ "edges":[], "metadata":{"version":"1.0-1.0"}, "nodes":[ { "color":"5", "file":"CTFs/_CTF-dashboard_wrapper.md", "height":3000, "id":"7d4edc3ad07daeee", "styleAttributes":{}, "subpath":"#B2R", "type":"file", "width":640, "x":-780, "y":-580 }, { "color":"1", "file":"CTFs/_CT...
__label__POS
0.618105
## Classic queries ### SELECT statement ```sql SELECT name, description FROM products WHERE id='A1'; ``` ### INSERT statement ```sql INSERT INTO person(name,surname) VALUES ("tizio","caio") ``` ### UPDATE statement ```sql UPDATE table SET field="val1",secondval=23 WHERE cond=5 ``` ### DELETE statement ```sql DEL...
__label__POS
0.622205
The pacman package manager is one of the major distinguishing features of Arch Linux. It combines a simple binary package format with an easy-to-use build system. The goal of pacman is to make it possible to easily manage packages, whether they are from the official repositories or the user's own builds. [^arch] [^arc...
__label__POS
0.812331
--- Description: Tools used to automate the process of finding SQL injection vulnerabilities URL: https://sqlmap.org/ --- ![](../../zzz_res/attachments/sqlmap.png) ### Enumerating the DBMS ```bash $ sqlmap -u "http://victim/vuln/vulnerabilities/sql_bind/?id=1&Submit=Submit" --cookie="[valore_cookie]" --dbs ``` ### ...
__label__POS
0.959148
--- author: James Kettle aliases: - How I Choose a Security Research Topic tags: - readwise/articles url: https://portswigger.net/research/how-i-choose-a-security-research-topic date: 2024-08-20 --- # How I Choose a Security Research Topic ![rw-book-cover](https://portswigger.net/cms/images/4d/0d/2f4f-twittercard-...
__label__POS
0.675217
{-# OPTIONS --safe #-} module Common.WF where open import Data.Fin using (zero; suc; #_; Fin) open import Data.Nat.Base open import Data.Nat.Properties open import Data.Vec open import Relation.Binary.PropositionalEquality using (_≡_; refl) infixr 20 _⊕_ _⊕_ : ℕ → ℕ → ℕ _⊕_ = _⊔_ ₁≤₂ : ∀ m n → m ≤ m ⊕ n ₁≤₂ = m≤m⊔n...
__label__POS
0.895273
# 设计 什么是设计: ## 策略 ### 业务周期 在业务[产品的不同生命周期](/产品/产品创新.md#生命周期)阶段,设计的侧重点 - 验证期:此时的重点工作都是搭建产品的基础建设,可以主动优化核心功能的体验,在共创过程中主动提出业务的差异化增长机会点,并推动项目落地,获得更好的成长和回报 - 爆发期:业务爆增,需求也会跟着应接不暇,更需要设计师有合理分配时间的能力,在承接需求以外,推动增长 - 成熟期:不断优化,服务好更为细分的业务点 - 衰退期:此时需要业务,建立新的核心壁垒,拓展业务类型和生态,作为设计者,就需要帮助业务一起推动转型 ### 商战模式 - 防御战:此时产品需要充分做好防御,也就是不断地补足自...
__label__POS
0.992985
--- tags: ['编程语言'] --- # C++ ## 生命周期 - 编码 - 预处理:目的是文字替换,用到的就是各种预处理指令,比如 #include、#define、#if 等 - 编译 - 链接 - 运行 ### 预处理阶段编程 ```cpp #include <iostream> // 可以包含任意的文件,只是编译器无法识别 // 避免头文件被多次包含 #ifndef _XXX_H_INCLUDED_ #define _XXX_H_INCLUDED_ ... // 头文件内容 #endif // _XXX_H_INCLUDED_ #ifdef AUTH_PWD ...
__label__POS
0.851991
# Kotlin ## 类型 ### 基本类型 ```kotlin // 基本类型 Byte Short Int Long Double Float val a = 1 // 同swift 不支持隐式转换 // val b: Double = a println(a.toDouble()) // 字面常量 同 Java 但不支持八进制表示 println(100_000) println(0b10000000) // 加减乘除取余跟大部分语言是一样的 // 位运算 println(1 shl 2) // 无符号整数 UByte UShort UInt ULong // 布尔运算也是跟Java一样 println(true &...
__label__POS
0.886182
--- tags: ['编程语言'] --- # C语言 C 语言是一种通用的、面向过程式的计算机程序设计语言。1972 年,为了移植与开发 UNIX 操作系统,丹尼斯·里奇在贝尔电话实验室设计开发了 C 语言。 C 语言是一种广泛使用的计算机语言,它与 Java 编程语言一样普及,二者在现代软件程序员之间都得到广泛使用。 当前最新的C语言标准为 C11 ,在它之前的C语言标准为 C99 ## 类型运算符与表达式 ### 变量 > 变量名的开头必须是字母或下划线,不能是数字 > 变量名中的字母是区分大小写的 > 变量名绝对不可以是C语言关键字 > 变量名中不能有空格 C语法形式|数据存放位置|说明 -|-|- ...
__label__POS
0.801366
# SQL ## SQL查询语言概览 - 数据定义语言(DDL) - 数据操纵语言(DML) - 完整性 - 视图定义 - 事务控制 - 嵌入式SQL和动态SQL - 授权 ## SQL数据定义 ### 基本类型 - char(n):固定长度的字符串(会追加空格) - varchar(n):可变长度的字符串 - int:整数类型 - smallint:小整数类型(和机器相关) - numeric(p,d):定点数,p位数,d位小数 - real,double,precision:浮点数与双精度浮点数,精度与机器相关 - float(n):精度至少为n位的浮点数 ### 表定义 create table 命令的通用形式 ...
__label__POS
0.999294
# 大数据 ![202171515242](/assets/202171515242.png) - 数据采集:Flume 、Logstash、Kibana 等 - 数据存储: HBase - 批处理:Hadoop MapReduce、Spark、Flink - 流处理:Storm、Spark Streaming、Flink Streaming ## 计算向存储移动 1. 大规模数据存储在服务器集群的所有服务器上 2. 分布式启动若干任务执行进程 3. 分布式计算编程模型:MapReduce、RDD等,上传代码到各台服务器上 4. 服务器执行代码,代码读取数据进行分布式计算与合并结果 ## 特点 4V: - Volum...
__label__POS
0.701565
const router = require('express').Router(); const catchErrors = require('../handlers/errorHandlers').catchErrors; const explorer = require('../controllers/explorer'); const tickets = require('../controllers/tickets'); const rates = require('../controllers/rates'); const favourites = require('../controllers/favourites'...
__label__POS
0.953621
using System; using System.IO; using System.Linq; using dnlib.DotNet; using dnlib.DotNet.Emit; namespace dnlib.Examples { public class Example7 { public static void Run() => new Example7().DoIt(); void DoIt() { var test1 = new OpCode( "test1", 0xf0, 0x00, OperandType.InlineNone, FlowControl.Next, StackBeh...
__label__POS
0.847087
using dnlib.DotNet; using dnlib.DotNet.Emit; namespace dnlib.Examples { public class Example2 { // This will open the current assembly, add a new class and method to it, // and then save the assembly to disk. public static void Run() { // Open the current module var mod = ModuleDefMD.Load(typeof(Example2)...
__label__POS
0.608112
using System; using System.IO; using dnlib.DotNet; namespace dnlib.Examples { /// <summary> /// Dumps all PE sections to disk /// </summary> public class Example5 { public static void Run() { string sectionFileName = @"c:\section{0}.bin"; // Open the current mscorlib var mod = ModuleDefMD.Load(typeof(i...
__label__POS
0.617658
const moment = require('moment'); exports.prepareTransactions = (transactions) => { if (!transactions) return []; const transactionsPerDateObject = {}; for (let i = 0, length = transactions.length; i < length; i++) { const transaction = transactions[i]; // In case a date was saved incorrec...
__label__POS
0.804013
const qs = require('qs'); const querystring = require('querystring'); class QueryPersistant { constructor() { this.applyRequestQueryParameters = this.applyRequestQueryParameters.bind(this); this.isAppliedParameter = this.isAppliedParameter.bind(this); } applyRequestQueryParameters(paramete...
__label__POS
0.871217
// dnlib: See LICENSE.txt for more info using System; using System.Collections.Generic; using System.Diagnostics; using dnlib.DotNet; using dnlib.DotNet.Emit; namespace dnlib.Utils { class CollectionDebugView<TValue> { readonly ICollection<TValue> list; public CollectionDebugView(ICollection<TValue> list) => thi...
__label__POS
0.937289
# scenario.yml -- File containing the scenarios of the specified genre scenarios: - "You and a group of friends are stranded in an abandoned mining town as night falls. Strange whispers echo through empty streets, and doors slam shut on their own. Tension rises as each member begins to suspect someone in the group i...
__label__POS
0.624237
// localization object window.localizer = (function() { var self = this; // gets a string from the localization dictionary self.getLocalizationString = function (dictPath) { var localizedString = ''; var currentObj = window.dictionary; // recursively iterates over dictionary path ...
__label__POS
0.698377
// dnlib: See LICENSE.txt for more info using System; using System.Collections.Generic; namespace dnlib.DotNet { /// <summary> /// Redirects .NET framework assembly references from older to newer versions /// </summary> public static class FrameworkRedirect { static readonly Dictionary<string, FrameworkRedirect...
__label__POS
0.952582
# 字符串 ## 排序 - 低位优先排序 ```java public static void sort(String[]a,int W) { int N = a.length; int R = 256; String[] aux = new String[N]; //循环W次键索引记数法 for(int d = W-1; d>=0;d--) { int[] count = new int[R+1]; //键索引记数法第一步--频率统计 for(int i=0;i<N;i++)...
__label__POS
0.99617
--- tags: ['数据结构'] --- # 树 ## 二叉查找树 - 擅长数据的查找 - 高效 **特点** 每个结点的键值大于左孩子,小于右孩子 每个孩子又是二叉查找树 **二分查找树不一定是完全二叉树** 对于任何节点: - 左子树上所有节点都小于它 - 右子树所有节点都大于它 ### 插入 ```java if (root == null) { count++; return new Node(key, value); // 当前节点为null,则创建一个节点返回 } if (key.equals(root.key)) { // 当前节点等于要插入的节点,则直接覆盖 root...
__label__POS
0.981354
<nav aria-label="breadcrumb"> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="/">{{localize req 'breadcrumbs.home'}}</a> </li> <li class="breadcrumb-item"> <a href="/account">{{localize req 'breadcrumbs.account'}}</a> </li> <li class="bre...
__label__POS
0.67232
# 思维 ## 基础思维 ### 抽象思维 抽象的过程就是通过归纳概括、分析综合来寻找共性、提炼相关概念的过程 - 抽象的概念只有通用语言才能表达出来 - 抽象具有层次性,抽象层次越高,内涵越小,外延越大,扩展性越好;反之,抽象层次越低,内涵越大,外延越小,扩展性越差,但语义表达能力越强 - 抽象层次要保持一致性,一致性可以减少混乱和降低理解成本 - 提升抽象能力的练习:阅读、总结、命名、建模 ### 逻辑思维 逻辑三要素: 1. 概念:人类通过思维所赋予的事物含义,语言是概念的外显形式 2. 判断:一个判断就是真或假,判断是概念的展开,没有判断,就不能揭示和说明概念。同时,判断也是推理的前提,是正确运用各种推理的必...
__label__POS
0.978847
# 数字逻辑电路基础 ## 数制 - 十进制 (1) 计数符号: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. (2) 进位规则: 逢十进一. - 二进制 (1) 计数符号: 0, 1 。 (2) 进位规则: 逢二进一 - 十六进制 (1)计数符号: 0,1,......,9,A,B,C,D,E,F (2)进位规则: 逢十六进一。 - 八进制 (1)计数符号: 0,1,......,6,7。 (2)进位规则: 逢八进一。 **二进制转十进制** ![批注 2020-02-10 200001](/assets/批注%202020-02-10%20200001.png) **十进制转二进制*...
__label__POS
0.848633
<nav aria-label="breadcrumb"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="/">{{localize req 'breadcrumbs.home'}}</a></li> <li class="breadcrumb-item active" aria-current="page">Sitemap</li> </ol> </nav> <ul> <li><a href="/">Main page</a></li> <li><a href="/clinics">Clin...
__label__POS
0.987904
# 数据类型 ## 数据值类别 数值: - 精确值:整数 带小数点的数 - 位域值: `b'1000'` 代表8 字符串值: ```sql 'cxk' -- 推荐使用单引号 ``` 二进制串比较是逐字节比较 非二进制串根据排序规则比较 日期时间值: ```sql '2020-08-25' '11:47:00' '2020-08-25 11:47:00' SELECT '2020-08-25 11:47:00' + INTERVAL 2 DAY; ``` 空间值:(10 20) 布尔值:0会被当成假 非0非NULL会被当成真 NULL值:`\N` 会被当成NULL ### 整型 TINYINT, SMA...
__label__POS
0.602592
# MYSQL performance schema详解 ### 0、performance_schema的介绍 ​ **MySQL的performance schema 用于监控MySQL server在一个较低级别的运行过程中的资源消耗、资源等待等情况**。 ​ 特点如下: ​ 1、提供了一种在数据库运行时实时检查server的内部执行情况的方法。performance_schema 数据库中的表使用performance_schema存储引擎。该数据库主要关注数据库运行过程中的性能相关的数据,与information_schema不同,information_schema主要关注server运行过程中的元数据信息...
__label__POS
0.866982
# 管理 ## MySQL 组件 - 服务器 - mysqld 服务器主程序 - mysql_safe 启动和监控 - mysql_multi 同一主机管理多台MySQL - 客户端和util - mysql 客户端交互式程序 - mysqladmin 管理数据库 - mysqldump 备份或复制 - mysqlcheck 检查分析优化或者修复表 myisamchk只适用于myisam ## 数据目录 位置:指定`datadir`配置项 ### 结构 ```mermaid graph TD 客户1 -->|Unix 域套接字| MySQL服务器 客户2 -->|TCP/IP端...
__label__POS
0.766096
# 执行计划 ​ 在企业的应用场景中,为了知道优化SQL语句的执行,需要查看SQL语句的具体执行过程,以加快SQL语句的执行效率。 ​ 可以使用explain+SQL语句来模拟优化器执行SQL查询语句,从而知道mysql是如何处理sql语句的。 ​ 官网地址: https://dev.mysql.com/doc/refman/5.5/en/explain-output.html ### 1、执行计划中包含的信息 | Column | Meaning | | :-----------: | :-----...
__label__POS
0.990282
{{#if drugs.length}} <div class="col-xl-3 push-xl-9 col-lg-12 push-lg-0"> <h3>{{localize req 'drug.categories'}}</h3> <ul class="cat-list"> <li> <a class="{{#if (compare selectedCategory '')}}active{{/if}}" href="/drugs">{{localize req 'drug.categoriesAll'}}</a> </li> {{#ea...
__label__POS
0.657665
// dnlib: See LICENSE.txt for more info namespace dnlib.DotNet.Emit { /// <summary> /// Contains all valid CIL opcodes /// </summary> public static class OpCodes { /// <summary> /// All one-byte opcodes /// </summary> public static readonly OpCode[] OneByteOpCodes = new OpCode[0x100]; /// <summary> //...
__label__POS
0.991372
## 客户端 ### RESP(redis 序列化协议) - 发送命令 ``` *< 参数数量 > CRLF $< 参数 1 的字节数量 > CRLF < 参数 1> CRLF ... $< 参数 N 的字节数量 > CRLF < 参数 N> CRLF ``` - 返回结果 状态回复:在RESP中第一个字节为"+"。 错误回复:在RESP中第一个字节为"-"。 整数回复:在RESP中第一个字节为":"。 字符串回复:在RESP中第一个字节为"$"。 多条字符串回复:在RESP中第一个字节为"*"。 ### java 客户端 Jedis 基本使用 ```java Jedis jedis = new Jedis...
__label__POS
0.865429
>PLSQL是Oracle对sql语言的过程化扩展,指在SQL命令语言中增加了过程处理语句(如分支、循环等),使SQL语言具有过程处理能力。把SQL语言的数据操纵能力与过程语言的数据处理能力结合起来,使得PLSQL面向过程但比过程语言简单、高效、灵活和实用 # 定义变量 ```sql declare i number(2) :=10; begin dbms_output.put_line(i); end; ``` - 查询语句赋值 ```sql declare ena emp.ename%type; begin select ename into ena from emp where empno = 7788...
__label__POS
0.970815
// dnlib: See LICENSE.txt for more info using System; namespace dnlib.DotNet.Pdb { /// <summary> /// Custom debug info guids /// </summary> public static class CustomDebugInfoGuids { #pragma warning disable 1591 // Missing XML comment for publicly visible type or member // Roslyn: PortableCustomDebugInfoKinds.c...
__label__POS
0.920579
# DOM > DOM是W3C组织制定的一套处理 html和xml文档的规范 DOM API 大致会包含 4 个部分: - 节点:DOM 树形结构中的节点相关 API。 - 事件:触发和监听事件相关 API。 - Range:操作文字范围相关 API。 - 遍历:遍历 DOM 需要的 API ## DOM树 ![202001232031](/assets/202001232031.png) - 核心DOM - Document:文档对象 - Element:元素对象 - Attribute:属性对象 - Text:文本对象 - Comment:注释对象 - Node:节点对象,其他5个的父对象 ...
__label__POS
0.995975
# 面向对象 ## JavaScript的对象模型 JavaScript 对象的运行时是一个“属性的集合” 属性都具备这两个特征: - enumerable:决定 for in 能否枚举该属性。 - configurable:决定该属性能否被删除或者改变特征值 ### 数据属性 - value:就是属性的值。 - writable:决定属性能否被赋值。 ### 访问器属性 - getter:函数或 undefined,在取属性值时被调用。 - setter:函数或 undefined,在设置属性值时被调用。 ### 创建对象 ```js // 字面量创建对象 var man = { name: 'cxk'...
__label__POS
0.856086
# Java 谜题 ## 表达式 - 奇数性 ```java x % 2 == 1 // 用来判断x是否为奇数 ``` 当 x 为负数时, 该表达式永不成立 当取余操作返回一个非零结果时 与左操作数拥有相同的正负符号 ```java -1 % 2 == -1 ``` - 找零时刻 浮点数问题 ```java 2.00 - 1.10 != 0.9 // true 2.00 - 1.10 == 0.8999999999999999 // true ``` - 长整除 ```java long a = 24*60*60*1000*1000 long b = 24*60*60*1000 a / b == 5 // tr...
__label__POS
0.975537
// dnlib: See LICENSE.txt for more info using System; using System.IO; using System.Security.Cryptography; namespace dnlib.DotNet.Writer { static class Hasher { static HashAlgorithm CreateHasher(ChecksumAlgorithm checksumAlgorithm) => checksumAlgorithm switch { ChecksumAlgorithm.SHA1 => SHA1.Create(), C...
__label__POS
0.673771
# 前端编译与优化 将.java编译为.class ## 编译过程 ```java initProcessAnnotations(processors, sourceFileObjects, classnames); // 插入注解处理器 ... processAnnotations( // 注解处理 enterTrees( stopIfError(CompileState.PARSE,initModules(stopIfError(CompileState.PARSE, parseFiles(sourceFileObjects)))) ), classnames ); ... case...
__label__POS
0.996198
# 线程池 作用: - 线程复用 控制最大并发数 - 实现任务缓存策略以及拒绝策略 - 定期执行 周期执行 - 隔离不同业务的线程执行环境 解决了两个问题: 1:通过减少任务间的调度开销 (主要是通过线程池中的线程被重复使用的方式),来提高大量任务时的执行性能; 2:提供了一种方式来管理线程和消费,维护基本数据统计等工作 线程池决定了任务的执行策略: - 什么线程 - 什么顺序 - 多少任务执行 - 多少任务等待 - 如何放弃以及通知放弃 - 任务执行前操作 ## Executor框架 ```java public interface Executor { void execute(Runnable comman...
__label__POS
0.64826
# JUC J.U.C java.util.concurrent 主要分为几个类簇: - 线程同步类 使进程间的协调更加容易 CountDownLatch CyclicBarrier等 - 并发集合类 - 线程管理类 线程池等 - 锁相关类  ## ReentrantLock - 语义同 synchronized 锁,可重入互斥锁 - 构造器接受 fairness 的参数,fairness 是 ture 时,保证获得锁时的顺序,false 不保证 轻量级锁与重量级锁:“轻量级”是相对于使用操作系统互斥量来实现的传统锁而言的 ReentrantLock 和synchronized 都是 可重入锁 可重入 是同一线程 外...
__label__POS
0.878535
# Cookie与Session 两者都是为了保持访问用户与后端服务器的交互状态 ## [Cookie](/计算机网络/http/Cookie.md) > 客户端会话技术,将数据保存到客户端 客户端第一次访问时服务器时 服务器会返回一个设置cookie的响应头 此后在cookie有效期内 并且在cookie所允许的域名下 浏览器发起请求时都会自动携带这个cookie请求头 ```java Cookie[] cookies = req.getCookies(); for (Cookie cookie : cookies) { if ("time".equals(cookie.getName())){ ...
__label__POS
0.676323
# List ## ArrayList ArrayList的subList方法会返回一个list视图,对这个SubList的修改都会映射到原来的list 而Arrays.asList返回的arrays包下的ArrayList,这个类并没有重写add,remove等方法,所以修改时会抛出异常 ### 结构 ![202002191425](/assets/202002191425.jfif) - DEFAULT_CAPACITY 表示数组的初始大小,默认是 10 - size 表示当前数组的大小 - modCount 统计当前数组被修改的版本次数,数组结构有变动,就会 +1 ### 解析 - 初始化 一共有三种方式可以...
__label__POS
0.931761
// dnlib: See LICENSE.txt for more info using dnlib.IO; namespace dnlib.DotNet.Pdb.Managed { static class NumericReader { public static bool TryReadNumeric(ref DataReader reader, ulong end, out object value) { value = null; ulong position = reader.Position; if (position + 2 > end) return false; var...
__label__POS
0.916134
# 垃圾回收 > 一个跟踪过程,它传递性地跟踪指向当前使用的对象的所有指针,以便找到可以引用的所有对象,然后重新使用在此跟踪过程中未找到的任何堆内存。公共语言运行库垃圾回收器还压缩使用中的内存,以缩小堆所需要的工作空间 - 回收什么 - 何时回收 - 如何回收 ## JAVA对象生命周期 ### 内存回收API - Object的finalize方法,垃圾收集器在回收对象时调用,有且仅被调用一次 - 如果覆写了该方法的对象将会被放置在一个名为F-Queue的队列之中,并在稍后由一条由虚拟机自动建立的、低调度优先级的Finalizer线程去执行它们的finalize() 方法 - System的gc方法。不靠谱 ##...
__label__POS
0.866699
// dnlib: See LICENSE.txt for more info // See Roslyn files: MethodDebugInfo.Portable.cs, MetadataWriter.PortablePdb.cs using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using dnlib.DotNet.Emit; using dnlib.DotNet.MD; using dnlib.IO; namespace dnlib.DotNet.Pdb.Portable { str...
__label__POS
0.789641
// dnlib: See LICENSE.txt for more info using System.Collections.Generic; using System.Diagnostics; using dnlib.DotNet.Emit; using dnlib.DotNet.MD; using dnlib.DotNet.Pdb.Symbols; namespace dnlib.DotNet.Pdb.WindowsPdb { static class PseudoCustomDebugInfoFactory { public static PdbAsyncMethodCustomDebugInfo TryCrea...
__label__POS
0.758278
# RecyclerView > A flexible view for providing a limited window into a large data set. ## 基本使用 - 定义一个Adapter,其用来控制数据与Item的绑定关系 ```java public class MyAdapter extends RecyclerView.Adapter<MyViewHolder> { LayoutInflater layoutInflater; Context context; List<String> data; public MyAdapter(Context...
__label__POS
0.632725
# 架构设计框架 什么驱动着架构设计: - 业务需求 - 非功能需求 - 限制 ## ABSD(基于架构的软件开发) ### 功能分解 - 自顶向下 - 一个目标:将需求转换为模块 -> 高内聚低耦合 ### 架构风格 选择架构风格来实现需求 ### 软件模板 描述软件元素在共享服务和底层构造的基础上,如何进行交互 ### 递归 不停迭代 以实现整个系统 ### 具体实现 #### 架构需求 1. 从需求库获取小而多的需求 2. 生成定义相关类图 将类进行粗略分组 打包成构件 3. 需求评审 #### 架构设计 1. 提出架构模型(合适的架构风格) 2. 映射构件(需求阶段划分的那些) 3. 分析构件...
__label__POS
0.990911
# 创建型模式 - 封装了系统使用哪些类 - 隐藏了这些类类的实例是如何创建和放在一起的 ## 建造者 > 将复杂对象的构建与表示相分离,同样的构建过程可以创建不同的表示 为了应对在对象创建过程中,构造函数参数过多、参数间有依赖关系或约束条件、以及对象希望不可变等复杂场景。通过Builder模式,能够将对象的创建逻辑集中在一个单独的Builder类中,避免了构造函数参数过长、校验逻辑难以安放、以及对象处于无效状态等问题 ```mermaid classDiagram class Builder { +buildPart() } class ConcreteBuilder { ...
__label__POS
0.984022
## 分布式锁 在分布式场景下,需要同步的进程可能位于不同的节点上,那么就需要使用分布式锁 阻塞锁使用一个互斥量来实现: - 0代表其他进程在使用锁 - 1代表未锁定 可以用一个整数表示,或者也可以用某个数据是否存在来表示 ### 数据库唯一索引 获得锁时向表中插入一条记录,释放锁时删除这条记录 - 锁没有失效时间,容易死锁 - 是非阻塞的,获取锁失败就报错 - 不可重入 ### redis setnx 1.获取锁的时候,对某个key执行setnx,加锁(如果设置成功(获得锁)返回1,否则返回0),并使用expire命令为锁添加一个超时时间,超过该时间则自动释放锁,锁的value值为一个随机生成的UUID,通过此在...
__label__POS
0.686557
/** * * 将/xx/xx.md 转为x-x形式的文档id * @export * @param {string} url * @return {*} {string} */ function docUrl2Id(url :string): string { if (!url) { return "" } if (url.startsWith('./doc')) { url = url.replace('./doc', '') } if (url.startsWith('/doc')) { url = url.replace('/doc', '') } url ...
__label__POS
0.903793
import pinyin from 'tiny-pinyin' const polyphonicMap = new Map<string, string[]>() polyphonicMap.set('重', ['ZHONG', 'CHONG']) export namespace PinyinUtils { function toPinyin(str: string): string[][] { const result: string[][] = [] for (const char of str) { if (polyphonicMap.has(char)) { resul...
__label__POS
0.994347
class CacheService { private static instance: CacheService = new CacheService() private cacheMap : Map<string, Map<string, any>> = new Map() private constructor(){} public static getInstance(): CacheService { return this.instance } /** * * 缓存添加/更新 * @param {string} id * @param {string} ...
__label__POS
0.960317
import BookMarkItem from "@/dto/BookMarkItem" /** * 书签管理服务 * * @class BookMarkService */ class BookMarkService { private static instance: BookMarkService readonly STORAGE_KEY = "book-mark-service::list" private constructor(){} public static getInstance(): BookMarkService { if (!this.instance) { ...
__label__POS
0.877777
import BaseService from '../build/BaseService' import fs from 'fs' import DocService from '../build/DocService'; import { marked } from 'marked'; import { JSDOM } from 'jsdom'; import UrlConst from '../const/UrlConst'; import { SimilarItem } from '../dto/doc/SimilarItem'; var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g"...
__label__POS
0.836486
import BaseService from '../build/BaseService' import fs from 'fs' var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g"); function similar(s: string, t: string, f: number = 3) { if (!s || !t) { return 0 } var l = s.length > t.length ? s.length : t.length var n = s.length var m = t.length var d: number[][]...
__label__POS
0.936342
import dayjs from 'dayjs' export default { fillTimeRange(data: [string, number][]){ const map = new Map<string, number>(data); const range = [data[0][0], data[data.length - 1][0]]; const start = +dayjs(range[0]); const end = +dayjs(range[1]); const dayTime = 3600 * 24 * 1000; const results: [...
__label__POS
0.99249
rem == General variables setup script == rem == (c) Oleg Linkin <MaledictusDeMagog@gmail.com> @echo off rem == Build variables == set QTDIR=C:\Dev\qt-everywhere-opensource-src-4.8.4 set BOOST_ROOT=C:\Installed\boost-1.53 set QJSON_DIR=C:\Installed\qjson set TAGLIB_DIR=C:\Installed\taglib-1.8 set QCA2_DIR=C:\Install...
__label__POS
0.650271
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #include <stdlib.h> #define MEMSIZE 256 void alloc_memory() { // ruleid: raptor-unchecked-ret-malloc-calloc-realloc char *ptr = (char *)malloc(MEMSIZE); } int alloc_memory_and_check1() { // ok: raptor-unchecked-ret-malloc-calloc-realloc char *ptr = (ch...
__label__POS
0.940526
rules: - id: raptor-incorrect-unsigned-comparison metadata: author: Marco Ivaldi <raptor@0xdeadbeef.info> references: - https://cwe.mitre.org/data/definitions/697 - https://g.co/kgs/PCHQjJ confidence: HIGH # NOTE: some types are not covered. # NOTE: incorrect unsigned...
__label__POS
0.797722
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #include <stdlib.h> #define MEMSIZE 256 void alloc_and_free1() { int err = 1, bailout = 0; char *ptr = (char *)malloc(MEMSIZE); // this should be catched but it isn't, due to a documented limitation in semgrep // https://semgrep.dev/docs/writing-rules/...
__label__POS
0.752929
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #include <stdlib.h> void bad1() { BarObj *ptr = new BarObj() // ruleid: raptor-mismatched-memory-management-cpp free(ptr); } void good1() { BarObj *ptr = new BarObj() // ok: raptor-mismatched-memory-management-cpp delete ptr; } class A { void bad2...
__label__POS
0.903058
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #define BUFSIZE 256 #define FMT "whatever" void read_string(char *string) { char buf[BUFSIZE]; int number; char fmt[] = "whatever"; // ruleid: raptor-insecure-api-scanf-etc scanf("%s", buf); // ok: raptor-insecure-api-scanf-etc scanf("%d", &number)...
__label__POS
0.737502
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #include <string.h> #define BUFSIZE 256 void copy_string1(char *string) { char buf[BUFSIZE]; // ruleid: raptor-unterminated-string-strncpy-stpncpy strncpy(buf, string, BUFSIZE); } void copy_string2(char *string) { char buf[BUFSIZE]; // ruleid: rapto...
__label__POS
0.68207
rules: - id: raptor-unchecked-ret-setuid-seteuid metadata: author: Marco Ivaldi <raptor@0xdeadbeef.info> references: - https://cwe.mitre.org/data/definitions/252 - https://lwn.net/Articles/451985/ - https://www.usenix.org/legacy/events/sec02/full_papers/chen/chen.pdf - ...
__label__POS
0.742207
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #include <string.h> // https://pwning.systems/posts/php_filter_var_shenanigans/ static int _php_filter_validate_domain(char * domain, int len, zend_long flags) { char *e, *s, *t; size_t l; int hostname = flags & FILTER_FLAG_HOSTNAME; unsigned char i = 1;...
__label__POS
0.907387
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #include <stdlib.h> #define MEMSIZE 256 void alloc_and_free1() { int bailout = 1; char *ptr = (char *)malloc(MEMSIZE); // this should be catched but it isn't, due to a documented limitation in semgrep // https://semgrep.dev/docs/writing-rules/pattern-s...
__label__POS
0.850688
// Marco Ivaldi <raptor@0xdeadbeef.info> #include <stdio.h> #include <string.h> #include <ctype.h> void bad1() { char *src, *dst; int left; while (*src && left) { *dst++=*src++; // ruleid: raptor-typos if (left = 0) { die("badlen"); } left--; } } void good1(char *path, char *dir, char ...
__label__POS
0.608573
using MetroWPFTemplate.Metro.Controls.PageTemplates; using MetroWPFTemplate.Metro.Dialogs; using MetroWPFTemplate.Windows; using Microsoft.Win32; using System; using System.Collections.Generic; using System.Globalization; using System.Windows; namespace MetroWPFTemplate.Backend { public class Settings { ...
__label__POS
0.935934
using System; using System.Drawing.Printing; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Interop; namespace MetroWPFTemplate.Metro.Native { public class DwmDropShadow { [DllImport("dwmapi.dll", PreserveSig = true)] private static extern int DwmSetWindowAtt...
__label__POS
0.631624
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Me...
__label__POS
0.633895
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Me...
__label__POS
0.692962
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Me...
__label__POS
0.634365
Reference ========= This reference page details the functions included in Virgo, describing their roles and what they do. simulate """""""" .. function:: simulate(l, b, beamwidth=0.6, v_min=-400, v_max=400, plot_file='') Simulate 21 cm profiles based on the LAB HI Survey. :param l: Target galactic longitude ...
__label__POS
0.651432
<footer class='flex flex-col justify-center items-start max-w-2xl mx-auto w-full mb-8' > <hr class='w-full border-t border-gray-200 dark:border-gray-800 mb-8' /> <div class='w-full max-w-2xl grid grid-cols-1 gap-4 pb-16 sm:grid-cols-3'> <div class='flex flex-col space-y-4'> <a href='/' c...
__label__POS
0.857108
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="en_US"> <context> <name>LC::Ooronee::Plugin</name> <message> <location filename="ooronee.cpp" line="82"/> <source>Provides a quark for handling image and text droppend onto it via other data filter plugins.</source>...
__label__POS
0.999649
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="ru_RU"> <context> <name>LC::Ooronee::Plugin</name> <message> <location filename="ooronee.cpp" line="82"/> <source>Provides a quark for handling image and text droppend onto it via other data filter plugins.</source>...
__label__POS
0.853808
# [CensoredStealthModeBits] Rails, Omniauth and Bulletproof.. Oh my! Tagged: knowledge is power, Bulletproof, bulletproofedness, The Bulletproof Executive, Dave Asprey. TODO: Put these bits into the old post, or link to a new post with this info from the old one. (When the site is live/I can talk about it) (**tl;dr*...
__label__POS
0.901395
--- title: "Facing the pain" tags: - writing - musings - pain - feelings - connection crossposted: - https://www.facebook.com/ensquared/posts/10160408692145414 --- These aren't my words, and I don't know the source, but I like them: > Keeping it in, that’s not brave. Feeling the pain, facing it, that takes courage. It...
__label__POS
0.909664
--- layout: post title: Nameserver? Whichserver? date: '2012-02-28T22:46:00+10:00' tags: - plesk - dns - subdomain - nameserver - headdesk categories: - devalias tumblr_url: http://devalias.tumblr.com/post/18368234347/nameserver-whichserver redirect_from: /post/18368234347/nameserver-whichserver disqus: true webmention...
__label__POS
0.625232
--- layout: post title: Reversing PowerShell 'SecureString' For Fun And Profit date: '2013-08-29T08:00:52+10:00' tags: - powershell - securestring - decrypt - decode - reverse - password - windows - hack - pentest categories: - devalias tumblr_url: http://devalias.tumblr.com/post/59562171885/reversing-powershell-secure...
__label__POS
0.85197
package tfgen import ( "os" "testing" "github.com/stretchr/testify/assert" ) func TestSearchInParentDirs(t *testing.T) { assert := assert.New(t) tempDir := t.TempDir() println(tempDir) os.MkdirAll(tempDir+"/dev/module-a/1/2/3", 0755) os.MkdirAll(tempDir+"/dev/module-b/1/2/3", 0755) os.MkdirAll(tempDir+"/de...
__label__POS
0.932847
# Soundmap API ![Soundmap API Logo](https://e-e.tools/soundmap.png) This Python library allows you to interact with the Soundmap API to manage songs, trades, and quests. I will be lightly monitoring this, any questions? Discord: eric.cpp Thank you Ethan for fixing what I did not want too lol ## Features - Search...
__label__POS
0.99694
package utils import ( "math" "strconv" ) func GetPage(page, limit int) (int, int) { num := (page - 1) * limit return num, limit } func GetStringPage(page, limit string) (int, int) { iPage, _ := strconv.Atoi(page) iLimit, _ := strconv.Atoi(limit) if iLimit == 0 { iLimit = 20 } num := (iPage - 1) * iLimi...
__label__POS
0.879275
var app = { /** * ajax * @param url * @param data * @param success * @param error */ ajax: function (url, data, success, error) { var loading = $('#loading-container'); $.ajax({ url: url, type: 'post', data: data, dataType: 'json', beforeSend: function () { ...
__label__POS
0.625693
package AuthRouter import ( "github.com/auxpi/controllers/api/v1" "github.com/auxpi/middleware" "github.com/astaxie/beego" ) func RegisterMiddleWare() { //登录用户中间件 =>已登录重定向 beego.InsertFilter("/login", beego.BeforeExec, middleware.CookieAuthedCheck) //重置密码中间件 =>已登录重定向 beego.InsertFilter("/reset/*", beego.Befor...
__label__POS
0.808999
// set function parseTime,formatTime to filter export { parseTime, formatTime } from '@/utils' function pluralize(time, label) { if (time === 1) { return time + label } return time + label + 's' } export function timeAgo(time) { const between = Date.now() / 1000 - Number(time) if (between < 3600) { ...
__label__POS
0.703565
import { asyncRoutes, constantRoutes } from '@/router' /** * Use meta.role to determine if the current user has permission * @param roles * @param route */ function hasPermission(roles, route) { if (route.meta && route.meta.roles) { return roles.some(role => route.meta.roles.includes(role)) } else { re...
__label__POS
0.720009
#include <stdio.h> #include <tchar.h> #include <conio.h> #include <cstdlib> #include "Wizmo.h" //---------------------------------------------------------------------------------- int main(int argc, char *argv[]) { // Should pause at exit? for (int iarg = 1; iarg < argc; ++iarg) { if (_stricmp(argv...
__label__POS
0.8738
package e var MsgFlags = map[int]string{ SUCCESS: "ok", ERROR: "fail", INVALID_PARAMS: "请求参数错误", ERROR_FILE_IS_EMPTY: "上传文件为空", ERROR_FILE_IS_TOO_LARGE: "上传文件太大", ERROR_FILE_TYPE: "文件类型错误", ERROR_CAN_NOT_GET_IMG_URL: "无法获取第三方图床 URL", ERROR_TOO_MANY_IMAGES: "上传...
__label__POS
0.989109
;; Tokenizer for Lust in Lust (let #t (eq 1 1)) (let #f (eq 0 1)) (let len (fn (list) (if (eq list ()) 0 (add 1 (len (cdr list)))))) (let last (fn (list) (if (eq list ()) () (if (eq (cdr list) ()) (car list) (last (cdr list)))))) (let do (fn (& args) (last args))) (l...
__label__POS
0.892756
;; String formatting for Lust in Lust (let #t (eq 1 1)) (let #f (eq 0 1)) (let list (fn (& args) args)) (let last (fn (list) (if (eq list ()) () (if (eq (cdr list) ()) (car list) (last (cdr list)))))) (let do (fn (& args) (last args))) (let and (fn (a b) (if a (if b #t #f...
__label__POS
0.980342
;; True evaluates to true (let #t '#t) ;; The only false value is the empty list. For convience #f evaluates ;; to that. (let #f ()) ;; Quoted versions of let and let using Lust's quaziquote syntax. (let letq (macro (symbol value) `(let ,symbol ,value))) ;; Folds a list of values with a function and accumulator. (let...
__label__POS
0.799173