Archive for the ‘Writing Projects’ Category

English IV: Untitled Satire

Sunday, May 27th, 2007

Note: This was originally written in 2004 for High School English IV class. So yes, there are grammar, spelling, and other problems. It is nice to see just how far I’ve came from three years ago, which honestly isn’t much. Just tells me I need to read more grammar books and actually practice from those books to speed up the improvements of my writing.

Chapter 1

There are two fractions on the fifth floor of the Mecha Corporation building: the EU and the PU. The Gods of the floor upheld the great time of peace between the two groups as the great battle came to a close a long time ago. Yes, three work days ago. The god whose music from the guitar and gentle rhythm calms the soul decreed that it was good. The goddess decreed that everyone should shut their fat mouths and it was so for a while. They people decided that it was time they stopped listening to the loud, talkative goddess as her high-pitch voice hurt their ears.

The leader of the end-users, Mr. Troll, is a great mighty troll that spits fire from his mouth. He also has a habit of eating careless mortals who partake in wrangling. Mr. Troll’s serf, Mr. An, is a human with the remarkable ability to change into a bitch and a sheep. “The Sirens” are head officers that talk with one beautiful voice until you get too close and their screech of insolence petrifies the person. “The Silents” are second in command and usually take up the duty of spying and blackmailing users. “The Silents” almost never talk so they are able to overhear conversations and pick up dirt that could be used to keep the other end-users in line.

Also on the floor is a human and cat hybrid that is very sarcastic and two intelligent Asian women who are very tidy and hard-working. Mrs. Rebe is a very affectionate redhead that talks about it but denies any relation to being a very bad girl. The rest of the end-users are without any faces and are rightfully named “Faceless Ones”.

In the power-user group, there are two members: Jacob and Stephen who are the network administrators. The rest of the power-user group was wasted during the war that took place a long time ago (still only three days). Jacob is in charge of user management and takes care of the task of creating users and keeping track of the users’ tasks. Stephen takes care of the security and plans to take over the floor for himself so he can rule unjustly. His previous attempts have failed as the other network admin would foil it by accident, somehow. They both have been assigned to take care of server integrity.

Chapter 2

The end-users and Travis from upper management on the top floor were having lunch together. They openly discussed different things with Travis and started to talk about the power-users which they admire and love. Travis told the group that he enjoyed waiting two hours before his download from the server was finished. He laughed, “I mean, it isn’t like, I wanted to work anyway!” Mr. An took a bite of grass, as he was a sheep today, and told the group with much glee about how he enjoyed not having email, “I sent Jacob an email saying the email was down! I still haven’t heard back from him but at least the email is up again so it is all good.” Mr. Troll drooled over his head-of-human soup and told of his “much pounding of humans” after he couldn’t get to a couple of sites because they were blocked. “Mr. Troll pound good but soft,” Mr. Troll said has he petted his hand and looked down teary eyed, and then pounded it, “not crush little humans like Mr. Troll should!”

“The Sirens” sang of how their home directories were changed so they had to send each other the files they needed but they said with merriment, “It wasn’t bad! It took a whole four hours before we could work again. Who needs to do work?” Mrs. Rebe spoke of the time she was whipping a client and her computer locked up, “It took all day before anyone could fix it and they erased all my files but they were only taking up disk space anyway.”

“Did you spank him? Baaa!” asked Mr. An.

“No he didn’t” said the goddess as she caused a maelstrom to pick Mr. An up and slam him against the wall.

Chapter 3

“I said, damn it, that you two better get the problem fix or we will all come down there and cuddle you to death!” threatened the cute but deadly supervisor hate bear. “And don’t f**k with me @$$hole!” Said the furry, fuzzy woozy as he walked off, “I’ll cut you Jacob!”

The problem was that traffic was inevitability becoming overloaded by the end-users swapping massive files across the network. The power-users didn’t know what to do and the upper-management was breathing down their neck. They’ll fire you; literally, they will set you on fire and push you down the stairs. They sure are strong and mean for cute, colorful, 2 feet tall bears.

Jacob and Stephen are trying to solve the problem with “The Sirens” by swapping home directories but every time they do it, the sisters end up having to send the files back to each other. So they decided to keep the home directories as it is and block them from sending the files from their home directory. Jacob had the problem of Travis downloading Office very day when he in fact had it installed already and just didn’t realize it. A memo was sent at some point and was sent back with brown and yellow stains, then was discarded.

