Wednesday 9 April 2014

JavaScript: YUI

This may be the last post (at least for quite a while) that I make in this blog. The thing was that all the posts that I made here were for a writing course that I was taking in the current semester (I kind of feel sad for this :`( ). I am in a dilemma that I feel so sad that I may actually continue this blog! (What's the point of writing a blog that no one reads anyways???!?!?)

In this final post I want to talk about a good but not very known library for JavaScript, namely YUI (Yahoo! User Interface). This is a very powerful library (perhaps at least as powerful as JQuery) developed by Yahoo! that is mainly used for making nice user interfaces.

APIs:
YUI has it's own APIs to interact with services provided by yahoo such as Yahoo! weather and Yahoo news.

YQL:
mmm...looks like something like SQL??!!? In fact YQL is a query language that allows you to search and retrieve data from some of services provided by Yahoo! such as Yahoo answers (so next time you were looking for the solutions to your homework you could try "select  * from answers where topic like '%chem 121%'")

Image Source: <https://www.servage.net/blog/wp-content/uploads/2012/05/yui3.png>


FIN :'(


Tuesday 8 April 2014

Choosing a good IDE

Although not visible to many, choosing a good IDE (Integrated Development Environment) before starting software development is a very important step. Most modern IDEs have features that allow the developer to build the UI (User Interface) with less or no effort.

For example, NetBeans IDE created by Oracle is a very good choice for creating real-world Java applications that require interactive and visually appealing user interfaces.

Microsoft has a very good reputation of creating good IDEs for everything in order to ease the process of software development. Visual Studio today can be used to make a variety of applications such as web or local apps using languages such as: ASP.NET, C++, C#.NET, Basic, JavaScript, F#, and even Python (IronPy).

In 2013 Google release its own IDEs for developing android applications, namely Android Studio.


Monday 7 April 2014

Android

In this post I want to briefly talk about Android (mobile phone OS, and applications).

First of all, it is not right to call it Android OS, as the operating system in Android phones and devices is not actually "Android". The operating system is Linux, which is an open-source operating system. For the same reason, the operating system that you see on different Android devices are not actually the same (at least in terms of looks)! And the reason for that is that each of the companies change the OS the way they want. For example, the OS in android devices that Sony makes look quite different than the ones created by Samsung. Furthermore, the operating system on Android devices is written in C language rather than Android langugage (just like Linux distros).

They why do they even call these "Android"? The second point is that Android is actually built on top of Java. Android applications are actually  in written a language with the same exact syntax with Java with a difference that Android apps use their own libraries (namely Android libraries), so in some sense, they are somehow different from Java (which is why they gave them a new name, Android!).

Image Source: <http://aasims.files.wordpress.com/2010/02/javaandandroid1.jpg>

Wednesday 2 April 2014

Object-oriented Design

I has been just quite recently that I have learned the principles of object-oriented design in so much details.

The idea is that you can break your program into objects and each object has its own perspective into the world. Suppose in the breaker game I talked about in the previous post, the game is divided into the following objects:

 Ball: has a width, height, dx (horizontal speed), and dy (vertical speed). It also has functions (methods) that detect whether or not the ball has had a collision with any given paddle. The ball does not know about paddle on its own but each time the main function passed a Paddle to this function and (literally) asks the ball if there has been any collision with that Paddle.

AIPaddle: Is a paddle that is controlled by AI (computer)and the user has no controls over its movements. just like ball, it has it's own width, height, and dx (no dy as the Paddles do not move vertically).

Paddle: I made this to be a child-class of AIPaddle. The reason for that was that regular paddles have all the features that AIPaddles have except that they can also (mainly) be controlled by the player.

Tuesday 1 April 2014

Making a Java Game is so fun!

Recently I have been learning Java to develop games. It is so fun to play a game that you make! I learned the main principles of making a Java game from website "edu4java.com", and made this game based on their single-player breaker game. I am very thankful to their awesome website :) I had previously tried a few Java game tutorial but each time I got repelled because of their lack of good explanation. Here is a screenshot of my 2-player game: