Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Friday, June 03, 2016

Old projects reborn - MoneyTimer

This is another tool, I've tried to update in order to withstand the test of time - MoneyTimer

What does it do ?
It measures time and calculates every second how much time it costed all participants.
Great for consultation meetings!



You can try out the latest release here:

What I can learn from it?
- Java 8 Lambda expressions
- Simple Multi-threaded application
- Swing

How to contribute: 
Check the instructions at the github repo page.
If you are wondering what to contribute: there's a list of ideas in the issues page


Tune in, because more complex ones are coming ...

PS:
Check out my other project that can interest you. This time about HTML generation via XSL transformations - http://javamissionary.blogspot.bg/2016/04/old-projects-reborn-filesystem2html-tool.html

Friday, April 29, 2016

Old projects reborn - FileSystem2Html tool

As everyone in the IT business, I have quite a few of my own projects. Most of them rot in solitude and are rather dusty... So, I decided as a way of exercise as well as a check how have technologies developed and my own views on code cleanness, tests' quality and overall project usability, to make them more development-friendly.

In short - I'm reviving my projects (both university and personal ones) so that they are easy to setup, run and contribute to if there's a willing person.

I'm starting with this small project: https://github.com/leni-kirilov/FileSystem2Html/

What does it do:

- it's a simple Folder structure scanner
- it can build an HTML/XML report of the folder structure
- it can rebuild that folder structure elsewhere (without the content, obviously)

My "beautiful" swing UI

Very useful if you like a certain folder structure, and don't have the time to remove all the files or whatever. You can easily mimic it. Quite a simple app.

Now to the contribution part:

- It's an open source project 
- Java 8 required
- built with Maven 
- a list of TODOs and ideas where one can get started! I've listed ideas based on effort. 
I would start with the small ones

The project builds automatically and measures code coverage (yes, there are unit tests there!)
(Thank you Travis-CI, Coveralls and Coverity!)

So that's pretty much it.
I can't wait until I see someone energetic about such a tool

Best of wishes!
Leni

PS:
Please be gentle :) I know there's some pretty lame code out there!

Friday, August 15, 2014

Automatic code coverage badge / reports for Java 8 project in Coveralls.io

Recently, I've setup a Java project hosted on Github to get automatically build using TravisCI. It's super cool to have a nice badge saying that your recent builds are green. But then I discovered I could have some more report using free tools like TravisCI.
For example - code coverage tool like Coveralls.io

This is where it got interesting quickly. It's written on the official site that it supports only dynamic languages but nothing about Java. But a quick search in Google pointed me to a maven plugin which connects with Coveralls' API. So I decided to give it a try.

Here are some useful links and hints for everybody trying to do it for his own project:
  1. Check if your project is Java 8If it is, you have to use the JaCoCo maven plugin, since this is the only code coverage tool supporting Java8 compiled classes. Use at least version than 0.7.0  (according to this bug report)

  2. Configure it your pom.xml to use JaCoCo
    You could use the snippet here but with newer JaCoCo version
  3. Configure in your parent pom.xml to use coveralls-maven-pluginCarefully read the README of the plugin. For security reasons don't publish your token on your repo.
  4. Update .travis.yml to try to upload your coverage report to Coveralls.io
    after_success: mvn clean test jacoco:report coveralls:jacoco
  5. Add cool coverage badge to your README
    Like this one:  Coverage Status

    Congratulations!
    You've succesfully integrated: Github + TravisCI + Coveralls.io + JaCoCO for a Java 8 Project

    Check out my example project which has successfully integrated all these wonderful systems. https://github.com/leni-kirilov/MoneyTimer

    Kudos to Tapio Rautonen for creating such a useful plugin and documenting it in an excellent way! 

Friday, June 07, 2013

Eclipse and maven-properties problem

Today, I'm going to share a problem which I think it's quite common:
- importing Java Maven projects into Eclipse and expecting Eclipse to just work with it.

You do:
1) sync from source control
2) import existing maven projects to eclipse
3) see many red errors in Eclipse.
4) yeah , I forgot to set the Maven settings file
5) still some projects are failing
6) try to fix each problem 1 by 1

Why does it happen like that?

Most common is that it will set a Java Compiler version which is from the POM.xml but then the JRE environment specified could be... just not right. So your POM.xml says "compiler version 1.7", but the Maven projects you import are automatically assigned Java1.5...
So errors like
- You cannot use @Override here
or for java1.7
- new ArrayList<> constructor not found (or not valid expression).