Not to mention the problem with the computer and monitor that was soaked and had to be completely replaced. Jacob is contemplating blocking Mr. Troll’s web access as he wishes to look at dirty things, mostly garbage but dirty things nevertheless. Jacob and Stephen are seriously thinking about how management is going to ‘play’ with them before they fire them if they can’t get the rest of the floor’s problems solved: adding new users, replacing obsolete hardware, and upgrading the servers.

Possibly Related Posts:


In Response to JIT Compilation

Thursday, April 26th, 2007

I understand now or at least a little bit more why JIT compilation wouldn’t be useful.

Most pages will take less than a second to execute. Caching, where possible, will also be used to further decrease the time. Opcode Caches can also be used to keep PHP from compiling the page with each request further decreasing the time it takes. Taken all together most professional web sites wouldn’t benefit from JIT compilation. Given the delay from converting to machine code, it might actually take longer on the first run.

Would it be quicker to write a C extension for PHP than building a JIT compiler for the Zend Engine? Yes. In the discussion with Frameworks, the solution is to write the slow PHP code in C and write a function to be called in PHP, if available. My argument has always been that I shouldn’t have to. If it is just as fast using JIT compilation than I shouldn’t have to touch C code unless I’m binding some library in C or C++ to be used in PHP.

Yeah, 2x time decrease (Roadsend compiler statistics) doesn’t sound like much, but I would like to run algorithms that normally take 15 to 30 seconds in half the time. That to me is a huge deal. Now, these algorithms won’t run in front end pages, of course, but I would like to maintain the code in PHP. The possibility of the algorithm being poor is there, and so is that it would be better writing the code in C/C++.

Well, what I’m trying to get at, is that with edge cases JIT compilation would make a lot of sense. For those with normal pages, then I concede that you are correct.

Possibly Related Posts:


Userland Multitasking: Introduction

Friday, March 16th, 2007

Difficulty

At my current level of skill and understanding, this feature would be impossible for me to implement on my own. It is just an introductory look at what the other sections will visually look like when they are also finished. I will not be implementing this feature.

Introduction

Multi-threading should not be allowed at the user level, but allow for sandbox threading. The PHP Engine should keep track of the creation of threads, protect against deadlocking, and control synchronization. This will abstract away the complexity and have PHP do all of the heavy lifting as well as protect the developers from themselves and harming the process the thread is in.

There are some architectures, both CPU and OS, that do not allow threading. There should be a fall back implemented in the virtual machine that still enables an environment functionally similar to threading. The fall back can be implemented like the ticks in the current PHP Engine or it could use a stack approach similar to operating systems.

The Engine could also track how efficient the system is and how well it would perform if it was single threaded. There should be a mix of allowing the developers to test and optimize on their own and tracking internally to help protect against slow scripts caused by wrong usage of this feature.

There should be internal reflection for threading to allow for tracking, overriding, and debugging. The reflection will track the time a thread takes, which threads and variables it is synchronized with, and how many times faults occurred. There should be functions for overriding whether or not the thread is still multi-threaded or if it creates an interprocess, or if it is instead acts like a single thread, when processed.

The multi-threading feature wouldn’t be useful, if the process shutdown and destroyed everything at execution. The feature would only be enabled for PHP environments that are already multi-tasked to keep the script from taking longer than it should.

Virtual Machine: Timing the Best Method

During runtime, the virtual machine can keep track of the time the script takes and switch between single threaded and multiple threads to get statistics on which would be the best method overall. After it figures which is the best method for the user, it can either log what it finds, allow for reflection to get the number, and then decide which is the best method to take. It would still work like the user expects, but allow for the virtual machine to decide which is the best method for the user.

This would add additional memory and processing overhead, so it could be disabled by those who already think that their script is optimized enough already. This adds another level of complexity to the feature and could introduce difficult to find and fix bugs. It should also be allowed to be overwritten by the user for those who know for a fact that the system doesn’t work that well for their script. The system won’t be able to work perfectly 100% of the time for every script.

This additional feature would be extremely useful for JIT or opcode cached environments where the script is stored in memory for extended periods of time. Keeping track of timing of various environments would allow for the system to rewrite itself to optimize the speed for the user. The abstraction would be such that the user wouldn’t be able to tell, except when the system fully realizes and optimizes itself and the script.

