Sharing Videos With Dropbox

Recently I had the need to share a video with someone who wasn’t on Facebook. Normally this wouldn’t be a problem and I would just use WhatsApp to send them the video. However because the video had been edited it was on my computer and getting it to my phone would take precious time.

The simple alternative is… www.dropbox.com

It’s easy to create an account and a great way to store and share things. To share the video I simply created a new folder by logging into my account and navigating to the following button (highlighted in yellow): 

dropboxnewfolder

Then I named the folder something appropriate and navigated inside it by double clicking it in the folder view you should be presented with after logging in. Dropbox supports the dragging and dropping of files so I simply dragged the file from my desktop and dropped it into the empty folder on Dropbox. Then to share you simply need to right click the file in the Dropbox folder and select share link, shown below..

dropboxsharelink

Then copy and paste the link given and give to anyone you dare to share the video with! Hope you enjoyed.

Tagged , ,

Pythagoras’ Theorem In APL

Below is Pythagoras’ theorem interpreted into APL. To the left of the function simply enter a 2 element numeric vector for example 3 4 and to the right enter a scalar for example 10.

Pythagoras Theorum APL

A result of 1 means the triangle is right angled, a result of zero means it is not a right angled triangle.

The left vector represents the two shortest legs of the triangle and the right scalar represents the hypotenuse. Below are a couple of examples:

Pythag proof APL

Give it a try…

Tagged , , , , , , ,

How To Fix Moodle’s Re-Direct and Access Issues

Recently I have been experimenting with Moodle and I have to say I have been impressed. However the installation was less than straight forward for me. The actual installer was very simple to follow however the bugs that proceeded were a nightmare.

The first error I came across was one which prevented me from going anywhere but my personal profile page. This is the re-direct bug. A picture of the screen displayed in chrome can be found below:

moodle_redirect_error

This error is fairly straight forward to fix however it did take some research. Anyway to amend this and access Moodle simply navigate to:

\htdocs\lib\setuplib.php

And open in a program such as notepad++. Then find this line (line 795 for me) in the text:

redirect($CFG->wwwroot, get_string(‘wwwrootmismatch’, ‘error’, $CFG->wwwroot), 3);

And replace it with this one:

redirect($CFG->wwwroot, get_string(‘wwwrootmismatch’, ‘error’, $CFG->wwwroot), 0);

This should fix the issue and you should now have a fully accessible site. SHOULD. But I didn’t… When trying to access the site from another computer (which was also inside the network) I got this error:

moodle_access_error

This error also required some hunting to find a solution but eventually a definitive one was found… Delete the moodledata folder. Please make backups and I am not liable for any damages or loss of data on your systems. This solved the problems for me.

There was one last issue that I run into however it was purely because of how I was hosting the site and how people were accessing this but just in case I will explain: after all of these solutions had been applied some people were just receiving a blank screen when punching in the IP of the hosting machine.

The solution to this is to navigate to:

\htdocs\config.php

Then open with a program such as Notepad++. Then locate the following line (line 20 for me):

$CFG->wwwroot   = ‘http://localhost';

And change it for this line where ‘*.*.*.*’ is replaced with the IP of your hosting machine:

$CFG->wwwroot   = ‘http://*.*.*.*';

I hope this resolves issues for some of you using Moodle, once it’s working it is incredibly powerful and well made however getting to that stage was a bit of a mission for me.

Tagged , , , , , , ,

The Final Day

Sorry for the belated post I was resting my brain. The final day was a learning experience however more to do with implementing the knowledge we had already learnt.

What a journey this course has been. A very challenging experience however I have obtained an incredible amount of understanding in the past 5 days. Our teacher was very knowledgeable and understanding and provided an education that can not be faulted.

Our last day consisted of the following topics:

  • Nested matrix’s and arrays and the bizarre results you sometimes obtain from them.
  • Enclosing and disclosing variables
  • Mixing and splitting variables
  • The lamination symbol and how to use it
  • Using the display function effectively
  • Checking the depth of variables

The course has been intense both in pace and content and in turn we have quickly developed a basic understanding of APL. However we have only scratched the surface in terms of using it and it’s potential. I look forward to learning more and more about this language and how it can be used.

Tagged , , , , , ,

The Fourth Day

Although every day has been interesting today held a particular interest for me. Today we were learning about traditional loops in APL such as For, Repeat Until etc… However before we learnt about these loops we were asked to perform a task seemingly only possible with loops, without any. I found the solution and compared it with a loop version I created. There was no difference. It shows that just because you know how to perform an operation you shouldn’t be narrow minded and should sometimes take a step back to look at the problem.

