Skip to content

Instantly share code, notes, and snippets.

View DumplingSociety's full-sized avatar
🎯
Focusing

DumplingSociety DumplingSociety

🎯
Focusing
View GitHub Profile
@DumplingSociety
DumplingSociety / gist:dd2dcd8f4518fdf873b4257dff8f91c8
Last active December 6, 2023 15:04
Linux Command Cheat Sheet

grep

grep -r --include="*.h" "text_you_want_to_searh" ./ 
  • used to search text_you_want_to_searh in all *.h recursively

find

@DumplingSociety
DumplingSociety / Svn_Cheatsheet.md
Last active November 5, 2025 03:37
GDB cheat sheet

svn merginfo

####show you what needs to be merged, next you need to svn merge each of those revisions

svn mergeinfo --show-revs eligible https://xxsubver/svn/path .

for each revision run with --dry-run as above and if no conflicts you can take the --dry-run out to perform the

The --dry-run option doesn't actually apply any local changes to the working copy. It shows only status codes that would be printed in a real merge. It's useful for getting a “high-level” preview of the potential merge, for those times when running svn diff gives too much detail.

Multiple Pass Technique

Most computations on a list will require O(N) time complexity, so a simple but very useful technique is to pass through the list a constant number of times to calculate some summary of the list that will simplify your algorithm. One example that we see a lot is the need to calculate the length of the list. That sounds simple enough, but let's see an example to motivate this technique better.

Example: Intersection of Two Linked Lists

Let's take a look at this common problem as defined in Intersection of Two Linked Lists.

Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists:

A:          a1 → a2
 ↘