Tuesday, 17 September 2013

Simple Data Structure for Tower Crane (Tower only)

// Data Structure for Generic Tower Crane (?)
// Program finds necessary size of concrete base to be poured and overall weight of tower segment.
// Note since the horizontal jib has not yet been accounted for the math to calculate the base weight is currently arbitrary. Once the moment of the crane is available, trigonometric functions can be used to calculate a more accurate size and weight.

#define _USE_MATH_DEFINES
#include<iostream>
#include<cmath>

using namespace std;

struct Rod{
    float diameter;
    float length;
};

struct Segment{
    int sides, segmentSize;
    float length, width;
    
    void CalcDimensions(bool tower){
        //Totally legit maths
        length = length * 2;
        width  = width/2;
        
        if (tower){sides=4;}else{sides=3;};
    }
};

struct Tower{
    int segnum, segheight;
    float height, weight;
    void CalcHeight( ){
        height = segnum * segheight;
    }
    void calcWeight(float diam, float sdiam, float slength){
        double pi = M_PI;
        float vol = (4 * (pi * pow(diam/2, 2) * height)) + (8 * (pi * pow(sdiam/2,2) * slength));
        //Density of steel = 8000kg/m^3
        weight = vol*8000;
    }
        
    
};

struct Base{
//public:
    float weight;
    void CalcBase(float towerheight, int towersides, float roddiam){
        //totally legit math
        float vol = towerheight*towersides*roddiam;
        //density of concrete = 2400 kg/m^3
        weight = vol*2400;
    }
    
    
};


int main(){
    
    Rod longr;
    Rod shortr;
    Segment s;
    Tower t;
    Base b;
    
    cout << "How long is each long rod? (m)" << endl;
    cin >> longr.length;
    cout << "What's the diameter of these rods? (m)" << endl;
    cin >> longr.diameter;
    cout << "How long is each short rod? (m)" << endl;
    cin >> shortr.length;
    cout << "What's the diameter of the short rods? (m)" << endl;
    cin >> shortr.diameter;
    cout << "How many Tower segments have you ordered?" << endl;
    cin >> t.segnum;
    
    s.length = longr.length;
    s.width = shortr.length;
    s.CalcDimensions(true);
    
    t.segheight = s.length;
    t.CalcHeight();
    //Calculate weight of tower
    t.calcWeight(longr.diameter, shortr.diameter, shortr.length);
    //calculuate weight of tower
    b.CalcBase(t.height, s.sides, longr.diameter);
    
    cout << endl << "Your tower is going to be " << t.height << " m tall, and you'll need a base that weighs " << b.weight << " kilograms" << endl;
    
    cout << "Your tower is going to weigh: " << t.weight/1000 << " tonnes." << endl;
    return(0);
    

}

Saturday, 7 April 2012

Let's talk about the film race

To be quite honest, it started badly... I knew that I would be subjecting myself to 24 hours of sleepless filmmaking, yet I could not bring myself to rest on the Thursday (granted, the copious amounts of work we get given for every weekend here at NYUAD may have had something to do with that). Thus, I entered the 24 hour film race, already 12 hours awake.

Jamie and I arrived early, both to seem eager and because our anticipation disallowed us from doing anything else. Once all the other, inferior teams had arrived, Dan presented the flip cameras and held up his iPhone, which was displaying a large readout of the the time (8:00pm). I took this to mean the race had begun, and made quite a show of exiting hastily. Jamie, every the rational one, procured the topic sheet which I had completely forgotten about and followed me. Slowly.

Things went smoothly for the first hour. As had been prearranged, Jamie wrote the script (which fitted very well with our vague concept of a plan) while I prepared the lighting. Once I'd approved the script, we rung up the three actors who we'd reserved earlier. They all came pretty quickly, and after a brief panic about what clothes would be worn, we started the actor training. Drawing from things I'd learned in Fundamentals of Acting, and things Jamie had learned by being an artsy person all his life, we were able to get the actors ready to shoot quite quickly. When all was said and done, we started filming roughly an hour before we'd anticipated we would, which we were very happy about.

Unfortunately, that was when we started to hit snags. The first notable one was that the flip camera we'd been allocated for the shoot had such a stupidly small frame that we could not get an establishing shot for the film. We compromised on two semi-establishing shots, and then encountered our second major issue, which was the realisation that the first scene (which realistically could only take up 1/3rd of our 3 and a half minute film) was taking longer that 4 minutes... After a bit of field script-surgery, we had that problem rectified.

The first two scenes (both indoor scenes) were filmed by 1am, again an hour ahead of schedule. Jamie and I bid the actors goodnight (with apologies about the ridiculous hour they had to be up again) and set about cutting the footage. We hit one issue early on, a standard formatting/compression problem, but since I'd seen the like during my film production course we had it sorted in no time. After we had established a visual style and a rhythm for the cuts, Jamie hung around more for moral support than anything else, since it was my job to do the actual editing. I let Jamie off the hook at around 4:30am, so he went to bed to prepare for the morning shoot.

At about 5:30, once everyone had assembled, we set off for the corniche. We stopped in Al Safa for breakfast (which comprised of 'Chips Ahoy' cookies and mango juice) and then took a cab. Jamie had chosen the location, though in the end we went for a playground right next to the initial place. Just as the sun was rising we began filming. Several interesting things happened during the filming. One was that we realised that we had to time the shoot to coincide with the traffic lights, so that the cars were not drowning out our audio (which was all filmed synced). The other, slightly more disturbing one was that right after our final shoot our lead actress pointed out a strange man sitting on a bench just watching us. Since we were done we hastily left the playground, and began walking back to Sama (there were no taxis along the road we ere on)

We stopped for coffee along the way back, which was certainly a nice break from the rush of the race (though at this stage Jamie and I realised that we had loads of time). Once back in Sama I returned to the editing suite, and Jamie had a bit of a rest. When he came by to see how I was doing, he was slightly startled to find that I had put our entire film through a slightly green filter, aas an experiment to see if I could make it a little bit more cinematic. It turns out the filter did not make the video look cinematic, rather just like you were watching it through seaweed. Jamie suggested that I revert the colour back to the original.

A couple of hours after that incident I had finished the first draft. We brought a couple of third-parties in and screened it to them, to get some feedback. We did some final changes, and then changed some of the final changes. Finally we looked through everything once more and changed some stuff again, and then called it a day. 3 hours before the deadline. We  triple checked every detail (though at this stage we were drowning in tiredness, so chances are we still missed many things) and then exported the file the way Dan had asked. We took a little nap before submission table opened, and then headed down to room 442 where Dan was waiting for all the submissions.

In 442 stories were being shared, congratulations were being made and a general feel of joviality was being experienced. This, combined with the fact that everyone was at least 24 hours sleep-deprived, created a sort of surreal, dream like state in which everyone looked like a pillow. Taking my hallucinations as a sign that I needed sleep, I left and went to bed.

The day was intense and fun, and whatever the outcome Jamie and I had a great time. I also look forward to seeing all the other submissions. All the films will be screened on Monday at 8pm in the common ground. I think someone said there'd be a red carpet.... 

Tuesday, 23 August 2011

Why this one's so late...

I think it's safe to say that if things like 'work ethic' and 'dedication' were measurable, mine would tend towards negative infinity. It has literally been months since my last post. Now I'm not one for making excuses (psh), but there are three reasons for my lack of commitment recently. The first and, if I'm honest, most prominent reason is that the past few months have been my 'gap year', of sorts.  It was a gap year on a rather tight budget, which means that while many of my peers went sailing across Bermuda, or running through Zimbabwe, or cage-fighting in Northern Europe, I stayed home watching Friends reruns and looking for a job which would let me keep at least some of my dignity. I also developed asthma, which was not so nice. As you can probably imagine, after seeing "The one with Mac and C.H.E.E.S.E" about six times my brain gave up, switched the 'autopilot' on and went for a Martini by the beach. While this must have been lovely for my brain, it left me in a state of complete uselessness: anything more complex than aimlessly clicking a mouse or holding a toothbrush caused a system overload resulting in an intense headache and an urgent desire to lie down and die.

This lasted for about a month, and then my brain decided to come back to me. I must say it wasn't in perfect condition, but I did enjoy being able to once again operate a door without fear of personal injury. However, this brings me on to the second reason for my disappearance from the blogoshpere. Once my brain let me access my higher functions again, I created a Youtube account. This was the second worst thing to happen to my productivity in 18 years. I got a strange sensation in those first few moments after creating my account: between Youtube's many pleas for me to upload a video and my somewhat exaggerated estimation of my abilities with a camera, I realised that I needed to grace the world with a film*. After about half an hour of excited, ambitious and ultimately pointless planning I started work on what would become Just another Lego Star Wars type movie. At that point I (naively) reckoned it would take me about a week to do. After a week, having finished about 27 seconds of what I wanted to be a 10 minute movie, I re-evaluated my first estimation. A strange thing happened thereafter: I became fixated on this clip I was making. My entire life, as lonely and sad as it was, was put on hold. Days (and I'm not kidding here, days) went by when I didn't eat or sleep at all, because that would have meant giving up precious and valuable time - time which could be used to work on the film. A few weeks later and I was quite impressed with the finished product, which I had been able to get into something resembling an HD format (you must understand I had - and still have - no understanding of video compression whatsoever and was rather shocked when, uncompressed, the movie took up 49GB of space). I was slightly less impressed when something went wrong while uploading it to Youtube. Somehow this professional and industry-leading video sharing site managed to stuff up my beautifully colourful and smooth HD blockbuster, turning it into a low resolution, blurry and fluctuant mess.

*This is a rather abridged version of the thought processes which led me to start making it. The full story is available in the AWoD Special Edition DVD, which is scheduled for release in Spring 2087.

"But," you scream at your computer screen or Blackberry or iPhone or iPad or internet TV or whatever other gadget you might be reading this on, mistakenly thinking that I can hear you, "but, your video was uploaded nearly two weeks ago! Why haven't you posted something in that meanwhile?" Well, this is because of my third reason: I'm going to university soon. In itself, this is not a very good excuse: most students-to-be spend every last moment, right up until they cross the threshold of their college, utterly intoxicated. Since inebriation is no excuse for writer's block, if my case had been similar then I would have no excuse. However, for me this is not the case. You see, the university I'm going to seems to have gotten it into its head that I'm quite smart. This might have once been true, but after 8 months of stumbleupon.com's humour section and BBC's mind-numbing daytime telly, I am probably not on top form. So for the past two weeks I've been attempting to refresh my memory of all the things that I learned in high school, in particular calculus and its affiliates. Unfortunately this hasn't been as effective as I'd hoped it would be; in general I'll get through half a question before saying 'grr' in frustration and dramatically giving up. But, every cloud has a silver lining...

Whether I struggle to keep up with the rest or outshine them all (fat chance...), university will at the very least give me something to write about. The reason for this is that the university I'm attending isn't exactly... conventional. The New York University of Abu Dhabi promises a rather unique experience for me and my 150-odd fellow classmates. I'll be travelling frequently, meeting lots of interesting people and apparently discovering the true meaning of soul-crushingly large amounts of work (less-vague information about NYUAD can be found here). So, for the next four years this blog and its Youtube equivalent will be a travelogue, a diary, a place to share my experiences and a place for me to bitch about difficult tests and unreasonable assignments...

Oh, yes. I leave on Friday!!!!!! ^_^

Saturday, 23 July 2011

A very quick update

Some of the more astute of you may have noticed that I haven't posted anything new in quite a while. I apologise profusely to those of you who have frequented this site and have been anticipating new material, but I have had other things on my mind recently.

For one thing, I have spent the last two weeks or so making sure that I'm in ship shape for university (which is drawing closer and closer, albeit with a pace similar to that of continental drift). I have visited the dentist, twice been to the local doctor's office and in two days I'm going to a physiotherapist because... well because it's free, and I'm taking as much advantage of this first world's free medical care as I can. This all may seem awfully crude of me, but having grown up in a country where teachers and nurses are on strike as often as not, some rigidity in infrastructure is very welcome.  Although I'm sure you don't care, the result of all these checkups is me being happy with the state of my health. I am, apparently, a healthy young male with no real cause for concern on the medical front. The Bulgarian dentist even said that I have very good teeth, though she did quietly add "...for an English person" which I think, in today's multicultural and racially considerate society, was rather rude. One thing that's not so nice though is it appears that England has given me asthma, which sucks.

Another reason for my recent lack of commitment to this site is my commitment to another project I am working on. You might have seen a video I posted on Facebook a few days ago in which I tested out some new software I have recently acquired. Quite frankly it was a rubbish video, but as it was my first time (ever) doing anything of the sort I needed to figure out how things worked. Since then I have been working on something a bit more... plot driven, and I'm hoping to have it ready in the next week (no promises though, you know my work ethic). I will, of course, have something a bit extra - a director's cut of sorts - for my avid readers, as a bit of a thank you.

I'm going to stop writing now, before my arrogance and ego burst and mess up my keyboard. Hopefully the frequency of my posts will return to normal once I am done with this tedious editing process. I thank you for your time.

Tuesday, 28 June 2011

It's an ego thing.



I’m going to cut straight to the chase:

We’re falling behind in reader numbers lately, despite my well thought out plan to review… things.
No matter, because I have a new plan, and this one’s even better than the last! It’ll attract many
strangers and thus increase my reader base by at least about two (many of you must now be inclined
to think that I’m a self-centred egotistic attention seeking git, but the truth is I simply really
love writing - I just feel that there’s little point in writing if nobody’s going to read what’s written.
You, the readers, are the source of both my inspiration and my desire to write, I hope you
know that).


The plan I speak of is the outcome of many hours of web browsing, during which I observed certain…
rules for successful interneting. It seems one of the main mistakes I have made is too much writing
and not enough pictures. People love pictures but I started this whole blogging thing for writing only.
So, I’m at a bit of a dilemma here: should I forgo my values as a writer for some extra page views, or
do I continue my picture-less rants knowing full well it’s costing me readers? After much thought
I have decided to try my luck at some pictures now and then (when appropriate) but this will not be
a picture-based blog. I s’pose if I actually found a definite topic to write about I could go back to
full literary dedication, but for now I’ll have a go at some mix ‘n match

Commitment’s another issue I have. As some of you may know I’ve basically had 6 months of chill.
What this means, besides me being well up to speed on the latest Dr Who and HIMYM, is that
I’m pretty darn lazy at the moment. 6 months of no responsibility and no commitment – just pure
thinking time – has shot my already questionable work ethic to pieces. It will take quite a bit
of time to get back into a routine, and my body is just not particularly interested in that right now.
You can judge my self-control all you like (it’s never been my strong point), the point is that I
wouldn’t, at this point in time, do anything strenuous or exertive unless I was guaranteed to
get something financial, amusing or gratifying out of it (and we’re back to the egotistic git).


This ‘plan,’ come to think of it, isn't a precisely good plan. In fact it’s not a plan at all, not really:
from browsing the internet I realised some people like pics, and thus decided to include some, if
any, in my blog. This is neither particularly convincing nor cunning however, as I’ve not got any
other ideas on increasing the instant-gratification factor of this page, it’ll have to do. I’m a shallow
guy, yes, yes I’ve heard it all before.


I feel I might be coming off a bit strongly here, and I don’t want you to get the wrong impression.
Just because I crave attention in my writing does not mean I’m an extroverted person. I don’t
wanna be known as the attention seeking narcissist who’d do anything for recognition. To
tell the truth, I’m not that person, I just occasionally exhibit some of his characteristics.
You know, in non-writing based endeavours I’m really quite modest. Incredibly modest. Oh,
how you wish you were as modest as me, ‘cause I’m the best at being modest!! But I digress.
I’m simply asking you not to judge me too harshly based solely on this passage (though I get the
feeling it’s a bit late for that). Goddammit, you see even now, I’m asking for your approval! I’ve
gotta stop this, it’ll drive me mad! I really need to get over my reliance on you, my readers.
Make me stop, please.


You might have noticed that I have diverged somewhat from the original topic. As you were led to
understand, this entire passage is meant to be about falling reader numbers. However, I almost
never reveal the true topic of my writings up front. Well, that’s a complete lie, I often do. But I’m
gonna do something different today. I shall change topic half way through (shock and horror!). I’ll
give you a moment to absorb this incredibly unconventional and somewhat risky move. Are
you over it yet? Good.


Up until now, bees (yes, bees - you didn’t think I was serious about the topic change, did you?) have
never really directly played an important part in my life. At least I thought they didn’t. I’m now
gonna tell you why bees (you still think I might be joking, don’t you?) actually do quite a lot to
let us humans live. Well, I say a lot, it’s more like one general thing, and they don’t exactly go to,
you know, any extra effort or anything (as it’s instinctive), but it’s still pretty important…


Down in the vast farmlands (or up, depending on your geographical location), farmers could
never even hope to make a living were it not for bees. In America alone (this is probably
gonna shock you as much as it did me) bees pollinate $19 billion worth of crops annually. I’ll
run that by you again. $19 billion. Every third mouthful of food you eat you owe to a bee that flew
around his entire life pollinating his fuzzy yellow arse off.


And that’s not all. You might not think it but bees, from those nasty scorpion things in the
desert to the smartest dolphins in the ocean, have the most sophisticated communication
you will ever find (aside from human language, of course). Also, whilst dolphins and scorpions have
never been understood too well, scientists believe they have a grasp on Bee. If, for example, a bee is
gonna go out flower hunting, it’ll do a funky ‘waggle dance’ to tell all its friends where it’s going, and 
make sure they know how long it’ll be out. That’s another thing they’re surprisingly good at; like
you and me, bees have a sense of time (uncommon in nature apparently). The sting might make you
cry, but you have to admit that bees are pretty incredible. As are the people who study them…


Never before Karl von Frisch had a Nobel Prize in animal study been awarded, and unless someone’s
gonna do something as cool as learning how bees talk to each other (what he did) pretty soon, I’d
say that record’s secure. There are many more facts about bees I could bore you with, but I must say
goodbye soon, as I think I’ve pushed my luck with word limits far enough for now. I dare say I’ve
never rambled for this long about such twaddle in my life. But bear with me just a bit longer, I’m
gonna try to wrap this drivel up as best I can.


Tell a man there’s a hundred billion stars in the cosmos and he’ll believe you. Tell him that his plate’s
a bit hot and he’ll have to touch it to check. It’s an ego thing. The earlier topic change was a bit of a
lie. I was only trying to distract you; I had no real intentions of changing the topic. For those of you, 
and I’m sure there are some, who have caught on to what I’ve done, I hope you appreciate it. But I
hurt to think that some might not notice. So if  you haven’t, and you’re currently rather confused,
you might want to take a closer look at the first word of every line… It’s an ego thing.

Wednesday, 22 June 2011

And another thing.... (sort of)


Functionality, style, and magnitude of instilled awe and wonder. These are the three qualities which I have, if I’m quite honest, somewhat randomly chosen to use in judging the awesomeness of the things that I write about. So far I have written about a thing that possesses the first two qualities, but lacks heavily in the third (for it does not double as a rocket launcher or anything), and a thing that is strong in all three areas (as it is basically full-scale, live Battleships). I thought today that I’d mix things up a little by attempting to find something that would not qualify in any of the categories; something that has no useful purpose, something that has no grace or flair and something that does not shock or amaze in any way. Essentially I am looking for something that no one in their right mind would ever conceive of; something with no point at all.

The name Lindsay Lohan immediately springs to mind, but that’s a little bit unfair – she did briefly provide mild amusement for the useless-white-trash-leeches of society who contribute nothing and spend their entire existences following the escapades of other, richer, useless non-contributors. On second thoughts, perhaps my hasty criticism of this broken actress was slightly uncalled for – she did use her fame to help the Red Cross during the Haiti disaster aftermath, though frankly I don’t see what use someone whose house has just been decimated can have for the former child-star of The Parent Trap.

Using the above reasoning I can discount any and all celebrities, famous people and indeed famous things from my search for a completely pointless thing; they all serve some purpose, even if it is only to be famous. Extrapolating this notion, I can see that it is going to be pretty tough finding something without any point at all: anything that can be named can be said to serve the fundamental purpose of being itself (for example a square qualifies, beyond anything else, as a square. Even if all its other functions are stripped away it still has that).

Ignoring the quite possible logical fallacy above, I’m betting that even were some philosopher able to come up with a loophole in the above statement and find a thing with no point, no purpose, no use or function, some spiteful bastard would argue that this thing’s purpose is then to be pointless; intended as some sort of exception to the rule (the fact that I’d probably be that spiteful bastard is irrelevant).

It seems that looking for something with absolutely no intended purpose is like trying to lick your own elbows; you can try for hours on end but no matter how much stretching is done beforehand your efforts will be fruitless (I’m not entirely sure how the stretching fits in to my metaphor, but I don’t really have much to work with here…).

This all makes sense, really. In evolutionary terms, we can only inherit those traits which our ancestors possessed. The urge to waste valuable and limited time on a thing that provides no advantage or gain, or even change, in any way is not exactly promising for a species’ progress. Pointlessness was bred out of us long ago (if we ever had it at all).

That said, recent ‘natural selection’ has favoured the brain-dead rugby player over the rational and coherent. Fortunately, humanity has not yet regressed to the stage where utterly useless things are conceivable, but perhaps one day we will, and then I’ll have a pointless thing to write about. For now, though, everything has a purpose, no matter how trivial or silly or rugby-affiliated that purpose may seem.