Classes in PHP and JSON

November 30, 2009


I started looking into classes in PHP and found a great way to encapsulate a lot of logic that I am going to use quite often for my grids. In addition, I found a method in PHP that also converts objects into JavaScript Object Notation (JSON) – json_encode($this). It takes a lot of the manual labor out of the equation. PHP’s implementation appears to be a little bit more heavier on the encoding and casts property names to strings. I found one problem where I had to recast integers retrieved from a database so that the JSON would represent them as numbers instead of strings.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Occer! Occer! Occer!

November 30, 2009


I used to have a little toy with Oscar the Grouch (a Muppet character from Sesame Street) in a trash can. It had wheels and when you pulled him along behind you, he would bob his head up and down and make this sound similar to saying “Oscar”. It sounded more like “Occer” to me, or perhaps wah-er. I often played with him on the front porch since there was plenty of room for me to run back and forth from one side of the house to the other. I think the wheels had sand or something in them as well that made sounds. Making noise was one of the most enjoying things that I got out of my child hood unless I got in trouble for it.
posted by Dedric Mauriac on Nowhereville using a blogHUD : [blogHUD permalink]


Big Coloring Books

November 30, 2009


It’s interesting what a mock-up of a memory can do. As I walk though my childhood home, the feel of the rooms call out to me. The colors, textures, and sense of them are familiar. Even now in my parents room, I feel like I’m in a place that is off limits, although I own every prim. I am remembering more about different rooms. For one, my parents closet had these enormouse coloring books in them. We rarely got to color them since they were in my parents room. It was a cherished experience when we did. I just wish that I could make this place look a bit more real.
posted by Dedric Mauriac on Nowhereville using a blogHUD : [blogHUD permalink]


Harassment and Insults from friendly neighbors

November 30, 2009


I got a message from David Bloom in an adjacent sim today regarding one of my test locations. The individual asked me to move my location so it wasn’t in their view from their own skybox. I thought the request was a little out there when I got it 2 months ago, but I moved and they said it was ok. To have them ask the same request again made me feel as if I was being harassed. They also mentioned that I was rezzing objects. Um, no – the structures been here for two months now and I’ve got the proof on a few blogs and sites. To add insult to the situation, they asked to speak with an adult that was guiding me. Why are they assuming that I am a child? Then they took pictures of thier view.

My response:

David, you or one of your associates already contacted me when I first acquired th land about two months ago. I had moved the building lower and the response was a positive confirmation with thanks. I have not moved the building since that time. It is your turn to move. If you no longer like the view from where your buildings are at, then please move your tenants higher, lower, or out of the region. If you need more control over your neighbors, I suggest that you look into acquiring a private region. A little respect for your fellow neighbors would be desirable.

Anyway, there is further thought on this. Specifically, the sky in general is used as a way to put “junk” in the sky so it doesn’t ruin the look of the land. That’s why I put my building in the sky. In fact, the term “Sky Box” is mainly used because people first started putting boxes in the sky. No fancy looks or anything like that. I had the decency to make my building look a bit functional rather than just a box.

If their tenants are that concerned about the view from their skybox, they could easily set the display down to 64 meters. What really irks me is that I’m not in front of their box. They would have to look to the right at a distance.
posted by Dedric Mauriac on Hilbert using a blogHUD : [blogHUD permalink]


Optimizing Code

November 29, 2009


I streamlined my backend code a bit further to reduce the complexity of paging, sorting, and searching data. Overall, it should help improve future development for other paged sets of data. I also added another feature to indicate when in-world objects last communicated. It is color coded, but also has a tool tip that shows the number of weeks, days, hours, minutes, and seconds when contact was made. Only the top two units of measurement are displayed (1 week, 3 days or 5 days, 6 hours, etc.) No need to get too specific.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Happy RezDay to me

November 28, 2009


I remember on my 9th birthday, I stood in my kitchen looking out the window at the back yard. It wasn’t anything in particular that I was looking at, but more in deep thought to myself. Nine was a big number back then, and there were plenty of milestone birthdays to look forward to. In this virtual environment, I now have a second birthday. Just as in real life growing up, there aren’t any celebration parties in the virtual environment either. However, I’m not quite certain what the milestones are if any. My avatar is now four years old. Will next year be a big number? What is the significance if any? There is so much that has changed over the years in both the platform and my avatar.
posted by Dedric Mauriac on Nowhereville using a blogHUD : [blogHUD permalink]


Inventory Server UI

November 28, 2009


The inventory server UI is pretty much done as far as functionality goes. I am able to send commands to ping, report, and remove inventory servers. All of this is done through AJAX and jQuery, resulting in less traffic between the web browser and the web server. The next step would be to identify all inventory available throughout each server, and then create “products”. At that point, I can start working on the in-world vendors and test product delivery based on which inventory server is online with the product.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


In the attic

November 28, 2009


In the attic, the ceiling and walls were painted blue. We had to bend over a lot walking around so we didn’t bump into the roof. There was an ornamental rug and a large sewing table on one side. My brother and I would spend hours with our trainset on the table, no matter how hot the attic got. We would sometimes lay sewing pins accross the tracks and watch as the electricity would heat up the pin and melt the plastic ball off. We had christmas lights that we would use as house lights. The houses were made of milk cartons that our grandfather had made long ago.
posted by Dedric Mauriac on Nowhereville using a blogHUD : [blogHUD permalink]


White Marsh

November 27, 2009


My mother in-law mentioned that Crap Mariner had an opening on nowhereville. After speaking with the community, Crap agreed that I could move on in. I’m going to use this place as an actual residence rather than a place to experiment. I constructed my old house that I grew up in as a child in White Marsh, MD. At the time, I lived accross from a car dealership. Nowhereville appears to be a better location. I can still remember watching the snow fall as I watched it being lit up from the dealerships lights.
posted by Dedric Mauriac on Nowhereville using a blogHUD : [blogHUD permalink]


