Lesson Learned from the First Term
by Sam Morrell on Jan.11, 2012, under General, Life
Today has been the my first exam at university, I’m not going to lie, I’m not very confident about how it went. It seemed like the writer of the paper in question had in-fact decided to almost avoid everything I’d revised. This crippling blow has forced me to look back over my techniques over the first term and revise them somewhat. So, here’s a quick post with some of the tips that I have come up with.
Always Be OCD About Your Notes
I’ve decided that I’m going to start being OCD with my notes again, as I did at A-level. Everything has it’s own folder, tucked away in a plastic wallet for each lecture with a contents page in the front of all the things we’ve covered / have to cover. This is going to take a boat load of effort now, but when I come to revision it should make my life a ton easier. Plus, it makes me feel good about myself when everything is nicely tidied away in folders, because I’m like that. Another thing I’ve noticed is it’s very hard to write things that you find obvious at the time, but not remember what was so obvious later. I think that making an effort to write everything that I think I’d need to know is a good idea.
Sleep Like Your Life Depends Upon It
I wish I was joking, but even as a self proclaimed nocturnal nerd, you need to sleep. Your mind cannot operate properly if you don’t sleep. Also, the knowledge you have accumulated during the day are processed while your asleep, so if you don’t get plenty of rest at night you’ll be doing yourself out of remembering things. This will be very difficult for me, I’m prolifically up very, very late at night doing things. I’m just going to have to force myself to take a break.
Take a Chill Pill
One thing I can’t proclaim I’ve not been doing this past 12 weeks is working, Yep, I’ve been doing something Physics related nearly every single night. Though, that’s fine in the short run, you just can’t do that, it’s not possibles to keep up like it. Take a break every now and then. No matter what you have to do, just take an hour out at least to wind down and do something you enjoy.
Procrastination is your Enemy
Serial procrastination should probably be listed as my hobby. I’m terrible for putting things off until they really need to be done. That’s why next term I’m going to try my very best to try and do things with plenty of time… and to not let my mind wander while I’m doing them. What with all the distractions of modern living it’s very difficult to not get pulled away from your immediate task by something ‘ooooh shiny’ like, especially if said task is rather difficult.
So, these are a few tips I’ve accumulated over the first term. Now if you’ll excuse me, I’m off to buy some folders and revise for tomorrow’s exam.
Thanks for Reading.
New Years Day Star Trek Marathon – 2012
by Sam Morrell on Jan.01, 2012, under General, Life
Hey all, as has been a tradition for me for many years, I must have a Star Trek marathon. It just has to happen. I generally do this on Christmas Eve Eve, but owing to being confined to a hospital bed after an operation that day, it was not an option. So, I decided to get 2012 off to a good start and have it today. The rules are as always, episodes from all series of Star Trek are chosen by a random number from random.org and then I watch and write a quick review of the episode as I go through the night, spoiler free of course. So, check back for updates if you’re interested. So, let’s kick off with…
- Star Trek Enterprise – ‘Terra Nova’ Season 1 Episode 5 – This was a very early episode in the Enterprise story arc, and it’s easy to tell at this point the writers were still somewhat establishing their characters. Though, this is classic Star Trek. Enter with a mystery, meet a race of people cut off from society and slowly earn their trust until they listen to what the crew of the Enterprise are try to tell them so that they can save their life. It’s a classic Star Trek storyline, and I don’t think anyone has ever done it better.
- Star Trek Enterprise – ‘Home’ Season 4 Episode 3 - This is one of my favourite Enterprise episodes. If you’ve watched Season 3 you’ll know why. In this episode the crew return to Earth and it’s mainly a very nice character development episode. The captain deals with his internal troubles and there’s a nice bit of character development between T’pol and Trip. This episode also shows some of the negative parts of humanity, namely xenophobia and lack of understanding toward alien species. Tis a shame to see it, but I think it gives an important lesson. This definitely one to watch, but only if you’ve seen season 3 and the first couple episodes of season 4.
- Star Trek Enterprise – ‘Observer Effect’ Season 4 Episode 11 – Another classic Star Trek storyline, which I’m sure I’ve seen more than a couple times throughout the run of the show. In this one two miscellaneous non-corporeal aliens watch the crew as they deal with a crisis bought on board the ship. Once again, the episode is touting how humanity is unique within all the species they’ve observed in how they react to it. I swear, if there are any aliens out there watching, they must think we’re a vain species. A good episode to watch if you don’t want to get tied into a story arc, as it resolves rather nicely by the end of the episode.
- Star Trek Deep Space Nine – ‘Paradise’ Season 2 Episode 15 – Finally, we’re on to something other than Star Trek Enterprise, not that I dislike it o’ course. Another classic formula, seemingly perfect society run by an overly nice evil woman with Orwellian intentions. It’s a nice enough episode, but it’s very much a filler, though the storyline is interesting enough. Some things of note about this episode. We get a little development on Miles O’Brian at the beginning and the female antagonist has the most annoying speaking voice I can recall hearing. I swear it sounds like she’s always on the verge of crying.
- Star Trek Deep Space Nine – ”Til Death Do Us Part’ Season 7 Episode 18 – Have to admit, paid very little attention to this one. Wasn’t a good one to watch in this context as it is right in the middle of a very involved story arc at the end of the series. Though, I can recall watching it during the arc and it has plenty of twists in it, so from that perspective, it’s a good episode. You have to watch all of Season 7 of DS9 together for it to make much sense anyway.
- Star Trek Enterprise – ‘Dead Stop’ Season 2 Episode 4 – This is a pretty good pick to be honest. It’s probably one of the best Enterprise episodes in my opinion. Essentially after the previous episode, the ship is in a pretty bad way, so they find an automated station to stop off and repair their ship, but some funny business goes on. It’s definitely one to check out, as it’s probably one of the more original story ideas I’ve seen in a while. You might want to watch the previous episode if you want the full story behind it, but still, it’s no big deal. It’s enjoyable enough without it.
- Star Trek The Next Generation – ‘The Survivors’ Season 3 Episode 3 – Ah, now that one is a classic. It’s typical TNG as well. Main story is basically weird people left on a planet that has been completely obliterated by a mysterious unknown alien race, meanwhile Troi is affected by something completely random that you never really find out about. It’s a nice enough episode, well worth not skipping if you’re going through TNG but it’s nothing to really go out of your way to watch.
- Star Trek Voyager – ‘Caretaker’ Season 1 Episode 1 – So much win! Personally, this is my favourite series opener. It has great introductions to the characters, an interesting storyline and it even has a Deep Space Nine cross-over. What more could you want. Also, it’s super long clocking in at about and hour and a half, it’s effectively a Star Trek Voyager movie; which I’m really unhappy they didn’t make by the way.You must totally watch this episode if you have a chance, it’ll get you kick started brilliantly to watching Star Trek Voyager. I grew up watching Voyager and this is a very fitting opening to a brilliant series.
So, I think that’s all I have time for this marathon, I think it’s bee pretty good, though I would have liked to have got some Original Series in there. Maybe next time. If you have been, thanks for reading / following.
A Little Digital Audio Rant
by Sam Morrell on Nov.17, 2011, under General
Hi All, it’s that time of the year again. Time for a good ol’ rant from yours truly.
This time I’m ranting about digital audio. In particular, music downloads and CDs. Personally I just can’t get my head around why someone would rather buy MP3s / AACs off of iTunes or any other miscellaneous MP3 purchasing service. Whenever I buy an album, I usually, if given the choice, buy the CD. Why you ask? Because CDs always have been and always will be much higher quality than MP3s and AAC, or for that matter any lossy format.
You’re currently probably sat there at the moment thinking I’m a complete fool, trying to espouse a 30 year old format over modern standards. Ok, let me prove it! CD Audio, or the ‘Red Book’ standard uses Linear Pulse Code Modulation (LPCM) which is completely uncompressed, meaning it’s the signal that was exported from the Artist’s computer or whatever they used to make it. This means it keeps all the nuances of their mixing, the way you hear it is exactly as the person mastering it heard it. However, both MP3 (MPEG Audio Layer 3) and AAC (Advanced Audio Coding) are compressed ‘Lossy’ formats, this means that the signal that is derived from the data being fed in to the decoder to make the pretty sound come out of your speakers has been sent through filters, compressors and mangled beyond belief. Now, why would you spend the same amount of money on a mangled, nasty MP3 when you could get the same recording on CD for the same if not less, which is bit for bit the same signal that the artist or recording engineer intended.
The other bug bear I have is iTunes, for various reasons I’ve always stayed well clear of iTunes unless absolutely necessary, which surprises many people as I have a MacBook, an iPhone and an iPad. There’s many reasons for this. Maybe it’s the fact that Apple, at least used to, impose very restrictive digital rights management (DRM) on all music and video downloaded from iTunes, maybe it’s the fact that once you’ve downloaded the file once you cannot download again if you loose yours, or maybe it’s the fact that Apple claim to have very high quality audio, when their files are a measly 256 kbps, and yes that is lossily compressed, when CDs are a whopping 1411.2 kbps completely uncompressed. The audio is just much higher quality. I mean, hell it’s well over 4 times the bit rate! Does that mean nothing?
Another thing I like is that CDs are generally just nicer! You have something to hold for your hard earned £8, or whatever you pay. There is something tangible to hold, with MP3s all you have is a smattering of numbers stored in some kind of storage medium. You get the excitement of waiting for it, unpacking it, sticking it in the stereo and sitting and listening. With iTunes and other download services all you have to do is click and button and they’re there, it’s no fun!
If that doesn’t put the final nail in the coffin for my argument, what can you do with CDs. Stick it into your computer’s CD drive, which pretty much every computer has, load up iTunes, take 2 or 3 minutes to rip the AAC / MP3 files and end up with exactly the same thing you would buy off iTunes minus the crappy DRM and restrictions, from the CD! It just seems a no brainer to me, with the CD you can play it as many times as you want, rip it to any computer you want, no 5 computer limit. Every computer!
You can mock me for ’standing in the way of progress’ if you want, but get this. The MP3 standard is just as old as CDs. It’s been around since the 80s. So There!
Random Star Trek Trivia
by Sam Morrell on Nov.13, 2011, under General
Okay, I think it’s time for a geek out. Here goes. Since I am a massive geek of general sci-fi, and in particular the Star Trek form of sci-fi, time for a little trek related trivia post.
- The phrase ‘Beam me up Scotty’ was never, ever actually said in the original series, quite ironic seeing as it’s one of the few lines that ever became famous from the show (that was never actually from the show).
- The phrase ‘Star Trek’ was never said on screen until the 8th feature film, ‘Star Trek – First Contact’ where it was said on screen by actor James Cromwell playing Zefram Cochrane, creator of the warp drive.
- Star Trek didn’t actually reach a wide audience until it was cancelled after the 3rd Season of the original series (a decision which the network later came to regret).
- Star Trek features features the first inter-racial kiss show on television between William Shatner and Nichelle Nichols.
- The term ‘Jeffries Tubes’ (tubes that spread throughout starfleet ships to allow easy maintenance) were named after Matt Jeffries, designer of the Enterprise on the original series. They were named by the crew on honour of him.
- Star Trek was ground breaking for it’s time, as it featured not only a woman, but a coloured woman at a very important post in the command crew of the federation’s flagship. Something practically unthought of in the 1960s.
- Spock was originally rejected by the network due to his ’satanic’ appearance. He later went on to become one of the most popular characters from the show.
- Majel Barret, wife of Gene Roddenberry, has been in every single series of Star Trek, either as a person or as the voice of a ships computer.
- A series of Star Trek after the original series, commonly known as ‘Star Trek Phase 2′ was in pre-production in the mid 1970s after the late success of the Original Series, however instead the first feature film was made.
- James Doohan, who played Scotty on the Original Series, lost the middle finger on his right hand during World War II.
What I’ve Been Listening To – September / October 2011
by Sam Morrell on Oct.13, 2011, under General, Life
It’s that time of decade again! I don’t know if anyone actually cares about reading these posts but I like sharing them anyway. I can go back over them and see what I liked listening to back in time. If nothing else it’s a musical bookmark for myself. Before I get any wise cracks about the frequency of these posts necessitating them being named after seasons rather than months, let’s get started!
Kal Lavelle
Much of my discovery of music is done via the iTunes free single of the week, by virtue of it being free to try and introducing artists I wouldn’t other wise have found / listened to. This time is no exception. About a few weeks ago I found an artists called Kal Lavelle with this song (‘Breakfast at Tiffany’s’). I wasn’t expecting an awful lot as predominantly, iTunes free single of the week sums up mediocrity, however I really enjoyed this one. I just seems really natural and airy. The vocal harmonies also help it along very nicely.
If this song isn’t quite to your taste, she’s also worked with Artful to make ‘This Could Be The Bassline’. Also really like this one. There’s another version of this song circulating with Ed Sheeran on vocals, as he was meant to do them but was unable and recommended Kal (I think).
He Is We
Here’s another lucky discovery of mine. This duo are really quite good. These two songs are my two favourites for you to have a listen to. The first one is called ‘Happily Ever After’ and the second is called ‘All About Us’. The second features Adam Young of Owl City fame, so if you recognise the vocals, that’s why. They’ve done plenty more good songs too so why not go check them out?
Amy Macdonald – This is the Life
Basically, I kept hearing it on the TV adverts for some car, I forget now but I think it was Fiat. I’ve always this song, but never known exactly what it was, thank goodness for iPhones and Shazam, eh? Once again, many harmonies, that seems to be a recurring theme.
Dlugokecki – Save My Soul
Just so you know, it’s pronounced der-loo-go-ken-ski. Don’t worry, I had that trouble too. I’ve loved this song since way back when I first heard it. It’s got everything in it that makes me want to listen more. Strings, a really punchy bass line, clean drums, plenty of vocal harmonies and generally a really big a lovely sound! This is the way I’d like to mix music.
Ady Hart
I can’t end this post without mentioning a friend of mine, Ady Hart, who has recently finished and published his own album. All the songs on it a very good, I’d be hard pushed to find a weak one. The production of the CD is also very well done. An all round class act. Why not have a look at his website at http://adyhart.com/. Seriously, you won’t regret it. In the meantime, here’s a sample I managed to dig up of one of his songs. Enjoy!
Right, I think that’s enough for now, else I won’t have anything for next year… ahem, month’s post. So in the meantime, thanks for reading and hope you like the music.
Dahl – Progress Update 1
by Sam Morrell on Jul.24, 2011, under Coding, General
Hello all, if you follow me on twitter, @smorrell if anyone is interested, you may have noticed I haven’t half been prattling on lately with a load of mumbo jumbo. These are my little snippets of code so here’s some context to my programming jargon fuelled tweets. Time for a little progress report on Dahl, which I introduced a couple posts ago. I won’t bore you with another introduction, you can read the other post for all that. Here’s what I’ve been working on.
Caching
The main focus of my work over the past couple days has been working on Dahl’s caching capabilities. I’ve managed to get it very ably fetching from databases, but how could I improve performance and reliability?
So, I implemented a nice little time based cache. I had to invent some extra objects and properties to make it all work out but alas it’s working rather nicely now. Only a few hours work too. It’s given performance a nice little boost too. With the data cached I saw performance that was averaging about twice as fast, even when I was executing 9 table fetches it still showed this trend. I’m happy with that, there’s always time for tweaking and performance improvements later on eh?
Offline Mode
It occurred to me today that I’m storing all this data locally to avoid some performance issues, so there must be something else I could do to leverage this. So I decided to allow Dahl to run disconnected from the datasource. Dahl will run off of the cached data if it is unable to establish a connection to the server, it will run off of that until it is able to reestablish a connection, at that point it refreshes the cache from the data source. I thought it was quite a good idea, though I might well add some kind of flag within the configuration file to allow it to be disabled.
Dataset Tweaking
Probably the most important object within Dahl is the Dataset object, this deals with all the data manipulation and storage while active within PHP. Today I’ve been tweaking how it behaves when treated like an array. Before, I had implemented the arrayaccess interface to allow it to be accessed like an array, but today I decided to also implement the Iterator and Countable interfaces to permit the count() function to be used and also to permit foreach statements and the like. So far it seems to be working fine but I think I shall keep tweaking it for a while yet before I’m happy with it.
I hope you enjoyed this little roundup of my recent activities. I’ll be sure to post another update soon. Thanks for reading.
Broken Physics – My Novel Ways to get Places really Fast!
by Sam Morrell on Jul.22, 2011, under General, Life, Philosophy, Physics
Hi all! I’ve been meaning to finish off one of my blog posts for a while, I usually tend to write something on what I’m currently pondering on as some way to record my somewhat rampant thoughts, usually works but my best thinking is often done late at night… when I’m tired… and I go to sleep half way through writing, like right now. So before I do, let’s get started.
For many years, humanity has looked up at the sky and wondered what’s out there, then we invented telescopes and made it possible to see the rest of the universe from our island in the sea of the cosmos. The sad thing is that most of the sights we have seen are millions of light years away from us, so the only way for us to see them first hand is for us to travel many times the speed of light, but first we have to make this possible. The problem, according to Einstein’s theory of special relativity and pretty much every branch of physics, it’s impossible for a particle with mass to travel faster than the speed of light or 300 Million metres per second, it’s not even possible to take anything above a subatomic particle close to the speed of light as when the object comes close to the speed of light, the energy required to accelerate it becomes seemingly infinite. So, how do we solve this?
Messing with Physics
I’ve been doing some thinking, also reading the works of Stephen Hawking, Carl Sagan, etc and if there’s one thing I have discovered about this problem it’s that one must usually try and avoid coming up against this problem by playing with physics. Time for some fun.
It’s suggested that we could get around this by showing that time is slowed down as we get close to the speed of light, thanks to Special Relativity we can use this trick. Just suppose that there’s a train travelling around the world very close to the speed of light, now just suppose that someone were to walk out in front of the train going just fast enough to be accelerated past the speed of light were the train go into them and accelerate them. Since nature doesn’t allow anything with mass to be accelerated past the speed of light, time relative to the train will slow down, therefore reducing the train’s speed so as to prevent that object to be accelerated to past light speed. However, relative to everyone else on the earth, the train will be travelling faster than light as only relative to the train does time slow down.
There is however a problem with this broken physics, as we get faster and faster, our mass will increase, causing the need for more and more energy to maintain our momenta. Of course, there’s also the problem that if we go fast enough, our mass will be so great that we will have so much gravitational force that we will implode on ourselves and become a black hole, but hey! That’s what speed limits are for.
Star Trek Physics
As you may well know, I’m a massive Star Trek fan, and one of the main parts of Star Trek is the faster than light technology, Warp Drive. Before now, I thought that the way the ships warp drive worked was to create a bubble outside of the ship and knock it out of normal space and allow it to travel past light speed, maybe dropping it into some form of hyperspace or a higher dimension. However, I recently got The Star Trey Haynes Enterprise Manual and it explains Warp Field Theory well and I think I understand how it works, so here goes. As far as I can see, The Warp Drive doesn’t so much as alter space around the ship as fold space. I’ll try and explain, if you take a two dimensional sheet of paper and want to travel from one end to it as quickly as possible then you fold it, therefore giving you three dimensions. If the 10 dimensions theory of space time is true, what’s to prevent us doing the same thing with space? So, what we do is fold space around the ship with the warp field and take our seemingly 5 dimensional space and fold it to give us a sixth dimension, making the space between them much smaller, or even non-existent. Now I come on to sub-space. In Star Trek, something called sub-space is mentioned an awful lot, as the space outside of normal space-time. This now makes sense as the space we cross to get across the fold could even be thought of as being ’sub-space’.
My Recent Reading
I don’t know if it was a slight count of masochism on my part or whether I actually believed I’d understand it well but I decided to try and get to grips with M-theory on the bus this morning. Needless to say I was relatively flummoxed, though with a little persistence it should be remotely possible. Though, it’d appear that one thing could be possible with M-theory, Wormholes! According to Einstein’s physics, we can warp space as much as we like as long as we don’t tear it, however wormholes would require tears in space, as such isn’t possible. With classical physics space cannot be torn as we’d probably have been obliterated by now, however if we factor in string theory, it’s possible. Space can be torn however according to string theory it can tear and then be repaired, making it possible for wormholes to exist.
An Insane Idea
Okay, I feel a little bit insane at the moment, so let’s just throw something really, really crazy out there. Who says we have to actually travel to other places to go there. There’s a little quantum phenomena called ‘Quantum Entanglement’, which means that two particles that are a long way away can act as a single particle. The properties of one are instantaneously transferred to the other. In theory, why could we not entangle sub-atomic particles on a far away planet and thanks to this quirk of nature particles that we change the state of here on earth, they would change the state here and there to?
Just think about it, a person hops onto a platform here on Earth, all atoms within the platform are entangle to particles on a planet millions of light years away. The person is simultaneously in two places at once. Everything within that field is entangled and exists simultaneously there and here on earth. This is a win-win situation as far as I can see as we can be picky about what we entangle. Any radiation that exists on the foreign environment that would be dangerous we could simply not entangle and the person here on Earth would be fine, but if we entangle the photons on the foreign planet, the person can see exactly what they would if they were standing there, and if they were in a perfectly photon free environment here on Earth, it’d be all they would see. Because the Earth’s atmosphere would be entangled with the person, they would be able to breathe perfectly well as they’d have a ’shell’ of atmosphere around them.
I know, it’s a completely insane idea that completely breaks physics, for a start how the hell do we entangle that many particles simultaneously? How do we get them entangled since it requires a physical interaction? How does it even work? Well, for certain I don’t know if it is even possible, I know very little about quantum mechanics, I don’t even know if it’d allow for this kind of thing, but it occurred to me that if we could make two particles that interacted to share a quantum state from a few kilometers away, what’s to stop that happening many Parsecs, or even millions of light-years away? As for the physical interaction to entangle them, what force acts between every particle with mass in the universe and every other particle with mass in the universe? Yep, Gravity. Why can we not entangle them through some form of Gravitational interaction? How do we entangle so many at once. I have no idea, but with the vast strides technology and understanding the human race has made in the last hundred years, whose to say what’ll be possible in a thousand if the human race still exists and keeps on with the current exponential rate of technological advancement.
I have some more Broken Physics posts in the pipeline, each of them breaking physics as much as this, trust me, they are for the most part completely crackpot, which suits me just fine.
If you have been, thanks for reading.
My Newest Little Project – Dahl
by Sam Morrell on Jul.21, 2011, under Coding, General
Hello all, I’d like to give you a quick introduction to my latest little project. I like to call it ‘Dahl’, or if you like Acronyms Data Abstraction & Handling Layer. It does pretty much what it says on the tin. It’s a layer that can be built into websites / applications to provide data access and data handling. Let me briefly take you through it.
What is a Database Abstraction Thingamajig?
Good Question! In General, abstraction means simplifying the problem by removing unnecessary details, that’s just what a DAL (Data Abstraction Layer) does. It provides a consistent interface to the application regardless of database. For example, let’s say you make a site, you want to make queries to a MySQL database so you write in all the code to use MySQL, then you find out the place you’ll be hosting don’t use MySQL (yes, I know it’s insane, but just suppose) and that they use PostgreSQL instead. All the code that you wrote is now useless because it’s using the wrong set of function calls for the database you’re using. With an abstraction layer, that’s not a problem. You write the application to call the abstraction layer, and then the abstraction layer deals with the database stuff, keeping it completely separate from program logic, so that in this case all you need to do is change the DAL instead of the whole application.
So why did you do it?
You may remember a while back I posted about my little Content Management System (SnapCMS, I promise I’ll do another post on it at some point). I wrote a basic abstraction layer for that, but the thing that always bugged me about it was that it relied on SQL. If you’d wanted to say use a data source that didn’t use SQL, you’d have to write some kind of SQL lexer / parser, which I really, really didn’t want to be on the other end of. So, over the past few days or so I’ve been trying to think up an elegant way around it, and I think I’ve managed to get away with it. I decided to write it because I really like making my code as modular as possible, so that something I write now might be able to be used as many times as possible in the future, so I don’t have to write it all again, I only need to include something and we’re ready to go. My main motivation was mainly to do it for fun, if I’m totally honest, but my other motivation was to try and make something cool that will come in useful at some point in the future, but mainly the fun thing if I’m honest.
So, how does it work?
Okay, let me take you through some of my proposed syntax and what the hell it does.
To get dal working, all you have to do is to fill in the configuration file, which I’ll probably make a lot easier if I ever get happy enough with it to release it, and include the framework like this.
include("dahl/dahl.php");
$dahl = Dahl:getInstance();
By this point all the conficguration is loaded and your are connected to the data source. So how do you run queries? Simples!
//Include DAHL Core Framework
require_once('dahl/dahl.php');
//Configure DAHL
$dahl = Dahl::getInstance();
$Dataset = $dahl->Table('TableName')->Fetch();
The last line of that little snippet retrieves a dataset object from the data source, where all the magic happens. This loads the table into a dataset, after this you can manipulate the retrieved dataset simply through the dataset object, like so.
//Include DAHL Core Framework
require_once('dahl/dahl.php');
//Configure DAHL
$dahl = Dahl::getInstance();
$Dataset = $dahl->Table("sc_settings")->Fetch();
//Filter Out Results
$Dataset->Filters->Add("FirstName = 'Fred'");
$Dataset->OrderBy = "LastName";
$Dataset->Order = "Ascending";
$Dataset->Limit = 5;
$Dataset->Refresh();
That last snippet of code has the effect of limiting down the dataset, by filtering out the records where only the first name is Fred, and limiting it to 5 rows returned. Also it’s sorting it into ascending order by last name. You then call the refresh so that the dataset can rebuffer the data, I’m working on having it do that automagically at the moment.
//This is the code used to get the value of a field from the table $name = $Dataset[0]['FirstName']; //This is the code used to set a value of a field in the table $Dataset[1]['FirstName'] = "George";
This is what I’m currently working on, among other features. If the program wishes to access a value from the table, all they need to do is use the usual syntax for array access, the first offset defines the row and the second offset defines the attribute. This is where the ‘Handling’ part of the title comes in. When you access a field within the table, the dataset first ensures that it is up to date checking to see if the filters have been modified since it was last refreshed and if they have, it refreshes from the data source. When the program sets a value within the dataset, it doesn’t immediately apply the changes to the database, but it tracks what changes are made and when the program has finished modifying the data it calls the Update() method of the dataset and all those changes are saved to the dataset. Just the same, if the program decides it doesn’t want to save those changes it can call the Cancel() method and all changes are removed.
Sounds good. How is it going?
I’ve only been working on it a couple of days so far so it’s very, very early days but so far it’s going well. I have so far implemented the Dataset object and it’s returning data from MySQL tables. Currently working the Array Access stuff that I just discussed, but the framework is at least there for the future. Also, I’ve got the foundations laid for some kind of Caching subsystem, to try and reduce the stress on databases for repeated queries. Hope you liked reading about my PHP hackery and I hope to update about my projects soon.
Thanks for Reading
My Initial Impressions of Google+
by Sam Morrell on Jul.12, 2011, under General, Life, Web Design
As I’m sure most of you know, Google hasn’t had the best of luck with social media and social networking services. With names like the late, great Orkut under it’s belt, as well as the likes of Buzz long since passed by the wayside and doomed to failure, it’s a wonder that they ever even contemplated trying to dip their toe cautiously in the sea of social networking again, but this week they really came out with their big new project. Google+ (or Google Plus, whatever you like). I got an invite just yesterday and I already have some initial impressions, so here goes nothing.
Like Facebook… but Nicer
First things first. The thing which everyone thinks when they try a new social network is how does it weigh up to the existing members of the species, Facebook being the main one of them. As an avid Facebook user, I procrastinate on the site many hours per day and the first thing that struck me is that anyone used to Facebook, the site which pretty much set the mainstream standard for social interactions, will be right at home in the shiny new interface. The first thing that struck me is how much nicer it looks. It maintains the basic layout of Facebook, but the design has so much more white space. Everything is spread out and the content is allowed room to breathe, unlike the cramped together layout of the Book of Face. The next thing that struck me is the platform specific things. Google+ does some neat stuff of it’s own, the way you can organise contacts into circles and segregate your content / contacts into those defined groups is awesome! I know you can do that sort of thing in Facebook’s jumbled friend manager, but it’s just not with the same pizzazz. With Google+ contact management is so intuitive it’s almost stupid. The general trend you’ll notice about Google+ after a while is that it’s very like it’s cousins in the social networking ecosystem, but it generally tends to do things a lot more nicely. Everything has that extra amount of polish on it. You can tell that the boys and girls at Google really put their best efforts into this attempt at taking the social network crown. Even the notifications area has been carefully thought out. Clicking on the notification won’t take you to the post, it will load up the post inline and allow you to comment and +1 it straight off, I really like this.
Everything now has a purpose
The thing which has struck me hugely about the experience I’ve had with Google+ is how it wasn’t a hassle to set everything up. With new miscellaneous social site you usually have to go around setting everything up, connecting with other services and all that jazz, but because Google has been getting it’s ‘Big Brother’ on with your data for the past how ever many years you’ve had a Gmail account, you don’t need to do all that. It’s all ready to go. So, within 30 seconds I was all ready to go and venture forth into the world of Plus. The other nice thing is how now, it ties in with all Google’s other services, unifying them all under one easily usable banner. Picasa Web Galleries is now your one stop shop for social photo sharing, and the great news is that if you’ve been hording them for years, they’re already available on plus, just switch them to public. It also ties in with YouTube, another Google acquisition, pulling in videos to your stream in a very fitting manner. Check-in metadata is handled by Google Maps, so that page you probably used to think were useless now provide very useful information about where your friends currently are and Google Chat is now the chat client for Google+, so that Chat section down the side of GoogleMail that you’ve probably never used will finally see some action, and most of all it is Google Chat, so third-party clients already speaks it’s language allowing you instant access to chat on your desktop. Most of all, when you’ve signed into any other Google service, you’re already signed in to Plus. It all works beautifully together.
Now, the Downside!
Yes, it has it’s negatives, but they are indeed few and far between. Big flaw, there’s no one there! Yes, I know that it’s because it’s still deep in testing and development, but it does mean that to most people in the world, for the moment it’s rendered effectively useless. Instead of searching for people you know, you have to go to the trouble of inviting everybody, and though I’m sure there is a limit to your invites, I have yet to hit it. The big issue is that for a social network, it’s not terribly social at the moment. Apart from the few geeky friends I have who are already there / I invited, it’s relatively void of anywhere near regular amounts of social interaction. The best thing Google could do to truly test out their social infrastructure is to open it right up to anyone and everyone. Then it’ll gain popularity, unlike their past ventures which floundered and drowned in the sea of services, and yes you guessed it. All the other attempts were invite only for nearly their entire lifetime.
Here’s what they need to do
This section is probably my own opinion, but here’s what I think Google need to do to make Google+ a success.
- Open it up! Make it public as soon as possible, they will never truly test it until they open it up, they will never get a true idea of what they can handle until they do this, this move will encourage adoption and probably make it rather successful on it’s self.
- The one thing I’ve been complimenting them about over this whole post is the user experience of the site. It has ample white space for all content, making the social interaction a top priority, they need to make this stick true if they want me to keep singing their praises. The big problem I have with Facebook is that looking at your Homepage is usually somewhat of an information overload. None of it is properly spaced and it’s all just jumbled up in a partially templated mess. They really need to keep it minimal like it is at the moment. Hide away what the user does not immediately need until they need it, but make it simple for them to get to at the same time. It’s a challenge, but one I reckon Google can take in their stride.
- This leads me on to my next point. One thing I severely dislike about Facebook is it’s apps. While they do have their place and I have dabbled in a little minor hypocrisy from time to time, apps are generally a bane of Facebook user’s existences. They clutter up news feeds while contributing little if nothing to the overall experience, aside from just providing free advertising to the app itself. I’m not saying that Google+ shouldn’t have some kind of App Platform, I just think Google need to be very careful about maintaining the user experience to the high level it currently is at so that they avoid the information overload I currently get on Facebook.
Overall Impressions
Putting it simply, Google done good! Though the odds were against them, with their track record counting against them also, they came out with what so far looks like a truly brilliant social networking experience. It’s well designed and well thought out, making up for a lot of the problems found in it’s much older cousins. This, in my estimation, makes it a success. They’ve taken what was already an acceptable experience and added their own shine to it in a way only Google could really truly do. I only hope that it eventually sees the light of day and gets opened up to the public before it becomes just another aborted experiment in Google’s ever expanding lab. Do I like it? Well, let me put it this way. At the moment I have a tab for Google+ open, but I do not have a tab for Facebook anywhere to be seen.
Thanks for Reading.
Apple Pre-Sales: Don’t Make Me Laugh!
by Sam Morrell on Mar.27, 2011, under General, Life
Here’s post I wrote a little while ago, I think an adequate amount of time has passed so that this rant can now be funny and unrelated… You must understand… I had no iPad at the time.
You know when the new Apple product comes out and you wait and wait and wait for new stock and that point you do a really ranting and bitchy blog post. Yeah, this is one of those.
The tale starts a week ago, preempting the release of the iPad 2. I decided I’d buy this as soon as it was announced, so I quickly started pooling together money to buy it. I went to my local Apple store, cornered the manager and asked him if it was still being released next Friday, if he knew how many he’d get in and if he thought he’d have any available the next day. He honestly couldn’t have given me a more vague and ambiguous answer, replying with a hearty chorus of ‘I don’t know’.
The story then continues this weekend. I decided to call Saturday morning to check if they had any in stock (already knowing the inevitable answer) and when they’d get any more in. After well over a 40 minute wait to clear 2 calls in the queue I finally managed to get through only to be greeted with another queue of false uncertainties. By now I was getting a little sick of this so I decided to go straight to the source and go into the Apple store myself. I was greeted by an Apple employee with a flippant attitude. I got a little peeved by now and decided to have a little dig, just because I’m evil, so I said that I could probably find one down the street in another store. At this point the employee in question simply smugly chuckled to himself, said ‘hah, good luck finding one’ and walked off.
Now, let me just get my head around the situation. I get that they are having supply troubles, they have a massive product launch which is in high demand and I understand that the sales reps have probably heard that same question so many times they wish to drill a freshly manufactured iGun straight into their corpus colosum, but surely that’s no reason to have an attitude towards your customers, especially the faithful ones who are keeping you in a job by buying your damned products over and over. Also, I find it remarkably hard to believe that absolutely nobody apart from this illusive ‘head office’ actually knows how many goddamn units they are getting in and when they are actually getting delivered. So either everyone including the manager is less organised than a flunking college student or someone is blatantly lying to me and indeed all of their ‘valued’ customers.
It’s true, you may not be able to tell me because of company policy but don’t front me and all your customers with lies, just tell us the truth, that you can’t tell us.
Update
Alas, my efforts have born fruit. I’m currently writing this update on my new iPad 2. Apple pre-sales took a turn for the better yesterday as I called up Apple support once again in vain, they revealed that I was able to reserve on online. So, I did. Today I rushed to get it and as they say the rest is history. Went off without a hitch. I’d like to compliment both Jo for her very eloquent phone manner and Ben for his supreme customer service. I know they don’t know who they are but it’s the sentiment that counts.
If you have been, thanks for reading this little rant.
Sam.