ICode9

精准搜索请尝试: 精确搜索
  • 使用pycharm or vscode如何来编写python代码?2022-12-31 17:28:47

    pycharm专业版和社区版功能对比表 PyCharm Professional Edition PyCharm Community Edition Intelligent Python editor ✔ ✔ Graphical debugger and test runner ✔ ✔ Navigation and Refactorings ✔ ✔ Code inspections

  • 手写编程语言-实现运算符重载2022-12-02 18:03:11

    前言先带来日常的 GScript 更新:新增了可变参数的特性,语法如下:int add(string s, int ...num){ println(s); int sum = 0; for(int i=0;i<len(num);i++){ int v = num[i]; sum = sum+v; } return sum;}int x = add("abc", 1,2,3,4);println(x);assertEqual(x, 10);得益于可变参数,

  • C++ 自定义隐式转换2022-09-16 18:30:57

    operator bool() const 我们经常用这个来自定义类型对bool的隐式转换,比如智能指针类型就定义了这个隐式转换,来让智能指针对象可以直接用在判断语句中,判断管理的指针是否为nullptr。 operator TypeXX() const 上述的用法有一个更为一般化的隐式类型转化定义。在函数调用中,可能伴随

  • Like Operator in Entity Framework?2022-09-15 11:00:55

    Like Operator in Entity Framework? 回答1 This is an old post now, but for anyone looking for the answer, this link should help. Go to this answer if you are already using EF 6.2.x. To this answer if you're using EF Core 2.x Short version: SqlFunctions

  • c++静态for循环2022-09-14 10:03:56

    #include <iostream> // 通过递归实现 template <int Beg, int End> struct static_for { template <typename Fn> void operator()(const Fn& fn) const { if (Beg < End) { fn(Beg); static_for&l

  • 302022-09-13 23:02:20

    1 #include <iostream> 2 using namespace std; 3 class MyCin 4 { 5 bool value; 6 public: 7 MyCin():value(true){ } 8 operator bool(){return value;} 9 MyCin& operator>>(int& n){ 10 cin >> n; 11 if

  • 【云原生】Kubernetes CRD 详解(Custom Resource Definition)2022-09-11 14:35:27

    目录一、概述二、定制资源1)定制资源 和 定制控制器2)定制控制器3)Operator 介绍1、Operator Framework2、Operator 安装3、安装 Operator SDK4、Operator 简单使用4)Kubernetes API 聚合层5)声明式 APIs6)添加定制资源7)访问定制资源三、CRD 示例演示1)创建 CRD (定制资源)2)创建定制对象(定

  • 如何使用helm优雅安装prometheus-operator,并监控k8s集群微服务2022-09-09 00:31:39

    前言:随着云原生概念盛行,对于容器、服务、节点以及集群的监控变得越来越重要。Prometheus 作为 Kubernetes 监控的事实标准,有着强大的功能和良好的生态。但是它不支持分布式,不支持数据导入、导出,不支持通过 API 修改监控目标和报警规则,所以在使用它时,通常需要写脚本和代码来简化操

  • client-go开发自定义operator2022-09-06 14:31:08

    开发operator一共分为5步骤 一、创建config config的创建有两种方式 1、clientcmd.BuildConfigFromFlags config, err := clientcmd.BuildConfigFromFlags("", clientcmd.RecommendedHomeFile) if err != nil { //访问集群内 inClusterConfig, err := rest.InClusterConfig(

  • 矩阵及其快速幂2022-09-05 23:33:00

    矩阵及其快速幂 模板 Code template <typename T> concept arithmetic = is_arithmetic_v<T>; template <typename T> struct mat : public vector<vector<T>> { int row, col; template <typename U> void isotype(const mat<U&g

  • 29. 牛客-一人行者2022-09-03 11:02:37

    本来不想为了这题写一篇博客的,但因为昨天被一组数据卡了一个小时,还是有必要来记录一下。 牛客练习赛 102D:一人行者 题意是给一棵树,求断掉每一条边后得到的两棵树各自的联通子集数量,对 \(998244353\) 取模。 容易想到树形 dp,令 \(dp[u][0/1]\) 表示 \(u\) 的子树中是否包含 \(u\)

  • modint自动取模2022-08-30 01:30:50

    modint 自动取模类模板 简单的一种 constexpr int mod = 1e9 + 7; template <typename T> T inv(T a, T m) { T u = 0, v = 1; while (a != 0) { T t = m / a; swap(a, m -= t * a); swap(u -= t * v, v); } assert(m == 1); return

  • AtCoder Grand Contest 058 部分题目不简要题解2022-08-23 00:32:56

    从这里开始 比赛目录 Problem A Make it Zigzag   考虑使 $1, 3, 5, 7, \cdots, 2n - 3$ 这些位置后三个中的最大值在中间,最后再处理一下最后两个位置就行了。 Code #include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n; int a[N]; vector<in

  • k8s-mtu设置不当引发的线上故障2022-08-22 08:00:46

    背景 在部署新的paas平台线上环境时,突发consul和es中间件无法创建。 排查过程 以consul 通过查询k8s集群中pod状态发现原来3pod的consul集群,其中2个pod一直重启。 # kubectl get pods -n paasconsul-propaas 通过describe查看pod信息,发现是liveness失败。 # kubectl describe pods

  • 字典排序2022-08-21 10:33:18

    import operator def deal_dict_sort(): x = [{'name': 'Homer', 'age': 39}, {'name': 'Bart', 'age': 10}] lx = sorted(x, key=operator.itemgetter('age'), reverse=True) print(lx

  • 09--栈实现综合计算器2022-08-20 23:00:55

    使用栈完成表达式的计算思路 1、通过一个index值(索引),来遍历我们的表达式 2、如果我们发现是数字,则直接入数栈;如果发现扫描到的是符号,就分一下集中情况: 3.1 :如果符号栈有操作符,就需要进行比较 -->          3.1.1 如果当前操作符的优先级小于或者等于栈中的操作符,就需要从数

  • 通过 ob-operator 部署 OceanBase 数据库2022-08-19 16:35:01

    本文介绍如何通过 ob-operator 来部署 OceanBase 数据库。 背景信息 ob-operator 与其他 operator 一样,旨在让 OceanBase 以容器的方式,无缝运行在 Kubernetes 集群上。 ob-operator 现已支持 OceanBase 集群的创建、删除,完整的节点生命周期管理、ob-proxy 管理,后续会支持租户管理

  • [模板] 计算几何2022-08-15 00:00:44

    #include <bits/stdc++.h> #define debug(x) std::cerr << "[" << __LINE__ << "]: " << #x << " = " << x << "\n" using i64 = long long; #define UP 1 #define DOWN -1 #de

  • Hive Explain 详解2022-08-14 11:30:20

    导读 前文 《一文读懂 SQL Server 执行计划》 中介绍过关系型数据库 SQL Server 的执行计划执行计划在数据开发过程中的重要性,以及如何阅读执行计划,根据执行计划分析 SQL 语句的执行效率问题并提出优化方案。Hive 是基于 Hadoop,实现了通过 SQL 操作 MapRedue 任务,简化了大数据编

  • 高精度2022-08-13 21:04:01

    适用于OI的高精度模板 #include<bits/stdc++.h> using namespace std; typedef long long ll; struct big{ typedef pair<big, big> pbb; static const int L = 1e3, MOD = 1e4, B = 4; ll data[L]; void clear(){ memset(data, 0, sizeof(data)); } big(){ cle

  • AtCoder Grand Contest 057 简要题解2022-08-12 21:04:34

    从这里开始 比赛目录   两年没摸 oi,补的第一场 agc 不看题解补完了?   感觉这场 agc 可以和 agc 046 掰手腕(指题目无聊程度)   现在都听不到妹老师妹式吐槽 agc ,sad...... Problem A Antichain of Integer Strings   容易发现先选大的一定不劣。 Code #include <bit

  • k8s-calico网络插件安装2022-08-08 19:00:44

    calico网络插件安装 官网 #下载operator资源清单文件 [root@k8s-master01 ~]# wget https://docs.projectcalico.org/manifests/tigera-operator.yaml #应用资源清单文件,创建operator [root@k8s-master01 ~]# kubectl apply -f tigera-operator.yaml #3.通过自定义资源方式安装,下

  • C++运算符重载2022-08-08 13:01:33

    注意事项 运算符重载不改变运算符的优先级。 以下运算符不能被重载:. .* :: ?: sizeof。 以全局函数的形式重载:四则运算符号、逻辑判断符号、流运算符号 + - * / == != < > <= >= << >> 以成员函数的形式重载:赋值类符号、自增符号、型强制转换符号、成员访问符号 = += -= *= /= +

  • [Typescript] Definite assignment operator2022-08-03 20:36:28

    The definite assignment !: operator is used to suppress TypeScript’s objections about a class field being used, when it can’t be proven1 that it was initialized. Definite assignment operator can help with this case, if you are sure that the code will h

  • [luogu3222]射箭2022-07-15 19:32:54

    假设抛物线为$y=ax^{2}+bx$,二分枚举答案后,每个靶子的限制即半平面 换言之,问题即对这些半平面求交(是否为空),需注意$a\le 0$和$b\ge 0$的自身限制 关于半平面交,与凸包(指维护直线极值)类似,具体流程如下: 1.用点+向量的形式描述直线(规定其左侧为可行区域),并加入足够大的外边框 2.将所有直

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有