Keywords

The following sections will introduce additional keywords and syntax that will require that the flex and bison skeletons be updated to allow for this feature. This section will not be updated and will not be found here.

Different Methods for Creating Threads

The following parts will detail the various parts of this feature and will be split up to allow for better understanding on what the feature will involve.

  1. Anonymous

    • Does not allow for returning to main thread or calling from the main thread.
    • Runs along side the main thread.
  2. Named

    • Does not run unless called from the main process.
    • Can return data to the calling thread.
  3. Shell

    • Allows for shell commands to be processed in another thread or process.
    • Allows for returning to the calling thread.
    • Allows for both anonymous and named shells.
    • It would replace functionality, most of the shell extensions, when implemented.
  4. Interprocess

    • Replaces the current method of the Process Control extension with an easier to setup and create method.
    • Also will allow for connecting to other processes for passing data.

Possibly Related Posts:


PHP Opcode Series

Tuesday, March 13th, 2007

Introduction

The PHP Opcode series will take a look at the theory and implementation of working with the Zend Engine in the specific areas of adding opcodes and enabling language features. The specific areas will be how it would look in the PHP language, how it would look as PHP opcodes, and how it would look as Assembler for looking at enabling JIT compiling later.

The posts will be researched and go through multiple drafts for professionalism before posting. In this hope, it will strive to enable discussion that isn’t flaming and collective of the topic at hand. For as much as I can achieve at my level of writing skill and researching the topic at hand.

(Honestly, I’m spending more time on these posts than I do on my school research papers… which is to still say that I am doing more than previous posts.)

Purpose

I want to add JIT compiling to the current Zend Engine and before I can do that I will have to learn how the Zend Engine works. The best way would be to read a book or learn from the minds that created it. There is a current lack of printed material on extending the Zend Engine and I’ll rather not bother the Zend Engine masters with my countless n00bish questions. I’ll wait to ask those questions for whenever I hit a road block or can’t find the answer myself.

I’m going to try to implement some of the easier features of the “Opcode Theory” part to learn how different areas of the Zend Engine work. I’ll also intentionally break the Engine and learn from there. Such questions as, “I wonder what would happen if I add this?” or “What if I change this to my own code.”

I’m tempted to rewrite the entire thing to my achieve my own goals, but that would negate the point of these exercises.

Not that I will implement all of the theory, but to think about how it would be possible. To learn how PHP uses Opcodes and how it can be improved and optimized by using more. By writing theory and how the current Zend Engine works, I can remember better and try to implement my ideas to see if they are possible.

Areas of Focus

There will be areas of focus with titles for keeping order of which post is for what.

  • Opcode Theory
  • Opcode Implementation
  • Opcode Documentation

Opcode Theory

These posts will abstract out the problem and how it could look once implemented. From above, the sections will be PHP userland code, PHP Opcode, and finally how it would look as Assembler for JIT. The Assembler isn’t much use for the JIT, but it will help to think about solutions once JIT is finally implemented. The JIT and Assembler will achieve the same functionality of converting opcodes to machine code.

It would be nice to see it in action outside of PHP, using Assembler, before implementing the feature using the JIT library. Getting Assembler code to work against the Zend Engine and PHP will also be part of the Implementation, which is outside the scope of the Theory. It is just to say that the Theory part will have puesdo-Assembler code for how it might look.

I will not be implementing all of these theory posts and I will be lucky if I even implement one. My main purpose is learning enough of the Opcode parts of the Zend Engine to hook into and write a Zend Engine extension that enables JIT compilation. These side projects should help to learn enough to accomplish that much.

Opcode Implementation

Will document how well I’m doing implementing some of the theory and eventually the JIT feature for the Zend Engine. In the event that I do implement one of the features in the theory part, I will post what it finally looks like and how it works. These posts will also include the road and difficulties in implementing the features in the theory posts and eventually how it was done.

Opcode Documentation

I expect that I’ll learn a lot by the above mangling of the Zend Engine and picking at the minds and team behind the Zend Engine. Some things I will have to learn myself and I’ll post them in this heading to make sure that I’ll remember them when I come back after an extended break or two to work on other projects.

“Hmm, how did I do that one thing again? Oh yeah, I wrote about that!” and also to store help I will eventually (hopefully) receive from the PHP lists.

Possibly Related Posts:


Quest For Magic: Vincent Draft 1

