Java programming

After just over 3 years of programming in Java, I still haven’t sussed out how to actually open up a basic IDE and start a simple UI project from scratch.

This I know from installing Netbeans. Which I’ve used before to create a dedicated server so that client devices can receive images created using Java AWT libraries. That was easy, create a TCP listening thread, accept connections, return renderings of bitmaps in compressed PNG format. Easy.

I’ve also created (which was a UI app) a program that sniffs the UDP broadcast of the IPTV/Digital Signage server (which I wrote), and opens up a custom web interface from the server without knowing the IP address. That was easy with the help of a couple of references from the web. It turned out to be quite a small program in the end and hardly any effort in it.

Even after Android development, writing games and even using FFMpeg to write a media player using the NDK.

I simply just wanted to write (using the accumulated knowledge of Java) a simple multi window/dialog application on my laptop. Wow… It still amazes me how I got through all the previous software developing. Maybe on an evening, I’m just not that focused. But I’m not giving in.

Java may not have the power of C, but it does have a lot that can be used as I’ve mentioned above. I’m finding it simple to handle threading and AWT bitmaps, etc. All I need now is to be able to setup up a display in a window (GL or raster, whichever is the quickest to begin with) and I’ll be happy.

Qt is simple enough for both openGL and normal UI stuff. So now I want to do the same with Java. So far without the UI stuff, I can run anything, ie server side from Java, but UI stuff I’ll just have to persevere with.

I’ll get there. Nighttime coding was something I always used to do. Going to bed when I realised the sun was poking its head up in the morning.

If I can keep this up (future plans)

Many years ago I started building my online profile and populated my old website with lots of content. Unfortunately, all that has gone despite trying to get in touch with the hosting company. It was free hosting.

Now my hosting is paid for so that gives me something if times get dark and finances get short.

The boiler-plate code for a 3D online demo is almost complete but am I hell staying up past 11pm when I have to be up at 6am in the morning.

I have all next week off, so when I am not out on my motorbike getting lost around the country, which I can’t do much anyway until I get paid next, I’ll be at home building up some showcase examples. These I will plan on hosting using webGL. I’ve got a lot of ideas and I plan on getting a good few of them done next week.

My future depends on it now, because I haven’t got the pennies to fill up my tank.

Dev updates for May 2017

There’s actually a shed load of updates, but I doubt I’ll get them all done tonight.

  1. I now have a Java server running which provides Java specific rendering using AWT and other java standard features.
  2. DVB-S is easy.
  3. Using FFMpeg as a general media player for both IPTV/UDP and file/network based streams, including pause and seek.
  4. Finally got round to installing 4 OS’s on my main laptop. Windows 10 and 3 other Linux OS’s.
  5. Manually re-installed a HP tablet with Android OS from scratch.
  6. Erm… Blank…

Stuff to do:

  1. Loads… I’ll remember them probably tomorrow.
  2. Add more code to this website.


Home server is offline… for now

My home PC has been re-installed, dual booting with Linux and Windows 7. My plan is to keep the web server running whether I boot up in either OS.

I’m working on it.

Time to get personal…

With a long weekend coming up due to the Easter break and a lot of ideas in my head, I’ve decided to start some more experiments with some serious coding.

Various online profiles will be updated too.

Watch this space…

!false is funny because it's true

New laptop and Linux Mint dual boot

A few weeks ago I bought a laptop, a Dell Precision 4500, i7 2Ghz, 4Gb memory, Quadro 1800M and a 320Gb hard disk, pre-installed with Windows 7.

The first thing I did was to shrink the volume which gave me about 130Gb which I installed Linux Mint 18.3. The dual boot worked fine until I updated the nVidia drivers and lost the resolution of 1920×1080. This is after installing everything, all my programming stuff, 3D stuff, etc. I tried the workarounds online with no joy, I was losing performance.

Anyway, I had a 9.5mm draw replacement which I could remove the DVD drive and put in my SSD drive.

The first three installs of Linux and it freezing randomly, plus sussing out out why in the end the GRUB bootloader was on the wrong drive, I finally figured a way to get it up and running. Initially, after reading that on an SSD you don’t need a swap partition, the last install I went back to the swap partition with the install. And it is now working.

