Latest Publications

Canvas 7, Saving and Loading

The last version of my Canvas app let you pick different brushes and draw on the grid. If you played around with the line brush you might have noticed a small bug. The line erases everything it passes over.  This is because the line has no idea what the image was supposed to look like before we started drawing.
(more…)

  • Share/Bookmark

Canvas Part 5

This time I’ve taking the actual drawing out of the canvas object so we can have different brushes. I’ve also included a bit of code to get the color from the current cell and compare it with a hex color.
(more…)

  • Share/Bookmark

192. Rehearsal

Chris stood in the middle of the empty seats. He looked to the stage below where Roland and Jaime chatted with each other. Chris clicked the microphone button on his belt. “Alright let’s get started. Roland and Jaime, this is your first encounter. Jaime, you need to allure to your ulterior motive. The audience should start to suspect you. Roland, you are captivated by her good looks. This is the first living woman you’ve seen in 6 months.”

Roland shook his body, getting into character. “Alright.”

Chris turned down the lights, “Action.”

Roland mimed opening a door. “Wave, stay back.” His foot pushed a small plush dog behind him. Entering the room, his flashlight made slow security sweeps across the floor. The light stopped on a pair of black heels. Roland gulped. The light creeped up her long tan legs, slowly reaching her knees, and then up her thigh and the bottom of a black pencil skirt.

“Excuse me.” Jaime said.

Roland shook his head and rushed the light past the white dress shirt and into her eyes.

She blocked the light with her hands. “Hey.”

“Sorry, sorry.” Roland brought the light down, stopping on her chest for a moment and then finding the floor.

“Are you?” She asked.

“No, not a zombie.” He walked closer.

“No shit, zombies don’t use flashlights. Are you a survivor?” She held out her forearm. Roland shined the light on the tattoo of an Egyptian Was, a symbol representing a staff.

“Oh … yeah I am.” He moved the light to it illuminated his Ahnk tattoo.

Jaime walked to the edge of the stage, “Wait a minute.”

Chris clicked on his mic. “Yes dear, what is it?”

“I just don’t think the audience is going to get it.”

“Isn’t going to get what?”

“All this Egyptian symbol stuff. Hell, I’m in it and I still don’t get it.” Her body slumped. The neatly pressed lines of her shirt mangled into a mess. “I just think it’s a bunch of smoke that no one really cares about.”

Chris brought up the house lights. “It is a minor detail. I’m fine if you want to play it down, make it something you notice but don’t make it the centerpiece. Is that alright Roland?”

“Yup, sure” Roland walked to his starting position.

The house lights dimmed. Roland mimed opening a door. His flashlight swept across the stage. “Wave Shhh!” He held the plush dog out of the room. The beam stopped on a pair of black heels. Roland’s sneaky posture straightened as the beam walked up her legs. “Are you the survivor?” He asked.

She held out her forearm. The beam hovered on the staff tattoo before moving to her face. “Where’s the rest of the rescue party?”

“I’m it.”

“You?” She walked slowly with each heel making an echoing click, hovering over him. “You’re going to rescue me?”

Roland dropped the flashlight. He bent his legs and felt along the floor for the light, not breaking her deadly gaze. Finally finding it, he picked up the light and straightened to his full height. Her eyes still burned just a few inches above his. He broke into a smile. “Ever been with a midget?”

She started laughing and turned her back to the audience.

Roland smiled. “I could be 7 foot too, if I had 3 foot heels.”

The house lights came up. “Alright guys.” Chris said. Jaime and Roland stifled their laughter while Chris talked. “I really liked the whole dominance through height, and the dropping of the flash light. But Jaime, you have to be nicer, more seductive. You’re pulling him into your trap, you’re a black widow. Right now you feel like ice queen.”

Billy stood up in the audience and faced Chris. “Can I be in this scene? Please? Just once?”

Roland shrugged at Chris. She waited for Jaime’s objection but none came. “Sure kid, take your place.” The lights dimmed.

Roland mimed slowly opening the door.

Billy pushed past him and ran into the room. “Come on.” His own flash light waved wildly about the room.

“Wait!” Roland ran in after the boy. Billy screamed. Roland’s light found him, he way sitting on his ass as his flashlight rolled away. Billy’s light stopped rolling and focused on a pair of black heels. Roland’s eyes walked up the well defined calf muscle as he picked Billy up.

On his feet, Billy walked up to the woman in a long pencil skirt and white dress shirt. “Are you the survivor?”

She bend over and held out her forearm. “Well I’m not a zombie.”

Billy ran his little fingers down the staff tattoo on her arm. “It feels weird.”

“Where’s yours?” she asked him.

