今日已更新 80 条资讯 | 累计 20052 条内容
关于我们

标签:#basic

找到 3 篇相关文章

AI 资讯

Day 02: The Terminal, Shells & File Systems

🎯 Learning Objectives Understand the interface boundary between Terminal Emulators and Shell Interpreters (including Windows Terminal vs. PowerShell vs. CMD). Master File System path tracking, hidden dotfiles, and essential CLI utilities. Map system execution paths via global and local environment configurations. 1. Terminal vs. Shell (The Windows Architecture) Terminal: The visual GUI wrapper. A window application that captures keyboard strokes, handles GPU text rendering, and manages tabs/panes. Examples: Windows Terminal, iTerm2, Alacritty. Shell: The command interpreter engine running inside the terminal. It evaluates text strings, processes scripts, issues system calls ( syscalls ), and interacts with the OS Kernel. Examples: PowerShell, Bash, Zsh, Command Prompt (CMD). ┌────────────────────────────────────────────────────────┐ │ WINDOWS TERMINAL GUI (The Visual Interface Window) │ │ │ │ │ ├───► Tab 1: [ PowerShell Core Engine (Modern) ] │ │ ├───► Tab 2: [ Command Prompt Engine (Legacy) ] │ │ └───► Tab 3: [ WSL Ubuntu Linux Bash (Core) ] │ └───────────────────────────┬────────────────────────────┘ │ Raw Text & Input Streams ▼ ┌────────────────────────────────────────────────────────┐ │ SHELL INTERPRETER (e.g., PowerShell / CMD) │ │ └───► Parses input string commands into system tasks │ └───────────────────────────┬────────────────────────────┘ │ System Call (Syscall) ▼ ┌────────────────────────────────────────────────────────┐ │ OPERATING SYSTEM KERNEL │ │ └───► Interacts directly with underlying hardware │ └────────────────────────────────────────────────────────┘ 2. Deep Dive: PowerShell vs. Command Prompt (CMD) While both are Windows shells hosted inside Windows Terminal, they belong to entirely different computing eras: Command Prompt ( cmd.exe ): A legacy text shell maintained purely for backwards compatibility with 1980s MS-DOS. It pipelines data as Plain Text Only , meaning outputs must be manually string-filtered. PowerShell ( pwsh.exe ): A modern, cros

2026-07-08 原文 →
AI 资讯

Comparable vs Comparator in Java

In Java, sorting is an important operation when working with collections such as ArrayList, LinkedList, and other data structures. For primitive data types, Java already knows how to sort values. However, for custom objects like Student, Employee, or Product, Java needs instructions on how objects should be compared. To achieve this, Java provides two interfaces: Comparable – Used for natural sorting. Comparator – Used for custom sorting. Comparable Interface Comparable is an interface available in the java.lang package. It is used to define the natural ordering of objects. The sorting logic is written inside the class itself using the compareTo() method. Method int compareTo(T obj) Return Values Negative - Current object comes before the given object Zero - Both objects are equal Positive - Current object comes after the given object When to Use Comparable? Use Comparable when: A class has one default sorting order. The sorting logic is a natural property of the object. The sorting criteria rarely change. Comparator Interface Comparator is an interface available in the java.util package. It is used to define custom sorting logic outside the class. Multiple comparators can be created for the same class. Method int compare(T o1, T o2) Return Values Negative - First object comes before second object Zero - Both objects are equal Positive - First object comes after second object When to Use Comparator? Use Comparator when: Multiple sorting criteria are required. You don't want to modify the original class. Different sorting orders are needed at different times.

2026-06-16 原文 →
AI 资讯

How I stopped nodding along and actually contributed to open source

For years I saw "open source contributions" on job descriptions and just... nodded along. Typed it into Google once, got overwhelmed, closed the tab. It always seemed like something other people did. People who actually knew what they were doing. People who weren't me. Then I started looking into it properly. And honestly? It still seemed big. Like I'd need to understand an entire codebase, find a complex bug, write some genius fix that the maintainers would applaud. Turns out that's not it at all. I found some resources that changed how I saw it completely. The bar to start is embarrassingly low, and that's intentional. The open source community built it that way on purpose. So I did it. Was it a few lines of code? Yes. Did I do it directly in the browser like a person who has no idea what they're doing? Also yes. Do I care? Absolutely not. Where to actually start: goodfirstissue.dev — filters repos by good first issue label up-for-grabs.net — same idea, different interface Docs you already use — if you read something and think "that's oddly worded," you're already there GitHub search — label:"good first issue" is:open and filter by language Here's the thing though, this isn't just about open source. Everything seems big and intimidating at first. So you start small. One tiny contribution. Not because it's impressive but because it's real, and it's yours, and it builds something. Confidence mostly. Then you do a slightly bigger thing. Then a bigger thing after that. You don't level up by waiting until you're ready. You level up by starting small and not stopping. My first contribution exists now. That's enough for today.

2026-06-04 原文 →