Anyway. Today produced the most challenging exercises. The culprit being inner and outer products. Here is what we learned today:

  • The jot symbol and how it is used and associated with the outer product.
  • The calculation and meanings of inner products.
  • Expanded on the operators we already used as well as learning new ones.
  • The use of scope with operators.
  • More on the rotation of vectors and matrix’s.
  • How to use dot products effectively.
  • Searching for character vectors in matrix’s and vectors.
  • Putting the idea of a zero populated matrix into use.
  • The unique symbol.

Although the bulleted list is not as populated as other days’ posts the theory behind the concepts that we learnt today required by far the most attention and even more time to implement them in a useful function.

Tagged , , , , , ,

The Third Day

Firstly apologies for the lack of a post summarizing yesterday’s lessons I was enjoying a delicious Chinese buffet. Without further hesitation here is again a summary of the techniques and idea that we learnt today (yesterday):

  • Membership and how it differs to finding items using a binary condition approach. 
  • The dyadic use of iota and how this compares to using membership to find items.
  • The rotational features of APL.
  • The use of AND, OR, NAND, NOR and XOR.
  • How to use comma bar and why it is so useful.
  • The idea of having empty vectors and the zero tilde symbol.
  • The symbols used to quickly operate on the first dimension of a variable.
  • We had a brief introduction to direct functions.
  • Compression using the results of binary expressions.
  • Some more formatting using binary.

That is all I can remember at the moment however as I said in an earlier post I am writing up a complete set of notes which I will publish at the end of the course and will include notes on every symbol I learn.

Also after the course I will start publishing some of the programs written during the course with explanations on how we learnt to optimize them.

Tagged , , , , , ,

Some Interesting Ideas

I am writing this post before I start my third day because having spoken to many veterans of APL I have learnt some interesting ideas:

  • The first idea being keep it simple. Bernard taught us that generally one line should have no more than 5 significant operations in it. This makes the code easier to read and maintain.
  • The concept that good APL code is 3 things; maintainable, easy to understand and clear to write.
  • Another APL programmer pitched the idea to me that APL code can be described as being elegant.
  • There are many ways to solve a problem however some are more elegant than others.
  • It is also better to have very clear spaced out code that is possibly not the most efficient as opposed to a complex one line statement that is very complex however more efficient.
  • The objective is to find the correct balance.

With all this in mind it’s time to start day 3…

Day Two

Day two of training was a steeper learning curve for everyone. Learning to interact with, identify and modify different types of variables opens a whole new bag of tricks. Again I have summarized my learning for today in bullet point form below:

  • We learnt more advanced ways of indexing matrix’s and vectors
  • We learnt the importance of the shape and rank of a variable and the peculiar fact that a scalar has no shape and a rank of 0.
  • Rank proved to be ever more important as we got into more complex variables.
  • We learnt about concatenation and the need for variables to conform to certain requirements in order to be concatenated.
  • The concept of linear mathematics and a small amount of how it is applied in APL and programming languages in general.
  • What a nested array is and why it is sometimes used, also when to use one and when not to use one.
  • The formatting in APL and how this can be used to produce presentations of concatenated arrays.
  • The reshaping of different variable types and why additional steps are necessary for some.
  • A brief history of the APL language.
  • We were tasked with writing functions to find data items and matrix’s and also to display data in an organised and presentable fashion.

That’s all I can remember for now however I did get lost in town for two hours today as well as take a chunk out of my thumb with a rather hefty knife so to say I am slightly tired and forgetful and this moment is an accurate statement. I will continue tomorrow…

Tagged , , , , , ,

First Day Of Training

Today was the first day of training. My teacher was the author of the book Mastering Dyalog APL, Mr. Bernard Legrand. Below is a list of all of the concepts and ideas that I learnt today. I am not aiming to explain any of the actual programming however I will be releasing a detailed write up of the programming and code towards the end of the week when the course finishes. Today I learnt:

• Basic operations such as multiplication and division along with the specialist symbols they use in APL.
• The assignment of variables and how variables may interact with each other using operands.
• Performing simple operations on sets of data.
• How to create a list or matrix and the differences between different types of variables.
• The use of the reshape feature and its purpose in the language.
• How to declare and manipulate multi-dimensional arrays.
• The meaning of shape and rank.
• The standard indexing of an array and vectors.
• The creation of dynamic and traditional functions and passing parameters to them.

Each of these bullet point have intricate implementations and purposes and learning them and when to use them was very insightful however we have only just scratched the surface of their full potential.

More to follow tomorrow…

Tagged , , , ,

The Start Of An Adventure

Tomorrow I start a week long course to enhance my programming skills ahead of an apprenticeship.

This marks the start of my adventure into the world of APL programming and full time employment.

Though daunting I am looking forward to learning from professionals and enjoying a new area of computing.

More posts to follow…

Follow

Get every new post delivered to your Inbox.