Roland put his hands on Billy’s shoulders and pulled him back. “He doesn’t have one.” Roland held out his arm showing his own tattoo. “He’s just a little kid I found.”

She flipped her hair and smiled keeping her back straight, showing off the several inches she stood above Roland. “Of course. Nice to meet you, my name is Jaime.”

The house lights came back up. Chris boomed over the speakers. “Billy, I think we might have to keep you.”

The actors broke position and walked to the front of the stage.

“Alright, time for a break everyone, We can pickup from the introduction when we get back.”

© Chris Richards 2009
  • Share/Bookmark

Sick!

I didn’t have a story last week because I was/am sick. I’ll have one up for this weekend.

  • Share/Bookmark

101. Ghosts

After I died, a lot of things changed. As a ghost, time streamed together giving me the opportunity to watch the world in a way I never could before. The first thing I did was to head back to my old high-school and sit in the girls locker room. I watched the cheerleaders-those snooty bimbos that wouldn’t give me the time of day when I was alive. I watched and judged them as they changed in and out of their outfits. Every inch was exposed to me, I could almost feel them, but they were always just out of reach. So I sat there and watched. Every year a new batch of fresh young girls would come in and the older girls would leave. To me, they all blended together creating an endless supply of young supple bodies.

Then all at once, the locker room was empty. The girls stopped showing up. It wasn’t like during summer break. This was much longer, the paint faded and peeled before my eyes, like a time lapse video. The room deteriorated taking the memories of the girls with it. Eventually light broke though the walls and the whole locker room fell into a flowering field. I figured it was time to move on.

I wandered around for a while trying to find something I remembered. The city had changed so much since I had died. All the old back streets and short cuts that I used to take were now large 5 lane highways filled with never ending traffic. My old university had grown exponentially in my absence. Electric shuttle busses zoomed around taking students to-and-fro. Everything was a blur of motion and activity. When I walked into a lecture hall I expected people to notice. I knew they couldn’t actually see me, but for some reason I still expected them to notice. Back when I was alive, if you walked into a room, people would notice you, even if they were trying to ignore you, you could still feel that they could feel you. That they knew, somewhere, that I existed. Walking in and out these busy lectures, no one had noticed. No one knew that I existed, or that I had ever existed. In one of the larger lecture halls I found a nice spot above a projector screen to sit and watch. I could see the entire audience and they would look back at me. Even if they weren’t actually looking at me, noticing me, it was comforting to pretend they were.

Students herded in, found places, and then herded out again. This blur of action and stops gave me time to watch the fashions. The girls wore tiny shorts with skinny long legs. Dark colored shirts with long sleeves. Then they shifted into tight pants with tiny tank tops. Eventually they were back to long shirts and sweaters. Their patterns cycled and repeated. The clothing thinned out only to become covered again. The outrages of the corrupted youth seemed so ridiculous to me now. Nothing ever really changed, everyone was just another version of someone else. After their entire lives, after my entire life, everything amounted to little more than just another meme.

I needed to break out. I grew tired of always watching, watching the same thing over and over again. I figured there must be something to show, something for a life well lived. I decided to seek out my descendents, to find some sort of evidence that I once lived. This proved harder than I thought. Books were simply out of reach to me unless someone else had it opened, computers were the same. I could never do anything on my own, I was stuck watching other people. My predicament had never occurred to me before, originally I just wanted to watch, but now I found that I had no choice. I did nothing but sit by as my own life passed me by and now as a ghost I had to sit and watch everyone else’s life pass me by.

I stormed around the university library, running though walls and pushing on book cases. I tried to create cold spots, appear in photographs, anything to get attention, anything to get a second chance. A chance to conquer the fears that held me back in life, a chance to help others conquer theirs. Anything to just say to the world, “I existed.”

© Chris Richards
  • Share/Bookmark

29 Evil

Red and yellow light flooded my face. The explosion echoed from the Dolby Surround Sound vibrating my ribcage. I gripped the seat as the main character drove a fire engine red 1952 convertible across the raised highway, dodging ufos falling out of the sky. Could he make it to the power station in time? What if one of those ufos fall on the car? Blue light blinded my row. Instinctively I threw up my arm to shield my eyes.

“Hello? Yeah I’m at the movie.” A black teen with an oversize white tee-shirt and white cap talked into his cell phone in front of me. “No we haven’t gotten to that part yet.” The blue light of the cell reflected off his gold tooth as he talked.

I leaned forward and whispered. “Please be quiet.”

He sat up in his seat and turned to face me. “Get out my face, cracker.” He yelled. Other people in the audience started hushing us. The teen sat back down and talked into his phone. “Nothing man, just some stupid ass cracker looking to get his ass beat.”

