Thursday, July 13, 2023

The Modded Chassi Project

I had an old Fujitsu Siemens(TM) chassi laying around which I decided to mod a bit. The idea was to just continously work on this chassi making various "improvements". Mostly to learn more on how to do chassi mods and have some fun.

So far what has been done is this: 

  1. repainted the front, 
  2. made a circular shape on one of the sides, 
  3. added some LED lighting, 
  4. and finally put a hinge to hold the side a little bit better.

1. repainted the front

The front was grey and had seen its better days, so I repainted it using black aerosol paint and clear lacquer.

Colour matched with the CD/DVD.

 

2. made a circular shape on one of the sides

I got some help from a friend cutting this circular shape since I didn't have much experience with an angle grinder. I did however learn to use an angle grinder, and have used it in a different chassi project. An angle grinder can be difficult to use but is a great tool when modding a chassi, especially thin metal sheets. Be careful and make sure you have the proper training if you decide to use an angle grinder, as it is a very powerful and a potentially dangerous piece of equipment.


 

My first cuts with an angle grinder.


 The circular shape.

 
The final result.
 
3. added some LED lighting

I basically just used a LED stripe which had adhesives attached to it. Then it was connected to the USB-port. The LED is RGB so it can switch to many different colours using a wireless remote control.
For future improvements, it would be cool to be able to program the LED stripe and maybe have it synced to music.

RGB LED + remote control plugged in & working.

 The RGB LED stripe attached to the side of the chassi.
 
In action.
 
 Illuminating the darkness.
 
4. put a hinge to hold the side
 
I always thought the side was difficult to take off, so I wanted a hinge solution. I opted for one hinge which was not enough to hold the side in place. Therefore it is a bit tilted right now. I think I need two hinges for it to be more stable. There was quite the bit of work to get this in place but I hope I will be able to make it more stable in the future - adding another hinge.
 
 Drilling the holes in the side for the hinge.

Cutting out some superfluous material...
 
 The hinge attached to the side.
 
 The hinge attached to both the frame and the side.
 

Saturday, July 1, 2023

Adding jar files to a Java Project on the Command Line using Classpath

This is a simple post about how you can add jar files on the command line so that you can incorporate their contents in your own projects. This can be handy if you only want to test a third party library and not work with an IDE.

The idea is that if you want to use a third party library which is contained in a jar-file, what you simply do is that you use the -classpath option in your compile command:

javac -classpath ".:sqlite-jdbc-3.39.3.0.jar" TestClass.java

Where sqlite-jdbc-3.39.3.0.jar is the third party library jar file which you have downloaded. In this case SQLite.

What you must do next is to use the same -classpath option in your run-command:

java -classpath ".:sqlite-jdbc-3.39.3.0.jar" TestClass.java

You can watch an example of this in the video below.



Friday, June 30, 2023

Junction Table in SQLite SQL Database with Cascade on Update and Delete


This is a complementary blog post to the video I've posted on the topic. In this blog post I will simply provide what to type into the command line of SQLite. The video is about the concept of using a junction table (also called a linking table) which is the "bridge" between two tables. This gives you a layout of three tables which is very useful in many practical applications and conforms to the normalization rules of database design. You will have one table with artists and one table with albums, and through the junction table you can link the artist to the album.

First you will start on a new SQLite database file by typing "sqlite database.db" or "sqlite3 database.db" in the command line of your preferred Linux distro*. This will create the database file in the current directory. The cascading will not work in sqlite3 (and not in previous versions at all, since there was no support for the foreign key) unless you initially type in:

pragma foreign_keys = ON;

This must be done every time SQLite is started (unless you configure the startup settings).

Create the tables
:

artist:

create table artist (
artist_id integer PRIMARY KEY AUTOINCREMENT,
artist_name text NOT NULL);

album:
create table album (
album_id integer PRIMARY KEY AUTOINCREMENT,
title text NOT NULL,
year integer NOT NULL,
tracks integer NOT NULL);

artistalbum
: <- junction table
create table artistalbum (
artistalbum_id integer PRIMARY KEY AUTOINCREMENT,
artist_id integer NOT NULL,
album_id integer NOT NULL,
CONSTRAINT fk_artist_id
FOREIGN KEY (artist_id)
REFERENCES artist (artist_id) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT fk_album_id
FOREIGN KEY (album_id)
REFERENCES album (album_id) ON UPDATE CASCADE ON DELETE CASCADE
);

Add data:

insert into artist (artist_name) VALUES ('ABC');
insert into album (title,year,tracks) VALUES ('CDE',1999,3);
insert into album (title,year,tracks) VALUES ('DEF',1999,3);

Add data in the junction table so that "ABC" has 2 records (the added albums):

insert into artistalbum (artist_id, album_id) 
VALUES ( (SELECT artist_id FROM artist WHERE artist_name = 'ABC'),
(SELECT album_id FROM album WHERE title = 'CDE') );

insert into artistalbum (artist_id, album_id) 
VALUES ( (SELECT artist_id FROM artist WHERE artist_name = 'ABC'),
(SELECT album_id FROM album WHERE title = 'DEF') );    

Get all tables:

SELECT artist.artist_name, album.title, album.year, album.tracks
FROM artist JOIN artistalbum ON artist.artist_id = artistalbum.artist_id
JOIN album ON album.album_id = artistalbum.album_id;

Get from all tables where the band name is 'ABC':

SELECT artistalbum.artistalbum_id, album.title, artist.artist_name
FROM artist INNER JOIN (album INNER JOIN artistalbum ON album.album_id = artistalbum.album_id)
ON artist.artist_id = artistalbum.artist_id
WHERE artist.artist_name='ABC';

Delete records using cascade from the "associate table", i.e. the album or the artist table:

DELETE FROM album WHERE title = 'DEF';

You can now notice the that data has been removed from both the "associate table" and the junction table. Make a delete from the album table and all the records in the artistalbum table will also be deleted. However, the artist table will not be effected, so an additional delete must be made there as well.

Check out the video for more details on how this works.


* similar syntax should work for SQLite on other OS:es too.

Wednesday, May 20, 2020

Art Videos with ZGameEditor Visualizer part I

ZGameEditorVisualizer comes with FL Studio in all its versions.

ZGameEditor is also a free open source software: http://www.zgameeditor.org/

Creating videos with ZGameEditor is pretty straight forward and there are several tutorials out there. In a coming post I will write a basic tutorial on how I like to use ZGameEditor.

Starting off, I will simply post my work with ZGameEditor to give you an idea of what you can do with it.

Video 1

nlsound – sky city

Effects used: colours and a glitch effect. That’s it! The rest is just playing with the clips, which were part of an idea where I would film the city from two angles.

Video 2

nlsound – art sky fx

Effects used: colours, glitch and a kaleidoscope effect. Initial work with choosing and trimming clips.

Fruity Formula Controller, which I intend to cover in an upcoming post, was used in the song.

This video is a bit more advanced but hardly so. I find working with a few effects more in depth rather than using too many can be a good approach.

And that’s all and the way I’ve worked with ZGameEditor Visualizer. In the upcoming post I will go through some basics and show some features which are common. Stay tuned.

Disclaimer: I am not affiliated with FL studio or ZGameEditor in any way in this blog post.


The State of WordPress and Perhaps Writing a Book About It

I have been preoccupied with certain features of WordPress and building plugins lately. It has been good knowledge to pick up and interestin...