Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

25 October, 2014

Java SE 7 Programming Essentials - my 2nd Java book

English: The cover illustration for the Java P...
English: The cover illustration for the Java Programming book on Wikibooks (Photo credit: Wikipedia)
25-October-2014


About a week ago, I finished reading my 2nd book on Java programming - Java SE 7 Programming Essentials, authored by Michael Ernest. It was basically written for a beginner, but one who is aiming for an Oracle certification, the OCA Java SE 7 (Oracle Certified Associate, Java SE 7).

I have been doing software development since 1996, using PROMIS and VMS, and the very first Windows, and DOS, etc., and I have used .NET in all of my latest applications, but I would admit that I still picked up a lot of fundamental knowledge from this book.

I've come across much of the same topics in another book, C# in Depth, but in Java SE 7 Programming Essentials, they were presented for beginners. Thus, the detailed explanation, which is easy to grasp.

I had to admit that the modifiers was one of the things that became clearer to me, and I am now more aware as to why a class or method is declared public, and not private, or if no modifier is used, what the default behavior is, etc. Very basic, right?

Inheritance and composition is another thing that I was refreshed on, and the use of the 'this' keyword, especially when using inheritance, where properties are also passed down.

Constructors were also discussed, and I learned how you can create your own constructor.

Then there is also the topic on interface, and when it becomes a limitation. Followed by enumeration.

But the one thing I like very much, which I have been looking for so long, is how he presented the acquisition of a business, which needed the merging, or enhancing of the acquired company's business system. Very simple, but that is what I have been looking for - creating your own, and integrating into an existing simple that is built differently - without breaking each other.

Indeed, doing software development is one easy task, but creating a code that is optimized and compact, easy to maintain, and is in all aspect of the highest standards - that is one tough goal, a hard target. But then again, how can you score if you don't have a goal?

Aim high, and hit the mark!

That's what I'm doing now. Patience, and I will hit the mark.

Till then...

23 April, 2014

Windows 8.1 and Ubuntu Linux 14.04

linux_inside
linux_inside (Photo credit: Adriano Gasparri)
23-April-2014

After I conquered my fear of Java, thanks to the book Java 7 for Absolute Beginners, I was thinking, what now? I was just so relieved that Java turned out to be so similar, to be precise, so close, to C#, 95%-99% identical, with the 'struct' as main difference, and of course, the way things are called and named.

No big deal, but I actually enjoyed learning Java, or at least, the first book that I grabbed gave me a good impression of Java. And thanks to my desire to learn Java, I now understand C# better. I am now on my second Java (Programming) book.

In some days after I finished the book, and typing the codes, and making them run, I got familiar somehow with Eclipse, IntelliJ and NetBeans editors. And that is when I thought, anything else?

Alongside Java, I also was intimidated by Unix, and with that, Perl. Like I said in my previous articles, I just can't 'grep' the things in Unix, and whenever I sat infront of a Unix terminal, I felt so 'awk'-ward.

Well, things have changed. First is Java. Now, Linux. Yap. Linux. Ubuntu. I managed to go with the VirtualBox thing, and yes, it was running in Windows 8, and also in Windows 7 (the latter already known).

The thing with my new machine is that it is UEFI-enabled, so I followed some blogs, forums and articles, and I tweaked and tweaked and tweaked, owing to the fact that I both have UEFI and Safe Boot flags to deal with, but these are just dealing with time, nothing much on hard thinking.

Anyway, I managed to get my Windows 8.x machine to boot on the USB stick, and I was off 'trying' Ubuntu. So to say, I run my 'Hello, world' program, but I found that the Broadcom WiFi card isn't working.

It was at this point that I tried using the same USB stick to try Ubuntu Linux in my other laptop, which is already going 6 years, and voila! Everything was working, including the WiFi. Which means that Ubuntu is okay, but in my new machine, there is some minor problem.

And I find it funny, that in my need to be connected, only at this time, after about 6 months, I found that my HP Envy 15, slim as it is, was still fitted with an RJ 45 plug, so I was still able to connect to the internet.

I did some cleaning in my HDD, for my mind is made up: I will attempt to do a dual-boot on my Windows 8.x laptop. When it came to defragmenting the drive to compress the data in it, I didn't find the native defragmenter in Windows to be doing the job. I searched, and I found some, like Smart Defrag, Perfect Disk, and the feature I needed was in PerfectDisk, just glad that their 30-day trial let me do the empty space compression and 'Prep for Shrink'. But I used Smart Defrag to set a defragmentation of the MFT and other system files on boot.

Again, when it was time to do the partitioning, I found that the built-in utility in Windows is lacking. As in the past, I used Partition Wizard Home Edition, and that software gave me the freedom to do what I needed to do.

I almost got mixed up in the file naming, or drive naming, to be more precise, between Windows and Linux. This was my first attempt, and I am having no back-up disc for my Windows OS, but when it comes to doing things like this, I am one who takes the risk. And not without rewards!

I got myself a bit familiar with the Ubuntu Linux installer, and I exercised my power of observation. I had to look at all that is being shown in the installer GUI, for I can't be mistaken with my selection. I think I re-run 3 times before finally proceeding.

To be precise, there were 3 partitions, the 1GB for the boot record, the 10GB for the swap file, and the 75GB for the Linux OS/kernel. Fortunately, the installer has the bar graph at the top that showed the physical layout - hey, I'm a newbie when it comes to Linux, and the success of anything is that anybody can follow it, even without a manual. And I did!

But a point to note: the installer is supposed to detect the existing Windows OS installation, but Windows 8.x being new and all, it wasn't. So as advised in many forums, back when it was Windows 7's being new in the computing world, the same rule applies: choose 'Something else', and you will have to manually configure the succeeding pages. I went through all that, and I managed to complete the installation.

Reboot, and as expected, I did not see GRUB, so I defaulted to pressing F9 so that I can choose which OS to run. And yes, Linux is so damn fast. This post is being generated in Firefox inside Linux, by the way. Actually, I am spending more time using Linux than Windows in the past couple of days. But to be fair, I salute Windows 8, which is by far the best in the breed (Windows 3, XP, 95, 98, 7, etc.) I like best the fast boot feature. But IE11 sucks so much, I hated it.

That was it for my Windows 8.x machine, and when I did the dual-boot attempt on my 14-year old Acer desktop PC, it was able to detect the existing Windows installation, so I selected 'install alongside Windows'. And when I almost would have said that my cleaning and partitioning effort for that old machine (yes, I had to uninstall many applications) was for naught, I found that even the empty partition was stored in some file used by Ubuntu Linux!

I found out about it when after checking that usage for the 10GB partition was 0%, I tried to merge it to the kernel drive, but failed. So I left it as unallocated. Because you see, the installation process, running entirely on its own, cut away the 10GB space for the swap file from the partition intended for the kernel, so I was just 'giving it back' the space.

Then after a reboot, I got an error, Ubuntu reported some 'unrecognized disk' and it stopped at some _grub prompt. Hey, I'm new to Linux, so what do I know?

I did a cold shutdown, and performed the reinstallation, did the whole thing again, and after a reboot, to confirm that even with the unallocated disk still unallocated, the problem is gone - and it was so!

I now have 2 machines running Ubuntu Linux 14.04. And while only the old machine is able to boot on GRUB, I am contented with being able to boot my Windows 8.x machine suing boot option manually.

And I managed to fix the WiFi error, with some guide drawn out by super users which isn't really that hard to follow, so now I am running wireless on Linux.

This post is coming from Ubuntu Linux 14.04. I will miss Windows...

Till then!


Enhanced by Zemanta

20 March, 2014

My bet on Java IDE

intellij-shop
intellij-shop (Photo credit: dibau_naum_h)
20-Mar-2014

I have been spending some time on learning Java (7), and I was fortunate enough to grab a copy of Jay Bryant's book, Java 7 for Absolute Beginners. There's a bit of contradiction here... I surely am a beginner in Java, but I have known C# for a decade now, and the pleasant surprise I got when I started reading the book!

The 2 programming softwares were very identical, I could say 99%, in form and substance. And of course, going through the history of how they came about, why woulnd't they be? It is just that they originated from two rival camps, but the structure and capabilities given to them, I believe were at par.

The curiosity came about while job hunting: there were many job ads that indicated the need for a Java developer, but in parenthesis, C#.NET are welcome to apply. Took me a few job ads to realize the obvious, but then again, not immediately.