In one smooth motion, I stood up, snatched the phone from his hand, and threw it down the theater. It’s blue light flashed as it hit the cement. It split in pieces as the light flashed a final time.

The teen stood up and pushed my shoulders back. “What the fuck you think you’re doing you racist cracker. I’m going to kick your little punk ass.” He pushed my shoulders again. Someone ran out of the theater.

I looked him in the eyes. He was shaking, his eyes darted around the dark room and a hand reached around to his back pocket.

Does he have a gun? A knife? The possibilities filled my head. He was too close for a gun, I could grab it. A knife I’d have to parry. I don’t need this, I just wanted to watch the movie. I looked at the screen quickly to see the main character’s arm had been transformed into a tentacle. How did that even happen? I needed to diffuse this situation quickly. “Just turn off your phone.”

“What?” he pushed me with his free hand. “You’re a bitch ass cracker. Come on then” he pushed me again. “What you got bitch?” His hand was still behind his back.

I looked around at the crowd. Everyone was focused on us. Earth could be blowing on on screen and no one would notice. A guy behind the teen nodded his head. I took it as a sign of support and clenched my fist.

“Come on bitch, what you gonna do? Huh? What you gonna do, cracker?” He pulled his hand out from behind his back. A switchblade glinted the projector light. He pointed the blade at me in his right hand and motioned for me to attack with his left.

I grabbed his right arm and forced the blade into the seat. With his hand pinned I swung and caught the left edge of his jaw with my fist. The crowd cheered as he let go of the knife and fell over the seat. The movie flickered white and the house lights came up. Ushers ran in and up the aisles. People emptied the row so they could get to the teen. He was holding his face crying on the floor. They picked him up and walked him out and down the stairs. The big bad gansta was crying.

The manager came up to me. “I’m so sorry, are you hurt?”

“No I’m fine.” The knuckles on my right hand burned, each vain throbbed individually. I held my hands next to each other, blood pooled around a small cut.

“Are you sure?” he asked again. I nodded. He pulled the knife out of the seat. “Thank god for that.” He walked back to the aisle and down to the front of the theater. “We’re going to restart the movie for you. I’m sorry about this fokes, if you don’t want to stay you can get a refund.”

©Chris Richards 2009
  • Share/Bookmark

Python, Evolving, Learning

I’ve always been interested in the idea of software that evolves on it’s own; software that can write itself. I’ve come up with all sorts of ways this can happen, from neurons to dynamic methods, to my latest effort, a sudo assembly language.

Note: I’m not trying to replicate or create an actually assembly language. I’m just using concepts from it to achieve my own goals.

The idea is that the assembly would act as sort of a DNA for the programs. They run the code and are ranked by their effectiveness. The most effective will continue to live and be breed to start a new generation. Those that aren’t effective will be deleted.

First step is to build the sudo assembler. I figured being able to print out the Fibonacci sequence would be a good test. My assembler doesn’t have any predefined variables, just a stack you can push things onto. The different methods would just pop what they need off the stack.

Alright enough talk, here is the code.

#
# Simple byte-ish interperter.
# No real assembly or byte code, just made up stuff.
# By Chris Richards 2009.
#

class ByteInterpreter:
    """Runs predefined Byte commands"""
    stack = []   #Varables that can be used by the ByteCode
    command_index = 0  #The command to be evaluated next
    once = True;

    def Run(self, command_list):
        """Run the commands from the start to end"""
        while self.command_index < len(command_list):
            self.Interpret(command_list[self.command_index])
            self.command_index += 1

    def Interpret(self, command):
        """Interprate the command and run the correct method."""
        #Break the command into it's parts
        parts = command.partition(" ")

        #get the method they want
        method = getattr(self, parts[0])
        #call it
        method(parts[2])

    def push(self, value):
        """Store the value on the top of the stack."""
        self.stack.append(value)

    def pop(self, ignored=True):
        """Remove and Return the top value on the stack."""
        if( 0 < len(self.stack) ):
            return self.stack.pop()
        else:
            return None

    def peek(self, ignored=True):
        """Return the top value on the stack without removing it."""
        if( 0 < len(self.stack) ):
            return self.stack[len(self.stack)-1]
        else:
            return None

    def duplicate(self, times):
        """Duplicates the top of the stack the number of times specified."""
        times = int(times)
        for i in range(times):
            self.push(self.peek())

    def add(self, ignored=True):
        """Pops two values, converts them to ints and then pushes the result back on the stack"""
        val1 = int(self.pop())
        val2 = int(self.pop())
        self.push( val1 + val2 )

    def subtract(self, ignored=True):
        """Pops two values, subtracts them, then pushes the result onto the stack."""
        val1 = int(self.pop())
        val2 = int(self.pop())
        self.push( val1 - val2 )

    def jumpnz(self, line):
        """Peeks the top value, if it's not zero it will jump to the line."""
        line = int(line)
        val1 = int(self.peek())
        if( 0 != int(val1) ):
            self.command_index = line-1

    def shift(self, amount):
        """Shifts the top value back the amount specified."""
        amount = int(amount)
        self.stack.insert( len(self.stack) - amount-1, self.stack.pop() )

    def prnt(self, ignored=True):
        """Does a peek and prints that value to the screen."""
        print "print " + str(self.peek())

