如何让代码段只运行在 Debug 模式下

在C#下,如何让一段代码只执行在DEBUG模式下

Conditional 特性

这个特性会告诉编译器除非遇到指定的编译符号,否则将会被忽略,参考下面的例子:

static void Main(string[] args)
{
    [Conditional("DEBUG")]
    static void Method() { }
 
    Method();
}

预处理指令

当你用了 #if … #end if 成对预处理指定时,当遇到编译符号与定义的环境一致时将会执行此if。

幼儿园,你真的准备好了吗?

上幼儿园,需要做哪些准备?

长期准备

语言能力的培养

大多数小朋友在上幼儿园的年纪已经拥有不错的语言沟通能力了,但仍有部分儿童,由于语言发展较慢或者害羞等原因沟通能力较弱。

2022年12月 疫情放开

2022年12月,三年防疫之后,全国以一种突然而迅速的姿态,吹枯拉朽般的放开了,令我始料未及。

现在,不要求做核酸,出门乘坐公共交通无需扫码,进出场所也绝对的自由。

关于HP打印机提示用户干预

首先,我想说,网上常见搜到的,在服务里找到什么PrintSpooler的,都是垃圾

解决的步骤:

1、“计算机/此电脑”——单击右键“管理”——左侧点击“服务和应用程序”——“服务”——双击“PrintSpooler”服务——点击“停止”;

C/C++ 基本类型32位和64位字节大小

64位编译器

  • char :1个字节
  • char*(即指针变量): 8个字节
  • short int : 2个字节
  • int: 4个字节
  • unsigned int : 4个字节
  • float: 4个字节
  • double: 8个字节
  • long: 8个字节
  • long long: 8个字节
  • unsigned long: 8个字节

32位编译器

  • char :1个字节
  • char*(即指针变量): 4个字节(32位的寻址空间是2^32, 即32个bit,也就是4个字节。同理64位编译器)
  • short int : 2个字节
  • int: 4个字节
  • unsigned int : 4个字节
  • float: 4个字节
  • double: 8个字节
  • long: 4个字节
  • long long: 8个字节
  • unsigned long: 4个字节

16位编译器

  • char :1个字节
  • char*(即指针变量): 2个字节
  • short int : 2个字节
  • int: 2个字节
  • unsigned int : 2个字节
  • float: 4个字节
  • double: 8个字节
  • long: 4个字节
  • long long: 8个字节
  • unsigned long: 4个字节

2022 武汉外小游园记

2022录取

2022分布

我是在6月12日提交游园申请截止的当天,晚上十点多才想起来要去写小作文的。

主要是那个星期自驾带孩子出去旅游了,玩嗨了,周日回来洗完澡才记起来还有这个事,险些错过了。

C++ 判断线段和矩形是否相交

public static bool isLineIntersectRectangle(float linePointX1,
                                      float linePointY1,
                                      float linePointX2,
                                      float linePointY2,
                                      float rectangleLeftTopX,
                                      float rectangleLeftTopY,
                                      float rectangleRightBottomX,
                                      float rectangleRightBottomY)
    {
        float lineHeight = linePointY1 - linePointY2;
        float lineWidth = linePointX2 - linePointX1;  // 计算叉乘 
        float c = linePointX1 * linePointY2 - linePointX2 * linePointY1;
        if ((lineHeight * rectangleLeftTopX + lineWidth * rectangleLeftTopY + c >= 0 && lineHeight * rectangleRightBottomX + lineWidth * rectangleRightBottomY + c <= 0)
            || (lineHeight * rectangleLeftTopX + lineWidth * rectangleLeftTopY + c <= 0 && lineHeight * rectangleRightBottomX + lineWidth * rectangleRightBottomY + c >= 0)
            || (lineHeight * rectangleLeftTopX + lineWidth * rectangleRightBottomY + c >= 0 && lineHeight * rectangleRightBottomX + lineWidth * rectangleLeftTopY + c <= 0)
            || (lineHeight * rectangleLeftTopX + lineWidth * rectangleRightBottomY + c <= 0 && lineHeight * rectangleRightBottomX + lineWidth * rectangleLeftTopY + c >= 0))
        {
 
            if (rectangleLeftTopX > rectangleRightBottomX)
            {
                float temp = rectangleLeftTopX;
                rectangleLeftTopX = rectangleRightBottomX;
                rectangleRightBottomX = temp;
            }
            if (rectangleLeftTopY < rectangleRightBottomY)
            {
                float temp1 = rectangleLeftTopY;
                rectangleLeftTopY = rectangleRightBottomY;
                rectangleRightBottomY = temp1;
            }
            if ((linePointX1 < rectangleLeftTopX && linePointX2 < rectangleLeftTopX)
                || (linePointX1 > rectangleRightBottomX && linePointX2 > rectangleRightBottomX)
                || (linePointY1 > rectangleLeftTopY && linePointY2 > rectangleLeftTopY)
                || (linePointY1 < rectangleRightBottomY && linePointY2 < rectangleRightBottomY))
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        else
        {
            return false;
        } 
    }

详细解析竞业限制

竞业限制是指用人单位在劳动合同或者保密协议或者竞业限制协议中,与掌握本单位商业秘密和与知识产权相关的保密事项的劳动者约定,在劳动合同解除或者终止后的一定期限内,不得到与本单位生产或者经营同类产品、从事同类业务的有竞争关系的其他用人单位任职,也不得自己开业生产或者经营同类产品、从事同类业务。

浏览器 STATUS_INVALID_IMAGE_HASH 错误状态码解决办法

解决方法:

  1. 打开注册表
  2. 进入\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome(Policies没有Google和Chrome就新建项)
  3. 然后新建DWORD(32位),将名称改为RendererCodeIntegrityEnabled,值为0

重启浏览器问题解决。

如何面试程序员

提问之前的准备

首先,最重要的是,你自己一开始就应该想清楚:

  1. 需要新员工完成什么样的任务?
  2. 怎样的人能完成这样的任务?
  3. 哪些途径和方法可以发现这样的人?

只有明确这些根本性的问题,才能正确高效地完成面试。