Sunday, November 30, 2014

An HTML image map tool written in Java using UniversalIDE

After I released the Java add-on for UniversalIDE, I thought I should have stopped for a while with UniversalIDE development to test what this program can actually do. So I decided to use UniversalIDE to write a simple Java program: a tool for web development which helps to generate image maps for HTML pages.
Basically, when you run it, you load the image from a file and then you can add areas of different shapes (rectangles, circles and polygons); then, clicking the "Generate HTML" button, the application will generate the HTML code that represents the image map.

Here a screenshot:
JHtmlImageMapper

Downloads:

Saturday, September 13, 2014

Java for UniversalIDE Alpha 0.1 released

About a month ago, I wrote a post about UniversalIDE, my current open source project, where I said I had just finished the new version of the project's website and I was planning an add-on to support the Java language. Now, the first alpha version of this add-on is available. Here is a screenshot:


It can easily be installed from the UniversalIDE Add-on Repository (Tools > Add-on manager > Install new from repository...); to compile Java code, you obviously need a JDK on your machine, and its installation directory path needs to be indicated in the application's options dialog (accessible by double-clicking the application's name in the UniversalIDE's file browser) to allow the IDE to
"know" where the compiler is.
This is the repository page, and the source is available here.
This is an Alpha version, so it only has basic syntax highlighting features; more advanced features like code suggestions are planned for the next releases.
Any feedback is appreciated, so leave a comment if you have anything to say.

Thursday, August 14, 2014

Universalide project updates: new website, a new contributor and planned features

Hello all! I'm writing this post to report some updates from the UniversalIDE Open Source project, after the v0.3 Beta has been released about a month ago.

Website updates

In these days I've been doing some updates to the project's website; as you can see from the screenshots, the main change is the layout (the old one was absolutely horrible).
The old layout...
...and the new one

A new developer is contributing

Finally I'm no longer the only the only developer working on UniversalIDE: the next version will contain some code written by dnha, a new developer which joined the project some weeks ago and is actually doing improvements to the code (for now, implemented his Error reporting library and added line numbers in the code editor).
Contact us if you are interested in contributing - this is an open source project, so the more the team grows, the more the program becomes better for all.

Development status

I'm going to start soon coding an add-on to support the Java language which will integrate UniversalIDE with Sun's JDK tools to compile Java applications; next, I'll continue working on the UniversalIDE's code to prepare the next release, which will probably be the first stable version, 1.0.

Wednesday, July 16, 2014

UniversalIDE beta 0.3 released!

I just released the version Beta 0.3 of my current open source project, UniversalIDE, an add-on based Integrated Development Environment designed to be adaptable to any programming language or development platform. It's written in Visual Basic .NET, so it requires the .NET Framework 4.0 installed to work.
The main change in the new version is the online add-on repository: with a click on Tools > Add-on Manager > Install new from repository you can easily install the add-ons available in the official repository (hosted here).

A screenshot of UniversalIDE 0.3

Another improvement is the output log and the error list at the bottom of the main window (in the previous versions the output was saved to a file). An auto update system has also been added, so you will automatically notified if new versions of UniversalIDE or of installed add-ons are avaiable.


Downloads (powered by Sourceforge):



Source code:

The source code is now available through Git (hosted by Sourceforge).

Website: http://universalide.sf.net

Saturday, May 31, 2014

Simple command-line utility to replace colors in multiple bitmap images

In this post I will show a very basic utility (the source is about 15 lines of code written in less than 5 minutes) to do a very specific task.
Some weeks ago, for school, I had to print and study two PowerPoint presentations of about 20 slides each, that for some strange reason had an intense pink background, so that printing them would be resulted in a useless waste of printer's ink (if I had printed in colors, the magenta ink, and if I had printed in black and white, the black ink since the background would have become gray). To avoid this, I wanted to change the background to white, that would have been very easy if I had the PPT file, but I only had a PDF-exported version of both presentations. I made some searches on the web about how to edit a pdf to change the colors, but I haven't found anything of useful. So I focused on working on images, since converting a pdf to images is very easy (lots of programs can do that, for example I used the free PDF-XChange Viewer) and editing images is a lot simpler than working on PDF documents. The result of the conversion was an image for each page. After that, on a single image, the editing operation I needed to do could have been done very easily with image manipulation applications such as gimp; but since performing the modification on each of the about 40 images wouldn't have been very time-saving, I decided to write, using Visual Basic .NET, an utility to automatize the process.
You may consider it a stupid program for its simplicity, but I'm publishing it so if someone has to do a task like the one I described before, he will found the ready to use solution, surely better than manually editing each single image.

Downloads

Binary (only .exe file)    or    Source(source archive)

What this program does is simply to replace, for each image in the input folder, each pixel that has the color of the pixel in the (0, 0) coordinates with a white pixel, and then save the result to the output folder. It takes the (0, 0) pixel because it's designed to remove the background, but it's very easy to change it by editing the source file (you need the source archive to do it).

Monday, April 14, 2014

HTML5breakout, a simple HTML5 game fully developed on Android tablet

