Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "smart locker"
I figured out a c++ syntax hack using for loops to make my own mutex locker unlocker that was immune to returns, immune to forgetting to unlock, etc.
Worked something like this:
Make a class that locks a mutex in the constructor and unlocks it in the destructor, call it class MutexLocker
for( MutexLocker a( mutex ); a.first(); )
// code here
Best part is some compilers are even smart enough to optimize out the extra jump at the end.
Wrap that code up in a macro and it’s as beautiful as
LOCK_MUTEX( mutex )
I literally freaked the hell out. Coolest way to lock mutexes ever. You can even have it skip over the code if it fails to lock.7
So someone gave me an idea today.
I am about go start going to school again soon and someone suggested having a locker competition.
My idea is this:
Have an lcd screen mounted to the outside. It will display a link. The link will be to a Twitter page specifically for the locker.
When I open the door it will tweet that the door was opened using a different message every time.
When I haven't opened it for a few minutes it will start tweeting about how it is getting bored and start tweeting jokes or something.
Also LED strips..
Does anyone have an idea how to power this? Also I know that it is dumb. Too bad, I am doing it anyways.21
I worked on a smart locker software with another developer a year back. Really cool stuff where you mix Node.js with real hardware. That another developer built the thing on Angular, despite not having a clue how to use it. We got fired, but those smart lockers are deployed to a lot of places now and whenever I see one I stop and feel proud because the API that powers it was written by me. Despite not getting a cent due to that other developer.