if __name__ == "__main__":
    fibonacci = ["push 1"
                 , "push 0"
                 , "push 10"
                 , "shift 2"
                 , "shift 1"
                 , "duplicate 1"
                 , "shift 2"
                 , "add"
                 , "prnt"
                 , "shift 2"
                 , "shift 1"
                 , "push 1"
                 , "shift 1"
                 , "subtract"
                 , "jumpnz 3"]

    runner = ByteInterpreter()
    runner.Run(fibonacci)

That prints out the first 10 Fibonacci numbers. So Now I know the assember works properly. The next step is to create a program that can create critters with random code. Then we can run their code and see if they can evolve into producing the Fibonacci sequence.

  • Share/Bookmark

New story is late.

I didn’t have the new story up over the weekend because my MacBook isn’t working. So I spent the weekend reformatting hopping it isn’t a hardware problem, it is.

I’ll have the new story posted up sometime this week.

  • Share/Bookmark

72. Wants

“Fine.” Lindsey plodded across the small dorm room. A tall table stood next to the door covered in junk. Lindsey slung her book-bag over her shoulder and plucked Jerome’s phone off the table. “You won’t need this.”

Jerome’s heart went into overdrive as she stormed out. His legs itched to follow. The door was propped open and her feet echoed from the hall. She stopped. His mind was struggling on the hand-break on his legs. The elevator chimed. His mind letting go for just a second, his legs took off out the door and down the hallway.

He reached the elevator just as the door started to close. He pushed on the doors and they opened again. “Give me my phone.”

Her scowl curled up. She dangled the phone, holding it by the small plastic antenna, in front him. He made a grab and she pulled it away. She dangled it again, teasing a dog with a treat.

He watched her eyes and moved his hand slowly for the phone. When it was just an inch away he made another grab. She pulled it away again.

“Damn it Lindsey, it’s my phone.”

She dangled it again. The doors chimed. She palmed the phone and waved to Jerome as the doors closed, separating them on either side.

“Bitch.” he yelled as the elevator descended. His legs were ready before he even made the choice. They took off for the stairs. He opened the door just as three students entered the hallway. They passed Jerome carrying armfuls of groceries. He held the door while the energy in his legs channeled into his foot tapping wildly. He made it to the first floor as the elevator chimed again. Watching her as she read though his phone, the elevator closed and headed up. “I don’t have time for this shit.” He yelled at the doors.

Jerome was panting as he made it back up to the third floor. He walked over to the elevator but it was empty. He walked back to his dorm room. Lindsey was sitting on the couch with her head in her hands. Her shoulders rolled with each sniffle. “Now you’re crying? What is with you today?”

“Nothing.” She wiped her eyes.

Rolling his eyes he sat next to her on the couch. “Come one, what’s wrong?”

“Nothing.”

He put an arm over her shoulder and scooted next to her. “Something’s wrong, you weren’t crying when you left.”

She pulled out from under him and stood up. “Here’s your stupid phone.” She hurled it at the couch.

Jerome stood up and towered over her. His arms over his head made it look like he could completely engulf her. “What do you want from me? I’m trying but you won’t tell me what’s wrong. This is bullshit.” He rubbed his eyes, sighed, and wrapped his arms around her. “Look, I’m sorry. I didn’t mean to piss you off.”

She oozed out of his arms and back on the couch. “You don’t even care.”

“Of course I do.” He kneeled on the floor in front of her. Using on hand, he gently lifted her chin so their eyes meet. “I thought you were just mad, why are you so sad now?”

“You know why.” Her eyes darted to the cell phone.

He stood up and stretched his back. “I’m not going to do this every time. You said you understood, that you wanted this.” He was pacing. “I don’t love you alright? I never will. So you can just walk out and never come back, or just deal with it.” He made his way to the door and pretended to hold it open. “You need to leave now.”