So you have to go to each project, reconfigure build path parameters to point to JRE1.7 manually, even though you have specified JDK1.7 as installed JDK.
Imagine fixing this manually for 20-50 projects (you've just been moved to moderately progressed project)

Even if you explicitly set the Maven settings in the Preferences menu, you would not solve your problem.

The single solution is to:
1) delete all projects ( only from Eclipse )
2) reimport them, because NOW you have set the Maven settings BEFORE the importing...

Just crazy... not being able to automatically adapt the projects to the new maven settings file... not even "clean" and "maven update" help...

Best wishes,
Leni Kirilov

Saturday, August 20, 2011

A diffrent software architecture - LMAX

It was an interesting afternoon to read the article that the famous Martin Fowler had written a month ago.

It's about a different kind of architecture, how it worked and how the software engineers got to that solution of their problems. The project is about processing multiple concurrent orders and the platform had to provide low latency. The team managed to create a system that copes with 6 million transactions per second.
The strange thing is that they do it on a single-threaded application with in-memory database approach (caches).

They have tried other more-conventional approaches like multi-threading and the Actor approach but the performance of the Queue was limiting them, also the need to synchronize threads and interactions between them, context switch at CPU level was drawing performance back.

So they decided to separate input/output and processing into different modules.
Each input event gets unmarshalled and all its required pre-processing (IO operations and credit card verification operations for example) are done before hand and inserted into a the main stream that is processed by the business logic unit.

The team also create special implementations for collection classes so that they use caches better. They processed events not in a Queue approach but with a ring buffer and on it were running several processor modules - one for unmarshalling, one for backup (Journal) and Replicator and finally the Business Logic Processor. They are in a constant race and there are rules that prevent 1 from getting ahead of the other and processing a data field that isn't ready yet. This ring buffer has enormous size (20 million items)

The main idea is that CPU can process fast sequence of operations which are simple (therefore very optimized by the Java compiler), and using in-memory caches (no SQL queries), this could push the performance of a system high.

Also another gain for the team is that they don't have to cope with complex techniques like transactions, inter-thread communications etc...


I think I've just covered the basics of this software architecture approach. If you are interested enough, do visit the original article at -> http://martinfowler.com/articles/lmax.html

Thursday, October 07, 2010

Java2Days Sofia Day 1 (part 6)

17:00 - 6. Google App Engine for Java Ice Penov

GAE = Google App Engine
Google Eclipse Plug-in - comfortable for developing in Java.

GAE lets you run and maintain your web applications
GAE supports Java and Python

An application will become available on *.appspot.com

Benefits and advantages of GAE:
- cloud
- free resources
- Google infrastructure for scalability
- easy integration with Google accounts and other services

(demonstrates how to create a GAE application)

GWT = Google Web Toolkit (made for JavaScript and AJAX)

GWT compiles Java to JavaScript => slower compile . That is done because it's executed in a browser.

Quote:
"OK. I'm speaking with the Google cloud... I should socialize more" - after creating a Google application that sends messages via Google Talk and you can return your parameters to your application as you respond via Google Talk as well. :)

GAE is in sandbox.
- cannot write to file system
- cannot open socket to another host
- cannot open a thread
- cannot make explicit System calls like System.exit()

There is a white-list of JRE features supported by the GAE cloud. (easily googleable)
- he thinks that this is a major drawback, because you can't make your application run on your server and then associate it with the cloud.

There are some metrics services on the GAE - CPU time, request-count etc...

Out-of-the-box Services API:

- storing data is done with Google BigTable which is a NoSQL
   JDO preferred to JPA; GQL is available - no real info given for this
 ------- cannot use JOIN query and aggregation queries

-  MemCache Java API - distributed in-memory data cache
      JCache API can be used

- Mail Service - Java Mail API can be used
- XMPP - Google Talk uses this IM protocol
- Image service - resize, rotate, flip, crop
- Google Account - you can integrate openID into your GAE application

GAE and other technologies interoperabilities:
- JEE - not supported JDBC, RMI,
- other JVM languages - supported

-3rd party
--- supported - Spring, Tiles, Struts, GWT
--- not supported - Hibernate, iText, Rich(ICE)Faces