Hooking into events

November 27, 2009


jQuery continues to impress me a bit more with each step that I get past. I am learning a ton of information in how to use the library. Each time that the data grid populates with data, I am now able to bind into specific elements based on the class name. The links to “Ping” and “Report” are tied into ajax queries so that the end-user remains on the current page while a request is made to the server to execute the logic behind these commands. It then gets a response asynchronously and updates the grid with the results. The functionality of the grid is almost completed for the inventory servers themselves. I wish I could intereact with urls on a prim.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


unmagic quotes

November 25, 2009


I ran into a problem today with encoding strings for SQL. Upon looking into the problem, I realized an oddity from a past problem was very much related. It turns out that PHP, by default, escapes quotes. It was originally included with PHP to prevent SQL injection attacks. The problem however, is that like-minded developers who already take measures against this end up having data appear in the database as if someone had double- escaped the strings during an insert/update. I’m at a cross roads determining if I should detect if this is on, or to turn it off and assume that it will always be off.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


jQuery with Flexigrid

November 24, 2009


This morning I found a plug-in called Flexigrid that works well with jQuery. It supports AJAX calls to get a paged set of data. It supports dynamic page sizes, searching specific columns, as well as the ability to sort each column. I’m even able to resize the columns and drag them into different positions. It’s been a little tricky getting it to work, as I had to beef up my skills on JavaScript Object Notation (JSON). Overall, it will make the presentation of data increase dramatically with little effort.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Web Interface via jQuery

November 24, 2009


Once I got a working front end web interface, I started to look into jQuery to standardize a bit and support cross-platform browsers easier. I have run into a few problems in that there are not many data grids available for jQuery that use server-side calls. It appears that I’ll have to develop my own plug-in. I just finished working out how to get a page of data to display. Next is pagination, column sorting, and searching. Afterwards, I want to look into implementing the jQuery UI. There are many widgets available that I could make use of.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Pagination Workaround

November 23, 2009


I’ve tried many attempts to working around the PDO integer problem such as direct binding, casting strings as integers, and working with stored procedures. The end result was not something that I like, in that it involved me going back to the basics and doing some manual string replacement. It works, but I’m not happy with it. In other news, I’m looking at using a price tag object I made a while back to dynamically show both the price and permissions above each item. I need to setup a texture to page results, get a note card, or tie-in gifting options.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


PDO thinks integers are strings

November 23, 2009


I seem to be finding bugs left and right. I am using PDO to prevent against SQL injection attacks. It takes all parameters that I pass in, and makes certain that the correct SQL statement is created to run against an MySQL database. The latest bug that I ran into is PHP Bug #40740. It is converting integers to strings, and breaking on paging results using the “limit” keyword. Unfortunately, the bug is over 2.5 years old and looks as though it will never be fixed, but plenty of people are complaining about it. I’ll have to find a work-around.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Lightweight Vendors

November 23, 2009


I usually come up with some interesting ideas when I go take a walk, or get a good nights sleep. The latest idea was how to improve the vendor experience. Most networked vendors are loaded with lots of scripts and prims. Using touch-based mapping, and the 5-faced prim that I use for my letter positioning, I can essentially create a vendor that has 10 preview panels, paging, and a main product presentation with 3 prims and 1 script. I’ve made a mockup and it looks like it can be done. I’ll need to get a rudamentary web interface working first assign images, note cards, and prices to items.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Discovering MySQL Bugs

November 23, 2009


I was going a bit nuts trying to find out why I was getting an error when adding one of my inventory items to the database. I have a primary key that contains a varchar(64) data type as one if it’s keys. One item got in the database that was 63 characters long. I tried to add another item with the same name, except that it had a trailing space. It appears that MySQL thinks that this is the same name without the trailing space. It appears that it may be related to Bug #14131. I’ll look into changing the collation from PADSPACE to NOPAD.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Inventory Loss

November 22, 2009


One of my tests that I use on my drop boxes is to copy the large list if notecards in my inventory into the contents of my dropbox. I’ve had a message pop up each time I attempt to do this: Inventory creation on in- world object failed. I’m assuming this has to do with inventory loss. Just about any information I have found on the Internet indicates that the item disappears in both their own inventory and the content of the prim. The message doesn’t go into detail regarding what the name of the item was. In the mean time, I’m trying to identify the limit of how many items a prim can actually hold, and if it has an effect on the scripts performance.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Online!

November 22, 2009


After trimming the fat off of my code for my drop-box, it is back online again. The server-side scripts had to be rewritten to handle the newer/condensed form of communications. The backend database is being updated to reflect when each box had last been verified along with it’s api endpoint uri. The next step is to process the inventory that the box sends to the server. I have a method that throttles the http requests to prevent problems with people who have multiple drop-boxes sending inventory at once. It also sends a condensed, serialized batch of inventory information (name, type, perms) so that there is less traffic needed.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Memory with LSL vs Mono

November 22, 2009


I’ve been working on my inventory server again in regards to optimizations. I’ve really cut it down to size while retaining much of the functionality that I had originally put into it. One thing that strikes me is the size of memory available when it’s compiled in Mono or LSL. LSL has a limit of 16 KB. The free memory reports 12,431 bytes free, so it’s safe to assume that the script itself takes up about 3.5 KB. Mono has a limit of 64 KB and reports that I have 48,298 bytes free; resulting in code roughly 16 KB in size. With Mono scripts taking up roughly four times the memory for the same written code, it’s understandable why the memory limit was increased to 64KB for mono.
posted by Dedric Mauriac on Woodbridge using a blogHUD : [blogHUD permalink]


Follow

Get every new post delivered to your Inbox.