Profile

Cover photo
art yerkes
Lives in San Francisco, CA
91 followers|23,907 views
AboutPostsPhotosVideos

Stream

art yerkes

Shared publicly  - 
 
Jeb Bush on the economy: Ummm, I'm gonna need you to go ahead come in tomorrow.
3
1
Charles Gory's profile photo
Add a comment...

art yerkes

Shared publicly  - 
 
Clarence Thomas on inequality: stealing your car should be legal because nobody can take away your hope of having one.
1
Add a comment...

art yerkes

Shared publicly  - 
 
Been writing a style enforcer using clang tooling recently.  It's in a state that is shareable.

It allows you to enforce some basic rules about coupling:

1) No collaboration over globals.
2) No direct coupling to banned namespaces from outside.
3) No concrete classes in namespaces designated for interfaces.

The overall goal is to be able to sweep out coupling in favor of polymorhism and hold it by using the -Werror flag to fail a build if these rules are subsequently violated.

https://github.com/prozacchiwawa/clang-tooling-style
clang-tooling-style - An enforcer for some opinionated rules about coupling in C++
1
Add a comment...

art yerkes

Shared publicly  - 
 
Does anyone else interpret some variation of "enjoy a limited number of articles for the next X days" as something like "sign up now and give up what we're already giving you to get less"?  It doesn't seem like a good way of selling something.

"Enjoy 2 or fewer litres of diet pepsi over the next 7 days." <-- doesn't really work.
"Enjoy limited access to doritos over the next 7 days." <-- also doesn't work.  It sounds like something you give up for lent.
1
Charles Gory's profile photo
 
That is very good Art.  I think the extrapolation of that arguments is pretty funny.  I find that when this is done it is a n inferior product such as U2 putting their new album on my IPOd telling me look its free. 
Add a comment...

art yerkes

Shared publicly  - 
Add a location to your Tweets. When you tweet with a location, Twitter stores that location. You can switch location on/off before each Tweet and always have the option to delete your location history. Learn more. Turn location on. Not now. Turn off location ...
1
Add a comment...

art yerkes

Shared publicly  - 
 
Phase 2 success
1
Add a comment...

art yerkes

Shared publicly  - 
 
Cat structure phase 2: carpeted shelves
1
Add a comment...
Have him in circles
91 people
Terence Smith's profile photo
Chris Schafer's profile photo
Theron Lewis's profile photo
Alexander Rex's profile photo
Giulia Q's profile photo
SETH CARUS's profile photo
Filip Navara's profile photo
Daniel Reimer's profile photo
Kyle Graehl's profile photo

art yerkes

Shared publicly  - 
2
Add a comment...

art yerkes

Shared publicly  - 
 
I just recently had to receive a callback which may be called inline or out of line, and wanted to use std::condition_variable to wait until the callback had consumed an EOF.  An std::mutex was controlling access to the important state.  The main question was: how is the std::unique_lock in the inline callback constructed?

This might be obvious, but I didn't see examples of this pattern in the most common places.  I generally find that if I'm fighting with these standard library primitives, I'm thinking incorrectly about how they should be used.  The relationship between mutex, unique_lock and condition variable is very well considered.

Here's what I came up with:

std::mutex mutex;
std::unique_lock<std::mutex> _l(mutex);
std::condition_variable stream_ended;
bool recursive = true;
bool stream_has_ended = false;
decode->SetFrameCallback([&] (const BufferResult &buffer) {
    std::unique_lock<std::mutex> _ll(std::move(recursive : std::unique_lock<std::mutex>() : std::unique_lock<std::mutex>(mutex))); // Use the move constructor to produce either an empty or active unique_lock based on whether we're recursing, because the parent owns mutex while we are.
    // Note that it's safe to just set recursive to false below because
    // stream_ended.wait releases the mutex from unique_lock.
    if (buffer.is_eof()) {
         stream_has_ended = true; // safe since either we own the lock or we're down the stack from the owner
         stream_ended.notify_all();
    }
});

for (InputRef inputRef = get_input(); inputRef = get_input();) {
    decode->feed(inputRef);
}
recursive = false;
stream_ended.wait(_l, [&] () { return stream_has_ended; });
1
Add a comment...

art yerkes

Shared publicly  - 
 
Happy "Buy Nothing" day.  Most of us have a lot to be thankful for without gearing up for war to go shopping.  There are lots of teachers out there that could use a donation for school supplies and organizations like handup.us that might help make life a little easier for somebody.  
1
Add a comment...

art yerkes

Shared publicly  - 
 
Cat structure relocated. Just missed both cats on it at the same time in picture
4
Kyle Graehl's profile photo
 
you live across from costco omg!!!!
Add a comment...

art yerkes

Shared publicly  - 
 
Phase 2 complete
2
Add a comment...
People
Have him in circles
91 people
Terence Smith's profile photo
Chris Schafer's profile photo
Theron Lewis's profile photo
Alexander Rex's profile photo
Giulia Q's profile photo
SETH CARUS's profile photo
Filip Navara's profile photo
Daniel Reimer's profile photo
Kyle Graehl's profile photo
Basic Information
Gender
Male
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
San Francisco, CA
Links
YouTube