Archives for December 2011
You are currently browsing 4 articles posted December 2011.
Sony and Google and the PS4
Published Saturday 24th of December 2011
I'd love it if Google and Sony could join forces on the PS4 (PSLife? :) and deliver super hardware (something like Nvidia's next) with Android / Google TV on top.
All your saves and user profiles etc would be handled online (or "in the cloud" as everybody seems to love to say these days), of course you should be able to try and buy games online - but they have to keep the blu ray so you can still buy the discs.
Android's (bound-to-come) Siri copy together with motion sensors (the improved PSEye) and maybe something like the (Swedish :) Tobii eye-tracking system would be the answer to Kinect and allows you to control the whole thing with your voice, eyes and body.
Of course if you're using Android on other devices you'll have access to everything on them as well (and even the ability to stream games to your portable like a mini-OnLive).
Be the first to post a comment
jQuery 3D Circle
Published Monday 12th of December 2011
I wanted to learn more about CSS 3D transforms so I started experimenting with the login page on SleekPHP.
It all turned into a jQuery Plugin called "3D Circle". I haven't uploaded it to the site yet but you can find both the CSS and the JS (beta) on Google code.
There's also a demo you can try out here (only tested in Chrome).
It's just a save of the HTML, CSS and JS on that page so you won't actually be able to sign up or do anything else. That's not the point of the demo though so.
I've only tried it in Chrome but use all vendor prefixes in the CSS so if your browser supports them all it should work in it too.
It took me a while to get everything the way I wanted it. The circle is automatically generated based on the items on the page. So if you add or remove items the circle adapts.
First I tried calculating the positions myself using sin and cos and apply them to the item's translateX and translateZ values. This worked fine before I started rotating the items as well. Without rotation the items were all facing the screen but they were at least in a circle.
When I started rotating the items all hell broke lose and nothing looked right. After some debugging I noticed that the rotation's origin is always from the 0, 0, 0 position. So the item would no longer rotate around itself but around the point at 0, 0, 0.
Thanks to this, though, it was much easier than having to calculate the circle positions myself. All I needed to do was place all the items at z: radie and then rotate them by 360 deg / num items.
Doing that placed all my items in a nice circle. Now to rotate this circle all I needed to do was rotate the parent element of all the items.
The problem with this, though, is that some items will be "in front" of the 0 z pane. That means they will look pretty much twice their size and that's not what we want.
My first thought was to simply move the wrapper of the items in the z pane, but doing that introduced the same problem I had before with the items themselves; now the rotation of the wrapper would go around its 0, 0, 0 position while it's sitting at 0, 0, -radie.
The only solution I could come up with was to wrap the circle in yet another element used only to move the circle in x, y or z.
So the final HTML requires quite a lot of wrapping elements. If you're doing this to a list of elements though you'll already have a
uland possibly a wrappingnavorsectionso you'd only need to add one extra element.The outer wrapper is the "stage" for the circle. It contains the perspective and perspective-origin properties. Without these the transforms will all be flat.
The second wrapper is the "mover" for the circle. It is only used for moving the entire circle its radie in the z pane. This way we avoid having elements twice their size.
The third wrapper is the actual circle and its direct descendants are the circle items.
As you can see the demo is from SleekPHP's login page, you can check out SleekPHP's logger at the bottom of the page. I've got loads of other work atm so progress has been a bit slow lately.
Be the first to post a comment
A thousand monkeys at a thousand typewriters in PHP
Published Tuesday 6th of December 2011
I actually had this idea ages ago and last night I started thinking about it again while trying to fall asleep so I decided to write the thing once and for all.
Using the
convBasefunction from the comments section here php.net/manual/en/function.base-convert.php as well as this little code snippet:<?php
$base = '0123456789abcdefghijklmnopqrstuvwxyz '; # add more if you wish
$slots = 1000000; # increase to get longer texts
$variations = pow(strlen($base), $slots);
for ($i = 0; $i < $variations; $i++) {
echo '"' . convBase($i, '0123456789', $base) . '"<br/>';
}You can make your computer print every text that's ever been written as well as any text that ever will get written in any language that uses the $base characters.
You'll get the LOTR trilogy written backwards only Frodo is called Froggo and the sky's color is purple and instead of beer everybody drinks the Swedish drink Trocadero.
You'll also get the answers to every question that can be asked in text and you'll get a detailed explanation of your life that's correct down to every little detail.
Mind you you'll get everything in between as well :P
Be the first to post a comment
SleekPHP User Handling
Published Thursday 1st of December 2011
SleekPHP development has gone a bit slow lately but last night I managed to get quite a lot of work done on the user management.

SleekPHP's user management is database driven and allows any number of users with any number of authorization levels (as opposed to aFramework's that wasn't DB driven and only two users and two auth levels could exist).
In addition to writing the Model, DB, User, UserModel and UsersModel classes I've also written a Form class which all three modules on the login page use.
The form class is used to generate, submit and validate forms consistently across SleekPHP sites.
It's not a core class and could really be used in any project. If you want to see it in action you can check out the RegisterModule. You'll also see how the different model classes are used there.
I'm severely tired so sorry if this doesn't make sense :P
Join 4 others and post a comment