She stood up and stomped a hoof on the floor. “Fine.” She made her way to the door. “I hope you two will be very happy together.” She took her book bag from his hand and walked out.

©Chris Richards 2009
  • Share/Bookmark

74. True Feeling

Taking several deep breaths, Russell paused outside of the principals’ office. Should he just enter? Or would the principal come out to get him? He looked around but the rest of the office was empty. The secretary must be out to lunch or something. A trembling ran though his body. Russell tried to force it out before anyone noticed. He knocked lightly on the door.

“Come in.”

Fighting back another wave of tremors Russell opened the door. The room was bright as the fluorescent lights reflected the posters covering the walls.. The principal wore a shirt that said “The principal is your pal” and sat behind a large wooden desk.. The desk was littered with brightly colored doodads. In front of the desk sat two chairs, a girl with short blonde hair was already sitting in one of them. As he approached, her blue pleated skirt came into view. He couldn’t help but look up her legs to where the skirt took over. He fought back a different sort of trembling now. As he came around the open chair, her face came into view. “What’s she doing here?” he blurted before he could catch himself.

Billie snapped her head and held up her chin. She made a loud “Hmph.”

The principal folded his hands over the desk and leaned forward. “Do you two know why you’re here?” The two middle school students shook their heads slowly. “There was an incident in the library yesterday. It just so happens that you two were the only ones there. I already know what happened, but I’m giving you the chance to confess.” He leaned back in his leather chair and waited for them to speak.

Russell looked at Billie; he tried to mentally ask her why she did it. She looked at him for a moment, raised an eyebrow and turned back to the principal.

“I don’t know why I’m here.” She said. “Whatever he did, I didn’t see it. I didn’t even know he was at the library yesterday. It’s not like I keep track of him or anything. I’m not his girlfriend.”

The principal leaned forward and started to say something. Russell interrupted him. “Yeah I did it.”

“He’s lying.” Billie snapped. Russell and the principal stared at her. Her eyes darted around the room as she realized she said something wrong. “I mean, yeah, that’s right. He must’ve done it.”

“That’s right” Russell added. “I was smoking in the library and I uh … I dropped, the cigarette and set the library on fire.”

Billie rolled her eyes. “Idiot” she mumbled.

“Who you calling an idiot, idiot.” Russell shouted at her. “That’s what I get for trying to help you.”

“Oh now you want to help me.” She matched the escalation in his voice. “You’ve never even talked to me, why would you suddenly want to help me now.” She turned away from him and pouted in her seat. “You don’t even know me.”

“I don’t know you?” Russell crossed his arms and pressed his back against the seat. He took a breath and lowered his voice. “We’ve been in the same classes since elementary school.”

“It’s not like you’ve ever talked to me.” She pressed her hands down her skirt, flatting it out. “This is like, the longest conversation we ever had.”

“Fine whatever, I don’t know you. I don’t know anything about you. But I do know one thing.” Russell leaned forward and rested his arms on his knees. “I know I didn’t start that fire.”

“Don’t blame me.” She came undone. “You already admitted to it. Go ahead” she motioned to the principal, “call his mother, send him to jail, he admitted to it.”

“I didn’t blame you stupid.” His voice was starting to creep back up. “You blamed me, twice. All I said was that I didn’t do it.”

She gripped the armrests. “You are blaming me.” Her eyes started to tear. “This is exactly why I never talked to you. You’re such a jerk. All the girls think you’re a jerk. I don’t even know why I like you.” The water stopped as her eyes widened to the size of dinner plates. “I mean…” her body tensed turning each knuckle white. “It was an accident ok? I didn’t mean to do it. I just tripped and the book hit the fire sprinkler thingy and the alarm went off and I didn’t know what to do.” She looked at Russell for a moment and quickly turned back to the principal and pouted. “I’m really sorry okay? It wasn’t my fault.”

“Wait, What?” Russell watched her very carefully. He watched every rapid breath, the sweat forming on her head. “You like me?”

Her mouth hung open in half horror half smile. “Yeah.” She managed to say.

“Are you kidding?” He watched her watching him. Taking a deep breath and making sure his mouth wasn’t handing open like hers. “I’ve liked with you since that first day on the playground.” He winced slightly waiting for the whiplash.

“Why the didn’t you ever tell me?” She finally closed her mouth.

“Why would I? We’ve never talked. And besides, you’re all cool and popular. You’d never date a guy like me.”

“I would if you ever asked me.” She said.

The principal stood up and they followed suit. “Seeing how it was an accident. I think we’re done here.” He opened the door and led them out. “Go have fun but don’t do anything your mothers wouldn’t approve of.”

© Chris Richards 2009
  • Share/Bookmark