You see, I shun away from Java years ago, even though I was using native C in my school days. That was due to my poor experience with UNIX, but then again, it was not a mandated skill, and when I was starting to learn UNIX, I just didn't have a nice encounter with the OS, being already exposed to DOS, which is more verbose when it comes to its commands. Then I came across BASIC, then QBASIC. This really put a wedge between me and UNIX, the power and capability of which I will never know. I simply can't 'grep' the commands, and with nobody around to guide me, it became 'awk'-ward. I mean, I can read and learn by doing when I can, but I simply didn't get that chance - which I got with DOS and BASIC.

So I was quite surprised when I finally got to learn Java; I was at home, very much at home. Even so, the abstract-ness of the two software became more familiar to me. That was good, I never skipped a page, and the things that I would have forgotten in C#, the terms, the methodologies, they were refreshed in my memory, and what's more, I am learning Java!

Now, being so at ease with Visual Studio IDE made me a bit frustrated with the IDEs that were available for Java development. I have been trying to put my hand in on Android programming, and I started with Eclipse IDE, which is too much for beginners. Just look at the list in their website, and it would be too much, so overwhelming, really. As for Android, I have also tried Android Studio, by Jet Brains.

There is also NetBeans. The feature that I was looking for in Eclipse and NetBeans is the feature that I become accustomed with in Visual Studio, two actually, namely: intellisense and auto-completion. Now, I am not saying that Eclipse and NetBeans don't have these features, but the behaviour isn't what I wanted. Eclipse would automatically add ".*;" after pressing enter. That isn't the case for NetBeans.

Oracle offers JDeveloper IDE, but sadly, you have to be really a geek to make it run: I can't even install it! I've been doing softwares since 1996, but I have chosen a motto that if anything should work, it should be easily usable, even by the dumbest person.

There are many other Java IDEs available, but one IDE I have tried and I will keep: Jet Brains' IntelliJ. Fortunately, they have the Community Edition, which is free, and while being a smaller version of the Ultimate edition, the feature is not. Of course, the intellisense and auto-completion features are very close to what you get in Visual Studio.

So now at least I have two options for Java IDE: NetBeans and IntelliJ. Both free, both having the intellisense and auto-completion features, less the irksome behaviour.

Till then!

Enhanced by Zemanta

07 July, 2010

Running javac in Windows

Image representing NetBeans as depicted in Cru...Image via CrunchBase
I just began my self-study in java using Netbeans 6.9 IDE, and I just managed to get through the "Hello World!" code using the IDE, which is followed by running the same small program in the shell.

I typed the compiler as indicated in the directions, but I got an error, like 'javac is not recognized....' or something like that.

I searched the web, which is usually my primary source of assistance, as it is with my self-study matters, and I got the first page with the top results containing the solution to my problem.

It is simply including the javac location in the PATH declaration.

So I did.

I opened up a Windows Explorer, right click on My Computer, and on Properties, then on Advanced tab, then on Environment Variables, then on the top window, which is the user's "User variables".

Open up "PATH" or "path", whichever is the one in your PC, then include the javac directory, for my case, is "C:\Program Files\Java\jdk1.6.0_01\bin> javac". That means going to the end of the current definition, adding a semicolon, then the file location, which is again, "C:\Program Files\Java\jdk1.6.0_01\bin> javac".

Click on OK, then the other OK, and the final thrid OK.

That sets the path for javac. There is no need to restart your PC, as was the case for me. But if javac still isn't recognized, try to do a restart, to be sure.

Till then.

Enhanced by Zemanta

08 April, 2010

C going up the list, actually top of the list

JavaImage via Wikipedia
What is C's rise to the top (again) have got to do with me? I mean, I'm using C# in the .NET package, and also VB and ASP. And though I wanted to delve into Java, I've not gone close enough, or even near, to be considered an intermediate-, or even a beginner-level at that.

But for those of you out there who are into Java and C programming languages, I think this news matters. It may be actually dictating the trend (and future employability) of software developers in this arena.

Read on:

----------
"After more than 4 years C is back at position number 1 in the TIOBE index. The scores for C have been pretty constant through the years, varying between the 15% and 20% market share for almost 10 years. So the main reason for C's number 1 position is not C's uprise, but the decline of its competitor Java. Java has a long-term downward trend. It is losing ground to other languages running on the JVM. An example of such a language is JavaFX, which is now approaching the top 20."
----------

What's on your mind? Do leave a comment - here - or check out what others are saying at the source here.


Reblog this post [with Zemanta]