Monday, August 7th, 2006

My story begins shortly after my fourth birthday, as I was sent to grammar school. My parents said it was needed since I would take over my father business some day after I grow up. That was good since I wanted that since they first taught me to read and write. Since I already knew how to read and write I was ahead of most of my class. My peers knew of my father and his wealth, so most of them didn’t treat me right. The others feared the bullies so they didn’t talk to me so I was alone but that didn’t matter because I was there to learn. I made friends with most of the teachers but some treated me like the bullies and my grades reflected it. It was all of these problems that I couldn’t wait to go home in the summer.

(more…)

Possibly Related Posts:


How to Start Spirit Keeper

Friday, August 4th, 2006

I’ve been thinking of the best way to start Spirit Keeper. I would usually start at the very beginning and work my way up to where the action is. This leads to tedious and boring writing and I”ve been contemplating starting at the point where the reader would still have no idea of what the plot is about, but open with enough clues to keep the reader asking for more.

The start of Spirit Keeper has always been at the school or more accurately, the city the school is in. I would then introduce each of the characters. There are two central groups for which to start the city. In one draft I introduce the team that starts at the school and in another I introduce the team that sets out to destroy another city.

The plot has changed somewhat as I focus more on the seemly magically beasts and not on the battle between the two fractions. It will still be within the story, but it will no longer take center stage on the story. Only when the different fractions meet will it come up.

The Third Element

There is a major subplot within the two main plots. It will gradually be introduced over the course of the two main plots and the travels of the team with the main character. The subplot deals more with dreams of the main character with no impression of whether the dreams are of real or not. That will be revealed later when the three plots converge and a new plot forms.

Would It Still Be Interesting?

The style and the way I going to write this may not be the best and I’ll probably rewrite the whole thing a lot better than what it is now. I’ll say it should take a few years to completely finish this story. To do it right should probably take 5 to 7 years.

Book Or Comic Or Graphic Novel

I can’t draw, so I would have to either find or pay another artist to draw the panels. It does have a greater chance of someone buying the editions if they are serialized in graphic form. I don’t have any money to pay an artist and the originial intent was that it would be a web comic and two or three artists would take over drawing the panels.

That sort of dropped out and new artists would have to be found at a later date. I’m still going to write it in a comic script fashion. If I do so, then it would be easier to pick out any flaws in the story and rewrite pages that suck. I would like to make the story as a comic, same with Obituary of Josh if I can.

If no artists are willing to take up the project, then I’ll most likely take the scripts and write the story in book form.

Artist Input

The issue of bringing it up as a web comic is that the artist may want to take it in another direction separate of mine. I don’t have a problem with that as long as I don’t have to change that many pages. I think it would be good to have two or more inputs for how the story should be developed and I’m willing to gain experience from another critique.

However, for Obiturary of Josh, I’ll most likely won’t be as accepting of input for the story as I have a very good idea of where I’m going to take the story.

Possibly Related Posts:


Happy Mecha Golden World

Sunday, September 25th, 2005

People

There are three fractions who reside on the world.

  1. Blue Team: Kills Red team; all male.
  2. Red Team: Kills Blue Team; all male.
  3. Scientists: Female; judge; creates more men.

Family

The people are grown in a test tube to replenish the supply of men to be used again. The Scientists are also grown in a test tube. The teams don’t live past age 25 and the Scientists live until 85.

Education

Males are trained from an early age of four years to be a soldier and battle on the ground and in Mecha. Females are trained in an academy.

Folkway and mores

Love between men and women is nonexistent but for those that venture into it are brutally tortured and then forced to shoot each other. Lover kills lover.

Friendship or kindness or love towards the other fraction is punished by having the persons’ arms off and then beat to death by their own limbs.

Laws

Blue Team must kill Red team.

Red Team must kill Blue Team.

Backstabbing is legal and expected in extreme cases to gain ranks. Murder is required from the teams, the Scientists can kill the males for any reason at any time.

Religion and Holidays

There isn’t any religion and any rhetoric about god is strictly put down by force.

1. Melee Battle Day

Coin is flipped and loser has to fight without any weapons for one day. Other side can have any weapon that they want.

2. Death to Love Day

No fighting for the day.

Each side takes a test to see if they have any love and/or compassion and then put down.

Political System

The leaders of each Fraction meet in a fashion that involves bloodshed. The side that wins, has the most people standing, gets to choose when the battle begins and ends. Any disputes are put down with all that are involved massacred.

