• One weird trick to induce lucid dreams and out of body experiences

    What if I told you that I have one weird trick to help you have a lucid dream and/or out of body experience? This particular trick has been well documented elsewhere, but if you don’t want to read an entire book I’ll give you the quick version here. Also note that this is intended for weekends or non-work days in general, because it requires sleeping in a little.

     
    What’s the difference?

    Now you may be asking what the difference is between a lucid dream and an out of body experience. In the former it’s like a traditional dream, except that you’re lucid enough to do what you want — it’s not just a passive dream experience. Yet all the normal weirdness of a dream still applies.

    In an out of body experience you typically start by “waking up” but soon realize that your surroundings are a little off. This is known as a false awakening. For me at least these out of body experiences don’t feel like a dream, yet are recognizable thanks to suffering from dream-like continuity problems. Additionally, physical things that don’t usually work in dreams (mirrors, light switches, etc.) will often function to some extent. In many ways it’s like a lucid dream only more grounded.

    There’s no real yardstick for determining whether an experience is one or the other. Dreams, lucid dreams, and out of body experiences can and will blend together along a spectrum of consciousness. For the rest of this post I’m just going to stick with the term “lucid dream,” but I’ll be referring to a variety of conscious sleep experiences.

     
    Cut to the chase

    So here’s the trick: wake up around an hour or two before you normally would. Use this time to read a book, check Twitter, or anything else that requires little effort and won’t wake you up too much.

    At about the time you’d normally wake up, go back to sleep. Ideally you should be a little tired at this point, but more or less fairly alert. You’ll probably have trouble falling asleep, which is a good sign — focus on keeping your mind clear of distractions. Any meditative exercise will do, my favorite is slowly counting your breaths backwards from 100.

    Now comes the important part: relax. At this point your brain will take you directly from being awake to being in a dream, so it’s important not to let anything that’s about to happen startle you into waking up. For some folks this will take a bit of practice.

    The first thing that will happen as you transition into sleep mode is you’ll hear a buzzing, almost chainsaw-like sound that fades in and out. Even though it’s all in your head it can sound both loud and real. Don’t worry about it, it’s natural and happens to everyone.

    Next, you’ll see a series of images float into your mind’s eye. You might see people, animals, etc. Sometimes they’ll be a little scary, but again it’s all in your head. The images will slowly start to move, and then *POOF*! You’re in the dream world now!

    With any luck, the transition from being fully awake to your body being asleep will leave you in a fully lucid state. Congrats!

     
    How it works

    Many lucid dreaming books explain the same technique. Technically it’s called a Wake Induced Lucid Dream (or WILD) because you’re inducing the lucid dream from a fully awake state. But most of the books leave out one key detail: this type of dream induction only works in the morning hours.

    Why? Let’s look at this sleep diagram from Wikipedia:

    First note that dreams can only occur in the REM cycle, which is marked in red. As you can see, the time between when you fall asleep at night and the first REM cycle is over an hour long — most of us can’t maintain consciousness that long while asleep. But as the night progresses, the REM cycles get longer, and you can go (as the diagram indicates) directly from being awake into REM.

    Waking up an hour or two before your usual time deprives your brain of that last extra long REM cycle, which means that when you finally sleep again, it will almost certainly jump straight into REM and thus a dream. The only tricky part is maintaining consciousness during the transition.

    Having any dream right before you wake up makes you far more likely to remember it. If you’re serious about lucid dreams, keeping a dream diary will also help build your ability to recall any and all dreams.

     
     
    By the way, if you’re wondering what to do in a lucid dream, just explore! You may be amazed by what you find hidden in your own mind. For a strange experience, try looking at your hands for a minute. Shoot me an email when you find out what happens — as they say, “You’ll never guess what happens next!.”

  • My own QML TreeView

    It’s Valentine’s Day and here’s the point where I have to confess my love as a software engineer for QML. It’s a markup language for building simple modern UIs with Javascript controls, and can be bound to C++ and Python via Qt. Since it’s based on Qt it runs on pretty much any modern desktop or mobile platform you can think of.

    But like any relationship, sometimes one is left wanting for more. Sure, QML is great but it has flaws that are hard to overlook. For example, there’s no “tree view” component (think: file system UIs, Windows RegEdit, etc.) which is a deal breaker for some use cases.

    That deficiency ends today.

    I’ve been busily working on my own tree view implementation, which you can find on GitHub. It supports drag and drop rearranging and folder creation with a mouse or touch interface. Like the iOS home screen, folders are limited to one level (i.e. no subfolders.)

    Here’s the sample test harness in action:

    The trick? It’s all a standard QML ListView with a special type of delegate, my own RearrangeableDelegate.

    The items can be rearranged by pressing (or long-pressing, see update below) on them, then dragging to the desired space. If you position it between two items a line appears, and releasing the mouse positions the item at that location. Positioning on top of an item causes the two items to pop out into a new folder. Dragging the last item out of a folder deletes the folder. If you want to have special items at the top of the list that can’t be rearranged, that’s supported via the numStationary property.

    Everything is designed to be styled to your liking. Want to change the drag border, the opener image, the indentation, etc? Easy! Just set some of RearrangeableDelegate’s existing properties and you’re good to go.

    The UI state of each item is stored in the list model itself, which provides an easy (if somewhat hacky) way of maintaining the UI state with a database or settings file. Here’s what you need to provide, subject to change:

    ListElement {
        // Unique id (integer)
        uid: 1;
    
        // Used for drag and drop UI. (Persistence not required.)
        dropTarget: "none";  
    
        // True if a folder, else false
        isFolder: false;     
    
        // -1 if not in a folder, else the uid of the parent
        parentFolder: -1;    
    
        // For folders, this indicates whether their children are
        // displayed. Otherwise, indicates if visible.
        folderOpen: true;
    }

    Best part: I’m giving away the entire thing for free under the MIT license, which ought to satisfy pretty much everyone (except for Richard Stallman.) Take my code and do what thou wilt. If you encounter a bug please file a new issue or fix it on your own and submit a Pull Request. Either way I — and perhaps other QML developers — will be eternally grateful for your ongoing efforts to make up for this missing QML component.

     
    UPDATE: After convincing Hryx to do some user testing, we decided that long-pressing wasn’t discoverable enough for a desktop. So now there’s a flag called dragOnLongPress to control this behavior. By default it’s set to false so that a long press isn’t required to move an item around. You can set it to true in situations where a long press to move makes sense, such as on touch and mobile devices.

  • The John Barrowman Theory

    Image credit: Phoenix Comicon

    What if the television shows Doctor Who, Desperate Housewives, and Arrow are all part of the same universe? Crazy, you say? Well sure. But let me explain The John Barrowman Theory to you anyway.

    After the events in Doctor Who and Torchwood, the enigmatic man who calls himself Captain Jack travels forward in time and discovers Earth is destroyed by an environmental disaster. Rather than work with Torchwood he decides to take matters into his own hands. He travels back in time and assumes the name Patrick Logan to conceal his identity from Torchwood.

    As Patrick, he becomes an eco-terrorist to stop the impending doom. To escape his crimes, Patrick fakes his own death in an explosion (an easy feat because he’s immortal) then changes his name to Malcolm Merlyn. In the face of tragedy Malcolm decides to become even more of a badass and trains with Ra’s al Ghul’s assassins. When things take an ugly turn, what does Malcolm do? He fakes his own death again, that’s what.

     
    See? There’s a pattern here — morally ambiguous, vengeful, mortality-challenged. Jack, Patrick, and Malcolm could easily be the same character in the same universe. And that’s the John Barrowman Theory.

    Mind = blown.

  • BART needs platform walls

    Shanghai Metro

    Recently we’ve had a number of cases in and around San Francisco where someone was hit by a train in a subway station. These tragedies — whether intentional suicides or simply accidents — have become common enough that we really should be doing something about it. It’s only fair for everyone involved.

    Fortunately there’s a solution that already exists: walls. Specifically, walls with sliding doors that line up with the subway’s doors, just like how elevators have inner and outer sets of sliding doors.

    Would you want to work in a building where the office elevator didn’t have outer doors, and instead you just stood next to an opening to the elevator shaft? No? Why should riding the subway be any different?

    If you’ve ever taken the driverless airport tram at SFO (or many other airports) you’ve seen this first hand: there’s a glass wall between you and the tram, and the doors only open when the tram arrives. The tram only departs once both sets of doors are safely closed.

    But this wall “technology” isn’t just for driverless trams — some major transit systems already have this, for example Shanghai Metro in the photo above. As the photo illustrates the yellow-tiled safety zone has been replaced by a thick piece of glass separating people from fast moving trains on the other side.

    Walls have a side benefit as well: stopping the wind. No need to worry about holding a paper steady or having your hair re-arranged by the wind from a fast approaching train.

    The good news is that BART has at least considered this recently, but so far they don’t seem to be in much of a hustle to build anything. That’s a shame for us all.

    UPDATE:

    Newly elected BART director Nick Josefowitz responded on Twitter:

    @mrericsir We’re working on platform walls at our most crowded stations. It’s a great idea, for safety and capacity. Please keep advocating!

    — Nick Josefowitz (@josefow) January 28, 2015

  • Schedule your day like a skater

    Wake Bake Skate
    Spotted in Clarion Alley

    Sure, you could go to the library or a bookstore and find a book about optimizing your daily schedule. But that would involve reading more than three words, and therefore is a sub-optimal use of your time.

    Instead, take the advice of the sticker I found on a wall in Clarion Alley and schedule your life like a skater. Wake, bake, skate. Sometimes the best things in life are the simplest.

  • 11 Christmas gifts for a San Franciscan

    Holiday shopping is stressful enough without troubling yourself with figuring out what to buy for people. I mean, does your grandmother want a red scarf, or a green hat? Does your kid want a toy dump truck, or a Lego set? I’m getting a headache just thinking about it.

    Fortunately for you, I’ve pre-assembled a listicle of eleven excellent Christmas gifts for the San Franciscan(s) in your life. Read on.

     
    1. Lunchbox shaped like an Uber vehicle

    If you want to get ahead in life, you have to break some rules — the more, the better. Teach your kids how staying several steps ahead of local regulations can net them billions in venture capital with this cute lunchbox.

     
    2. Cisgender Barbie

    Cisgender Barbie loves makeup and expensive shoes, but that’s because of who she is on the inside, not because of society’s expectations for someone assigned her gender at birth. Does that make her “normal”? No; let’s be honest, Barbie is a freak for entirely different reasons. And don’t get me started on Ken.
     

    3. Officially-licensed Ed Lee mustache trimmer

    Mayor Ed Lee had this mustache trimmer designed just for his own ‘stache. Only with this officially-licensed trimmer will you be able to achieve Lee’s timeless, manly look. Order today and we’ll throw in an autographed copy of Lee’s best selling men’s grooming book, “Mustache 2.0.”
     

    4. “ZUCK”, aka Mark Zuckerberg cologne

    The man… the legend… the scent. New from Facebook’s Mark Zuckerberg: ZUCK cologne. It’s a scent like no other: a dash of figs, a pinch of sweat, a splash of Mountain Dew. Hack together a PHP script and accidentally fall into a pile of money? It could be you; you smell like ZUCK.
     

    5. Four dollar toast-shaped earrings

    Commemorate San Francisco’s boldest move yet into overpriced foodie hedonism with a pair of earrings patterned after The Mill’s infamous toast. Don’t settle for a cronut necklace, I hear those are already at Ross.
     

    6. My first bicycle chop shop

    What? These bikes I’m taking apart right here on the sidewalk? They’re mine, man! Of course I don’t have a receipt, don’t be ridiculous. I just take apart my own bikes on the sidewalk all the time, there’s no law against it. Have a nice day, officer.
     

    7. Gingerbread luxury condo

    Sure, it’s a fifth floor studio with no elevator, and your only view is a candy cane freeway overpass. But it has gumdrop countertops, and exposed M&M walls! Is it worth two million chocolate coins? Don’t bother asking, another kid just showed up with two and a half million chocolate coins, and now you don’t get to eat it. That’s life, kid.
     

    8. Incoherent Gibberish or Possibly References You’re Not Hip Enough to Get by Dave Eggers

    “I open the door and she’s standing in her nightgown facing me. She scowls. I’m reminded of my aunt. Those cold summer nights, gargling mouthwash. She turns on the radio but nothing happens. I get on the slide. We enter the drugstore. Seven.”
     

    9. Gift basket from Dolores Park’s Weed Truffle Guy

    Dude, did you leave the PBR at home again? Ah, fuck dude. But don’t worry, I got us covered bro — the Truffle Guy made me this sweet gift basket, it’s got like mad edibles dude. Hey man is that the Cold Beer Cold Water guy over there? Let’s grab some beer too bro. Get all our bases covered.
     

    10. Talking Leland Yee plush toy

    The Talking Leland Yee plush toy will say anything you want! Want him to endorse an assault rifle ban? Just stick $20 in his mouth! Want him to help purchase a grenade launcher from a shady Russian mobster? That’ll be another $20! But make sure you’re out of earshot of the authorities, or Talking Leland Yee may wind up in time out.
     

    11. Christmas tree made entirely of kale

    Real or artificial; how about neither? This Christmas tree is handmade from locally sourced, organic kale. While you can’t hang ornaments on it and it wilts after a couple of days, it contains far more micronutrients and antioxidants than a traditional tree.

  • Terrifying feat accomplished with suction cups

    Suction cups

    While walking by the construction for LinkedIn’s new offices at 222 Second Street, I happened to notice some windows were being lifted up on a crane. How do you get a pane of glass from the street to 12 floors up?

    Look closely: the only thing holding that windows is eight suction cups. That’s right, the technology behind your favorite childhood bath toys is now being used to hoist enormous panes of glass over a busy street. Let’s hope the workers remembered to lick them first for a better grip.

  • Fuck SFPD squirrel

    Fuck SFPD squirrel
    (Spotted at 3rd and Folsom)

    Presumably, this crime fighting squirrel operates in a similar manner to Disney’s 1989 series Chip ‘n Dale Rescue Rangers, wearing a little outfit and solving crimes within 24 minutes. Come to think of it, this sounds adorable and I’m not sure why anyone would object.

    The person behind the red crayon has some explaining to do: why do you hate SFPD’s squirrel? Is there a specific beef you have with this squirrel? We deserve answers.

  • Demonic parking meter wants your quarters, soul

    Demonic parking meter
    Demonic parking meter close up

    What would you pay for the perfect parking spot?

    • 25 cents?
    • 50 cents?
    • Your eternal soul?

    If you answered the latter, I’ve found the perfect parking spot for you! Over Halloween, a new demonic parking meter appeared at the corner of 18th and Oakwood.

    It’s a great place to park your vehicle if you made the unfortunate mistake of driving to Dolores Park, and don’t mind committing your very own soul to endless torment while you buy wine and cheese from Bi-Rite for your sunny afternoon picnic.

  • Assassin’s Creed Halloween costume

    Nothing is true,
    Everything is permitted.

         – The Creed

     
    Assassins. Seems like they’re everywhere these days, murdering it up. So for Halloween this year I made my own modern-style Assassin’s Creed costume.

    The white hoodie is pretty much standard as far as assassins go these days. The felt patch on the hood is a tribute to Connor Kenway’s patch in AC III. It’s clipped on with safety pins.

    And for good measure I’ve got dual hidden blades.

    Costume

    My hidden blades use a pair of telescoping drawer sliders from a local hardware store. The “blade” is made from a freebie paint stir stick painted gray. It’s held to the slider with fishing wire.

    For the wrist straps I bought some old belts at Goodwill, cut them down to size, and bolted them to the opposite side of the slider. I glued a couple excess pieces of belt to this side for extra grip.

    The blades pop out with a flick of the wrist and can be held in place with a finger.

    Hidden blade
    Hidden blades

    And of course we have an Apple of Eden. You can’t really call yourself an assassin if you don’t go around collecting artifacts from the First Civilization, so I made this one by dremeling out the lines in a styrofoam ball and painting it.

    The apples vary from one game to the next, this one’s more or less like the one Ezio found in the second game.

    Apple of Eden

    And that’s all there is to it! If you spot anyone dressed as a Templar, please let me know.