And that's it for today!
Java2Days first day is over. I hope you find these notes interesting. I wrote them as I was attending the sessions so my posts could lack enough sentences but you will forgive me :)

Unfortunately, I cannot cover Java2Days Day 2 and  share my thoughts.

Leni Kirilov

Java2Days Sofia Day 1 (part5)

Quotes from other sessions not that interesting:

JSF has no pros
Oracle + Sun =  Snoracle

16:00 - 5. Building RESTFul Web Services with Java  Vassil Popovski, VMware

REST Principles:
-- everything is a resource
-- resources have identifiers
-- uniform access
-- resources have representations
-- link things together

HTTP methods
POST UPDATE GET DELETE

JAX-RS - java API for rest services. The presenter says that this SRS seems readable.

java.ws.rs.*

JAX-RS = POJO + Annotations

Best implementation of JAX-RS is CXF

Key concepts
- resource classes - have at least 1 resource method
- resource methods - annotated with @POST @GET etc
- provider classes  - extending JAX-RS interface

More commonly-used annotations:
@Path - relative path for a resources
@Consumers / @Produces - for media types
 - produces = output
 - consumes = input
@PathParam
@Context
@QueryParam - inject the value of a query into a variable

Benefits:
- scalable solutions
- compared to SOAP is much simpler

(next-page) 

Java2Days Sofia Day 1 (part4)

4. Mission Critical Enterprise/Cloud ApplicationsEugene Ciuran

What is Cloud  and how do we use it?
- quick deployment
- virtualize hardware
- replace data center

Advantages
- turn on/off machines (virtual hardware) as needed - all you need is a credit card

Scalability:
- horizontal - load-balancing
- vertical - improve applications - more hardware

high availability != uptime
If your network is down and servers UP - your application is not AVAILABLE for users.

Availability scale chart
90% - one nine  = 36.5 days down
99% - two nines = 4 days down
99,9% - ... =  9 hours
... 53 minues
... 5.3 minutes
....32 sec

from 90% - 99 -- you double the resources
Each step, the cost is doubled.

The best option at the moment is 99.9%
Well, at 2008 Amazon was down for 9 hours... it cost them much.

SLA = Service Level Agreement - agreement between customer and a vendor
SLA is not a legal document!

The most important question is "What do I do when an outage happens? How do I repair a disaster?"

At the point of 5-6 nines you see that cloud will cost you as much as building your own infrastructure!!!!

Hybrid cloud architecture - some data that is not mission-critical is stored in the User part, so when that part goes down , your applications are still working.

Amazon vs Google App Engine vs Rackspace
elastic load-balancer vs static stateless calls

Interesting case study about a project not scaling and going to migrate to a cloud.

Quote:
"If there is a mission-critical application/data just write it on Java... .Net is great, but if your job depends on it - just write it on Java"   - The comment to do on a Java conference :)

- introduced ESB for scaling
- although ESB has many connections, it is not the single-point-of-failure - it is the load-balancer(which was another virtual machine)

(next - page)

Java2Days Sofia Day 1 (part3)

12:00 3. A Quick Tour of Contexts and Dependency Injection for Java EE Reza Rahman

The nice looking Indian dude Reza will explain the JEE6 introduced feature  CDI / DI.

CDI/DI is the most important new feature, if we believe him.
CDI is about application orchestrations.

@Qualifier - a mechanism to introduce additional logic in a bean

The general perspective is that JEE6 applications using CDI will include lots of annotations
like @Inject, @Qualifier, @Decorator @Produces, @xxxxScoped ...etc etc - may be 20 more

(next-page)

Java2Days Sofia Day 1 (part2)

11:00 - 2.Introduction to Spring Integration and What's new in Spring Integration 2.0
Josh Long & Oleg Zhurakousky, VMWare


Pipes and Filters - this is the basics of Spring - similar to Linux.
=> loose coupling mechanism

(Interesting way of question->answer way to present your product. The two presenters are great!)

Channels are comfortable for postponed communication. When both sides aren't presented at the same moment in time. a.k.a publish/subscribe.

Pipes are channels
Filters are endpoints.

Message endpoint types:
Transformers  - convert payload or modify headers
Filters - discard messages based on boolean evaluation
Router - determine next channel based on content
Splitter - generate multiple messages from one
Aggregator - assemble a single message from multiple

Spring Integration - it's integrated in the Spring framework.
(long demo with small letters... not everybody sees that good and they didn't zoom it permanently...)

(next part)

Java2Days Sofia Day 1 (part1)

11Here I'm going to blog my thoughts about the sessions:

9:30 - 0. Introduction

The introduction was translated live in both English and French by two girl-students. :) They were kind of shy and inexperienced but it was funny to watch them.

Unscheduled introduction by a dude from Oracle forced the Vitosha schedule to be 30 minutes behind the other xxx2Days presentations... Great organization ...


10:00 - 1. Java EE 6 - why and how J2EE became popular again

Regarding JEE6 the new Oracle employee Alexis Pouchkine said that NetBeans is the best for JEE6 development today. Eclipse is still behind. Go go, NetBeans!

Expect more annotations in JEE6.

Ruby developers don't create applications much faster than Java developers anymore. Just 5-10% faster.

JEE6 compliant application servers are : Glassfish, Oracle's WebLogic, and a few more.

He's making a comparison between JEE5 and JEE6. JEE5 was all about making the development faster and easier, but JEE6 includes a lot of new features.

Detailed explanations for
- JAX-RS
- Bean validation
     - something like assertions with annotations for fields of beans - @Valid annotation makes validation recursive
     - you can create your own validation annotations
 - Web Profile
 - CDI - very interesting annotations for defining exact implementations and validations etc... Interesting code samples

Expect JEE7 with cloud features. If I can suppose right, I expect Java7 features as well :) That means we won't see it for another 2-3 years.

(next-page)

Thursday, September 09, 2010

Java 7 new feautres (part 2)

Hi there,

I'm continuing my review on the expected features from where I started them:

JSR 308: Annotations on Java types
An extension to the Java annotation syntax to permit annotations on any occurrence of a type
----
In my opinion, this will make Java code stranger... May be I have got used to the current Java code style, but too much @ will make it look like PHP or other languages using strange symbols.
About the feature - it could add new flexibility in checks - kinda like "throws", final ... Imagine how JUnit will change after this feature is introduced!


JSR TBD: Small language enhancements (Project Coin)
A set of small language changes intended to simplify common, day-to-day programming tasks
----
String in switch --- My comment is "FINALLY, GUYS!"
Automatic resource management --- Well, we all got tired of all the try-catch around code pieces using  Streams. Just makes the code larger, but not doing anything special.
Generics initialization improvement - personally, I don't mind leaving it out, but sloppy developers will make less errors.
Collection literals and array-like access - this is similar to the one above. Just for easier initialization and access.



JSR 203: More new I/O APIs for the Java platform (NIO.2)
New APIs for filesystem access, scalable asynchronous I/O operations, socket-channel binding and configuration, and multicast datagrams
---
The best new feature about this is the new .resolve() method, which will find the files as they are meant to be found and not force the developer to think which class loader is used at the moment etc etc... Until man encounters this problem, he doesn't know how frustrating it can be.



Update the XML stack
Upgrade the JAXP, JAXB, and JAX-WS APIs to the most recent stable versions
Dropped
---
Actually, I don't know the exact reason behind the decision to drop the upgrade of the above-mentioned technologies, but as I use them at work on daily basis, I find this surprising. It would be great if their specifications are revised and developers at Oracle (former Sun) upgrade them to the next level, because Java API for XML will always be "modern" and the need for updates/improvements won't decrease.
Of course, I could be terribly wrong. ;)

Swing JDatePicker component
Add the SwingLabs JXDatePicker component to the platform
---
I have not used Swing as much as to notice that DatePicker is missing ... When I read it was to be "ADDED" I thought, "shame on you for forgetting it"! I suppose that more than half of Swing applications need date of some sort...

-------------------

I'll skip intentionally the other improvements regarding class loaders, collections concurrency and Swing , because I don't find them as attractive as the ones I commented above. Here's a link to the full list.

I hope you found my comments reasonable. I am optimistic about the new Java version. I just hope the developers don't have too many problems and they don't delay the launch...

Good luck!



Leni Kirilov

Thursday, September 02, 2010

My own naming convention and what problems could arise from it

Hi, developers!

We write applications and our applications use data. We create data, edit data, store data...
Sometimes we store data on the File System. And I think that's a common practice.

Have you ever wondered how to name your files in order, not to have naming collisions or creating some temporary files with some extensions, only you as a developer, should know about ?
Have you ever encountered exceptions in your code while accessing the file system? A glitch in your code maybe?

I am going to address this issue because it's sometimes regarded as a trivial task and everybody is said to do it the right way.

1. Create states in your program 

If at runtime your program has some strict set of states that it is in, then you can be calm and happy about your design. If you can keep the state of your variables consistent, you can manipulate them as you wish and not fear some collisions. What I mean is when you invoke a method, it knows exactly what to expect - whether a String that is passed as a parameter could be null, or if it is in a special internal format, etc...

Entering methods and exiting from methods must keep the representation invariant intact and everybody should know their role in the process.

2. Keep the number of states of your program low
If you apply rule no.1, you can still mess up, if you have like ... 100 different states. Your head will be full of conditions and rules to transit from one state to the other...

 A developer should not think about more than 7 things while developing. That way he can stay focused and make always the best decisions about his design.

3. Document your states

Be honest about your program's states. Tell your colleagues. Don't be shy or overprotective , if there's this colleague who always critisize your code. If they know about the states you introduced, then they could tell you about a problem earlier and adopt those states in their modules early on.
Not to mention that at one happy moment, somebody else different from you will be supporting this code.

4. Avoid tricky (smart) code

I've seen smart code and it lead to invisible problems, reported and fixed years after the code was written and got into the final product.

- Imagine the following situation - you are passed String with the name of a file, and you must create your own temp file, where you should store your temporary data during the processing of the original file. So you create a file with

String tempName = originalFile + "temp";

And later you decide to wipe all those temp files, but since you have added "temp" at the end, you can just use
if ( "temp".equals(String.lastIndexOf(aFileName) ) {...deleteFile(); }

And you thought you deleted your files. What happens if there are files that are called "xxxtemp" by the original user? Even if you add "temp" at the end , you will get to delete both the temp and the original.

- Another smelly situation - your use case is to keep the temp files and delete all non-temp-ending files.
Ok so lets use:

fileName.replaceAll("", "temp");

So we'll discard the temp and we'll automatically get the original filename...
Wrong! What happens if all this is happening in directory "c:\temp\myfiles" ? You will get invalid file paths and another exception is thrown.


You should be very careful with these kind of situations with files.
I suggest 2 ways to avoid problems:

A) store in a collection the original files and in a new collection the references to the temp (new) files.
That way you don't need to think of weird algorithms to find temp/original files by their derivative's names.

B) if you have to think of such an algorithm be sure that it finds exactly what you want.
Back to the example with the replaceAll():
int lastIndex = fileName.lastIndexOf("temp");
fileName.replace("", "temp", lastIndex);

And this is exactly the opposite of string += otherString.


I am sure other developers have found other techniques to avoid problems but those were mine.
Feel free to share your opinion.


Leni Kirilov

Wednesday, September 01, 2010

JDK 7 new features (part 1)

Hi there,

We all know Java. Many love it, some dislike it, other actually hate it... and if they knew its weaknesses and flaws as I know some of them, well, they'd pity all the Java developers for choosing such a fragile platform and language...

 So basically , before you thought I hate Java, the thruth is just the opposite - check this blog's name :) - but I admit that Java has some veeeery bad treats and design flaws.

But why am I talking about Java flaws in a posting called "Java 7 new features" -- well , because they(the guys behind Java) try to address some of these problems , I'm also going to point some of them to you..

 
This list is not ordered by me - everywhere I look these features are presented in this order. I'll keep it that way for consistency.

Feature: 64/32 bit pointers support 
-- why store 32bit pointers in 64bit space, when you don't need it. The JVM will be more agile and not create empty spaces in the pointers, so less space will be required, which will help the traffic more than a local system with gigabytes of RAM. Performance boost.

Feature: Garbage-first Garbage Collection
- kills the young fast-dying generation first. and preserves objects that have survived the wipe a few times.
Result: more GC options and strategies -- performance boost.


Feature: dynamic languages in JVM
-- All can agree that Dynamic languages have big future ahead of them and that's a good reason that Java should try to adopt them and try to run them natively on a JVM. Thus making the JVM something like a universal VM for different kinds of languages. Imagine the freedom to combine different languages and techniques easily with native support and not some simulators.... no performance problems ... no interoperability problems... I really hope this is going to be implemented very professionally.

Added support for lambda functions, which could revolutionize some known patterns in the Java world - creation of an anonymous class for an interface like MouseListener and so on - now you can create a lambda implementation, pass it as an argument and inside it can be executed. This will make our Java a more interesting place. The anonymous-class design that was being forced because of the lack of such a feature and it's not intuitive at all. Let's see where this will get us.

Feature: Java modularity - Project Jigsaw
This project, in my opinion, will be an improvement, which will improve our Java experience. But what exactly is the problem? What do you mean with "Java modularity" ? Java is already modular, some will say... Well, it isn't.

Just check your local JRE installation and see in the \lib\  directory the rt.jar (rt = runtime). Notice the size - using latest JDK 1.6 Update 21, the rt.jar is around 47 MB.

Yeah, 47 MB and that's a module... yeah right. Nice design, guys! Many classes must be written with lots of lines to fill those 47 MB and believe me - these 47MB in rt.jar are all classes. Who wants to say how many millions of code...

But why when I only use java.net and java.lang should my JVM also load SWING and java.beans and javax.xml ... The sad reason is that all of them are all TIGHTLY coupled...

Somehow, somebody let it all loose control and everybody started pushing shit in this .jar file... well it works, so who cares? It's not modular... again, who cares? You can't easily extract a piece of it and place it elsewhere. You can't manage your JVM RAM requirements because of required modules being all stick together and you can't separate them.

Image that you can modify your JVM depending on your business case !
Well, project JIGSAW is trying to solve exactly this problem - separating all swing, applet etc modules into separate sub-projects and decomponentizing the  rt.jar into several (hundred?) jar files.

I imagine something like a ( JVM + OSGi ) ... yeah :)

I wish the developers good luck, because of the issues that could arise, and I think it's not a trivial job.
Remember they also have to maintain the backwards operability somehow...

...
I see that this post has become very long, so I'm going to continue it later.

Feel free to comment, because my view on a topic could be very wrong, but I'd love if you start a discussion. Especially when the topic is Java :)

Leni Kirilov

Saturday, August 28, 2010

Java 5 and Java 6 not so popular features set

Many know about generics, collections enhancements and auto-boxing, varargs, annotations ,but there are some less popular features added to java in Java5 and Java6. I'm going to point the lights on them, because they are little treasures:

Java 5:


- Formatter class - easy to use class for proper formatting of numbers, date-time, currency etc

- Scanner class - slower but comfortable to use to read text from streams

-    java.util.concurrency.* package - atomic classes introduced. You are going to use them if you are in a concurrent environment... Also locks and some thread-safe collections

- JMX was added to J2SE --- instrumentation, management for your applications, MBeans - you name it

- Arrays.fill() -- fills an array with a value you give it. Very useful instead of writing a loop and doing it manually.

- Arrays.deepToString(); --- another great static method -- instead of writing a recursion method to print the toString method of the elements in a multi-dimensional array, you just use this method !

- JTable printing - it looks more natural to have a native printing method



Java 6:

-  Deque --double-ended queue was added as an interface in the collections package

- int[] newArray = Arrays.copyOf(anotherArray, newLength);  --- faster and cooler than System.arraycopy(..)

- drag'n'drop improved --- they made it more usable, but how exactly - I haven't tried it to tell you

- JTable sorting and filtering added

- Console class added

- new methods in File - getTotalSpace(), getFreeSpace(), getUsableSpace() --- why create a file and fill it with some data when you can first check if there is enough space in the drive to create the file in the first place?

- java.util.zip.DeflaterInputStream: Data read from this stream is compressed.
  java.util.zip.InflaterOutputStream: Data written to this stream is decompressed.

Or in normal human language - something like a Zip Streams where data is compressed . Nice! I am sure to use it next time!

- JMX was greatly fixed and update so my suggestion is to use it on this JRE6 version.

- JSR 223: Scripting for the Java™ Platform API -- This is a framework by which Java Applications can "host" script engines


So Java guys, out there, don't miss out these features and have in mind the enhancements :)

L.K.

Wednesday, August 25, 2010

Dell Inspiron 1520 bugs

First of all I want to say that I'm very happy with my 2-year-old Dell laptop and his performance. This little piece of hardware (3 kg isn't that small...) has been very useful for me, writing some homeworks for the university, studying, chatting, even flirting, and of course preparing some projects connected with  Java, CPP and Python.

Anyway, but there are some flaws and I'll comment on a few of them

- strange noise

From time to the laptop starts beeping in a disturbing way... as if there is a flake of dirt in the CPU and the CPU's reading heads are registering it and the fast movement produces the squeaking sound ! Of course, that's not it, because CPU's units don't have moving parts... May be it's something in the HDD ... I hope not because I don't want lost bytes/files/hard-drives problem. It was a frightening sound the first few times, but I got used it .... because it happens quite often. May be once a month. And I'm using my notebook everyday...

- blue/black screen of death

I suppose this is due to my Windows 7 (and before was XP), but the message I got is always for a hardware malfunction and a memory dump is created. This has happened 4-5 times for these 2 years. Not good. But there was the moment I played Starcraft and it got it quite often... so may be it's a software glitch... Nevertheless it's not a
pleasant experience.

- I use Hibernate
I'm not using restart very often. I'm always hibernating and I can justify that this feature is GREAT! What hibernate does is save the state of all programs on your HDD (requires some free HDD space) and shuts down completely very quickly.
+ no power consumption compared to sleep
+ faster shut down compared to restart/shut down
+ faster start compared to restart/ shut down + start
+ all programs are already loaded and waiting for you!

People, use hibernate! Saves time and it's very nice.

A few more tricks help reduce the performance degradation:
- use programs like CCleaner to uninstall unused programs; clean registry; turn off start-up applications
- use defragmenters - your HDD becomes so unordered (fragmented) that a simple song play with Winamp makes your HDD heads travel looong distances and degrade performance. Of course all the small and constantly created/deleted files that a browser makes are "helping" for the situation. 

- DVD malfunction

In today's epoch of very fast Internet connection people need less and less CDs or DVDs storages, so basically I have almost never used my DVD and it's all in dust now. Well I tried to clean it, being careful with the lenses etc but the read speed is very low. But again may be it's a common problem when not using a device.

 - light up/down the Laptop screen on Windows 7

 When using FN+up and FN+down the display sometimes doesn't dim itself on all possible levels (8 levels of gray may be). For example 4-5 levels are active and the screen stays dark... Then you have to find the "Adjust brightness" option in Windows and using the software slider to move it and then it seems it resets which level how much darkness must set and then it manages to be from full dark to full light again...
Again this could be just a driver issue.
Later I found this to be connected with the Power plan chosen and with the cable of my AC adapter charger. When I unplug it and then plug it again, it fixes.

- Home button next to Power button

OK what's good is this button to me when I don't have Home Media Station or what was its name (a Dell software) because my laptop had not a single bit set when I bought it - completely empty (as I wanted it) and now it seems I cannot adjust what the button should do - for example open an Opera browser would be great... I'm very disappointed because I used some forum discussions solutions to setup my PC but... I failed...
Actually that was on my Win XP and now I'm going to try on Win7. Wish me luck!

//edit
I managed to set my Home Media Station button to Winamp :) Finally, I can use all buttons on my notebook.
I used this forum discussion to manage and configure the button :  link 

Leni Kirilov

Sunday, July 11, 2010

Idea: JUnit and Code coverage connection

I'm going to share my first thoughts regarding unit testing, JUnit and TDD (test-driven development). I'm sure that this won't be the last post on this subject because there is a lot that can be said and I've had a few interesting discussions with a colleagues of mine regarding the benefit of TDD and whether it is a good or a bad principle.

---

Here I'm going to share a thought which seems logic to me, but unfortunately have not seen it implemented yet.
I've been writing some unit tests recently and  it occurred to me that it would be nice if the JUnit was combined with code coverage and after runs of the test suites, there is a statistic that shows which test (test method), which lines of code did they cover!

Imagine if it was possible to see that - when an old test fails, it shows you which particular code it validates, so if a change in that code occurred, you can catch it immediately!

Of course there is the scenario when a change occurred in the context of the process that is tested and not the process itself and the code that could break a certain test, but nevertheless this information won't lie to you and trick you and slow you down in rooting down the real problem.

Also some monitoring of the submits to the project repository and analyzing which code fixes what test , would be the same as which test validates which lines of code.

There could be done something about that!


----
Some basic tips:

For NetBeans users check this link:
http://netbeans.org/kb/docs/java/junit-intro.html

Check official xUnit site or Junit
http://www.junit.org/

L.K. 

Saturday, July 10, 2010

Eclipse DemoCamp 2010

Here I'm going to tell every reader what amazed me and what I think is remarkable around Eclipse DemoCamp 2010 Sofia.

---
First of all I would like to give my special thanks to the organizers who managed to stay in schedule through the whole event - all presentations were exact, question sessions, no power surge problems, comfortable hall and of course top-class food and beverages prepared for the breaks.

I was impressed that the president of the Eclipse Foundation presented its goals and its history and path for the future - very interesting indeed to hear it from the man who has seen it all from the very beginning and gave birth to something that is accepted as a standard in the modern world - open-source foundation which holds and nurtures different projects under the hood of Eclipse.

There were a few presenters whose names I cannot write, because I don't remember them (sorry) but they covered the following areas:
- RAP
- OSGi bundled application server - Virgo
- Swordfish - framework for bundled enterprise services
- Rational - IBM's CASE non-free very functional software product
- context-depended language generator plug-in for Eclipse

1. Virgo
 I was most impressed by the Virgo application server which is constructed using the ideology of bundled products (like Eclipse IDE) and the ease and plugability at runtime of small software components called bundles. In that way you can turn on/off features at runtime with no downtime and manage dependencies between different components.
Also you can create very light and feature-set specific application servers who can for example support only Servlets (web container) and you don't care about EJBs or Web Services and all you need are simple security and logging for example.

The man presenter was very young Spring (now VMWare) developer who demonstrated the Virgo server
and it started very quickly and redeployed applications with just a click and no waiting or whatever...

Just amazing! - Believe me, you will find it amazing if you have to do an enterprise application and deploying it on a heavy proprietary application server like NetWeaver, whose architecture is just not modern anymore. The bundle concept is unknown to it. Nevertheless still an excellent application server.

Don't forget scalability - using bundles would be much easier to manage dependencies and physical separation and transport.

2. Context-dependant language generator plug-in for Eclipse
There was an amazing demo of a framework which lets you easily define your own language and reserved words for it. After that you can easily create an Eclipse project specific for your new language and even have the editor validate your syntax and semantics!

The presenter Kiril did a great job and capture the audience - he was the winner of the Demo sessions.


3. Rational
The presenter was a guy from Croatia (sorry if I am wrong) and used not 1 but 4 presentation sessions to explain what Rational can and cannot do (actually, I think it can do everything, even prepare you a sandwich...)

So basically Rational is a CASE tool which covers all aspects of software development process:
- requirements engineering
- storing requirements and managing them
- preparing architecture
- design analysis
- bug tracker and connection to various requirements
- track exceptions with real code lines and bugs
- suggest improvements based on an exception
- complex statistics and diagrams which even the presenter was confused to explain
and many more

Believe me, if you know all the features of Rational and can use it productively  you are a GOD.

Unfortunately not everybody in the audience appreciated the presenters attempt to cover high percentage of the products capabilities... His voice wasn't as clear as hoped either...

----

All in all I am very confident that I will attend the Eclipse Demo Camp next year and who knows - may be I'll present something of my own...

L.K.

Sunday, June 20, 2010

NetBeans 6.8 ME removal leads to unusable NetBeans

I had installed NetBeans 6.8 the version where all possible java technologies are bundled together.

I had no problems, but I decided to deactivate and uninstall the ME plugins... huge mistake.. The whole NetBeans became an empty shell... with just a few menus to the top and a simple editor... I was greatly surprised.

The good thing is that I installed NetBeans 6.9 and it sniffed my NetBeans 6.8 and imported all projects, copied the configurations and even the plugins... And in just 5 minutes a could continue with my work having all my configurations, no need to configure all my custom changes all over again.

So in just 30 minutes I was surprised twice by the NetBeans - the good thing is that in the end everything is working how it is supposed to be working. :)

I suppose this is something that Еclipse lacks...

//later edit:
- different Eclipse installations can share configuration with the Workspaces

Sunday, June 06, 2010

Programming language popularity

I've just stumbled upon a very interesting site showing the trend through the years regarding peoples' interest in different programming languages.

You can find it here:

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

TIOBE says their statistics don't show that the languages compared are better/worse than the others, or that there are more Lines Of Codes written using them now.