Economic System

There is no money and all technology is shared equally to allow for fair fighting. Everything is shared equally between everyone.

Language

Own, unique language for battle techniques. Mostly grunts and other sounds that could come out as cuss words.

Sports

None, every day is a game of survival, such as.

  1. Throwing a timed Grenade around as one of them is taken out.
  2. Form of soccer where the losers are all killed.

Art, Literature, Music

Music is played during the tortures and paintings are done of the dead people and landscape after the battles.

The expensive ones were done while the artist was being tortured while music was being played.

Science and Technology

Mecha are 8 feet tall machines that are men fight in as a form of killing the other.

Possibly Related Posts:


Obiturary of Josh Details

Tuesday, January 11th, 2005

History

I’ve been writing this story in book form, but I believe it would better capture the emotion if it was serialized in comic form. In the first draft, Josh jumps off the bridge and then his story is retold to him from the love of his mother to what he missed and could have had in life. Keeping to that, the second draft waited to kill the character and I sort of didn’t write much since I had all of these ideas for planning.

Second Draft

The second draft is really where I’ll pick up on the story and continue it with the details I’ve written over time. I have the main plot points of the beginning, middle, and end for a book. Writing in a book style does give more to descriptions and details. I’ll have to speed the story up for the comic form. The draft I had for the comic form had the first 20 pages in the same realm.

Amount Of Pages

I’ll have to find a way to speed the story up, so the first 200 pages aren’t in the beginning arc. It would be nice, so that the story could continue on until probably 800+ pages (which would be 40 chapters for manga form), but by then I’ll probably become sick of the arcs and want to end it. 40 chapters in black and white would translate to around less than a year or 40 weeks. The pages will most likely be in color, so it would be 40 months or almost 4 years. The actual time would three a week or roughly 5 years.

The format I’ll most likely be looking to is the graphic novel, which between 200 and 250 pages. However long it takes to do that format is up to how quickly I write the pages, find artists to draw the pages and piece each of the pages together. If I plan each of the graphic novels correctly, it should be possible to end the story in two graphic novels and see about continuing the story afterwards in a final third graphic novel that brings all of the details together.

New Style

The new style will cut away the transitions and try to move the story along quickly. Such as the first 20 pages included the transitions of the Lady Optimistic walking towards the main character. That would be cut out or only have one panel devoted to it. Most likely I will have just the character and the other character sitting at the bench instead. It should rid of a few pages of so.

I should also be creative when it comes to telling the story in a graphic form instead of having the characters sitting at a bench move on to the graphic interpretation of the story instead. To many words were going across in the second comic draft.

The Final Destination

The primary issue is finding how to continue after Josh dies. Do I want some magical elements where he becomes a reaper for lost souls? Like Beach? No, I don’t want it to be like Beach or Death Note.

I decided that I should restart this project and write everything that I can. After I get the first draft done then I can think about the second draft and see about getting some help from different people when I’m done. The problem is that I need to have a lot of the stuff done before I ask for help. The only thing I need now is an editor to tell me what I should change and what I should keep and expand upon my ideas.

Help Wanted:

Editor: to correct any grammar mistakes I make, which I’ll probably end up making a lot. It depends also on whether I write comic or book style. I’ll make more grammar mistakes in the book than I would writing dialogue for a comic panel.

Artists: The more artists working on the project the more panels and therefore pages that can be finished. If I only have one artist, he or she will have other tasks, such as life to do and won’t be able to devote as much time as I would like towards the project. If I have 2 or 3, then I can delegate different panels to each of them allowing more panels to be finished in a timely matter. If I have to wait on another artist, then I can move their panel to another artist for them to do, until they are ready.

Money Dilemma

I would depend on the motivation of the artists to complete both this project and Spirit Keeper and any money made would have to be split between all of us. That would probably lead to a large problem and a split of the team.

If the project is free then there won’t be any major problems over the split of the money. However, once a graphic novel is finish and sent to be published, it will cause conflicts with the team.

I don’t mind not making a lot of money from the project as I’m more excited about telling the story.

Any money received would have to be tracked, recorded, and given evenly to the rest of the contributors. I’ll probably have to write out a legal document for them to sign detailing how the money would be given out for donations and money from t-shirts or published graphic novels.

Possibly Related Posts: