22 January 2012

Physica website testing week 1

The website is finished (sort of Scalar module isn't done yet), all that is left to do is testing. I have received all the Physica test cases and as of Monday I have begun testing the website. Unfortunately some of the test cases are 6 years old so they may need to be updated and isn't exactly helpful.
On the plus side I will be able to test any silly mistakes I have made whilst making the website. Silly mistakes I have made so far and have corrected:
  1. In the Geometry module, gravity couldn't be set below zero.
  2. Also in Geometry module gravity Z wouldn't display
  3. In the Monitor module OUTPUT_INTERVAL was misnamed
  4. In Generic module the code doesn't include "TRANSIENT_RUN"
  5. Also in Generic module>transient>Delta_t>Cfl_Based CFL_LIMIT misnamed
  6. under Generic module>Transient END_TIME default is 1.0E+20
  7. In Inform Option New doesn't reset everything. Also need to add a confirm button for option New
  8. Material properties module doesn't display the code after refresh
  9. not put a confirm new button on inform page
  10. not put in the extra JavaScript needed to display content when clicked on
  11. put an option for FALSE_TIMESTEP and UNDER_RELAXATION to use
Some mistakes that need further investigation:
  1. In Free Surface module>SOLVE_FREESURF CONVECTION_METHOD is missing, one of the options is VAN_LEER
  2. under Free surface module>Level_set_method LSM_WIDTH not found when running Physica
  3. test cases>apps>fill04 run-time error M6201:MATH
Note to self
  1. in the test cases under apps fill01, fill02, fill03, fill04 removed the extension ".gz". gz extension is a file compression
  2. fill04 Inform file solidification module a lot of the code can be set in material properties module
  3. mesh builder page has been updated to included everything, does need checking though
  4. Generic module USER_INTERVAL_SAVE produces images if you have the plotpar file, if not use USER_MODULE
  5. have to put Geometry file first for some reason otherwise it produces errors

8 December 2011

OR careers, MSc project, Discrete Event Simulation

Apologies first. I have not been blogging in a long time mainly because I was caught up doing my MSc project website in which there is a heck of a lot of modules to go through and then check to make sure they display correctly. At the moment I have made all 27 modules of the website, now all I need to is sort out display, repeating JavaScript and the most labour-some task Testing. Or as I like to call it "Testing to destruction". The idea of making it fail is more harsh but sounds more fun.

Okay apologies done. On the 16th November 2011, it was a Wednesday (by the way) I attended a Operational Research Careers Open day. This was in Birmingham and started at 10:00 and went on to 15:30. There were a lot of stalls there so to name as many as I can: After browsing the stalls they had a lot of talks from a lot of different companies on what exactly they do. There was talks from Martin Slaughter from Hartley McMaster Ltd on what they did with Vodafone. It was on opening hours and rotas for staff i.e. whether to open on a Sunday or not? Also a talk from Mike Nicholson from IBM UK talking about a case study they did. Next up was GORS or Government OR Services. They talked about how the work is very varied, job security and an amazing pension (better than the average). Then Andrew Long from British Airways Where he talked about the code on an airway ticket and all the different sections which is put together to form British Airways. Then there was a Company I never heard of before that day Tata Steel I presume this is for engineers who describe themselves as mathematicians but I could be wrong. And the very last talk of the day was Tom Hibbert from Tesco who talks about the different problems Tesco faces like perishable good, how much to order etc.

The Careers day was very informative the only problem was travel costs for me to get there by 10.00 i had to pay £70 roughly and to get home i got the cheapest ticket which was around £18 pounds mark. If however they moved the starting time to nearly 12.00 then my forward journey would only cost £18 roughly. Thats the only thing that annoyed me, apart from that well done the OR Society.

For an assessment centre I have to study up on one of four Operational Research Topics namely "System Dynamics", "Discrete Event Simulation", "Bayes net or other decision tree type approach", "Multi- criteria Decision Analysis (or a specific technique from within this group of techniques)".

Having looked at the wiki pages of these I found out Discrete Event Simulation looks mainly like Queueing theory. So I have to brush up on this, luckily I did actually do this in my BSc whilst at Greenwich University with my favourite lecturer Professor Vitaly Strusevich. I have a lot of man love for this guy, a person who actually got me into OR and got me to join the OR society.

UPDATE 13th December
Some links I forgot about. Whilst at the career fair the first talk was from the chairman of the OR Society and he mentioned some projects he was working on they were Green Logistics and ITIS Holding.

10 October 2011

Job hunting-feel out this questionaire...

If your in my position (finished university)you will be now job hunting. Depending on what sites you go to, instead of wanting your CV, they want to ask you questions about certain criteria's that they will be judging you on. These questions will be different on every website you do, but the type of questions will be near enough the same. Instead of typing out your answer on every site you go to, I would recommend you make a document which has these type of questions on there, so when you go to a website which asks a question you have previously answered, you can copy and paste your answer and then tweak it to fit what that website requires of you.

Here is some questions to get you thinking about:
  1. Describe a situation when you identified a new way of doing something, which affected other people. How did you convince the others that it was the right thing to do?
  2. Describe a recent situation when you have had to overcome a challenge. What difficulties did you face and how did you resolve these?
  3. Describe a situation which demonstrates how you applied your analytical skills to solve a problem
  4. Describe a time when you have worked within a team. What attributes did you bring to the team? What did you learn about your own behavior in this situation and how would you change your behavior in a similar situation in the future?
  5. What are your spare time interests? Please explain why these are important to you and include any areas of responsibility

Specific questions

Why have you chosen to join <insert company name>? What has influenced your choice of business area and what particularly interests you in the <insert company scheme>?

Modelling/problem question

  1. Quantitative Analysis This Refers to a situation where the analytical questions have been established and you need to produce a concrete and quantified solution using numerical analysis and /or modelling. Please describe:
    1. Your role
    2. Any analytical techniques you used and how you used them.
    3. How you used available data or produced it.
    4. How you assessed the accuracy and usefulness of your results
  2. Drive for results It is important that OR analysts plan their work clearly and can respond to clients requests within deadlines, being proactive and using initiative when problems arise. Please describe:
    1. Your role in the project;
    2. Your objective and the steps you took to plan and monitor the project;
    3. How you dealt with challenges, both foreseen and unexpected.

You may not get these exact question, but it will be along the same lines as these. If you are job hunting good luck out there, and be careful of spam website and spam job posting.

7 September 2011

php open, write and download a file

I have spend today and yesterday trying to make html write into a file and then download that file. The first objective was to open a file.

<?php
$filename="LinkTestText.txt";
$file=fopen($filename,'w+');
?>

Seems straight forward but i got an error

fopen(LinkTestText.txt) [function.fopen]: failed to open stream: Permission denied.

Okay okay calm down all I have to do is change permission of the file. <long time doing a google search> (many frustrating clicking and shouting at the computer (glad it doesn't have emotions)). On all <exaggeration> the forums no one mentioned a php function called "chmod"!!! Why this is what i'm looking for, okay so lets code it.

<?php
$filename="LinkTestText.txt";
chmod($filename, 0777);
$file=fopen($filename,'w+');
?>

Error appears:

chmod(): Operation not permitted in /file/path/to/that/ruddy/file.php

Rubbish, lets look on php.net to see if they have an answer <Quick look> ooh they have an answer. What one person says is use File Transfer Protocol (ftp) to change the permission, Huzzah an answer finally.

<?php
$filename="LinkTestText.txt";
$row['username']="Joe Bloggs";
$row['password']="passw0rd";
$ftp_details['ftp_user_name'] = $row['username'];
$ftp_details['ftp_user_pass'] = $row['password'];
$ftp_details['ftp_root'] = '/file/path/to/that/ruddy/';
//website address
$ftp_details['ftp_server'] = '10.0.1.200';
function chmod_11oo10($path, $mod, $ftp_details){
// extract ftp details (array keys as variable names)
extract ($ftp_details);
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// try to chmod $path directory
if (ftp_site($conn_id, 'CHMOD '.$mod.' '.$ftp_root.$path) !== false){
$success=TRUE;
}
else {
$success=FALSE;
}
// close the connection
ftp_close($conn_id);
return $success;
}
chmod_11oo10($filename, "0777", $ftp_details);
$file=fopen($filename,'w+');
fwrite($file,"Writing a lovely string to a file");
fclose($file);
$file=fopen($filename,'w+');
?>

Good so all we need to do now is activate ftp and then work out a way to force a download. Here is a link i found earlier

<?php
//http://php.net/manual/en/function.readfile.php
header('Content-Description: File Transfer');
header('Content-Type: application/download');
//it will be called
header('Content-Disposition: attachment; filename="Link test test.txt"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($filename));
ob_clean();
flush();
readfile($filename);
exit;
?>

Done. One last thing the whole of it HAS to appear before "any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.". The only thing that is missing is why i put 0777 as the permission, to be honest i have no idea, just saw the number keep on popping up on a couple of forums.

1 September 2011

Film reviews rankings (no maths here)

I manage to see a film in the cinema nearly every Tuesday, so i do see a lot of film. When I rank film, i normally base it on how much i want someone to see the film in the full cinema experience, this is normally confusing as some bad films get high reviews because they look incredible.

So I have come up with a different system, this is based on DVD collection:
  1. Absolutely rubbish film, if it comes on the TV, change the channel.
  2. Don't waste your money on buying the DVD, Just watch it on the TV.
  3. I don't think you should own the DVD, so just rent it.
  4. The film is lacking something, but the DVD is still worth owning.
  5. Watch in the cinema and definitely buy the DVD.
Unfortunately I do own at least one film that belongs to each of the different ranks. <sigh>

3 August 2011

Backing Samuel Hansen Relatively Prime


Right im backing it mainly because of his twitter updates which were summed up on Peter Rowletts blog. Some of them sound interesting
Wondering if you can musically represent a function? Support Relatively Prime and I will have the chance to answer
If you want to hear maths (or math if your from certain parts of the world) stories that aren't well known but deeply fascinating, go on and support Relatively Prime. Heres a video to wet your appetite.

1 August 2011

MSc Project website

I did originally set the website up as being just one big huge html file. It became too big especially when i started doing Material Properties Module (at the moment Material Properties Modules is still very big and is a bit slow on loading). This also meant it was slow as well. Now being a student (still) I get to have some free webspace and hosting, I know amazing. So all my pages i've done so far are up on the website. Just to let you know don't click on any links between and including 'General Equation Module' and 'User Module' you will get a error message saying page not found. Any suggestion to improve the site please leave a comment.