I’ve yet to update the nVidia drivers which I will do sometime soon.

At the moment, I can boot into Windows off the normal HD and Linux off my SSD. It runs sweet. Programming stuff is installed but not yet used. I need a long holiday to really get this beast going. The graphics on this laptop actually run better than my PC (i7 4790, nVidia GTX 730).

The only thing that slows this laptop down is the hard drive and Windows.

Maybe tomorrow I will actually bravely update the nVidia drivers for Linux Mint because I soon want to start experimenting with 3D graphics API’s for desktop and mobile again. And as usual I wish I had just a minute more time to focus on my personal projects.

Reinstallation done

All done and only got a few bits to install now. And the good news is that the tomcat server now works again.

Phew! I can get back to the 3D stuff again.

Re-install PC

I’ve recently upgraded from Linux Mint 17.3 to 18 and although everything else is working just fine, the tomcat server doesn’t. The client side of a web application works but there’s no joy from the server side so zero RPC calls are working.

A fresh install will be good anyway as it will clear a lot of junk out.

Ah well, should be about 30 minutes to an hour installing most of my software back. It’s handy having a nice 480Gb SSD and decent download speeds.

TCP internet communication notes

Now that I’ve got that working over the internet, there are many things that this kind of thing can be used for. Most of them are obvious, but a few I’ve had in mind for some time now.

  1. For an app running on a device, it can download media specific to that device. ie, scaled to fit the resolution.
  2. A device can be checked for memory and storage space limits and then download media that is optimised for the device to run the app.
  3. Even for 3D apps, a device can request 3D meshes optimised to run on that device depending on the graphics capabilities. This can be useful for animated meshes with lots of vertices. The server can reduce the size of the mesh and the animation.
  4. If a device can output in surround sound then audio can requested that supports surround sound.
  5. Multiplayer games. The server can receive players positions and then send the local information back out to other devices.
  6. Devices can also send data to the server. This can be for a multitude of reasons. ie. a players profile picture or for audio communication between players.

As you can see from the above, there’s no limit to what a running server can do.

One thing I will have to do soon is to handle brute force attacks on the server. This happens when a DoS (Denial Of Service) attack occurs, which is a deliberate attack in which lots of data is sent to the server continuously. The simple way around this is to have a damn good fast CPU in the server and to record IP’s that are connecting. If an IP is not requesting the usual data and has attempted X amount of times then it goes onto a block list. Each connection attempt will first check the block list and instantly close the connection if that IP is blocked so that no further time is spent processing the connections request. At this current moment in time the Intel Xeon and the latest Intel i7’s have the cores that could handle DoS attacks.

Multiplayer games requires a whole new line of thinking, especially when they’re real time. Band width can be a pain, but there are many ways to get around this. In one of the above notes, I mentioned ‘local’ data. This comes into play when a players device only needs to receive the local updates in the surrounding area. Although the server will handle all players, it will only send each device its local data.

Anyway, that’s me done for now while I think of what to do next.

Any ideas, then get in touch.

Testing out TCP server over the web (my IoT stuff)

So I have this idea where I can take photos on my phone or save images from the web and then send them directly to my PC.

I’m currently using a Sky router in which I have enabled a port redirect to my PC. That’s all working. And I’ve got an external web address which re-routes to my PC also. That’s all working as I can host a website on my PC and access from outside.

The first pitfall was I started a console application in Qt to be a TCP server, but, deploying Qt applications to anywhere can be a huge pain in the butt.

So now I’ve decided to pick between a Java server or a C/C++ server. The issue I will have with a standard C/C++ server is image handling when it comes to working with them in the future, whereas Java has built in Bitmap libraries. Although I could add a 3rd party library to get around this, Java has lots of other libraries.

The other issue is speed. C/C++ has raw speed and that it. But because its a server, speed shouldn’t really be an issue for most things.

I’ve already successfully got the address of my PC over the internet and in the past had a basic TCP communication test working. This time it’s for real.

Okay, I’ll try out a Java project and see how it goes.