Javascript Archive

PHP Laravel - emptying database during seeding with foreign key constraints

It was little over a decade ago when I first began my developing career in some of the most basic of web-based projects. Back in those days, I was primarily based in web-development for a variety of projects including DW4N and a range of forums. In this challenge, PHP was my primary language of use,

How to use sockets to send data from a C# application to a server/webpage

Continuing the current them of working with NodeJS and sockets before I go on holiday for a couple of weeks, this post is going to look at how we can send data from a C# application to a server/webpage using Javascript and NodeJS. Previously in this theme we've looked at using NodeJS and Socket.IO to

Using sockets to communicate between Javascript and C# with NodeJS

Previously, we looked at how to create a simple chat application between two web clients using NodeJS and sockets. Those that know me however, know that web development is not my preferred role anymore (not since the days of DW4N, MP101 and my pet project Lobo Malo anyway), so the work in Javascript and NodeJS

Simple chat application with NodeJS and Socket.IO

This week has been about playing with sockets for some data communication between C# and Javascript. While getting to grips with the basics of the socket libraries, I created a simple chat application to run on my local machine. It served well as a basic introduction to sockets and the NodeJS package, so I thought

NodeJS - how to install Socket.IO

This week my focus at work has shifted slightly away from Grasshopper and back into the world of web development, server communications and associated tasks. For part of my work, I created some test files to play about with sockets in Javascript (the bigger picture is to use sockets to communicate between some C# code

Obtaining the angle between two vectors for 360 degrees

This previous post demonstrated how to obtain the angle between two vectors from three geometric points, providing an angle between 0-180 degrees. However, there may be times when you need the angle between 0-360 degrees instead, as I did earlier this week. As such, this post aims to complete the previous with the solution for

Calculating angle between two vectors from geometric points - code solution

Calculating the angle between two vectors is a fairly easy solution to find online - there are plenty of maths help websites which will take you through step by step how to work out the angle, however, not many sites will provide you with the necessary programming code to put this into your software. As

For loops - running method calls in the declaration

For loops are a key part of recursive code, allowing us to iterate over items in a vector, or perform actions a set number of times without repeating the lines of code. We all know how they can be applied and declared, however, something which may not be very well-known is the ability to call

HTML include - object orientated development in HTML

Hyper Text Mark-up Language (HTML) is the backbone of the internet and has evolved since its early days in the 1990's as a mark-up language for text. Currently, we are in a state of HTML5 which has brought with it many new features to make our webpages more interesting and interactive, such as the canvas