This article is about the assetpack that can be found here:

This assetpack has been built in Unity2019.3. Since the 2019.x version Unity has a new approach on prefabs. Prefabs can be nested, which has great advantages. However, projects that use nested prefabs can not be imported into older versions of Unity. That is … it needs some work to get it working.

If you follow the guide below, it will take you about 30 minutes to have the Steamboat assetpack work in Unity 2018.4.

  1. To get the assetpack from the Unity Store, create a new 2019.x project and import.
  2. Once imported, rightclick the “steamboat” fodler in the projectview and select “export package”.
  3. In the “exporting package” window, make sure everything is selected and click “Export…”
  4. Choose a name and location for the export and click save.
  5. Now close the Unity project and open or create a Unity 2018.4x project.
  6. In this 2018.4x project, in the project view, rightclick the assets folder and select “Import Package”>”Custom Package”.
  7. Select the package you have just saved.
  8. In the “Import Package” window, make sure everything is selected, and click “Import”.
  9. When the import is ready, in your projectview, go to “Assets>Steamboat>Demoscene”. Open the scene called “Steamboat Demo Scene”.

10. In your hierarchy view, select “Steamboat”. You will see that in the scenewindow no meshes are shown. The only thing you see are collider outlines:

You will need to attach all meshes to the prefabs. This is a bit tedious, but luckilly it doesn’t take too much of our time. The principle of all prefabs/meshes is the same. However, I will describe all of them for your convenience. Let’s start.

11. In the hierarchy view unfold Steamboat. Next unfold “doors”. Shift select the doors as in the image below:

Now, in the inspector notice that the mesh is missing:

Click on the little circle to the right:

In the “Select Mesh” window, enter “door” in the searchfield. Next doubleclick “Door_u”

The doors have now been added:

We’ll continue this approach to get all meshes in place.

12. Unfold “Door II” , select “Door (6)”. In the inspector, click the little circle right tot the missing mesh again. Search for Door again, and doubleclick “Door_u”

13. Repeat this for “Door II (1)” And the separate “Door (6)”.

14. Open the “Stairs Railing” folder. Select “Railing_Stairs”:

In the inspector, click the little circle right to the missing mesh (from now on I will simply write “select the mesh”. In the inspector, select the mesh called “Railing_Stairs_u”.

15. In the hierarchy, select “Stairs_Front”. In the inspector, select the mesh called “Stairs_Front_u”

16. In the hierarchy, open the folder “Railing”. Shift select all “Railing_Mains”. In the inspector, select the mesh called “Railing_Main_u”.

17. In the hierarchy, shift select all “Railing_Floor3_Stairs_Inside”. In the inspector, select the mesh called “Railing_Floor3_Stairs_inside_u”.

18.In the hierarchy, shift select “Railing_Construct”. In the inspector, select the mesh called “Railing_Construct_u”. From now on I will write this as:

“Railing_Construct” –> “Railing_Construct_u”

19. “Railing_Construct_RINGS” –> “Railing_Construct_Rings_u”

20. “Stairs_Small_Right” –> “Stairs_Small_Right_u”. (note there are three of them)

21. “Holder” –> “Holder_u”

22. “Wheel” –>”Wheel_u”

23. “Bottom” –> “Bottom_u”

“Floor3_part1” –> “Floor_3_part_1_u”
“Floor3_part2” –> “Floor_3_part_2_u”
“Floor3_part3” –> “Floor_3_part_3_u”

“Cabin_part1” –> “Cabin_part1_u”
“Cabin_part2” –> “Cabin_part2_u”
“Cabin_part3” –> “Cabin_part3_u”
“Cabin_part4” –> “Cabin_part4_u”

“Floor_2_part_1” –> “Floor_2_part_1_u”
“Floor_2_part_2” –> “Floor_2_part_2_u”
“Floor_2_part_3” –> “Floor_2_part_3_u”

“Floor_1_part_1” –> “Floor_1_1_u”
“Floor_1_part_2” –> “Floor_1_2_u”
“Floor_1_part_3” –> “Floor_1_3_u”

28. Select all shutters.
“Shutter” –> “Shutter_u”

29. “Chimney_Small” –> “Chimney_Small_u”

30. “Chimney_Large” –> “Chimney_Large_u”

31. “Mast_Front” –> “Mast_front_u”

32. “Mast_Back” –> “Mast_back_u”

33. “Gangboard” –> “Gangboard”

The result so far:

Now we are almost there! Some of the prefabs have a mesh colliders, which we’ll need to point tot the right mesh.

The mesh collider can be found in the inspector view.

The following prefabs need a mesh collider (prefab in hierarchy view –> mesh in Meshcollider in inspector):

Railing_Stairs –> Railing_Stairs_u
Stairs_Front –> Stairs_Front_u

Railing_Construct –> Railing_Construct_u
Stairs_Small_Right –> Stairs_Small_Right_u
Bottom –> Bottom_u

Floor3_part1 –> Floor_3_part_1_u
Floor3_part2 –> Floor_3_part_2_u
Floor3_part3 –> Floor_3_part_3_u

Cabin_part2 –> Cabin_part2_u

Floor_2_part_1 –>Floor_2_part_1_u
Floor_2_part_2 –>Floor_2_part_2_u
Floor_2_part_3 –>Floor_2_part_3_u

Floor_1_part_1 –> Floor_1_1_u
Floor_1_part_2 –> Floor_1_2_u
Floor_1_part_3 –> Floor_1_3_u

That’s it, have fun!

When navigating the mouse over the screen you only change two coordinates. A mouse cursor lives in a 2D world. In this article I will explain how you can get the position of a mouse click in a 3D world.

First, lets create a new Unity project. Name it as you like. Once the project is created, add a plane. scale the plane up. Next, ad some cubes and spheres.

Your scene should look something like below (does not need to be exactly the same, just add the plane, some cubes and spheres).

Next, Create a new material. Make it red. Also, ad another small sphere to your scene, drag the material to it so that you have a red sphere. Reset the sphere’s position (all 0). Now drag the sphere from the hierarchy to your assets folder. This will create a prefab from the red sphere. Rename the prefab to “RedSphere”, and delete it from your scene. We will use this red sphere to indicate where the mouse click appeared.

We want the game window to show the same as the designer window. For that purpose, make sure the designer/scene window shows all cubes and spheres. Select the camera, go to the menu [Game Objects]>[Align with view] to align the camera.

Now we need to make a script. This script will handle the mouse click. The script has to be attached to a gameobject in order to be activated in the screen. We will attach it to the camera. Create a new script, call it “ClickLocation” and add it to the camera.

Open the script.

To determine the click position of the mouse we will use ray casting. We will send a ray from the position of the camera to the position of the mouse. At the place where the ray collides with any object, that is where the mouse click is positioned.

To make this more visual, we will instantiate the red sphere prefab at the position of the mouse click. For this we’ll need a reference to the prefab in the script.

At the top of the script, make a serializable field of the type GameObject, with the name “redSphere”:

Save the script and return to the editor. The new field should now appear in the inspector:

Now drag the RedSphere Prefab to the Red Sphere field, or click the little circle at the right of this field and select the RedSphere from the list:

Now go back to your script. We will put the logic in the update method. This is what we will do:

1. Check if the mousebutton is released (we want the position of the mouse cursor when you release the left button);
2. If so, create a ray from the camera to the mouse position;
3. Cast this ray ( “fire the laser”). If it hits something, return the position where this hit occurred;
4. Instantiate a red sphere at the hit position.

Use the following code to accomplish this:

Save your script and run the game. When you click and release your button, a red sphere will be placed in 3D space!

This is a very basic tutorial that shows how to bake a normal map from a mesh that has a Multiresolution Modifier applied to it. Screenshots are from Blender 2.81.

Start Blender, start a new general file. Remove the default cube and add a plane.

Go to the modifier properties en click on “Add Modifier”.

Select the Multiresolution Modifier

Select “Simple” and click 6 times on “Subdivide”. “Preview” should now have a value of 6.

Go to sculpting mode (top menu) and left click a few times on the plane to create some geometry.

Add a new material to the plane. Name it anything you like.

Go to UV Editing. By default your plane should have a square UV map. If you have a different mesh, make sure you have a workable UV-map.

Click the shading top menu to open the shading window. Add the following:

– Texture Coordinate (Add>Input>Texture Coordinate)

– Image Texture (Add > Texture > Image Texture)

Connect UV to Vector as in the image below.

In the Image Texture, click “New”. Change the name “untitled” to something you like (e.g. NormalMap).

Click “OK”.

Next, in the Render Properties, set the Render Engine to Cycles. Set the render value to 512. Lower is possible, but you’ll get a better normal map when setting this higher.

Still in the Render Properties, open the “Bake” Settings. Check “Bake from Mutires”, and set the Bake Type to “Normals”

Press “Bake”

Still in the shading window, at the left side select your image (you probably have to resize the window). Note that in the example below “Normal_Map” is the name I gave to the new image texture. Here is your brand new normal map!

In this same image editor window, click the hamburger button, select image and “save as”. Save your normal map to a location of your choice.

For the sake of simplicity in this tutorial you will just delete the multires modifier. Normally you will keep it and make a copy of your mesh, remove the modifier from that copy – or lower the subdivisions – and continue working on the copy.

Go to the Modifier Properties and remove the modifier.

Your plane will now look like …. a plane again.

Go to the shading tab. In the image texture, set color-space to none-color. Als add a normal-map (Add>Vector>Normal Map). Connect Color to Color, Normal to Normal, as in the image below.

Now, to check if this is really working, set the Render Engine to Eevee.

Click on the light in your scene, and change it to a sun. Move the light to x=0, y=0, z=0.4. set the rotation to x = 125, y=-20, z=260. These are just some values that worked for me.

Go to the layout window and set the viewport shading to rendered.

Now select the light, hit the R key and slightly rotate the light to see the Normal Map doing its magical work!

Final Note. In this case we completely removed the Multires Modifier. Normally you would not do that, you would decrease the subdivision count to one where the polycount is acceptable.

In Blender, Shift-select the animated object ans its armature. So both are selected.

Go to File->Export, select FBX.

Next, browse to the folder where you want to export to, and enter an appropriate name.

Make sure to set the following configuration:

1. Check “Selected Objects”

2. At the right bottom, open the “Armature” settings and check “Only Deform Bones”, uncheck “Add Leaf Bones”

3. At the right top shift-select “Armature” and “Mesh”

Click “Export FBX”.

In Unity, Create a new folder under “Assets”. Give it an appropriate name (“Animations” in this example).

Now drag and drop your exported FBX file into this folder.

Done. From here on, you can setup and use the animation in Unity.

This is a short post. It is short because it presents a very simple solution. However, it is a solution to a problem that took me two days to solve.

As I do not want you to lose the same time as I did, I will describe the problem in a few sentences. I will state the keywords below, just to make sure you find this post if you have the same problem … I couldn’t find the solution myself in any forum, I found out by having some luck πŸ™‚ And it is so simple….

The problem:

When you use multiple meshes that are connected to each other, e.g. for modulair walls, or if you use multiple point lights, you might end up with an annoying effect: not all meshes get the same amount of light. The image below demonstrates this. It is a screenshot from a scene in Unity, presenting two identical walls, with two identical lights. There is not any other light source in the scene. Take a look at the difference in lighting:

Different light effect on identical meshes

A more real-world example can be seen in the image below:

Different light effect on identical meshes #2

The walls are simple quads, with the same (seamless) texture applied to it. The scene has multiple lights.

How to solve this? It is very simple! Simply go to the lights that shine or should shine on the wall or that should somehow affect your wall. Next, in the inspector set the Render mode to Important.

That’s it! Check the image below:

Lighting fixed by setting the light sources render mode to important

Problem Solved! … took me two days experimenting with textures, different meshes, shading, smoothness … the solution was build into Unity all the time πŸ™‚

Keywords: Unity 3D Light, Bug, Light Error, same light different effect, light interference, light shows seams, light shines differently on multiple objects.

Do you like the scene with the tables? You can get it here:

This guide assumes you have already successfully installed LAMPP.

Step 1 – install symfony

sudo wget -O - | bash

Step 2 – move the installed files to make the installation global on your system:

mv /home/[your home folder]/.symfony/bin/symfony /usr/local/bin/symfony

Step 3 – check if it works. Enter:


Step 4 – Check if your system meets all requirements. Type:

symfony check:requirements

Step 5 – If you have a fresh install of LAMPP, you will need to install the SimpleXML extension. To do that, enter:

 sudo apt-get install php-xml

Step 6 – After that, restart the LAMPP services:

sudo ./lampp restart

Step 7 – final step. Check again:

symfony check:requirements

If needed, you can install the mbstring and intl extensions with the following commands:

sudo apt-get install php-mbstring
sudo apt-get install php-intl

To get PDO drivers for mySQL, type:

sudo apt-get install php-mysql

That’s it, you should be good to go now.

Normally your development environment has no connection tot the live environment … well, it shouldn’t have. You develop in a development environment.

When using migrations in a code first approach, you will probably not be able to update the database on the production server (or staging server).

Luckily there is a simple way to get your database changes in a staging / production environment, simply by generating SQL scripts.

To generate a full script, in case you need to generate the database starting from zero, in Visual Studio’s Package Manager Console, enter:

update-database -script -SourceMigration:0

This will generate a SQL-script for all migrations.

Once the database is in production, after you have made changes, you can generate a change scripts of a single migration using:

update-database -script -SourceMigration:[name of the migration]

When entering the name of the migration, you do not need to enter the datestamp-portion of the name.

To generate change scripts of multiple migrations (in sequential order), enter:

update-database -script -SourceMigration:[name of the migration] -TargetMigration:[name of the migration]

Once you have the scripts you can test them and after that run them on your production database.

This post describes the very basic actions needed to setup a code first approach with Entity Framework (EF) and MySQL Database. For the sake of simplicity a console app is used. The purpose of this post is not to explain Entity Framework or Code First, it is just a getting started guide.

Open Visual Studio and create a new console application:

In Visual Studio, go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution…

Select “browse” and enter “Entity Framework MySQL” in the search box.

Select “MySQL.Data.Entityframework”

At the right side, check “Project” and click install.

Next, open the App.config file. Add a section directly below the <startup> section:

<add name="DefaultConnection" providerName="MySql.Data.MySqlClient" connectionString="server=[your mySql server address];User Id=[db user]; Persist Security Info=True;database=[database name];password=[your password]" />

In the entityFramework section delete all providers that do not have invariantname=”MySql.Data.MySqlClient”. There should be only one provider.

Your App.config file should resemble this (with your own server, db,name and credentials):

Next, you will need to write a table class and the DBContext class. To keep things simple we will place this class in program.cs.

Open program.cs, add references to system.Data.Entity and MySQL.Data.EntityFramework. On top of the code:

using System.Data.Entity;
using MySql.Data.EntityFramework;

Now add an Author Class , directly under the opening { of the namespace:

public class Author
public int Id { get; set; }
public string Name { get; set; }

This simple class will represent the Authors table in the database. As this is a code first approach, this table does not yet exist!

Following thing to do is to add a DBContext class. Write this directly below the Author class:

public class MyDbContext : DbContext
    public DbSet<Author> Authors { get; set; }
    // Constructor - set name of connection
    public MyDbContext() : base("name=DefaultConnection")

Three things to note here:

  • The attribute DbConfigurationType. Needed by Entity Framework to know it is a MySQL Database to talk to
  • The public DBSet. This tells Entity Framework there will be a table called Authors, of which the model is the class Author.
  • The (empty) constructor, needed to point to the right connection in App.config.

Next, open the Package Manager Console (Tools>NuGet Package Manager>Package Manager Console)

You will need to tell your project that you will use migrations. This is a one time action. In the Package Manager Console, type: enable-migrations.

If everything is ok, you will get the following message:

If you get errors, check the connection string.

Last step is to generate the Authors table in the database. To do this, first make a migration, after that update the database.

Again, in the package Manager Console, type add-migration [name for the migration]:

The result:

Finally, update the database:


Done! We have used the Code First approach in Entity Framework to generate a table in a MySQL database.

On class level declare the following vars in your Activity:

private int mYear;
private int mMonth;
private int mDay;
private int mHour;
private int mMinute;
private Calendar c;
private Context ctx = this;

In the OnCreate, initialize them:

mYear= Calendar.getInstance().get(Calendar.YEAR);
mDay=Calendar.getInstance().get(Calendar.DAY_OF_MONTH) ;
mHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY) ;
mMinute = Calendar.getInstance().get(Calendar.MINUTE);

To get the Date Picker, call the following function:

private void show_Datepicker() {
  c = Calendar.getInstance();
  int mYearParam = mYear;
  int mMonthParam = mMonth-1;
  int mDayParam = mDay;

  DatePickerDialog datePickerDialog = new DatePickerDialog(ctx,
    new DatePickerDialog.OnDateSetListener() {

    public void onDateSet(DatePicker view, int year,
      int monthOfYear, int dayOfMonth) {
        mMonth = monthOfYear + 1;
    }, mYearParam, mMonthParam, mDayParam);;

This will give you the date picker pop-up.

To get a Time Picker, call the following function:

private void show_Timepicker() {

  TimePickerDialog timePickerDialog = new TimePickerDialog(ctx,
  new TimePickerDialog.OnTimeSetListener() {

  public void onTimeSet(TimePicker view, int pHour,
    int pMinute) {

      mHour = pHour;
      mMinute = pMinute;
  }, mHour, mMinute, true);;

That will give you the time picker pop-up.

When developing games for mobile devices the first challenge you will encounter is the difference in screen resolutions. You will want to use the full screen on your device, while maintaining correct aspect ratios.

There are many ways to solve this, in this blog post I will present a simple one. One that works for games that do not use views. One that does not go into depth on camera views etc.

First let’s look at what happens when you set your game to Full Screen.

Gamemaker will size the width and height of your room to match the width and height of your device.

If, for example, your device has a resolution of 1440×900 (like the Samsung Galaxy Tab A 2016), Gamemaker will stretch/shrink the width and height of your room to match this. When you want to get the screen width and height in Gamemaker, it will return the device width and height: 1440×900. This will always be the case, no matter what size your room is, and no matter how you try to retrieve is. So:

display_get_gui_width() will return 1440
) will return 900

And also:

display_get_width() will return 1440
display_get_height() will return 900

When designing your game, you will have to choose a resolution to work with. E.g. 900 x 600. To do so, make your room dimensions 900 x 600.

Now what happens? The width of the device is divided into 900 pixels, the height of the device is divided into 600 pixels. Even when your device has a completely different resolution. With our example of a device with a resolution of 1440 x 900 that means:

The width of 900 in GameMaker = 1440 in reality. So one (1) pixel in gamemaker = 1.6 pixels on your device horizontally.

The height of 600 in GameMaker = 900 in reality, so one pixel in gamemaker = 1.5 pixels on your device vertically.

If you have a sprite of a perfect square of 100×100, that square will look perfect on a device with the same (900×600) resolution. In our example device it will have the following dimensions:

width: 100×1.6 = 160
height: 100×1.5 = 150

So the prefect square wil be 160 x 150 on your device: it is no longer a perfect square, it is a rectangle.

a square will be resized to a rectangle

How to solve this?

In your code you must apply a correction factor. To find that factor, you need to know the difference between the horizontal and vertical ratios.

In our example the horizontal ratio is 1.6, the vertical is 1.5.

You will want to multiply the height of your objects in such way that the 1.5 becomes 1.6.

To get this factor, use the following formula:

designWidth = 900; (your design width and height)
designHeight = 600;

factor_height =
(display_get_width()/designWidth) /  (display_get_height()/designHeigh

So factor_height will be (1440/900) / (900/600) = 1.067

To make your square perfect again, you will need to multiply the height by 1.067. You can do this by setting the image_yscale property.

The way I do this: at the start of the game I calculate the height_factor.

Next, I make a parent object that sets the image_yscale to this factor. All objects in the game inherit from this parent object.

A new game build in GameMaker Studio 2

Square This! is both relaxing as well as challenging. There is no time pressure. You can sit back, relax, and solve the puzzles. The game has many levels. Solving a puzzle unlocks a new one. The goal is to swap tiles in a logical order. To unlock a new level the puzzle needs to be solved in a maximum number of turns. Enjoy tapping tiles, enjoy solving the puzzles, enjoy playing this game!

“Square This!” is now available on Google Play.

Get it on Google Play

Google Play and the Google Play logo are trademarks of Google LLC.

Code snippet for saving a key-value pair in gamemaker. Data is saved in the file data.dat. Works for all platforms.


mMap = ds_map_secure_load("data.dat");
if (mMap==-1){

if (!ds_map_exists(mMap, mKey)){
   // add the key-value 
   ds_map_add(mMap, mKey, mValue);
} else {
   // replace the value for the key
   ds_map_replace(mMap, mKey, mValue);

ds_map_secure_save(mMap, "data.dat");


mValue="default value";

mMap = ds_map_secure_load("data.dat"); 
if (mMap==-1){
if (ds_map_exists(mMap, key)){ mValue=ds_map_find_value(mMap, key); } ds_map_destroy(mMap);

With this workout timer app you can make a serie/sequence of timers that are executed one after the other. Every timer has its own time and its own alarm sound. You can make unlimited sequences, and every sequence can have an unlimited amount of timers.
This app is ideal for workouts, but can also be used for other things. E.g. Yoga, Reiki, and also as a timer for homework / study, coaching sessions, and many many more.

Get it on Google Play

Google Play and the Google Play logo are trademarks of Google LLC.

Context _ctx = this;
AlertDialog.Builder mBuilder = new AlertDialog.Builder(_ctx);
mBuilder.setMessage("[The message you want to show]");
mBuilder.setPositiveButton("[Button caption for Yes]",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Do what is needed if user selects Yes
mBuilder.setNegativeButton("Button Title for No]",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// users selected No

AlertDialog mAlertDialog = mBuilder.create();;


function GetDbConnection(){ 

  $servername = "localhost"; 
  $username = "user"; 
  $password = "password"; 
  $dbname = "myDB"; 
  $conn = new mysqli($servername, $username, $password, $dbname); 
  if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
  return $conn;

function ListAllFromQuery($conn,$sql){
  $mArr = array();
  $result = $conn->query($sql);
  if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
      array_push($mArr, $row);
  return $mArr;

$conn = GetDbConnection();
$list =ListAllFromQuery($conn,"SELECT * FROM tblUser ORDER BY id;");

for($i = 0; $i < count($list); $i++) { 
  $currentUser= $list[$i]; 
  foreach($currentUser as $key => $key_value) {
    $output.= $key . " = " . $key_value;
    $output.= "<br>";
  $output.= "<hr>";


echo $output;



# Get the full HTML of an url and strip all urls in it

use strict;
use warnings;
use LWP::Simple;

# The array that will hold all found urls
my @urls = ();

# the url to scan
my $url = '';

# get the content
my $content = get $url;
die "Couldn't get $url" unless defined $content;

#convert to lowercase
$content = lc($content);

# replace all " to '
$content =~ s/\"/\'/ig;

# search for  "a href" tags and strip the urls.
while (index($content, "<a href") != -1) {

   my $i = index($content, "<a href");

   my $tmp = substr($content, $i );
   $content = substr($content, $i + 1 );

   my $t = index($tmp,">");
   if (index(substr($tmp,0, $t+1),"http") != -1){
      my $tmp2 = substr($tmp,0, $t+1);
      my $c1 = index($tmp2,"\'");
      $tmp2 = substr($tmp2,$c1+1);
      $c1 = index($tmp2,"\'");
      $tmp2 = substr($tmp2,0,$c1);
      # add the url to the array
      push @urls, $tmp2;  

# do what ever you like with the found url's. E.g. print them to your console.
    print "$_\n";

using System;
using System.Threading;
using System.Threading.Tasks;

namespace ConsoleApp1
    class Program
        static void Main(string[] args)
            Console.WriteLine("Press any key to quit.");

        // common method
        private static string GetData(string actionName)
            // Do your heavy work here. E.g. fetch data from a database.
            return string.Format("Action {0} finished. The time is {1}.", actionName, DateTime.Now.TimeOfDay);

        // WRAPPER for async methods: these will make "GetData" asynchronous.

        private static Task<string> GetDataAsync(string name){
            // wrap the GetData method in a Task:
            return Task.Run<string>(() =>
                return GetData(name);


        private async static void CallWithAsync()
            // Call the async method and wait for its result
            string result = await GetDataAsync("Custom Action Name");

Want to generate a HTML table in Javascript? This is how you do that:

<!DOCTYPE html>
 <meta charset="utf-8">
 <title>Javascript tables</title>

<h1>Javascript generated table</h1>

<table id='mTable' border='1' cellspacing='0' cellpadding='8'></table>


var tabel = document.getElementById("mTable");
var rowOne = tabel.insertRow(0);
var rowOneColumns = [];
rowOneColumns[0] = rowOne.insertCell(0);
rowOneColumns[1] = rowOne.insertCell(1);
rowOneColumns[2] = rowOne.insertCell(2);

var rowTwo = tabel.insertRow(1);
var rowTwoColumns = [];
rowTwoColumns[0] = rowTwo.insertCell(0);
rowTwoColumns[1] = rowTwo.insertCell(1);
rowTwoColumns[2] = rowTwo.insertCell(2);

rowOneColumns[0].innerHTML = "Row One, First Cell"; 
rowOneColumns[1].innerHTML = "Row One, Second Cell"; 
rowOneColumns[2].innerHTML = "Row One, Third Cell"; 
rowTwoColumns[0].innerHTML = "Row Two, First Cell"; 
rowTwoColumns[1].innerHTML = "Row Two, Second Cell"; 
rowTwoColumns[2].innerHTML = "Row Two, Third Cell";


Another App updated to the newest iOS version!
Project Time Log has been rebuilt in Swift, with updated API’s for DropBox and SQLite. After five years (first version in 2012!) still up and running!

Project Time Log in the AppStore

The goal of Project Time Log is to keep track of time you’ve spent on projects. There are three main actions:

1. Add one or more projects;
2. Start the timer for the project you start working on. Stop the timer when you stop working. You can repeat this as often as you wish;
3. View the log to learn how much time you’ve spent on your projects (per timer, per day and in total).

In addition to these actions you can:
– change project properties any time;
– make changes to your logs or add/delete logs manually: this comes in handy when you forgot to stop or start the timer;
– use the build-in notification system to alert you when a certain amount of time has been exceeded.
– export your logs for use in an external spreadsheet.
– backup and restore your data.

Project Time Log has been designed to be intuitively simple. The best way to get to know it is by testing and trying. There is a predefined ‘test project’ which you can use for that purpose. When finished testing you can delete it without any consequences.

A powerful feature of Project Time Log is that once you’ve started a timer, it will simply keep on counting until you stop it, even when your device is completely switched off.

Best solution for using SQLite in your Swift project isΒ SQLite Swift. It works perfect and comes with very good documentation.

A problem I was facing was converting a field value to an integer.

In short, this was the problematic code:

let db = try Connection(databasePath)
let stmt = try db.prepare("SELECT someId, someCount, someName FROM someTable")
for row in stmt {
    print("row[1] = \(String(describing: row[1]))")
    // ... I need row[1] as Integer!

I needed to convert row[1] to an Integer.
I tried many solution, found on multiple forums, none of them really worked.
Finally I came up with this:

let db = try Connection(databasePath)
let stmt = try db.prepare("SELECT someId, someCount, someName FROM someTable")
for row in stmt {
    let optionalCount : Int64 = Optional(row[1]) as! Int64
    let lCount = Int(optionalCount)
    // Now I have an integer!


Happy Coding!