David Dong

David Dong

Java/C/C#/Python

Java/C/C#/Python

  • posts

  • Git commands and usage tips

    git-command-01

    Git is a powerful version control tool. I would even say it’s one of the best. However, being powerful sometimes means being complex in terms of functionality. Git has a lot of commands. The good thing is that you can do everything you want with them, the bad thing is that you need to remember them. Here, I’ll write down the commands that I’ll use often to keep better track of them and make them easier to search.😉

  • 生产力工具

    others-online-tools-01 “工欲善其事,必先利其器”,使用一款好的工具,能帮助我们工作中事半功倍,提升效率。这篇文章记录了我日常使用的一些我认为相当不错的工具和软件。

  • 从 MarkdownPad2 到 Typora - 使用 Typora 的直观感受

    others-typora-01

    一直以来我都是用 MarkdownPad2 撰写自己的博客文章,也没有觉得哪里不好。关注到 typora 这个软件是因为最近网上讨论的比较热烈的这个软件要收费的消息,于是上网 Google 了一下这个软件才发现很多人对这个软件的评价很高,这就引起了我的兴趣,于是我决定下载这个软件亲自试用一下。😉

  • Securing Connections with SSH - A Comprehensive Guide

    Introduction

  • C# 的 IntPtr 类型

    C# 中,IntPtr 是一个代表内存位置指针的类型。它被用来存储一个变量或一个对象在内存中的地址。IntPtr 是一个整数类型,但它的大小与平台有关。在 32 位系统中,IntPtr 的大小为 32 比特(4字节),在 64 位系统中,它的大小为 64 比特(8字节)。

  • 浅析 C# 中的线程同步

    线程间同步是指在多线程环境下,保证共享资源的安全和一致性的机制。 C# 中提供了多种方式实现线程间同步。例如:

    • lock 语句:使用一个对象作为锁,保证一次只有一个线程可以进入临界区;
    • Interlocked 类:提供了原子操作,如递增、递减、交换和读取值;
    • Monitor 类:提供了锁定对象、等待信号和通知信号的方法;
    • Mutex 类:提供了跨进程的互斥锁,可以用来同步不同进程中的线程;
    • Semaphore 类:提供了一个计数器,限制同时访问共享资源的线程数;
    • AutoResetEvent 和 ManualResetEvent 类:提供了信号量,可以用来通知或等待其他线程的状态变化;
  • Use Pypy to make Python run faster

    “If you want your code to run faster, you should use Pypy.” - Guido van Rossum, the father of Python.
    To understand why Pypy is faster, we should know what makes Python slower.

  • Fixing the issue: Communication error with Jack server (35) when building AOSP

    I met an issue Communication error with Jack server (35) when built the AOSP yesterday. I can build the AOSP successfully before this issue popped up. I spent hours figuring out why and solved the problem.

  • CI platform migration: from Travis CI to GitHub Actions

    I’ve used Travis CI to build and deploy my projects for some years. The performance of Travis CI can meet my requirements. However, recently I found Travis CI stopped working for me. ☹️

  • Speeding up my blog loadtime

    示例图片
    This is the story of how I speed up my blog website load time…

  • C# 线程

    在.NET 应用程序中,都是以 Main () 方法作为入口的,当调用此方法时系统就会自动创建一个主线程

  • A quick way to fix the Gitalk Error: Validation Failed

    I’ve met an error Validation Failed (422) when using Gitalk in my blog. This article records how I fixed this error. If you are in trouble with this issue and you are looking for a solution, reading this article may help you.