Hello all, and sorry for my long absence, but I've been very busy with school and I used lots of free time to work on UniversalIDE, my open source project (version 0.3 is coming). I've also found an old little project which I started this summer, then I had forgotten it, but now I found and finished it.
It's an HTML5 arcade game, a remake of the classic breakout, with a little particularity: it has been fully developed using an Android Tablet (my Asus ME301T), by writing code with DroidEdit Free and drawing graphics sprites of the bloks with Android Photo Editor. The only graphics that hasn't been drown by me are the background and the explosion sprite, which are both from OpenGameArt.

It can be played both on computers, using left and right arrow keys, both on touch devices, touching the sides of the screen.

Click here to play or click here to download source

Here a screenshot:



Probably it isn't very well-made as a game, but in my opinion it's a good example of what you can actually build using portable devices like tablets.
Feel free to post any feedback or criticism, as always all comments are welcome. See you at the next post!

Friday, February 7, 2014

How to monitor your PC's hardware inside Steam games using OpenHardwareMonitor (and how to set up an alternative web GUI for OHM)

If you use Steam, the popular gaming platform by Valve, you probably know Steam Overlay, the feature that allows you to open, through a keyboard shortcut (as default, Shift+Tab), an overlay interface useful to chat with steam friends, view screenshots, etc. while you are playing full screen games.
I noticed that it would be very useful to monitor the hardware status (parameters like CPU and RAM usage, temperatures, etc.) in this panel to see how much the computer uses resources to run games. Fortunately, this is possible because a)Valve provides a in-game browser (probably designed for social networking, chatting, etc.), and b)there are hardware monitoring tools that includes an internal web server, thought for remote monitoring. I found, for example a simple but very useful program, free and open source, called OpenHardwareMonitor.

So, the solution is very simple:
  • Download OpenHardwareMonitor from here and unpack it to a folder (it doesn't require installation, just unzip & run)
  • Before starting a game, run the program (to access some sensors, you may have to do it with administrator rights), then go to Options > Remote web server > Run. Now the server is listening on the dafault port (you can change it in Options > Remote web server > Port).
  • Launch the game.
  • When you want to monitor the system's performances open Steam Overlay (the default shurtcut is Shift+Tab), then click on Web Browser and, in the addres bar, type http://localhost:8085 (remember the http://, the Steam browser, unlinke the normal modern browsers, isn't so clever to understand the protocol automatically).
  • Now, to switch between game and performance monitoring, just use Shift+Tab (or the shurtcut you set if you changed it).
  • When you finish gaming, remember to close OpenHardWareMonitor (you can leave the server on, so the next time you run the program it will start automatically).
The OpenHardwareMonitor built-in web GUI shown in Steam Overlay's web browser while me playing Dota 2

But, as you can see from the screenshot, this GUI isn't very intuitive; if you need to monitor only a few parameters, follow these additional steps to set up an alternative cool web interface using a bit of HTML, CSS and JS. This will be the result:
My custom OpenHardwareMonitor web GUI.

  • Download the archive that I prepared from here. It contains an HTML page that is the custom GUI, and a very simple webserver written as a Windows PowerShell Script (based on this) that answers the request of the index page with my HTML page and redirects any other requests (scripts and especially JSON data requests) to the OpenHardwareMonitor built-in webserver.
  • Unzip all in the same folder where you unzipped OpenHardwareMonitor.
  • Actually, you have all the necessary files, but the custom web GUI isn't ready to work, because OpenHardwareMonitor identifies each sensor with an ID and probably (almost securely) the IDs of your system's sensors does not correspond to mine. To "calibrate" the interface, open CustomGUI.html with a text editor (for example Notepad), scroll down a bit and you will find some comments in the javascript code that shows you the parts of code you need to edit. Precisely, it's from line 33 to line 44. In each of this lines, you need to change the sensor's IDs (the second parameter passed to the function search) with your own sensor's IDs. To discover it, start the OpenHardwareMonitor webserver and navigate with your browser to http://localhost:8085/data.json): you will see a big amount of lines of code that seems incomprehensible (the server doesn't indent JSON, probably for compression), but don't worry: you just need to do a bit of searches in this document. Press CTRL+F and, for each sensor, type the name displayed in OpenHardwareMonitor and find the respective ID, as you can see by this example:
    Example of how to find a sensor
    Copy each ID in the corresponding place in the javascript and you are done.
  • Another little step: before starting the Powershell script that contains the server, the first time, you need to run the following command from an administrator prompt to authorize the port (Start > type cmd > right click > run as administrator), obviously replacing you Windows username:
    netsh http add urlacl url=http://+:8086/ user=YOUR-USERNAME
  • Now you can run the server simply by launching Launcher.bat. If the first time you get errors, try rebooting your PC. Each time you want to run the webserver launch this script; it automatically launches OpenHardwareMonitor too, so if you leave it's built-in webserver on you don't need any other action. To stop the server, just close the command prompt.
If you have problems or suggestions, leave a comment. See you at the next post!