Skip to content

Instantly share code, notes, and snippets.

@amatus
amatus / llvm-ar.patch
Created July 14, 2013 02:19
Patch for llvm-ar to create sub-directories correctly.
--- llvm-3.2.src.orig/tools/llvm-ar/llvm-ar.cpp 2012-10-26 05:49:15.000000000 -0500
+++ llvm-3.2.src/tools/llvm-ar/llvm-ar.cpp 2013-07-13 21:17:35.047302973 -0500
@@ -461,11 +461,12 @@
(std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) {
// Make sure the intervening directories are created
- if (I->hasPath()) {
- sys::Path dirs(I->getPath());
- dirs.eraseComponent();
- if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg))
@amatus
amatus / IRLZ34N
Created April 27, 2013 14:12
IRLZ34N HEXFET® Power MOSFET
IRLZ34N
HEXFET® Power MOSFET
_____ D
| |
| |<-,
G___| |__|__ S
(reverse diode not shown)
@amatus
amatus / atx2600.120203.txt
Created August 31, 2012 18:11
ATX2600 code-down, 2012-02-03
[ problem 1 ]
Given an arbitrary linked list, can you figure out if a loop occurs. Find
a solution that can be done with O(1) space restriction (constant extra
spaced used). You have no knowledge about the length of the list.
Write an algorithm that solves the problem.
[ problem 2 ]
Given a string, find the first occurrence of a letter that does not repeat.
For example, in the string "abcdab", the answer is 'c' (not 'd'). Try to
find a solution with O(n) time.